Normand Briere
2019-05-05 44b1501b5c4cd60ea67cc3d0971ed53f53b594e6
ObjEditor.java
....@@ -138,34 +138,41 @@
138138 public void closeUI()
139139 {
140140 //new Exception().printStackTrace();
141
- System.out.println("this = " + this);
142
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
143143 //nameField.removeActionListener(this);
144
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
145
+
146
+ objEditor.ctrlPanel.remove(namePanel);
145147
146148 if (!GroupEditor.allparams)
147149 return;
148150
149
- objEditor.ctrlPanel.remove(liveCB);
150
- objEditor.ctrlPanel.remove(hideCB);
151
- objEditor.ctrlPanel.remove(markCB);
152
-
153
- objEditor.ctrlPanel.remove(randomCB);
154
- objEditor.ctrlPanel.remove(speedupCB);
155
- objEditor.ctrlPanel.remove(rewindCB);
156
-
157
- objEditor.ctrlPanel.remove(resetButton);
158
- objEditor.ctrlPanel.remove(stepButton);
159
-// objEditor.ctrlPanel.remove(stepAllButton);
160
-// objEditor.ctrlPanel.remove(resetAllButton);
161
- objEditor.ctrlPanel.remove(link2masterCB);
162
- //objEditor.ctrlPanel.remove(flipVCB);
163
- //objEditor.ctrlPanel.remove(texresMenu);
164
- objEditor.ctrlPanel.remove(slowerButton);
165
- objEditor.ctrlPanel.remove(fasterButton);
166
- objEditor.ctrlPanel.remove(remarkButton);
151
+// objEditor.ctrlPanel.remove(liveCB);
152
+// objEditor.ctrlPanel.remove(hideCB);
153
+// objEditor.ctrlPanel.remove(markCB);
154
+//
155
+// objEditor.ctrlPanel.remove(randomCB);
156
+// objEditor.ctrlPanel.remove(speedupCB);
157
+// objEditor.ctrlPanel.remove(rewindCB);
158
+//
159
+// objEditor.ctrlPanel.remove(resetButton);
160
+// objEditor.ctrlPanel.remove(stepButton);
161
+//// objEditor.ctrlPanel.remove(stepAllButton);
162
+//// objEditor.ctrlPanel.remove(resetAllButton);
163
+// objEditor.ctrlPanel.remove(link2masterCB);
164
+// //objEditor.ctrlPanel.remove(flipVCB);
165
+// //objEditor.ctrlPanel.remove(texresMenu);
166
+// objEditor.ctrlPanel.remove(slowerButton);
167
+// objEditor.ctrlPanel.remove(fasterButton);
168
+// objEditor.ctrlPanel.remove(remarkButton);
167169
168
- Remove(normalpushField);
170
+ objEditor.ctrlPanel.remove(setupPanel);
171
+ objEditor.ctrlPanel.remove(commandsPanel);
172
+ objEditor.ctrlPanel.remove(pushPanel);
173
+ //objEditor.ctrlPanel.remove(fillPanel);
174
+
175
+ //Remove(normalpushField);
169176 }
170177
171178 public ObjEditor GetEditor()
....@@ -302,44 +309,61 @@
302309 //normalLensItem.addActionListener(this);
303310 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
304311 revertCameraItem.addActionListener(this);
305
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
306
- toggleTimelineItem.addItemListener(this);
312
+
307313 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
308314 toggleFullScreenItem.addItemListener(this);
309315 toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
310316 cameraMenu.add("-");
317
+
311318 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
312319 toggleTextureItem.addItemListener(this);
313320 toggleTextureItem.setState(CameraPane.textureon);
314
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
315
- toggleLiveItem.addItemListener(this);
316
- toggleLiveItem.setState(Globals.isLIVE());
317
- cameraMenu.add(stepItem = new MenuItem("Step"));
318
- stepItem.addActionListener(this);
319
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
320
-// toggleDLItem.addItemListener(this);
321
-// toggleDLItem.setState(false);
322
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
323
- toggleRenderItem.addItemListener(this);
324
- toggleRenderItem.setState(!CameraPane.frozen);
325
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
326
- toggleDebugItem.addItemListener(this);
327
- toggleDebugItem.setState(CameraPane.DEBUG);
328
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
329
- toggleFrustumItem.addItemListener(this);
330
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
331
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
332
- toggleFootContactItem.addItemListener(this);
333
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
334
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
335
- toggleRandomItem.addItemListener(this);
336
- toggleRandomItem.setState(CameraPane.RANDOM);
321
+
322
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
323
+ toggleSwitchItem.addItemListener(this);
324
+ toggleSwitchItem.setState(CameraPane.SWITCH);
325
+
337326 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
338327 toggleHandleItem.addItemListener(this);
339328 toggleHandleItem.setState(CameraPane.HANDLES);
329
+
340330 cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
341331 togglePaintItem.addItemListener(this);
342332 togglePaintItem.setState(CameraPane.PAINTMODE);
333
+
334
+ if (Globals.ADVANCED)
335
+ {
336
+ cameraMenu.add("-");
337
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
338
+ toggleLiveItem.addItemListener(this);
339
+ toggleLiveItem.setState(Globals.isLIVE());
340
+
341
+ cameraMenu.add(stepItem = new MenuItem("Step"));
342
+ stepItem.addActionListener(this);
343
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
344
+ // toggleDLItem.addItemListener(this);
345
+ // toggleDLItem.setState(false);
346
+
347
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
348
+ toggleRenderItem.addItemListener(this);
349
+ toggleRenderItem.setState(!CameraPane.frozen);
350
+
351
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
352
+ toggleDebugItem.addItemListener(this);
353
+ toggleDebugItem.setState(CameraPane.DEBUG);
354
+
355
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
356
+ toggleFrustumItem.addItemListener(this);
357
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
358
+
359
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
360
+ toggleFootContactItem.addItemListener(this);
361
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
362
+
363
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
364
+ toggleTimelineItem.addItemListener(this);
365
+ }
366
+
343367 // cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
344368 // toggleRootItem.addItemListener(this);
345369 // toggleRootItem.setState(false);
....@@ -353,21 +377,23 @@
353377 objectPanel = new JTabbedPane();
354378 toolbarPanel = new JPanel();
355379 toolbarPanel.setName("Toolbar");
356
- treePanel = new JPanel();
380
+ treePanel = new cGridBag();
357381 treePanel.setName("Tree");
358
- ctrlPanel = new cGridBag(); // new GridBagLayout());
382
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
359383 ctrlPanel.setName("Edit");
360384 materialPanel = new cGridBag().setVertical(true);
361385 materialPanel.setName("Material");
362386 /*JTextPane*/
363387 infoarea = createTextPane();
388
+ doc = infoarea.getStyledDocument();
389
+
364390 infoarea.setEditable(true);
365391 SetText();
366392 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
367393 // infoarea.setOpaque(false);
368394 // //infoarea.setForeground(textcolor);
369
- infoarea.setLineWrap(true);
370
- infoarea.setWrapStyleWord(true);
395
+// TEXTAREA infoarea.setLineWrap(true);
396
+// TEXTAREA infoarea.setWrapStyleWord(true);
371397 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
372398 infoPanel.setPreferredSize(new Dimension(50, 200));
373399 infoPanel.setName("Info");
....@@ -378,15 +404,15 @@
378404 mainPanel.setName("Main");
379405 mainPanel.setContinuousLayout(true);
380406 mainPanel.setOneTouchExpandable(true);
381
- mainPanel.setDividerLocation(1.0);
382407 mainPanel.setDividerSize(9);
383
- mainPanel.setResizeWeight(0);
408
+ mainPanel.setDividerLocation(0.5); //1.0);
409
+ mainPanel.setResizeWeight(0.5);
384410
385411 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
386412 //mainPanel.setLayout(new GridBagLayout());
387413 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388
- treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
414
+// treePanel.setLayout(new GridBagLayout());
415
+ //ctrlPanel.setLayout(new GridBagLayout());
390416 //materialPanel.setLayout(new GridBagLayout());
391417
392418 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
....@@ -426,7 +452,7 @@
426452 static String newline = "\n";
427453 protected static final String buttonString = "JButton";
428454 StyledDocument doc;
429
- JTextArea infoarea;
455
+ JTextPane infoarea;
430456
431457 void ClearInfo()
432458 {
....@@ -493,7 +519,10 @@
493519 }
494520
495521 if (full)
496
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
522
+ {
523
+ si.SendInfo(" BBox min: " + minima, "regular");
524
+ si.SendInfo(" BBox max: " + maxima, "regular");
525
+ }
497526
498527 if (sel.bRep != null)
499528 {
....@@ -591,6 +620,9 @@
591620 {
592621 CameraPane.pointflow = (PointFlow) sel;
593622 }
623
+
624
+ si.SendInfo("_____________________", "regular");
625
+ si.SendInfo("", "regular");
594626 }
595627 }
596628
....@@ -622,52 +654,52 @@
622654 cameraView.ToggleFullScreen();
623655 }
624656
625
- private JTextArea createTextPane()
657
+ private JTextPane createTextPane()
626658 {
627
- String[] initString =
628
- {
629
- "This is an editable JTextPane, ", //regular
630
- "another ", //italic
631
- "styled ", //bold
632
- "text ", //small
633
- "component, ", //large
634
- "which supports embedded components..." + newline,//regular
635
- " " + newline, //button
636
- "...and embedded icons..." + newline, //regular
637
- " ", //icon
638
- newline + "JTextPane is a subclass of JEditorPane that "
639
- + "uses a StyledEditorKit and StyledDocument, and provides "
640
- + "cover methods for interacting with those objects."
641
- };
659
+// TEXTAREA String[] initString =
660
+// {
661
+// "This is an editable JTextPane, ", //regular
662
+// "another ", //italic
663
+// "styled ", //bold
664
+// "text ", //small
665
+// "component, ", //large
666
+// "which supports embedded components..." + newline,//regular
667
+// " " + newline, //button
668
+// "...and embedded icons..." + newline, //regular
669
+// " ", //icon
670
+// newline + "JTextPane is a subclass of JEditorPane that "
671
+// + "uses a StyledEditorKit and StyledDocument, and provides "
672
+// + "cover methods for interacting with those objects."
673
+// };
674
+//
675
+// String[] initStyles =
676
+// {
677
+// "regular", "italic", "bold", "small", "large",
678
+// "regular", "button", "regular", "icon",
679
+// "regular"
680
+// };
681
+//
682
+// JTextPane textPane = new JTextPane();
683
+// textPane.setEditable(true);
684
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
685
+// addStylesToDocument(doc);
686
+//
687
+// try
688
+// {
689
+// for (int j = 0; j < 2; j++)
690
+// {
691
+// for (int i = 0; i < initString.length; i++)
692
+// {
693
+// doc.insertString(doc.getLength(), initString[i],
694
+// doc.getStyle(initStyles[i]));
695
+// }
696
+// }
697
+// } catch (BadLocationException ble)
698
+// {
699
+// System.err.println("Couldn't insert initial text into text pane.");
700
+// }
642701
643
- String[] initStyles =
644
- {
645
- "regular", "italic", "bold", "small", "large",
646
- "regular", "button", "regular", "icon",
647
- "regular"
648
- };
649
-
650
- JTextPane textPane = new JTextPane();
651
- textPane.setEditable(true);
652
- /*StyledDocument*/ doc = textPane.getStyledDocument();
653
- addStylesToDocument(doc);
654
-
655
- try
656
- {
657
- for (int j = 0; j < 2; j++)
658
- {
659
- for (int i = 0; i < initString.length; i++)
660
- {
661
- doc.insertString(doc.getLength(), initString[i],
662
- doc.getStyle(initStyles[i]));
663
- }
664
- }
665
- } catch (BadLocationException ble)
666
- {
667
- System.err.println("Couldn't insert initial text into text pane.");
668
- }
669
-
670
- return new JTextArea(); // textPane;
702
+ return new JTextPane(); // textPane;
671703 }
672704
673705 protected void addStylesToDocument(StyledDocument doc)
....@@ -767,54 +799,44 @@
767799 JButton slowerButton;
768800 JButton fasterButton;
769801 JButton remarkButton;
802
+
803
+ cGridBag namePanel;
804
+ cGridBag setupPanel;
805
+ cGridBag commandsPanel;
806
+ cGridBag pushPanel;
807
+ cGridBag fillPanel;
770808
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
809
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
772810 {
773811 JCheckBox cb;
774812
775
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
776
- oe.aConstraints.gridwidth = 1; // 3;
777
-// oe.aConstraints.weightx = 1;
778
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
779
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
813
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
780814 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
784815
785816 return cb;
786817 }
787818
788
- cButton AddButton(ObjEditor oe, String label)
819
+ cButton AddButton(cGridBag panel, String label)
789820 {
790821 cButton cb;
791822
792
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
793
- oe.aConstraints.gridwidth = 1;
794
-// oe.aConstraints.weightx = 1;
795
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
796
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
823
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
797824 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
801825
802826 return cb;
803827 }
804828
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
829
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
806830 {
807831 JComboBox combo;
808832
809
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
810
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
811
- oe.aConstraints.gridx += 1;
833
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
812834 combo.addActionListener(this);
813835
814836 return combo;
815837 }
816838
817
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, double min, double max, double current, double pow)
839
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
818840 {
819841 cGridBag control = new cGridBag();
820842
....@@ -826,12 +848,12 @@
826848 control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827849 combo.setFloat(current);
828850
829
- ctrlPanel.add(control);
851
+ panel.add(control);
830852
831
- return combo;
853
+ return control;
832854 }
833855
834
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, int min, int max, int current)
856
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
835857 {
836858 cGridBag control = new cGridBag();
837859
....@@ -839,25 +861,21 @@
839861
840862 JLabel jlabel = new JLabel(label);
841863 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
842
- ctrlPanel.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
843
- ctrlPanel.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
864
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
865
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
844866 combo.setInteger(current);
845867
846
- ctrlPanel.add(control);
868
+ panel.add(control);
847869
848
- return combo;
870
+ return control;
849871 }
850872
851873 JTextArea AddText(cGridBag ctrlPanel, String name)
852874 {
853875 JTextArea text;
854876
855
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
856
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
857877 ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
858878 text.addCaretListener(this);
859
- aConstraints.gridx += 1;
860
- aConstraints.gridwidth = 1;
861879
862880 return text;
863881 }
....@@ -896,7 +914,7 @@
896914
897915 /*
898916 */
899
- void Return() // ObjEditor oe)
917
+ void Return0() // ObjEditor oe)
900918 {
901919 aConstraints.gridy += 1;
902920 aConstraints.gridx = 0;
....@@ -951,37 +969,70 @@
951969
952970 void SetupUI2(ObjEditor oe)
953971 {
954
-// oe.aConstraints.weightx = 0;
955
-// oe.aConstraints.weighty = 0;
956
-// oe.aConstraints.gridx = 0;
957
-// oe.aConstraints.gridy = 0;
958
- SetupName(oe);
972
+ //SetupName(oe);
973
+
974
+ namePanel = new cGridBag();
975
+
976
+ nameField = AddText(namePanel, copy.GetName());
977
+ namePanel.add(nameField);
978
+ oe.ctrlPanel.add(namePanel);
979
+
980
+ oe.ctrlPanel.Return();
959981
960982 if (!GroupEditor.allparams)
961983 return;
962984
963
- liveCB = AddCheckBox(oe, "Live", copy.live);
964
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
965
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
985
+ setupPanel = new cGridBag().setVertical(false);
986
+
987
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
988
+ liveCB.setToolTipText("Animate object");
989
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
990
+ hideCB.setToolTipText("Hide object");
966991 // Return();
967
- markCB = AddCheckBox(oe, "Mark", copy.marked);
968
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
969
- randomCB = AddCheckBox(oe, "Rand", copy.random);
970
- Return();
971
- resetButton = AddButton(oe, "Reset");
972
- stepButton = AddButton(oe, "Step");
992
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
993
+ markCB.setToolTipText("Set the animation target transform");
994
+
995
+ rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
996
+ rewindCB.setToolTipText("Rewind animation");
997
+
998
+ randomCB = AddCheckBox(setupPanel, "Random", copy.random);
999
+ randomCB.setToolTipText("Option for switch node");
1000
+
1001
+ if (Globals.ADVANCED)
1002
+ {
1003
+ link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
1004
+ link2masterCB.setToolTipText("Attach to support");
1005
+ speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
1006
+ speedupCB.setToolTipText("Option motion capture");
1007
+ }
1008
+
1009
+ oe.ctrlPanel.add(setupPanel);
1010
+ oe.ctrlPanel.Return();
1011
+
1012
+ commandsPanel = new cGridBag().setVertical(false);
1013
+
1014
+ resetButton = AddButton(commandsPanel, "Reset");
1015
+ resetButton.setToolTipText("Jump to frame zero");
1016
+ stepButton = AddButton(commandsPanel, "Step");
1017
+ stepButton.setToolTipText("Step one frame");
9731018 // resetAllButton = AddButton(oe, "Reset All");
9741019 // stepAllButton = AddButton(oe, "Step All");
975
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9761020 // Return();
977
- slowerButton = AddButton(oe, "Slow");
978
- fasterButton = AddButton(oe, "Fast");
979
- remarkButton = AddButton(oe, "Rem");
1021
+ slowerButton = AddButton(commandsPanel, "Slow");
1022
+ slowerButton.setToolTipText("Decrease animation speed");
1023
+ fasterButton = AddButton(commandsPanel, "Fast");
1024
+ fasterButton.setToolTipText("Increase animation speed");
1025
+ remarkButton = AddButton(commandsPanel, "Remark");
1026
+ remarkButton.setToolTipText("Set the current transform as the target");
9801027
981
- //Return();
1028
+ oe.ctrlPanel.add(commandsPanel);
1029
+ oe.ctrlPanel.Return();
9821030
983
- //normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
1031
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1032
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
9841033 //Return();
1034
+
1035
+ oe.ctrlPanel.Return();
9851036
9861037 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871038 // ObjEditor.aConstraints.gridx += 1;
....@@ -1076,7 +1127,7 @@
10761127 oe.aConstraints.gridwidth = 1;
10771128 /**/
10781129 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1130
+ oe.ctrlPanel.Return();
10801131
10811132 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821133 //textureButton.setEnabled(false);
....@@ -1253,10 +1304,11 @@
12531304 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12541305 //tmp.setName("Edit");
12551306 objectPanel.add(materialPanel);
1256
- JPanel north = new JPanel(new BorderLayout());
1257
- north.setName("Edit");
1258
- north.add(ctrlPanel, BorderLayout.NORTH);
1259
- objectPanel.add(north);
1307
+// JPanel north = new JPanel(new BorderLayout());
1308
+// north.setName("Edit");
1309
+// north.add(ctrlPanel, BorderLayout.NORTH);
1310
+// objectPanel.add(north);
1311
+ objectPanel.add(ctrlPanel);
12601312 objectPanel.add(infoPanel);
12611313
12621314 /*
....@@ -1278,7 +1330,7 @@
12781330 scrollpane.addMouseWheelListener(this); // Default not fast enough
12791331
12801332 /*JTabbedPane*/ scenePanel = new cGridBag();
1281
- scenePanel.preferredWidth = 7;
1333
+ scenePanel.preferredWidth = 6;
12821334
12831335 JTabbedPane tabbedPane = new JTabbedPane();
12841336 tabbedPane.add(scrollpane);
....@@ -1384,8 +1436,8 @@
13841436
13851437 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13861438
1387
- frame.setSize(1024, 768);
1388
- frame.show();
1439
+ frame.setSize(1280, 860);
1440
+ frame.setVisible(true);
13891441
13901442 gridPanel.setDividerLocation(1.0);
13911443
....@@ -1415,7 +1467,7 @@
14151467 ctrlPanel.removeAll();
14161468 }
14171469
1418
- void SetupMaterial(cGridBag ctrlPanel)
1470
+ void SetupMaterial(cGridBag panel)
14191471 {
14201472 /*
14211473 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
....@@ -1424,18 +1476,26 @@
14241476
14251477 cGridBag editBar = new cGridBag().setVertical(false);
14261478
1427
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
1479
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1480
+ createMaterialButton.setToolTipText("Create material");
14281481
14291482 /*
14301483 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14311484 */
14321485
1433
- editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints);
1434
- editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints);
1435
- editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1436
- editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1486
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1487
+ clearMaterialButton.setToolTipText("Clear material");
1488
+
1489
+ if (Globals.ADVANCED)
1490
+ {
1491
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1492
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1493
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1494
+ }
14371495
1438
- ctrlPanel.add(editBar);
1496
+ editBar.preferredHeight = 15;
1497
+
1498
+ panel.add(editBar);
14391499
14401500 /**/
14411501 //aConstraints.weighty = 0;
....@@ -1484,9 +1544,9 @@
14841544 shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
14851545 colorSection.add(shadowbias);
14861546
1487
- ctrlPanel.add(new JSeparator());
1547
+ panel.add(new JSeparator());
14881548
1489
- ctrlPanel.add(colorSection);
1549
+ panel.add(colorSection);
14901550
14911551 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14921552
....@@ -1534,9 +1594,9 @@
15341594 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15351595 diffuseSection.add(fakedepth);
15361596
1537
- ctrlPanel.add(new JSeparator());
1597
+ panel.add(new JSeparator());
15381598
1539
- ctrlPanel.add(diffuseSection);
1599
+ panel.add(diffuseSection);
15401600
15411601 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15421602
....@@ -1572,7 +1632,7 @@
15721632 velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15731633 specularSection.add(velvet);
15741634
1575
- shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1);
1635
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
15761636 //Return();
15771637 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
15781638 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
....@@ -1585,9 +1645,9 @@
15851645 // aConstraints.gridwidth = 1;
15861646
15871647
1588
- ctrlPanel.add(new JSeparator());
1648
+ panel.add(new JSeparator());
15891649
1590
- ctrlPanel.add(specularSection);
1650
+ panel.add(specularSection);
15911651
15921652 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15931653
....@@ -1617,9 +1677,9 @@
16171677 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16181678 globalSection.add(opacity);
16191679
1620
- ctrlPanel.add(new JSeparator());
1680
+ panel.add(new JSeparator());
16211681
1622
- ctrlPanel.add(globalSection);
1682
+ panel.add(globalSection);
16231683
16241684 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16251685
....@@ -1661,9 +1721,9 @@
16611721 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
16621722 textureSection.add(opacityPower);
16631723
1664
- ctrlPanel.add(new JSeparator());
1724
+ panel.add(new JSeparator());
16651725
1666
- ctrlPanel.add(textureSection);
1726
+ panel.add(textureSection);
16671727
16681728 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16691729
....@@ -1700,12 +1760,15 @@
17001760 opacityPowerField.addChangeListener(this);
17011761 /**/
17021762
1703
- resetSlidersButton.addActionListener(this);
17041763 clearMaterialButton.addActionListener(this);
17051764 createMaterialButton.addActionListener(this);
1706
-
1707
- propagateToggle.addItemListener(this);
1708
- multiplyToggle.addItemListener(this);
1765
+
1766
+ if (Globals.ADVANCED)
1767
+ {
1768
+ resetSlidersButton.addActionListener(this);
1769
+ propagateToggle.addItemListener(this);
1770
+ multiplyToggle.addItemListener(this);
1771
+ }
17091772 }
17101773
17111774 void DropFile(java.io.File[] files, boolean textures)
....@@ -1876,7 +1939,7 @@
18761939
18771940 //? flashIt = false;
18781941 CameraPane pane = (CameraPane) cameraView;
1879
- pane.clickStart(location.x, location.y, 0);
1942
+ pane.clickStart(location.x, location.y, 0, 0);
18801943 pane.clickEnd(location.x, location.y, 0, true);
18811944
18821945 if (group.selection.size() == 1)
....@@ -2337,7 +2400,7 @@
23372400 {
23382401 /**/
23392402 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2340
- browser.show();
2403
+ browser.setVisible(true);
23412404 String filename = browser.getFile();
23422405 if (filename != null && filename.length() > 0)
23432406 {
....@@ -2482,6 +2545,7 @@
24822545 }
24832546 if (input == null)
24842547 {
2548
+ new Exception().printStackTrace();
24852549 System.exit(0);
24862550 }
24872551
....@@ -2696,7 +2760,8 @@
26962760 return;
26972761 }
26982762
2699
- multiplyToggle.setSelected(mat.multiply);
2763
+ if (multiplyToggle != null)
2764
+ multiplyToggle.setSelected(mat.multiply);
27002765
27012766 assert (object.projectedVertices != null);
27022767
....@@ -2911,7 +2976,7 @@
29112976 frame.validate();
29122977
29132978 return;
2914
- } else if (event.getSource() == toggleRandomItem)
2979
+ } else if (event.getSource() == toggleSwitchItem)
29152980 {
29162981 cameraView.ToggleRandom();
29172982 cameraView.repaint();
....@@ -2956,6 +3021,7 @@
29563021 if (event.getSource() == randomCB)
29573022 {
29583023 copy.random ^= true;
3024
+ objEditor.refreshContents();
29593025 return;
29603026 }
29613027 if (event.getSource() == speedupCB)
....@@ -3179,7 +3245,7 @@
31793245 if (!Globals.ANIMATION)
31803246 {
31813247 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3182
- browser.show();
3248
+ browser.setVisible(true);
31833249 String filename = browser.getFile();
31843250 if (filename != null && filename.length() > 0)
31853251 {
....@@ -3240,7 +3306,7 @@
32403306 void CreateMaterial()
32413307 {
32423308 //copy.ClearMaterial(); // PATCH
3243
- copy.CreateMaterialS(multiplyToggle.isSelected());
3309
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32443310 if (copy.selection.size() > 0)
32453311 //SetMaterial(copy);
32463312 {
....@@ -3299,11 +3365,11 @@
32993365 {
33003366 copy.ResetBlockLoop(); // temporary problem
33013367
3302
- boolean random = CameraPane.RANDOM;
3303
- CameraPane.RANDOM = false; // parse everything
3368
+ boolean random = CameraPane.SWITCH;
3369
+ CameraPane.SWITCH = false; // parse everything
33043370 copy.ResetDisplayList();
33053371 copy.HardTouch();
3306
- CameraPane.RANDOM = random;
3372
+ CameraPane.SWITCH = random;
33073373 }
33083374
33093375 // public void applySelf()
....@@ -3421,6 +3487,7 @@
34213487 || e.getSource() == apertureField
34223488 || e.getSource() == shadowblurField)
34233489 {
3490
+ new Exception().printStackTrace();
34243491 System.exit(0);
34253492 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34263493 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -4392,8 +4459,8 @@
43924459 //MenuItem normalLensItem;
43934460 MenuItem editCameraItem;
43944461 MenuItem revertCameraItem;
4395
- CheckboxMenuItem toggleLiveItem;
43964462 MenuItem stepItem;
4463
+ CheckboxMenuItem toggleLiveItem;
43974464 CheckboxMenuItem toggleFullScreenItem;
43984465 CheckboxMenuItem toggleTimelineItem;
43994466 CheckboxMenuItem toggleRenderItem;
....@@ -4402,7 +4469,7 @@
44024469 CheckboxMenuItem toggleFootContactItem;
44034470 CheckboxMenuItem toggleDLItem;
44044471 CheckboxMenuItem toggleTextureItem;
4405
- CheckboxMenuItem toggleRandomItem;
4472
+ CheckboxMenuItem toggleSwitchItem;
44064473 CheckboxMenuItem toggleRootItem;
44074474 CheckboxMenuItem animationItem;
44084475 CheckboxMenuItem toggleHandleItem;
....@@ -4410,7 +4477,7 @@
44104477 JSplitPane mainPanel;
44114478 JScrollPane scrollpane;
44124479 JPanel toolbarPanel;
4413
- JPanel treePanel;
4480
+ cGridBag treePanel;
44144481 JPanel radioPanel;
44154482 ButtonGroup buttonGroup;
44164483 cGridBag ctrlPanel;