Normand Briere
2019-05-02 c209bbe1cf788c9af3dcffea7667c830170a3f1f
ObjEditor.java
....@@ -19,6 +19,8 @@
1919 import //weka.core.
2020 matrix.Matrix;
2121
22
+import grafeme.ui.*;
23
+
2224 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2325 ActionListener, ChangeListener,
2426 InputMethodListener,
....@@ -136,34 +138,41 @@
136138 public void closeUI()
137139 {
138140 //new Exception().printStackTrace();
139
- System.out.println("this = " + this);
140
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
141143 //nameField.removeActionListener(this);
142
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
145
+
146
+ objEditor.ctrlPanel.remove(namePanel);
143147
144148 if (!GroupEditor.allparams)
145149 return;
146150
147
- objEditor.ctrlPanel.remove(liveCB);
148
- objEditor.ctrlPanel.remove(hideCB);
149
- objEditor.ctrlPanel.remove(markCB);
150
-
151
- objEditor.ctrlPanel.remove(randomCB);
152
- objEditor.ctrlPanel.remove(speedupCB);
153
- objEditor.ctrlPanel.remove(rewindCB);
154
-
155
- objEditor.ctrlPanel.remove(resetButton);
156
- objEditor.ctrlPanel.remove(stepButton);
157
-// objEditor.ctrlPanel.remove(stepAllButton);
158
-// objEditor.ctrlPanel.remove(resetAllButton);
159
- objEditor.ctrlPanel.remove(link2masterCB);
160
- //objEditor.ctrlPanel.remove(flipVCB);
161
- //objEditor.ctrlPanel.remove(texresMenu);
162
- objEditor.ctrlPanel.remove(slowerButton);
163
- objEditor.ctrlPanel.remove(fasterButton);
164
- 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);
165169
166
- 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);
167176 }
168177
169178 public ObjEditor GetEditor()
....@@ -300,44 +309,60 @@
300309 //normalLensItem.addActionListener(this);
301310 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
302311 revertCameraItem.addActionListener(this);
303
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
304
- toggleTimelineItem.addItemListener(this);
312
+
305313 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
306314 toggleFullScreenItem.addItemListener(this);
307315 toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
308316 cameraMenu.add("-");
317
+
309318 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
310319 toggleTextureItem.addItemListener(this);
311320 toggleTextureItem.setState(CameraPane.textureon);
312
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
313
- toggleLiveItem.addItemListener(this);
314
- toggleLiveItem.setState(Globals.isLIVE());
315
- cameraMenu.add(stepItem = new MenuItem("Step"));
316
- stepItem.addActionListener(this);
317
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
318
-// toggleDLItem.addItemListener(this);
319
-// toggleDLItem.setState(false);
320
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
321
- toggleRenderItem.addItemListener(this);
322
- toggleRenderItem.setState(!CameraPane.frozen);
323
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
324
- toggleDebugItem.addItemListener(this);
325
- toggleDebugItem.setState(CameraPane.DEBUG);
326
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
327
- toggleFrustumItem.addItemListener(this);
328
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
329
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
330
- toggleFootContactItem.addItemListener(this);
331
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
332
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
333
- toggleRandomItem.addItemListener(this);
334
- 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
+
335358 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
336359 toggleHandleItem.addItemListener(this);
337360 toggleHandleItem.setState(CameraPane.HANDLES);
361
+
338362 cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
339363 togglePaintItem.addItemListener(this);
340364 togglePaintItem.setState(CameraPane.PAINTMODE);
365
+
341366 // cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
342367 // toggleRootItem.addItemListener(this);
343368 // toggleRootItem.setState(false);
....@@ -351,21 +376,23 @@
351376 objectPanel = new JTabbedPane();
352377 toolbarPanel = new JPanel();
353378 toolbarPanel.setName("Toolbar");
354
- treePanel = new JPanel();
379
+ treePanel = new cGridBag();
355380 treePanel.setName("Tree");
356
- ctrlPanel = new JPanel(); // new GridBagLayout());
381
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
357382 ctrlPanel.setName("Edit");
358
- materialPanel = new JPanel();
383
+ materialPanel = new cGridBag().setVertical(true);
359384 materialPanel.setName("Material");
360385 /*JTextPane*/
361386 infoarea = createTextPane();
387
+ doc = infoarea.getStyledDocument();
388
+
362389 infoarea.setEditable(true);
363390 SetText();
364391 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
365392 // infoarea.setOpaque(false);
366393 // //infoarea.setForeground(textcolor);
367
- infoarea.setLineWrap(true);
368
- infoarea.setWrapStyleWord(true);
394
+// TEXTAREA infoarea.setLineWrap(true);
395
+// TEXTAREA infoarea.setWrapStyleWord(true);
369396 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
370397 infoPanel.setPreferredSize(new Dimension(50, 200));
371398 infoPanel.setName("Info");
....@@ -376,16 +403,16 @@
376403 mainPanel.setName("Main");
377404 mainPanel.setContinuousLayout(true);
378405 mainPanel.setOneTouchExpandable(true);
379
- mainPanel.setDividerLocation(1.0);
380406 mainPanel.setDividerSize(9);
381
- mainPanel.setResizeWeight(0);
407
+ mainPanel.setDividerLocation(0.5); //1.0);
408
+ mainPanel.setResizeWeight(0.5);
382409
383410 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
384411 //mainPanel.setLayout(new GridBagLayout());
385412 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
386
- treePanel.setLayout(new GridBagLayout());
387
- ctrlPanel.setLayout(new GridBagLayout());
388
- materialPanel.setLayout(new GridBagLayout());
413
+// treePanel.setLayout(new GridBagLayout());
414
+ //ctrlPanel.setLayout(new GridBagLayout());
415
+ //materialPanel.setLayout(new GridBagLayout());
389416
390417 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
391418 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -424,7 +451,7 @@
424451 static String newline = "\n";
425452 protected static final String buttonString = "JButton";
426453 StyledDocument doc;
427
- JTextArea infoarea;
454
+ JTextPane infoarea;
428455
429456 void ClearInfo()
430457 {
....@@ -491,7 +518,10 @@
491518 }
492519
493520 if (full)
494
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
521
+ {
522
+ si.SendInfo(" BBox min: " + minima, "regular");
523
+ si.SendInfo(" BBox max: " + maxima, "regular");
524
+ }
495525
496526 if (sel.bRep != null)
497527 {
....@@ -589,6 +619,9 @@
589619 {
590620 CameraPane.pointflow = (PointFlow) sel;
591621 }
622
+
623
+ si.SendInfo("_____________________", "regular");
624
+ si.SendInfo("", "regular");
592625 }
593626 }
594627
....@@ -620,52 +653,52 @@
620653 cameraView.ToggleFullScreen();
621654 }
622655
623
- private JTextArea createTextPane()
656
+ private JTextPane createTextPane()
624657 {
625
- String[] initString =
626
- {
627
- "This is an editable JTextPane, ", //regular
628
- "another ", //italic
629
- "styled ", //bold
630
- "text ", //small
631
- "component, ", //large
632
- "which supports embedded components..." + newline,//regular
633
- " " + newline, //button
634
- "...and embedded icons..." + newline, //regular
635
- " ", //icon
636
- newline + "JTextPane is a subclass of JEditorPane that "
637
- + "uses a StyledEditorKit and StyledDocument, and provides "
638
- + "cover methods for interacting with those objects."
639
- };
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
+// }
640700
641
- String[] initStyles =
642
- {
643
- "regular", "italic", "bold", "small", "large",
644
- "regular", "button", "regular", "icon",
645
- "regular"
646
- };
647
-
648
- JTextPane textPane = new JTextPane();
649
- textPane.setEditable(true);
650
- /*StyledDocument*/ doc = textPane.getStyledDocument();
651
- addStylesToDocument(doc);
652
-
653
- try
654
- {
655
- for (int j = 0; j < 2; j++)
656
- {
657
- for (int i = 0; i < initString.length; i++)
658
- {
659
- doc.insertString(doc.getLength(), initString[i],
660
- doc.getStyle(initStyles[i]));
661
- }
662
- }
663
- } catch (BadLocationException ble)
664
- {
665
- System.err.println("Couldn't insert initial text into text pane.");
666
- }
667
-
668
- return new JTextArea(); // textPane;
701
+ return new JTextPane(); // textPane;
669702 }
670703
671704 protected void addStylesToDocument(StyledDocument doc)
....@@ -765,115 +798,83 @@
765798 JButton slowerButton;
766799 JButton fasterButton;
767800 JButton remarkButton;
801
+
802
+ cGridBag namePanel;
803
+ cGridBag setupPanel;
804
+ cGridBag commandsPanel;
805
+ cGridBag pushPanel;
806
+ cGridBag fillPanel;
768807
769
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
808
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
770809 {
771810 JCheckBox cb;
772811
773
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
774
- oe.aConstraints.gridwidth = 1; // 3;
775
-// oe.aConstraints.weightx = 1;
776
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
777
- 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);
778813 cb.addItemListener(this);
779
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
780
- oe.aConstraints.gridwidth = 1;
781
- oe.aConstraints.gridx += 1;
782814
783815 return cb;
784816 }
785817
786
- cButton AddButton(ObjEditor oe, String label)
818
+ cButton AddButton(cGridBag panel, String label)
787819 {
788820 cButton cb;
789821
790
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
791
- oe.aConstraints.gridwidth = 1;
792
-// oe.aConstraints.weightx = 1;
793
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
794
- 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);
795823 cb.addActionListener(this);
796
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
797
- oe.aConstraints.gridwidth = 1;
798
- oe.aConstraints.gridx += 1;
799824
800825 return cb;
801826 }
802827
803
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
828
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
804829 {
805830 JComboBox combo;
806831
807
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
808
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
809
- oe.aConstraints.gridx += 1;
832
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
810833 combo.addActionListener(this);
811834
812835 return combo;
813836 }
814837
815
- NumberSlider AddSlider(JPanel 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)
816839 {
817
- NumberSlider combo;
840
+ cGridBag control = new cGridBag();
841
+
842
+ cNumberSlider combo;
818843
819844 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822845 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
823
- aConstraints.gridwidth = 1;
824
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
825
- aConstraints.gridx += 1;
826
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
827
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
828
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
829
- aConstraints.gridx += 1;
830
- aConstraints.gridwidth = 1;
831
-
846
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
847
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832848 combo.setFloat(current);
833
-
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
849
+
850
+ panel.add(control);
851
+
852
+ return control;
839853 }
840854
841
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
855
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
842856 {
843
- NumberSlider combo;
857
+ cGridBag control = new cGridBag();
858
+
859
+ cNumberSlider combo;
844860
845861 JLabel jlabel = new JLabel(label);
846
-
847
- aConstraints.fill = GridBagConstraints.VERTICAL;
848862 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
849
- aConstraints.gridwidth = 2;
850
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
851
- aConstraints.gridx += 1;
852
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
853
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
854
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
855
- aConstraints.gridx += 1;
856
- aConstraints.gridwidth = 1;
857
-
863
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
864
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
858865 combo.setInteger(current);
859866
860
- combo.label = jlabel;
861
-
862
- combo.addChangeListener(this);
863
-
864
- return combo;
867
+ panel.add(control);
868
+
869
+ return control;
865870 }
866871
867
- JTextArea AddText(JPanel ctrlPanel, String name)
872
+ JTextArea AddText(cGridBag ctrlPanel, String name)
868873 {
869874 JTextArea text;
870875
871
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
872
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
873
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
876
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
874877 text.addCaretListener(this);
875
- aConstraints.gridx += 1;
876
- aConstraints.gridwidth = 1;
877878
878879 return text;
879880 }
....@@ -903,9 +904,16 @@
903904 objEditor.ctrlPanel.remove(j);
904905 }
905906
907
+ void Remove(cNumberSlider j)
908
+ {
909
+ j.removeChangeListener(this);
910
+ //objEditor.ctrlPanel.remove(j.label);
911
+ objEditor.ctrlPanel.remove(j);
912
+ }
913
+
906914 /*
907915 */
908
- void Return() // ObjEditor oe)
916
+ void Return0() // ObjEditor oe)
909917 {
910918 aConstraints.gridy += 1;
911919 aConstraints.gridx = 0;
....@@ -960,37 +968,70 @@
960968
961969 void SetupUI2(ObjEditor oe)
962970 {
963
-// oe.aConstraints.weightx = 0;
964
-// oe.aConstraints.weighty = 0;
965
-// oe.aConstraints.gridx = 0;
966
-// oe.aConstraints.gridy = 0;
967
- 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();
968980
969981 if (!GroupEditor.allparams)
970982 return;
971983
972
- liveCB = AddCheckBox(oe, "Live", copy.live);
973
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
974
- 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");
975990 // Return();
976
- markCB = AddCheckBox(oe, "Mark", copy.marked);
977
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
978
- randomCB = AddCheckBox(oe, "Rand", copy.random);
979
- Return();
980
- resetButton = AddButton(oe, "Reset");
981
- 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");
9821017 // resetAllButton = AddButton(oe, "Reset All");
9831018 // stepAllButton = AddButton(oe, "Step All");
984
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9851019 // Return();
986
- slowerButton = AddButton(oe, "Slow");
987
- fasterButton = AddButton(oe, "Fast");
988
- 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");
9891026
990
- Return();
1027
+ oe.ctrlPanel.add(commandsPanel);
1028
+ oe.ctrlPanel.Return();
9911029
992
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
993
- Return();
1030
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1031
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1032
+ //Return();
1033
+
1034
+ oe.ctrlPanel.Return();
9941035
9951036 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9961037 // ObjEditor.aConstraints.gridx += 1;
....@@ -1085,7 +1126,7 @@
10851126 oe.aConstraints.gridwidth = 1;
10861127 /**/
10871128 nameField = AddText(oe.ctrlPanel, copy.GetName());
1088
- Return();
1129
+ oe.ctrlPanel.Return();
10891130
10901131 //ctrlPanel.add(textureButton = new Button("Texture..."));
10911132 //textureButton.setEnabled(false);
....@@ -1187,7 +1228,8 @@
11871228 //JPanel worldPanel =
11881229 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11891230 //worldPanel.setName("World");
1190
- centralPanel = new JPanel(new BorderLayout());
1231
+ centralPanel = new cGridBag();
1232
+ centralPanel.preferredWidth = 20;
11911233 timelinePanel = new JPanel(new BorderLayout());
11921234 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11931235
....@@ -1217,12 +1259,13 @@
12171259 //frontView.object = copy;
12181260 //sideView.object = copy;
12191261
1220
- XYZPanel = new JPanel();
1221
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1262
+ XYZPanel = new cGridBag().setVertical(true);
1263
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12221264
1223
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1224
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1225
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1265
+ XYZPanel.preferredWidth = 5;
1266
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1267
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1268
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12261269
12271270 /*
12281271 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1260,10 +1303,11 @@
12601303 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12611304 //tmp.setName("Edit");
12621305 objectPanel.add(materialPanel);
1263
- JPanel north = new JPanel(new BorderLayout());
1264
- north.setName("Edit");
1265
- north.add(ctrlPanel, BorderLayout.NORTH);
1266
- 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);
12671311 objectPanel.add(infoPanel);
12681312
12691313 /*
....@@ -1284,19 +1328,23 @@
12841328 scrollpane.setWheelScrollingEnabled(true);
12851329 scrollpane.addMouseWheelListener(this); // Default not fast enough
12861330
1287
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1288
- scenePanel.add(scrollpane);
1331
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1332
+ scenePanel.preferredWidth = 7;
1333
+
1334
+ JTabbedPane tabbedPane = new JTabbedPane();
1335
+ tabbedPane.add(scrollpane);
12891336
1290
- scenePanel.add(FSPane = new cFileSystemPane(this));
1337
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12911338
1292
- optionsPanel = new JPanel(new GridBagLayout());
1339
+ optionsPanel = new cGridBag().setVertical(true);
12931340
12941341 optionsPanel.setName("Options");
12951342
1296
- AddOptions(optionsPanel, aConstraints);
1343
+ AddOptions(optionsPanel); //, aConstraints);
12971344
1298
- scenePanel.add(optionsPanel);
1299
-
1345
+ tabbedPane.add(optionsPanel);
1346
+
1347
+ scenePanel.add(tabbedPane);
13001348
13011349 /*
13021350 cTree jTree = new cTree(null);
....@@ -1330,6 +1378,7 @@
13301378 //bigPanel.setSize(new Dimension(10,10));
13311379 //bigPanel.add(ctrlPanel);
13321380 //bigPanel.add(gridPanel);
1381
+ /**
13331382 bigThree = new JPanel();
13341383 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13351384 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1353,7 +1402,13 @@
13531402 // aConstraints.gridheight = 3;
13541403 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13551404 bigThree.add(XYZPanel, aWindowConstraints);
1405
+ /**/
13561406
1407
+ bigThree = new cGridBag();
1408
+ bigThree.addComponent(scenePanel);
1409
+ bigThree.addComponent(centralPanel);
1410
+ bigThree.addComponent(XYZPanel);
1411
+
13571412 // // SIDE EFFECT!!!
13581413 // aConstraints.gridx = 0;
13591414 // aConstraints.gridy = 0;
....@@ -1396,7 +1451,7 @@
13961451 });
13971452 }
13981453
1399
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1454
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
14001455 {
14011456 }
14021457
....@@ -1411,260 +1466,173 @@
14111466 ctrlPanel.removeAll();
14121467 }
14131468
1414
- void SetupMaterial(JPanel ctrlPanel)
1469
+ void SetupMaterial(cGridBag panel)
14151470 {
1416
- aConstraints.weighty = 0;
1417
- //aConstraints.weightx = 1;
1418
- /*
1471
+ /*
14191472 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14201473 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1421
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1422
- aConstraints.gridx += 1;
14231474 */
14241475
1425
- aConstraints.gridwidth = 1;
1426
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1427
- aConstraints.gridx += 1;
1428
- aConstraints.weighty = 0;
1429
- aConstraints.gridwidth = 1;
1476
+ cGridBag editBar = new cGridBag().setVertical(false);
1477
+
1478
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1479
+ createMaterialButton.setToolTipText("Create material");
14301480
14311481 /*
14321482 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1433
- aConstraints.gridx += 1;
1434
- aConstraints.weighty = 0;
1435
- aConstraints.gridwidth = 1;
14361483 */
14371484
1438
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1439
- aConstraints.gridx += 1;
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
+ }
14401494
1441
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1442
-
1443
- aConstraints.gridx += 1;
1444
-
1445
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1446
-
1447
- aConstraints.gridx += 1;
1448
-
1449
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1450
-
1451
- aConstraints.gridx = 0;
1452
- aConstraints.gridy += 1;
1453
- aConstraints.weighty = 0;
1454
- aConstraints.gridwidth = 1;
1495
+ editBar.preferredHeight = 15;
1496
+
1497
+ panel.add(editBar);
1498
+
14551499 /**/
14561500 //aConstraints.weighty = 0;
14571501 ////aConstraints.weightx = 1;
14581502 //aConstraints.weighty = 1;
14591503 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14601504 //aConstraints.gridx += 1;
1461
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1462
- aConstraints.weighty = 0;
1463
- aConstraints.gridx = 0;
1464
- aConstraints.gridy += 1;
1465
- aConstraints.gridwidth = 1;
1505
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14661506
1467
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1468
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1469
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1470
- aConstraints.gridx += 1;
1471
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1472
- //aConstraints.weightx = 0;
1473
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1474
- aConstraints.gridx = 0;
1475
- aConstraints.gridy += 1;
1476
- aConstraints.gridwidth = 1;
1507
+ cGridBag colorSection = new cGridBag().setVertical(true);
1508
+
1509
+ cGridBag color = new cGridBag();
1510
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1511
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1512
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1513
+ //colorField.preferredWidth = 200;
1514
+ colorSection.add(color);
14771515
1478
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1479
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1480
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1481
- aConstraints.gridx += 1;
1482
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1483
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1484
- aConstraints.gridx = 0;
1485
- aConstraints.gridy += 1;
1486
- aConstraints.gridwidth = 1;
1516
+ cGridBag modulation = new cGridBag();
1517
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1518
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1519
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1520
+ colorSection.add(modulation);
14871521
1488
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1489
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1490
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1491
- aConstraints.gridx += 1;
1492
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1493
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1494
- aConstraints.gridx = 0;
1495
- aConstraints.gridy += 1;
1496
- aConstraints.gridwidth = 1;
1522
+ cGridBag texture = new cGridBag();
1523
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1524
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1525
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1526
+ colorSection.add(texture);
14971527
1498
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1499
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1500
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1501
- aConstraints.gridx += 1;
1502
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1503
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1504
- aConstraints.gridx = 0;
1505
- aConstraints.gridy += 1;
1506
- aConstraints.gridwidth = 1;
1528
+ cGridBag anisoU = new cGridBag();
1529
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1530
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1531
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1532
+ colorSection.add(anisoU);
15071533
1508
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1509
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1510
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1511
- aConstraints.gridx += 1;
1512
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1513
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1514
- aConstraints.gridx = 0;
1515
- aConstraints.gridy += 1;
1516
- aConstraints.gridwidth = 1;
1534
+ cGridBag anisoV = new cGridBag();
1535
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1536
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1537
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1538
+ colorSection.add(anisoV);
15171539
1518
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1519
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1520
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1521
- aConstraints.gridx += 1;
1522
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1523
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1524
- aConstraints.gridx = 0;
1525
- aConstraints.gridy += 1;
1526
- aConstraints.gridwidth = 1;
1540
+ cGridBag shadowbias = new cGridBag();
1541
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1542
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1543
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1544
+ colorSection.add(shadowbias);
15271545
1528
- //aConstraints.weighty = 1;
1529
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1530
- //aConstraints.gridx += 1;
1531
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1532
- aConstraints.weighty = 0;
1533
- aConstraints.gridx = 0;
1534
- aConstraints.gridy += 1;
1535
- aConstraints.gridwidth = 1;
1546
+ panel.add(new JSeparator());
1547
+
1548
+ panel.add(colorSection);
1549
+
1550
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1551
+
1552
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1553
+
1554
+ cGridBag diffuse = new cGridBag();
1555
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1556
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1557
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1558
+ diffuseSection.add(diffuse);
15361559
1537
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1538
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1539
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1540
- aConstraints.gridx += 1;
1541
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1542
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1543
- aConstraints.gridx = 0;
1544
- aConstraints.gridy += 1;
1545
- aConstraints.gridwidth = 1;
1560
+ cGridBag diffuseness = new cGridBag();
1561
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1562
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1563
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1564
+ diffuseSection.add(diffuseness);
15461565
1547
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1548
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1549
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1550
- aConstraints.gridx += 1;
1551
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1552
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1553
- aConstraints.gridx = 0;
1554
- aConstraints.gridy += 1;
1555
- aConstraints.gridwidth = 1;
1566
+ cGridBag selfshadow = new cGridBag();
1567
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1568
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1569
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1570
+ diffuseSection.add(selfshadow);
15561571
1557
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1558
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1559
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1560
- aConstraints.gridx += 1;
1561
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1562
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1563
- aConstraints.gridx = 0;
1564
- aConstraints.gridy += 1;
1565
- aConstraints.gridwidth = 1;
1572
+ cGridBag sheen = new cGridBag();
1573
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1574
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1575
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1576
+ diffuseSection.add(sheen);
15661577
1567
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1568
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1569
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1570
- aConstraints.gridx += 1;
1571
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1572
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1573
- aConstraints.gridx = 0;
1574
- aConstraints.gridy += 1;
1575
- aConstraints.gridwidth = 1;
1578
+ cGridBag subsurface = new cGridBag();
1579
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1580
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1581
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1582
+ diffuseSection.add(subsurface);
15761583
1577
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1578
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1579
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1580
- aConstraints.gridx += 1;
1581
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1582
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1583
- aConstraints.gridx = 0;
1584
- aConstraints.gridy += 1;
1585
- aConstraints.gridwidth = 1;
1584
+ cGridBag shadow = new cGridBag();
1585
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1586
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1587
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1588
+ diffuseSection.add(shadow);
15861589
1587
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1588
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1589
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1590
- aConstraints.gridx += 1;
1591
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1592
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1593
- aConstraints.gridx = 0;
1594
- aConstraints.gridy += 1;
1595
- aConstraints.gridwidth = 1;
1590
+ cGridBag fakedepth = new cGridBag();
1591
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1592
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1593
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1594
+ diffuseSection.add(fakedepth);
15961595
1597
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1598
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1599
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1600
- aConstraints.gridx += 1;
1601
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1602
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1603
- aConstraints.gridx = 0;
1604
- aConstraints.gridy += 1;
1605
- aConstraints.gridwidth = 1;
1596
+ panel.add(new JSeparator());
1597
+
1598
+ panel.add(diffuseSection);
1599
+
1600
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1601
+
1602
+ cGridBag specularSection = new cGridBag().setVertical(true);
16061603
1607
- //aConstraints.weighty = 1;
1608
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1609
- //aConstraints.gridx += 1;
1610
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1611
- aConstraints.weighty = 0;
1612
- aConstraints.gridx = 0;
1613
- aConstraints.gridy += 1;
1614
- aConstraints.gridwidth = 1;
1604
+ cGridBag specular = new cGridBag();
1605
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1606
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1607
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1608
+ specularSection.add(specular);
16151609
1616
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1617
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1618
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1619
- aConstraints.gridx += 1;
1620
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1621
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1622
- aConstraints.gridx = 0;
1623
- aConstraints.gridy += 1;
1624
- aConstraints.gridwidth = 1;
1610
+ cGridBag lightarea = new cGridBag();
1611
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1612
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1613
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1614
+ specularSection.add(lightarea);
16251615
1626
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1627
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1628
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1629
- aConstraints.gridx += 1;
1630
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1631
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1632
- aConstraints.gridx = 0;
1633
- aConstraints.gridy += 1;
1634
- aConstraints.gridwidth = 1;
1616
+ cGridBag shininess = new cGridBag();
1617
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1618
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1619
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1620
+ specularSection.add(shininess);
16351621
1636
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1637
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1638
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1639
- aConstraints.gridx += 1;
1640
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1641
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1642
- aConstraints.gridx = 0;
1643
- aConstraints.gridy += 1;
1644
- aConstraints.gridwidth = 1;
1622
+ cGridBag metalness = new cGridBag();
1623
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1624
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1625
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1626
+ specularSection.add(metalness);
16451627
1646
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1647
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1648
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1649
- aConstraints.gridx += 1;
1650
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1651
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1652
- aConstraints.gridx = 0;
1653
- aConstraints.gridy += 1;
1654
- aConstraints.gridwidth = 1;
1628
+ cGridBag velvet = new cGridBag();
1629
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1630
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1632
+ specularSection.add(velvet);
16551633
1656
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1657
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1658
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1659
- aConstraints.gridx += 1;
1660
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1661
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1662
- aConstraints.gridx = 0;
1663
- aConstraints.gridy += 1;
1664
- aConstraints.gridwidth = 1;
1665
-
1666
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1667
- Return();
1634
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1635
+ //Return();
16681636 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16691637 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16701638 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1675,130 +1643,93 @@
16751643 // aConstraints.gridy += 1;
16761644 // aConstraints.gridwidth = 1;
16771645
1678
- //aConstraints.weighty = 1;
1679
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1680
- //aConstraints.gridx += 1;
1681
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1682
- aConstraints.weighty = 0;
1683
- aConstraints.gridx = 0;
1684
- aConstraints.gridy += 1;
1685
- aConstraints.gridwidth = 1;
16861646
1687
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1688
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1689
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1690
- aConstraints.gridx += 1;
1691
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1692
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1693
- aConstraints.gridx = 0;
1694
- aConstraints.gridy += 1;
1695
- aConstraints.gridwidth = 1;
1647
+ panel.add(new JSeparator());
1648
+
1649
+ panel.add(specularSection);
1650
+
1651
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1652
+
1653
+ cGridBag globalSection = new cGridBag().setVertical(true);
16961654
1697
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1698
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1699
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1700
- aConstraints.gridx += 1;
1701
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1702
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1703
- aConstraints.gridx = 0;
1704
- aConstraints.gridy += 1;
1705
- aConstraints.gridwidth = 1;
1655
+ cGridBag camera = new cGridBag();
1656
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1657
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1658
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1659
+ globalSection.add(camera);
17061660
1707
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1708
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1709
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1710
- aConstraints.gridx += 1;
1711
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1712
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1713
- aConstraints.gridx = 0;
1714
- aConstraints.gridy += 1;
1715
- aConstraints.gridwidth = 1;
1661
+ cGridBag ambient = new cGridBag();
1662
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1663
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1664
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1665
+ globalSection.add(ambient);
17161666
1717
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1718
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1719
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1720
- aConstraints.gridx += 1;
1721
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1722
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1723
- aConstraints.gridx = 0;
1724
- aConstraints.gridy += 1;
1725
- aConstraints.gridwidth = 1;
1726
- aConstraints.weighty = 0;
1667
+ cGridBag backlit = new cGridBag();
1668
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1669
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1670
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1671
+ globalSection.add(backlit);
17271672
1728
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1729
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1730
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1731
- aConstraints.gridx += 1;
1732
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1733
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1734
- aConstraints.gridx = 0;
1735
- aConstraints.gridy += 1;
1736
- aConstraints.gridwidth = 1;
1673
+ cGridBag opacity = new cGridBag();
1674
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1675
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1676
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1677
+ globalSection.add(opacity);
17371678
1738
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1739
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1740
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1741
- aConstraints.gridx += 1;
1742
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1743
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1744
- aConstraints.gridx = 0;
1745
- aConstraints.gridy += 1;
1746
- aConstraints.gridwidth = 1;
1679
+ panel.add(new JSeparator());
1680
+
1681
+ panel.add(globalSection);
1682
+
1683
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1684
+
1685
+ cGridBag textureSection = new cGridBag().setVertical(true);
17471686
1748
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1749
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1750
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1751
- aConstraints.gridx += 1;
1752
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1753
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1754
- aConstraints.gridx = 0;
1755
- aConstraints.gridy += 1;
1756
- aConstraints.gridwidth = 1;
1687
+ cGridBag bump = new cGridBag();
1688
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1689
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1690
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1691
+ textureSection.add(bump);
17571692
1758
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1759
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1760
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1761
- aConstraints.gridx += 1;
1762
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1763
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1764
- aConstraints.gridx = 0;
1765
- aConstraints.gridy += 1;
1766
- aConstraints.gridwidth = 1;
1693
+ cGridBag noise = new cGridBag();
1694
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1695
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1696
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1697
+ textureSection.add(noise);
17671698
1768
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1769
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1770
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1771
- aConstraints.gridx += 1;
1772
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1773
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1774
- aConstraints.gridx = 0;
1775
- aConstraints.gridy += 1;
1776
- aConstraints.gridwidth = 1;
1699
+ cGridBag power = new cGridBag();
1700
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1701
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1703
+ textureSection.add(power);
17771704
1778
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1779
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1780
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1781
- aConstraints.gridx += 1;
1782
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1783
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1784
- aConstraints.gridx = 0;
1785
- aConstraints.gridy += 1;
1786
- aConstraints.gridwidth = 1;
1705
+ cGridBag borderfade = new cGridBag();
1706
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1707
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1709
+ textureSection.add(borderfade);
17871710
1788
- //aConstraints.weighty = 1;
1789
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1790
- //aConstraints.gridx += 1;
1791
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1792
- aConstraints.weighty = 0;
1711
+ cGridBag fog = new cGridBag();
1712
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1713
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1714
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1715
+ textureSection.add(fog);
17931716
1794
- aConstraints.gridx = 0;
1795
- aConstraints.gridy = 0;
1796
- aConstraints.gridwidth = 1;
1717
+ cGridBag opacityPower = new cGridBag();
1718
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1719
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1720
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1721
+ textureSection.add(opacityPower);
1722
+
1723
+ panel.add(new JSeparator());
1724
+
1725
+ panel.add(textureSection);
1726
+
1727
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17971728
17981729 SetMaterial(copy); // .GetMaterial());
17991730
1800
- colorField.addChangeListener(this);
1801
- modulationField.addChangeListener(this);
1731
+ //colorField.addChangeListener(this);
1732
+// modulationField.addChangeListener(this);
18021733 metalnessField.addChangeListener(this);
18031734 diffuseField.addChangeListener(this);
18041735 specularField.addChangeListener(this);
....@@ -1828,12 +1759,15 @@
18281759 opacityPowerField.addChangeListener(this);
18291760 /**/
18301761
1831
- resetSlidersButton.addActionListener(this);
18321762 clearMaterialButton.addActionListener(this);
18331763 createMaterialButton.addActionListener(this);
1834
-
1835
- propagateToggle.addItemListener(this);
1836
- multiplyToggle.addItemListener(this);
1764
+
1765
+ if (Globals.ADVANCED)
1766
+ {
1767
+ resetSlidersButton.addActionListener(this);
1768
+ propagateToggle.addItemListener(this);
1769
+ multiplyToggle.addItemListener(this);
1770
+ }
18371771 }
18381772
18391773 void DropFile(java.io.File[] files, boolean textures)
....@@ -2610,6 +2544,7 @@
26102544 }
26112545 if (input == null)
26122546 {
2547
+ new Exception().printStackTrace();
26132548 System.exit(0);
26142549 }
26152550
....@@ -2824,7 +2759,8 @@
28242759 return;
28252760 }
28262761
2827
- multiplyToggle.setSelected(mat.multiply);
2762
+ if (multiplyToggle != null)
2763
+ multiplyToggle.setSelected(mat.multiply);
28282764
28292765 assert (object.projectedVertices != null);
28302766
....@@ -3039,7 +2975,7 @@
30392975 frame.validate();
30402976
30412977 return;
3042
- } else if (event.getSource() == toggleRandomItem)
2978
+ } else if (event.getSource() == toggleSwitchItem)
30432979 {
30442980 cameraView.ToggleRandom();
30452981 cameraView.repaint();
....@@ -3084,6 +3020,7 @@
30843020 if (event.getSource() == randomCB)
30853021 {
30863022 copy.random ^= true;
3023
+ objEditor.refreshContents();
30873024 return;
30883025 }
30893026 if (event.getSource() == speedupCB)
....@@ -3307,7 +3244,7 @@
33073244 if (!Globals.ANIMATION)
33083245 {
33093246 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3310
- browser.show();
3247
+ browser.setVisible(true);
33113248 String filename = browser.getFile();
33123249 if (filename != null && filename.length() > 0)
33133250 {
....@@ -3339,6 +3276,7 @@
33393276 callee.refreshContents();
33403277 } else
33413278 {
3279
+ new Exception().printStackTrace();
33423280 System.exit(0);
33433281 }
33443282 }
....@@ -3368,7 +3306,7 @@
33683306 void CreateMaterial()
33693307 {
33703308 //copy.ClearMaterial(); // PATCH
3371
- copy.CreateMaterialS(multiplyToggle.isSelected());
3309
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33723310 if (copy.selection.size() > 0)
33733311 //SetMaterial(copy);
33743312 {
....@@ -3427,11 +3365,11 @@
34273365 {
34283366 copy.ResetBlockLoop(); // temporary problem
34293367
3430
- boolean random = CameraPane.RANDOM;
3431
- CameraPane.RANDOM = false; // parse everything
3368
+ boolean random = CameraPane.SWITCH;
3369
+ CameraPane.SWITCH = false; // parse everything
34323370 copy.ResetDisplayList();
34333371 copy.HardTouch();
3434
- CameraPane.RANDOM = random;
3372
+ CameraPane.SWITCH = random;
34353373 }
34363374
34373375 // public void applySelf()
....@@ -3501,7 +3439,7 @@
35013439 current.fakedepth = (float) fakedepthField.getFloat();
35023440 current.shadowbias = (float) shadowbiasField.getFloat();
35033441
3504
- if (!NumberSlider.frozen)
3442
+ if (!cNumberSlider.frozen)
35053443 {
35063444 //System.out.println("Propagate = " + propagate);
35073445 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3549,6 +3487,7 @@
35493487 || e.getSource() == apertureField
35503488 || e.getSource() == shadowblurField)
35513489 {
3490
+ new Exception().printStackTrace();
35523491 System.exit(0);
35533492 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35543493 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3874,7 +3813,7 @@
38743813
38753814 radioPanel.revalidate();
38763815 radioPanel.repaint();
3877
- ctrlPanel.revalidate(); // ? new
3816
+ ctrlPanel.validate(); // ? new
38783817 ctrlPanel.repaint();
38793818 }
38803819 }
....@@ -4520,8 +4459,8 @@
45204459 //MenuItem normalLensItem;
45214460 MenuItem editCameraItem;
45224461 MenuItem revertCameraItem;
4523
- CheckboxMenuItem toggleLiveItem;
45244462 MenuItem stepItem;
4463
+ CheckboxMenuItem toggleLiveItem;
45254464 CheckboxMenuItem toggleFullScreenItem;
45264465 CheckboxMenuItem toggleTimelineItem;
45274466 CheckboxMenuItem toggleRenderItem;
....@@ -4530,7 +4469,7 @@
45304469 CheckboxMenuItem toggleFootContactItem;
45314470 CheckboxMenuItem toggleDLItem;
45324471 CheckboxMenuItem toggleTextureItem;
4533
- CheckboxMenuItem toggleRandomItem;
4472
+ CheckboxMenuItem toggleSwitchItem;
45344473 CheckboxMenuItem toggleRootItem;
45354474 CheckboxMenuItem animationItem;
45364475 CheckboxMenuItem toggleHandleItem;
....@@ -4538,20 +4477,20 @@
45384477 JSplitPane mainPanel;
45394478 JScrollPane scrollpane;
45404479 JPanel toolbarPanel;
4541
- JPanel treePanel;
4480
+ cGridBag treePanel;
45424481 JPanel radioPanel;
45434482 ButtonGroup buttonGroup;
4544
- JPanel ctrlPanel;
4545
- JPanel materialPanel;
4483
+ cGridBag ctrlPanel;
4484
+ cGridBag materialPanel;
45464485 JScrollPane infoPanel;
4547
- JPanel optionsPanel;
4486
+ cGridBag optionsPanel;
45484487 JTabbedPane objectPanel;
4549
- JPanel XYZPanel;
4488
+ cGridBag XYZPanel;
45504489 JSplitPane gridPanel;
45514490 JSplitPane bigPanel;
4552
- JPanel bigThree;
4553
- JTabbedPane scenePanel;
4554
- JPanel centralPanel;
4491
+ cGridBag bigThree;
4492
+ cGridBag scenePanel;
4493
+ cGridBag centralPanel;
45554494 JSplitPane cameraPanel;
45564495 JPanel timelinePanel;
45574496 JMenuBar timelineMenubar;
....@@ -4604,67 +4543,67 @@
46044543 // MATERIAL
46054544 JLabel materialLabel;
46064545 JLabel colorLabel;
4607
- NumberSlider colorField;
4546
+ cNumberSlider colorField;
46084547 JLabel modulationLabel;
4609
- NumberSlider modulationField;
4548
+ cNumberSlider modulationField;
46104549 JLabel metalnessLabel;
4611
- NumberSlider metalnessField;
4550
+ cNumberSlider metalnessField;
46124551 JLabel diffuseLabel;
4613
- NumberSlider diffuseField;
4552
+ cNumberSlider diffuseField;
46144553 JLabel specularLabel;
4615
- NumberSlider specularField;
4554
+ cNumberSlider specularField;
46164555 JLabel shininessLabel;
4617
- NumberSlider shininessField;
4556
+ cNumberSlider shininessField;
46184557 JLabel shiftLabel;
4619
- NumberSlider shiftField;
4558
+ cNumberSlider shiftField;
46204559 JLabel ambientLabel;
4621
- NumberSlider ambientField;
4560
+ cNumberSlider ambientField;
46224561 JLabel lightareaLabel;
4623
- NumberSlider lightareaField;
4562
+ cNumberSlider lightareaField;
46244563 JLabel diffusenessLabel;
4625
- NumberSlider diffusenessField;
4564
+ cNumberSlider diffusenessField;
46264565 JLabel velvetLabel;
4627
- NumberSlider velvetField;
4566
+ cNumberSlider velvetField;
46284567 JLabel sheenLabel;
4629
- NumberSlider sheenField;
4568
+ cNumberSlider sheenField;
46304569 JLabel subsurfaceLabel;
4631
- NumberSlider subsurfaceField;
4570
+ cNumberSlider subsurfaceField;
46324571 //JLabel bumpLabel;
46334572 //NumberSlider bumpField;
46344573 JLabel backlitLabel;
4635
- NumberSlider backlitField;
4574
+ cNumberSlider backlitField;
46364575 JLabel anisoLabel;
4637
- NumberSlider anisoField;
4576
+ cNumberSlider anisoField;
46384577 JLabel anisoVLabel;
4639
- NumberSlider anisoVField;
4578
+ cNumberSlider anisoVField;
46404579 JLabel cameraLabel;
4641
- NumberSlider cameraField;
4580
+ cNumberSlider cameraField;
46424581 JLabel selfshadowLabel;
4643
- NumberSlider selfshadowField;
4582
+ cNumberSlider selfshadowField;
46444583 JLabel shadowLabel;
4645
- NumberSlider shadowField;
4584
+ cNumberSlider shadowField;
46464585 JLabel textureLabel;
4647
- NumberSlider textureField;
4586
+ cNumberSlider textureField;
46484587 JLabel opacityLabel;
4649
- NumberSlider opacityField;
4588
+ cNumberSlider opacityField;
46504589 JLabel fakedepthLabel;
4651
- NumberSlider fakedepthField;
4590
+ cNumberSlider fakedepthField;
46524591 JLabel shadowbiasLabel;
4653
- NumberSlider shadowbiasField;
4592
+ cNumberSlider shadowbiasField;
46544593 JLabel bumpLabel;
4655
- NumberSlider bumpField;
4594
+ cNumberSlider bumpField;
46564595 JLabel noiseLabel;
4657
- NumberSlider noiseField;
4596
+ cNumberSlider noiseField;
46584597 JLabel powerLabel;
4659
- NumberSlider powerField;
4598
+ cNumberSlider powerField;
46604599 JLabel borderfadeLabel;
4661
- NumberSlider borderfadeField;
4600
+ cNumberSlider borderfadeField;
46624601 JLabel fogLabel;
4663
- NumberSlider fogField;
4602
+ cNumberSlider fogField;
46644603 JLabel opacityPowerLabel;
4665
- NumberSlider opacityPowerField;
4604
+ cNumberSlider opacityPowerField;
46664605 JTree jTree;
46674606 //ObjectUI parent;
46684607
4669
- NumberSlider normalpushField;
4608
+ cNumberSlider normalpushField;
46704609 }