Normand Briere
2019-05-02 c209bbe1cf788c9af3dcffea7667c830170a3f1f
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,60 @@
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
+ if (Globals.ADVANCED)
323
+ {
324
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
325
+ toggleLiveItem.addItemListener(this);
326
+ toggleLiveItem.setState(Globals.isLIVE());
327
+
328
+ cameraMenu.add(stepItem = new MenuItem("Step"));
329
+ stepItem.addActionListener(this);
330
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
331
+ // toggleDLItem.addItemListener(this);
332
+ // toggleDLItem.setState(false);
333
+
334
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
335
+ toggleRenderItem.addItemListener(this);
336
+ toggleRenderItem.setState(!CameraPane.frozen);
337
+
338
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
339
+ toggleDebugItem.addItemListener(this);
340
+ toggleDebugItem.setState(CameraPane.DEBUG);
341
+
342
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
343
+ toggleFrustumItem.addItemListener(this);
344
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
345
+
346
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
347
+ toggleFootContactItem.addItemListener(this);
348
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
349
+
350
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
351
+ toggleTimelineItem.addItemListener(this);
352
+ }
353
+
354
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
355
+ toggleSwitchItem.addItemListener(this);
356
+ toggleSwitchItem.setState(CameraPane.SWITCH);
357
+
337358 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
338359 toggleHandleItem.addItemListener(this);
339360 toggleHandleItem.setState(CameraPane.HANDLES);
361
+
340362 cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
341363 togglePaintItem.addItemListener(this);
342364 togglePaintItem.setState(CameraPane.PAINTMODE);
365
+
343366 // cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
344367 // toggleRootItem.addItemListener(this);
345368 // toggleRootItem.setState(false);
....@@ -353,21 +376,23 @@
353376 objectPanel = new JTabbedPane();
354377 toolbarPanel = new JPanel();
355378 toolbarPanel.setName("Toolbar");
356
- treePanel = new JPanel();
379
+ treePanel = new cGridBag();
357380 treePanel.setName("Tree");
358
- ctrlPanel = new cGridBag(); // new GridBagLayout());
381
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
359382 ctrlPanel.setName("Edit");
360383 materialPanel = new cGridBag().setVertical(true);
361384 materialPanel.setName("Material");
362385 /*JTextPane*/
363386 infoarea = createTextPane();
387
+ doc = infoarea.getStyledDocument();
388
+
364389 infoarea.setEditable(true);
365390 SetText();
366391 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
367392 // infoarea.setOpaque(false);
368393 // //infoarea.setForeground(textcolor);
369
- infoarea.setLineWrap(true);
370
- infoarea.setWrapStyleWord(true);
394
+// TEXTAREA infoarea.setLineWrap(true);
395
+// TEXTAREA infoarea.setWrapStyleWord(true);
371396 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
372397 infoPanel.setPreferredSize(new Dimension(50, 200));
373398 infoPanel.setName("Info");
....@@ -378,15 +403,15 @@
378403 mainPanel.setName("Main");
379404 mainPanel.setContinuousLayout(true);
380405 mainPanel.setOneTouchExpandable(true);
381
- mainPanel.setDividerLocation(1.0);
382406 mainPanel.setDividerSize(9);
383
- mainPanel.setResizeWeight(0);
407
+ mainPanel.setDividerLocation(0.5); //1.0);
408
+ mainPanel.setResizeWeight(0.5);
384409
385410 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
386411 //mainPanel.setLayout(new GridBagLayout());
387412 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388
- treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
413
+// treePanel.setLayout(new GridBagLayout());
414
+ //ctrlPanel.setLayout(new GridBagLayout());
390415 //materialPanel.setLayout(new GridBagLayout());
391416
392417 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
....@@ -426,7 +451,7 @@
426451 static String newline = "\n";
427452 protected static final String buttonString = "JButton";
428453 StyledDocument doc;
429
- JTextArea infoarea;
454
+ JTextPane infoarea;
430455
431456 void ClearInfo()
432457 {
....@@ -493,7 +518,10 @@
493518 }
494519
495520 if (full)
496
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
521
+ {
522
+ si.SendInfo(" BBox min: " + minima, "regular");
523
+ si.SendInfo(" BBox max: " + maxima, "regular");
524
+ }
497525
498526 if (sel.bRep != null)
499527 {
....@@ -591,6 +619,9 @@
591619 {
592620 CameraPane.pointflow = (PointFlow) sel;
593621 }
622
+
623
+ si.SendInfo("_____________________", "regular");
624
+ si.SendInfo("", "regular");
594625 }
595626 }
596627
....@@ -622,52 +653,52 @@
622653 cameraView.ToggleFullScreen();
623654 }
624655
625
- private JTextArea createTextPane()
656
+ private JTextPane createTextPane()
626657 {
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
- };
658
+// TEXTAREA String[] initString =
659
+// {
660
+// "This is an editable JTextPane, ", //regular
661
+// "another ", //italic
662
+// "styled ", //bold
663
+// "text ", //small
664
+// "component, ", //large
665
+// "which supports embedded components..." + newline,//regular
666
+// " " + newline, //button
667
+// "...and embedded icons..." + newline, //regular
668
+// " ", //icon
669
+// newline + "JTextPane is a subclass of JEditorPane that "
670
+// + "uses a StyledEditorKit and StyledDocument, and provides "
671
+// + "cover methods for interacting with those objects."
672
+// };
673
+//
674
+// String[] initStyles =
675
+// {
676
+// "regular", "italic", "bold", "small", "large",
677
+// "regular", "button", "regular", "icon",
678
+// "regular"
679
+// };
680
+//
681
+// JTextPane textPane = new JTextPane();
682
+// textPane.setEditable(true);
683
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
684
+// addStylesToDocument(doc);
685
+//
686
+// try
687
+// {
688
+// for (int j = 0; j < 2; j++)
689
+// {
690
+// for (int i = 0; i < initString.length; i++)
691
+// {
692
+// doc.insertString(doc.getLength(), initString[i],
693
+// doc.getStyle(initStyles[i]));
694
+// }
695
+// }
696
+// } catch (BadLocationException ble)
697
+// {
698
+// System.err.println("Couldn't insert initial text into text pane.");
699
+// }
642700
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;
701
+ return new JTextPane(); // textPane;
671702 }
672703
673704 protected void addStylesToDocument(StyledDocument doc)
....@@ -767,54 +798,44 @@
767798 JButton slowerButton;
768799 JButton fasterButton;
769800 JButton remarkButton;
801
+
802
+ cGridBag namePanel;
803
+ cGridBag setupPanel;
804
+ cGridBag commandsPanel;
805
+ cGridBag pushPanel;
806
+ cGridBag fillPanel;
770807
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
808
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
772809 {
773810 JCheckBox cb;
774811
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);
812
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
780813 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
784814
785815 return cb;
786816 }
787817
788
- cButton AddButton(ObjEditor oe, String label)
818
+ cButton AddButton(cGridBag panel, String label)
789819 {
790820 cButton cb;
791821
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);
822
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
797823 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
801824
802825 return cb;
803826 }
804827
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
828
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
806829 {
807830 JComboBox combo;
808831
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;
832
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
812833 combo.addActionListener(this);
813834
814835 return combo;
815836 }
816837
817
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, double min, double max, double current, double pow)
838
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
818839 {
819840 cGridBag control = new cGridBag();
820841
....@@ -826,12 +847,12 @@
826847 control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827848 combo.setFloat(current);
828849
829
- ctrlPanel.add(control);
850
+ panel.add(control);
830851
831
- return combo;
852
+ return control;
832853 }
833854
834
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, int min, int max, int current)
855
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
835856 {
836857 cGridBag control = new cGridBag();
837858
....@@ -839,25 +860,21 @@
839860
840861 JLabel jlabel = new JLabel(label);
841862 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);
863
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
864
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
844865 combo.setInteger(current);
845866
846
- ctrlPanel.add(control);
867
+ panel.add(control);
847868
848
- return combo;
869
+ return control;
849870 }
850871
851872 JTextArea AddText(cGridBag ctrlPanel, String name)
852873 {
853874 JTextArea text;
854875
855
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
856
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
857876 ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
858877 text.addCaretListener(this);
859
- aConstraints.gridx += 1;
860
- aConstraints.gridwidth = 1;
861878
862879 return text;
863880 }
....@@ -896,7 +913,7 @@
896913
897914 /*
898915 */
899
- void Return() // ObjEditor oe)
916
+ void Return0() // ObjEditor oe)
900917 {
901918 aConstraints.gridy += 1;
902919 aConstraints.gridx = 0;
....@@ -951,37 +968,70 @@
951968
952969 void SetupUI2(ObjEditor oe)
953970 {
954
-// oe.aConstraints.weightx = 0;
955
-// oe.aConstraints.weighty = 0;
956
-// oe.aConstraints.gridx = 0;
957
-// oe.aConstraints.gridy = 0;
958
- SetupName(oe);
971
+ //SetupName(oe);
972
+
973
+ namePanel = new cGridBag();
974
+
975
+ nameField = AddText(namePanel, copy.GetName());
976
+ namePanel.add(nameField);
977
+ oe.ctrlPanel.add(namePanel);
978
+
979
+ oe.ctrlPanel.Return();
959980
960981 if (!GroupEditor.allparams)
961982 return;
962983
963
- liveCB = AddCheckBox(oe, "Live", copy.live);
964
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
965
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
984
+ setupPanel = new cGridBag().setVertical(false);
985
+
986
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
987
+ liveCB.setToolTipText("Animate object");
988
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
989
+ hideCB.setToolTipText("Hide object");
966990 // 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");
991
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
992
+ markCB.setToolTipText("Set the animation target transform");
993
+
994
+ rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
995
+ rewindCB.setToolTipText("Rewind animation");
996
+
997
+ randomCB = AddCheckBox(setupPanel, "Random", copy.random);
998
+ randomCB.setToolTipText("Option for switch node");
999
+
1000
+ if (Globals.ADVANCED)
1001
+ {
1002
+ link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
1003
+ link2masterCB.setToolTipText("Attach to support");
1004
+ speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
1005
+ speedupCB.setToolTipText("Option motion capture");
1006
+ }
1007
+
1008
+ oe.ctrlPanel.add(setupPanel);
1009
+ oe.ctrlPanel.Return();
1010
+
1011
+ commandsPanel = new cGridBag().setVertical(false);
1012
+
1013
+ resetButton = AddButton(commandsPanel, "Reset");
1014
+ resetButton.setToolTipText("Jump to frame zero");
1015
+ stepButton = AddButton(commandsPanel, "Step");
1016
+ stepButton.setToolTipText("Step one frame");
9731017 // resetAllButton = AddButton(oe, "Reset All");
9741018 // stepAllButton = AddButton(oe, "Step All");
975
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9761019 // Return();
977
- slowerButton = AddButton(oe, "Slow");
978
- fasterButton = AddButton(oe, "Fast");
979
- remarkButton = AddButton(oe, "Rem");
1020
+ slowerButton = AddButton(commandsPanel, "Slow");
1021
+ slowerButton.setToolTipText("Decrease animation speed");
1022
+ fasterButton = AddButton(commandsPanel, "Fast");
1023
+ fasterButton.setToolTipText("Increase animation speed");
1024
+ remarkButton = AddButton(commandsPanel, "Remark");
1025
+ remarkButton.setToolTipText("Set the current transform as the target");
9801026
981
- //Return();
1027
+ oe.ctrlPanel.add(commandsPanel);
1028
+ oe.ctrlPanel.Return();
9821029
983
- //normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
1030
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1031
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
9841032 //Return();
1033
+
1034
+ oe.ctrlPanel.Return();
9851035
9861036 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871037 // ObjEditor.aConstraints.gridx += 1;
....@@ -1076,7 +1126,7 @@
10761126 oe.aConstraints.gridwidth = 1;
10771127 /**/
10781128 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1129
+ oe.ctrlPanel.Return();
10801130
10811131 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821132 //textureButton.setEnabled(false);
....@@ -1253,10 +1303,11 @@
12531303 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12541304 //tmp.setName("Edit");
12551305 objectPanel.add(materialPanel);
1256
- JPanel north = new JPanel(new BorderLayout());
1257
- north.setName("Edit");
1258
- north.add(ctrlPanel, BorderLayout.NORTH);
1259
- objectPanel.add(north);
1306
+// JPanel north = new JPanel(new BorderLayout());
1307
+// north.setName("Edit");
1308
+// north.add(ctrlPanel, BorderLayout.NORTH);
1309
+// objectPanel.add(north);
1310
+ objectPanel.add(ctrlPanel);
12601311 objectPanel.add(infoPanel);
12611312
12621313 /*
....@@ -1415,7 +1466,7 @@
14151466 ctrlPanel.removeAll();
14161467 }
14171468
1418
- void SetupMaterial(cGridBag ctrlPanel)
1469
+ void SetupMaterial(cGridBag panel)
14191470 {
14201471 /*
14211472 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
....@@ -1424,18 +1475,26 @@
14241475
14251476 cGridBag editBar = new cGridBag().setVertical(false);
14261477
1427
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
1478
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1479
+ createMaterialButton.setToolTipText("Create material");
14281480
14291481 /*
14301482 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14311483 */
14321484
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);
1485
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1486
+ clearMaterialButton.setToolTipText("Clear material");
1487
+
1488
+ if (Globals.ADVANCED)
1489
+ {
1490
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1491
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1492
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1493
+ }
14371494
1438
- ctrlPanel.add(editBar);
1495
+ editBar.preferredHeight = 15;
1496
+
1497
+ panel.add(editBar);
14391498
14401499 /**/
14411500 //aConstraints.weighty = 0;
....@@ -1484,9 +1543,9 @@
14841543 shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
14851544 colorSection.add(shadowbias);
14861545
1487
- ctrlPanel.add(new JSeparator());
1546
+ panel.add(new JSeparator());
14881547
1489
- ctrlPanel.add(colorSection);
1548
+ panel.add(colorSection);
14901549
14911550 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14921551
....@@ -1534,9 +1593,9 @@
15341593 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15351594 diffuseSection.add(fakedepth);
15361595
1537
- ctrlPanel.add(new JSeparator());
1596
+ panel.add(new JSeparator());
15381597
1539
- ctrlPanel.add(diffuseSection);
1598
+ panel.add(diffuseSection);
15401599
15411600 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15421601
....@@ -1572,7 +1631,7 @@
15721631 velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15731632 specularSection.add(velvet);
15741633
1575
- shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1);
1634
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
15761635 //Return();
15771636 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
15781637 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
....@@ -1585,9 +1644,9 @@
15851644 // aConstraints.gridwidth = 1;
15861645
15871646
1588
- ctrlPanel.add(new JSeparator());
1647
+ panel.add(new JSeparator());
15891648
1590
- ctrlPanel.add(specularSection);
1649
+ panel.add(specularSection);
15911650
15921651 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15931652
....@@ -1617,9 +1676,9 @@
16171676 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16181677 globalSection.add(opacity);
16191678
1620
- ctrlPanel.add(new JSeparator());
1679
+ panel.add(new JSeparator());
16211680
1622
- ctrlPanel.add(globalSection);
1681
+ panel.add(globalSection);
16231682
16241683 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16251684
....@@ -1661,9 +1720,9 @@
16611720 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
16621721 textureSection.add(opacityPower);
16631722
1664
- ctrlPanel.add(new JSeparator());
1723
+ panel.add(new JSeparator());
16651724
1666
- ctrlPanel.add(textureSection);
1725
+ panel.add(textureSection);
16671726
16681727 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16691728
....@@ -1700,12 +1759,15 @@
17001759 opacityPowerField.addChangeListener(this);
17011760 /**/
17021761
1703
- resetSlidersButton.addActionListener(this);
17041762 clearMaterialButton.addActionListener(this);
17051763 createMaterialButton.addActionListener(this);
1706
-
1707
- propagateToggle.addItemListener(this);
1708
- multiplyToggle.addItemListener(this);
1764
+
1765
+ if (Globals.ADVANCED)
1766
+ {
1767
+ resetSlidersButton.addActionListener(this);
1768
+ propagateToggle.addItemListener(this);
1769
+ multiplyToggle.addItemListener(this);
1770
+ }
17091771 }
17101772
17111773 void DropFile(java.io.File[] files, boolean textures)
....@@ -2482,6 +2544,7 @@
24822544 }
24832545 if (input == null)
24842546 {
2547
+ new Exception().printStackTrace();
24852548 System.exit(0);
24862549 }
24872550
....@@ -2696,7 +2759,8 @@
26962759 return;
26972760 }
26982761
2699
- multiplyToggle.setSelected(mat.multiply);
2762
+ if (multiplyToggle != null)
2763
+ multiplyToggle.setSelected(mat.multiply);
27002764
27012765 assert (object.projectedVertices != null);
27022766
....@@ -2911,7 +2975,7 @@
29112975 frame.validate();
29122976
29132977 return;
2914
- } else if (event.getSource() == toggleRandomItem)
2978
+ } else if (event.getSource() == toggleSwitchItem)
29152979 {
29162980 cameraView.ToggleRandom();
29172981 cameraView.repaint();
....@@ -2956,6 +3020,7 @@
29563020 if (event.getSource() == randomCB)
29573021 {
29583022 copy.random ^= true;
3023
+ objEditor.refreshContents();
29593024 return;
29603025 }
29613026 if (event.getSource() == speedupCB)
....@@ -3179,7 +3244,7 @@
31793244 if (!Globals.ANIMATION)
31803245 {
31813246 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3182
- browser.show();
3247
+ browser.setVisible(true);
31833248 String filename = browser.getFile();
31843249 if (filename != null && filename.length() > 0)
31853250 {
....@@ -3211,6 +3276,7 @@
32113276 callee.refreshContents();
32123277 } else
32133278 {
3279
+ new Exception().printStackTrace();
32143280 System.exit(0);
32153281 }
32163282 }
....@@ -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;