Normand Briere
2019-05-05 f69d25e4682ca33edfc8cfad26187050f4eb558a
ObjEditor.java
....@@ -138,34 +138,41 @@
138138 public void closeUI()
139139 {
140140 //new Exception().printStackTrace();
141
- System.out.println("this = " + this);
142
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
143143 //nameField.removeActionListener(this);
144
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
145
+
146
+ objEditor.ctrlPanel.remove(namePanel);
145147
146148 if (!GroupEditor.allparams)
147149 return;
148150
149
- objEditor.ctrlPanel.remove(liveCB);
150
- objEditor.ctrlPanel.remove(hideCB);
151
- objEditor.ctrlPanel.remove(markCB);
152
-
153
- objEditor.ctrlPanel.remove(randomCB);
154
- objEditor.ctrlPanel.remove(speedupCB);
155
- objEditor.ctrlPanel.remove(rewindCB);
156
-
157
- objEditor.ctrlPanel.remove(resetButton);
158
- objEditor.ctrlPanel.remove(stepButton);
159
-// objEditor.ctrlPanel.remove(stepAllButton);
160
-// objEditor.ctrlPanel.remove(resetAllButton);
161
- objEditor.ctrlPanel.remove(link2masterCB);
162
- //objEditor.ctrlPanel.remove(flipVCB);
163
- //objEditor.ctrlPanel.remove(texresMenu);
164
- objEditor.ctrlPanel.remove(slowerButton);
165
- objEditor.ctrlPanel.remove(fasterButton);
166
- objEditor.ctrlPanel.remove(remarkButton);
151
+// objEditor.ctrlPanel.remove(liveCB);
152
+// objEditor.ctrlPanel.remove(hideCB);
153
+// objEditor.ctrlPanel.remove(markCB);
154
+//
155
+// objEditor.ctrlPanel.remove(randomCB);
156
+// objEditor.ctrlPanel.remove(speedupCB);
157
+// objEditor.ctrlPanel.remove(rewindCB);
158
+//
159
+// objEditor.ctrlPanel.remove(resetButton);
160
+// objEditor.ctrlPanel.remove(stepButton);
161
+//// objEditor.ctrlPanel.remove(stepAllButton);
162
+//// objEditor.ctrlPanel.remove(resetAllButton);
163
+// objEditor.ctrlPanel.remove(link2masterCB);
164
+// //objEditor.ctrlPanel.remove(flipVCB);
165
+// //objEditor.ctrlPanel.remove(texresMenu);
166
+// objEditor.ctrlPanel.remove(slowerButton);
167
+// objEditor.ctrlPanel.remove(fasterButton);
168
+// objEditor.ctrlPanel.remove(remarkButton);
167169
168
- Remove(normalpushField);
170
+ objEditor.ctrlPanel.remove(setupPanel);
171
+ objEditor.ctrlPanel.remove(commandsPanel);
172
+ objEditor.ctrlPanel.remove(pushPanel);
173
+ //objEditor.ctrlPanel.remove(fillPanel);
174
+
175
+ //Remove(normalpushField);
169176 }
170177
171178 public ObjEditor GetEditor()
....@@ -302,44 +309,61 @@
302309 //normalLensItem.addActionListener(this);
303310 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
304311 revertCameraItem.addActionListener(this);
305
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
306
- toggleTimelineItem.addItemListener(this);
312
+
307313 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
308314 toggleFullScreenItem.addItemListener(this);
309315 toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
310316 cameraMenu.add("-");
317
+
311318 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
312319 toggleTextureItem.addItemListener(this);
313320 toggleTextureItem.setState(CameraPane.textureon);
314
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
315
- toggleLiveItem.addItemListener(this);
316
- toggleLiveItem.setState(Globals.isLIVE());
317
- cameraMenu.add(stepItem = new MenuItem("Step"));
318
- stepItem.addActionListener(this);
319
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
320
-// toggleDLItem.addItemListener(this);
321
-// toggleDLItem.setState(false);
322
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
323
- toggleRenderItem.addItemListener(this);
324
- toggleRenderItem.setState(!CameraPane.frozen);
325
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
326
- toggleDebugItem.addItemListener(this);
327
- toggleDebugItem.setState(CameraPane.DEBUG);
328
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
329
- toggleFrustumItem.addItemListener(this);
330
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
331
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
332
- toggleFootContactItem.addItemListener(this);
333
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
334
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
335
- toggleRandomItem.addItemListener(this);
336
- toggleRandomItem.setState(CameraPane.RANDOM);
321
+
322
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
323
+ toggleSwitchItem.addItemListener(this);
324
+ toggleSwitchItem.setState(CameraPane.SWITCH);
325
+
337326 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
338327 toggleHandleItem.addItemListener(this);
339328 toggleHandleItem.setState(CameraPane.HANDLES);
329
+
340330 cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
341331 togglePaintItem.addItemListener(this);
342332 togglePaintItem.setState(CameraPane.PAINTMODE);
333
+
334
+ if (Globals.ADVANCED)
335
+ {
336
+ cameraMenu.add("-");
337
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
338
+ toggleLiveItem.addItemListener(this);
339
+ toggleLiveItem.setState(Globals.isLIVE());
340
+
341
+ cameraMenu.add(stepItem = new MenuItem("Step"));
342
+ stepItem.addActionListener(this);
343
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
344
+ // toggleDLItem.addItemListener(this);
345
+ // toggleDLItem.setState(false);
346
+
347
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
348
+ toggleRenderItem.addItemListener(this);
349
+ toggleRenderItem.setState(!CameraPane.frozen);
350
+
351
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
352
+ toggleDebugItem.addItemListener(this);
353
+ toggleDebugItem.setState(CameraPane.DEBUG);
354
+
355
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
356
+ toggleFrustumItem.addItemListener(this);
357
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
358
+
359
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
360
+ toggleFootContactItem.addItemListener(this);
361
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
362
+
363
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
364
+ toggleTimelineItem.addItemListener(this);
365
+ }
366
+
343367 // cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
344368 // toggleRootItem.addItemListener(this);
345369 // toggleRootItem.setState(false);
....@@ -353,21 +377,23 @@
353377 objectPanel = new JTabbedPane();
354378 toolbarPanel = new JPanel();
355379 toolbarPanel.setName("Toolbar");
356
- treePanel = new JPanel();
380
+ treePanel = new cGridBag();
357381 treePanel.setName("Tree");
358
- ctrlPanel = new JPanel(); // new GridBagLayout());
382
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
359383 ctrlPanel.setName("Edit");
360
- materialPanel = new JPanel();
384
+ materialPanel = new cGridBag().setVertical(true);
361385 materialPanel.setName("Material");
362386 /*JTextPane*/
363387 infoarea = createTextPane();
388
+ doc = infoarea.getStyledDocument();
389
+
364390 infoarea.setEditable(true);
365391 SetText();
366392 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
367393 // infoarea.setOpaque(false);
368394 // //infoarea.setForeground(textcolor);
369
- infoarea.setLineWrap(true);
370
- infoarea.setWrapStyleWord(true);
395
+// TEXTAREA infoarea.setLineWrap(true);
396
+// TEXTAREA infoarea.setWrapStyleWord(true);
371397 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
372398 infoPanel.setPreferredSize(new Dimension(50, 200));
373399 infoPanel.setName("Info");
....@@ -378,16 +404,16 @@
378404 mainPanel.setName("Main");
379405 mainPanel.setContinuousLayout(true);
380406 mainPanel.setOneTouchExpandable(true);
381
- mainPanel.setDividerLocation(1.0);
382407 mainPanel.setDividerSize(9);
383
- mainPanel.setResizeWeight(0);
408
+ mainPanel.setDividerLocation(0.5); //1.0);
409
+ mainPanel.setResizeWeight(0.5);
384410
385411 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
386412 //mainPanel.setLayout(new GridBagLayout());
387413 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388
- treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
390
- materialPanel.setLayout(new GridBagLayout());
414
+// treePanel.setLayout(new GridBagLayout());
415
+ //ctrlPanel.setLayout(new GridBagLayout());
416
+ //materialPanel.setLayout(new GridBagLayout());
391417
392418 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
393419 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -426,7 +452,7 @@
426452 static String newline = "\n";
427453 protected static final String buttonString = "JButton";
428454 StyledDocument doc;
429
- JTextArea infoarea;
455
+ JTextPane infoarea;
430456
431457 void ClearInfo()
432458 {
....@@ -493,7 +519,10 @@
493519 }
494520
495521 if (full)
496
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
522
+ {
523
+ si.SendInfo(" BBox min: " + minima, "regular");
524
+ si.SendInfo(" BBox max: " + maxima, "regular");
525
+ }
497526
498527 if (sel.bRep != null)
499528 {
....@@ -591,6 +620,9 @@
591620 {
592621 CameraPane.pointflow = (PointFlow) sel;
593622 }
623
+
624
+ si.SendInfo("_____________________", "regular");
625
+ si.SendInfo("", "regular");
594626 }
595627 }
596628
....@@ -622,52 +654,52 @@
622654 cameraView.ToggleFullScreen();
623655 }
624656
625
- private JTextArea createTextPane()
657
+ private JTextPane createTextPane()
626658 {
627
- String[] initString =
628
- {
629
- "This is an editable JTextPane, ", //regular
630
- "another ", //italic
631
- "styled ", //bold
632
- "text ", //small
633
- "component, ", //large
634
- "which supports embedded components..." + newline,//regular
635
- " " + newline, //button
636
- "...and embedded icons..." + newline, //regular
637
- " ", //icon
638
- newline + "JTextPane is a subclass of JEditorPane that "
639
- + "uses a StyledEditorKit and StyledDocument, and provides "
640
- + "cover methods for interacting with those objects."
641
- };
659
+// TEXTAREA String[] initString =
660
+// {
661
+// "This is an editable JTextPane, ", //regular
662
+// "another ", //italic
663
+// "styled ", //bold
664
+// "text ", //small
665
+// "component, ", //large
666
+// "which supports embedded components..." + newline,//regular
667
+// " " + newline, //button
668
+// "...and embedded icons..." + newline, //regular
669
+// " ", //icon
670
+// newline + "JTextPane is a subclass of JEditorPane that "
671
+// + "uses a StyledEditorKit and StyledDocument, and provides "
672
+// + "cover methods for interacting with those objects."
673
+// };
674
+//
675
+// String[] initStyles =
676
+// {
677
+// "regular", "italic", "bold", "small", "large",
678
+// "regular", "button", "regular", "icon",
679
+// "regular"
680
+// };
681
+//
682
+// JTextPane textPane = new JTextPane();
683
+// textPane.setEditable(true);
684
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
685
+// addStylesToDocument(doc);
686
+//
687
+// try
688
+// {
689
+// for (int j = 0; j < 2; j++)
690
+// {
691
+// for (int i = 0; i < initString.length; i++)
692
+// {
693
+// doc.insertString(doc.getLength(), initString[i],
694
+// doc.getStyle(initStyles[i]));
695
+// }
696
+// }
697
+// } catch (BadLocationException ble)
698
+// {
699
+// System.err.println("Couldn't insert initial text into text pane.");
700
+// }
642701
643
- String[] initStyles =
644
- {
645
- "regular", "italic", "bold", "small", "large",
646
- "regular", "button", "regular", "icon",
647
- "regular"
648
- };
649
-
650
- JTextPane textPane = new JTextPane();
651
- textPane.setEditable(true);
652
- /*StyledDocument*/ doc = textPane.getStyledDocument();
653
- addStylesToDocument(doc);
654
-
655
- try
656
- {
657
- for (int j = 0; j < 2; j++)
658
- {
659
- for (int i = 0; i < initString.length; i++)
660
- {
661
- doc.insertString(doc.getLength(), initString[i],
662
- doc.getStyle(initStyles[i]));
663
- }
664
- }
665
- } catch (BadLocationException ble)
666
- {
667
- System.err.println("Couldn't insert initial text into text pane.");
668
- }
669
-
670
- return new JTextArea(); // textPane;
702
+ return new JTextPane(); // textPane;
671703 }
672704
673705 protected void addStylesToDocument(StyledDocument doc)
....@@ -720,7 +752,7 @@
720752 protected static ImageIcon createImageIcon(String path,
721753 String description)
722754 {
723
- java.net.URL imgURL = GrafreeD.class.getResource(path);
755
+ java.net.URL imgURL = Grafreed.class.getResource(path);
724756 if (imgURL != null)
725757 {
726758 return new ImageIcon(imgURL, description);
....@@ -767,115 +799,83 @@
767799 JButton slowerButton;
768800 JButton fasterButton;
769801 JButton remarkButton;
802
+
803
+ cGridBag namePanel;
804
+ cGridBag setupPanel;
805
+ cGridBag commandsPanel;
806
+ cGridBag pushPanel;
807
+ cGridBag fillPanel;
770808
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
809
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
772810 {
773811 JCheckBox cb;
774812
775
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
776
- oe.aConstraints.gridwidth = 1; // 3;
777
-// oe.aConstraints.weightx = 1;
778
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
779
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
813
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
780814 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
784815
785816 return cb;
786817 }
787818
788
- cButton AddButton(ObjEditor oe, String label)
819
+ cButton AddButton(cGridBag panel, String label)
789820 {
790821 cButton cb;
791822
792
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
793
- oe.aConstraints.gridwidth = 1;
794
-// oe.aConstraints.weightx = 1;
795
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
796
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
823
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
797824 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
801825
802826 return cb;
803827 }
804828
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
829
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
806830 {
807831 JComboBox combo;
808832
809
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
810
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
811
- oe.aConstraints.gridx += 1;
833
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
812834 combo.addActionListener(this);
813835
814836 return combo;
815837 }
816838
817
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
839
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
818840 {
819
- NumberSlider combo;
841
+ cGridBag control = new cGridBag();
842
+
843
+ cNumberSlider combo;
820844
821845 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824846 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
825
- aConstraints.gridwidth = 1;
826
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
829
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
830
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
- aConstraints.gridx += 1;
832
- aConstraints.gridwidth = 1;
833
-
847
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834849 combo.setFloat(current);
835
-
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
850
+
851
+ panel.add(control);
852
+
853
+ return control;
841854 }
842855
843
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
856
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
844857 {
845
- NumberSlider combo;
858
+ cGridBag control = new cGridBag();
859
+
860
+ cNumberSlider combo;
846861
847862 JLabel jlabel = new JLabel(label);
848
-
849
- aConstraints.fill = GridBagConstraints.VERTICAL;
850863 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
851
- aConstraints.gridwidth = 2;
852
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
853
- aConstraints.gridx += 1;
854
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
855
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
856
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
857
- aConstraints.gridx += 1;
858
- aConstraints.gridwidth = 1;
859
-
864
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
865
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860866 combo.setInteger(current);
861867
862
- combo.label = jlabel;
863
-
864
- combo.addChangeListener(this);
865
-
866
- return combo;
868
+ panel.add(control);
869
+
870
+ return control;
867871 }
868872
869
- JTextArea AddText(JPanel ctrlPanel, String name)
873
+ JTextArea AddText(cGridBag ctrlPanel, String name)
870874 {
871875 JTextArea text;
872876
873
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
874
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
875
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
877
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
876878 text.addCaretListener(this);
877
- aConstraints.gridx += 1;
878
- aConstraints.gridwidth = 1;
879879
880880 return text;
881881 }
....@@ -905,9 +905,16 @@
905905 objEditor.ctrlPanel.remove(j);
906906 }
907907
908
+ void Remove(cNumberSlider j)
909
+ {
910
+ j.removeChangeListener(this);
911
+ //objEditor.ctrlPanel.remove(j.label);
912
+ objEditor.ctrlPanel.remove(j);
913
+ }
914
+
908915 /*
909916 */
910
- void Return() // ObjEditor oe)
917
+ void Return0() // ObjEditor oe)
911918 {
912919 aConstraints.gridy += 1;
913920 aConstraints.gridx = 0;
....@@ -962,37 +969,70 @@
962969
963970 void SetupUI2(ObjEditor oe)
964971 {
965
-// oe.aConstraints.weightx = 0;
966
-// oe.aConstraints.weighty = 0;
967
-// oe.aConstraints.gridx = 0;
968
-// oe.aConstraints.gridy = 0;
969
- SetupName(oe);
972
+ //SetupName(oe);
973
+
974
+ namePanel = new cGridBag();
975
+
976
+ nameField = AddText(namePanel, copy.GetName());
977
+ namePanel.add(nameField);
978
+ oe.ctrlPanel.add(namePanel);
979
+
980
+ oe.ctrlPanel.Return();
970981
971982 if (!GroupEditor.allparams)
972983 return;
973984
974
- liveCB = AddCheckBox(oe, "Live", copy.live);
975
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
976
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
985
+ setupPanel = new cGridBag().setVertical(false);
986
+
987
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
988
+ liveCB.setToolTipText("Animate object");
989
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
990
+ hideCB.setToolTipText("Hide object");
977991 // Return();
978
- markCB = AddCheckBox(oe, "Mark", copy.marked);
979
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
980
- randomCB = AddCheckBox(oe, "Rand", copy.random);
981
- Return();
982
- resetButton = AddButton(oe, "Reset");
983
- stepButton = AddButton(oe, "Step");
992
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
993
+ markCB.setToolTipText("Set the animation target transform");
994
+
995
+ rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
996
+ rewindCB.setToolTipText("Rewind animation");
997
+
998
+ randomCB = AddCheckBox(setupPanel, "Random", copy.random);
999
+ randomCB.setToolTipText("Option for switch node");
1000
+
1001
+ if (Globals.ADVANCED)
1002
+ {
1003
+ link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
1004
+ link2masterCB.setToolTipText("Attach to support");
1005
+ speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
1006
+ speedupCB.setToolTipText("Option motion capture");
1007
+ }
1008
+
1009
+ oe.ctrlPanel.add(setupPanel);
1010
+ oe.ctrlPanel.Return();
1011
+
1012
+ commandsPanel = new cGridBag().setVertical(false);
1013
+
1014
+ resetButton = AddButton(commandsPanel, "Reset");
1015
+ resetButton.setToolTipText("Jump to frame zero");
1016
+ stepButton = AddButton(commandsPanel, "Step");
1017
+ stepButton.setToolTipText("Step one frame");
9841018 // resetAllButton = AddButton(oe, "Reset All");
9851019 // stepAllButton = AddButton(oe, "Step All");
986
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9871020 // Return();
988
- slowerButton = AddButton(oe, "Slow");
989
- fasterButton = AddButton(oe, "Fast");
990
- remarkButton = AddButton(oe, "Rem");
1021
+ slowerButton = AddButton(commandsPanel, "Slow");
1022
+ slowerButton.setToolTipText("Decrease animation speed");
1023
+ fasterButton = AddButton(commandsPanel, "Fast");
1024
+ fasterButton.setToolTipText("Increase animation speed");
1025
+ remarkButton = AddButton(commandsPanel, "Remark");
1026
+ remarkButton.setToolTipText("Set the current transform as the target");
9911027
992
- Return();
1028
+ oe.ctrlPanel.add(commandsPanel);
1029
+ oe.ctrlPanel.Return();
9931030
994
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
995
- Return();
1031
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1032
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1033
+ //Return();
1034
+
1035
+ oe.ctrlPanel.Return();
9961036
9971037 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9981038 // ObjEditor.aConstraints.gridx += 1;
....@@ -1087,7 +1127,7 @@
10871127 oe.aConstraints.gridwidth = 1;
10881128 /**/
10891129 nameField = AddText(oe.ctrlPanel, copy.GetName());
1090
- Return();
1130
+ oe.ctrlPanel.Return();
10911131
10921132 //ctrlPanel.add(textureButton = new Button("Texture..."));
10931133 //textureButton.setEnabled(false);
....@@ -1189,7 +1229,8 @@
11891229 //JPanel worldPanel =
11901230 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11911231 //worldPanel.setName("World");
1192
- centralPanel = new JPanel(new BorderLayout());
1232
+ centralPanel = new cGridBag();
1233
+ centralPanel.preferredWidth = 20;
11931234 timelinePanel = new JPanel(new BorderLayout());
11941235 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11951236
....@@ -1222,6 +1263,7 @@
12221263 XYZPanel = new cGridBag().setVertical(true);
12231264 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12241265
1266
+ XYZPanel.preferredWidth = 5;
12251267 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
12261268 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
12271269 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
....@@ -1262,10 +1304,11 @@
12621304 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12631305 //tmp.setName("Edit");
12641306 objectPanel.add(materialPanel);
1265
- JPanel north = new JPanel(new BorderLayout());
1266
- north.setName("Edit");
1267
- north.add(ctrlPanel, BorderLayout.NORTH);
1268
- objectPanel.add(north);
1307
+// JPanel north = new JPanel(new BorderLayout());
1308
+// north.setName("Edit");
1309
+// north.add(ctrlPanel, BorderLayout.NORTH);
1310
+// objectPanel.add(north);
1311
+ objectPanel.add(ctrlPanel);
12691312 objectPanel.add(infoPanel);
12701313
12711314 /*
....@@ -1286,19 +1329,23 @@
12861329 scrollpane.setWheelScrollingEnabled(true);
12871330 scrollpane.addMouseWheelListener(this); // Default not fast enough
12881331
1289
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1290
- scenePanel.add(scrollpane);
1332
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1333
+ scenePanel.preferredWidth = 6;
1334
+
1335
+ JTabbedPane tabbedPane = new JTabbedPane();
1336
+ tabbedPane.add(scrollpane);
12911337
1292
- scenePanel.add(FSPane = new cFileSystemPane(this));
1338
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12931339
1294
- optionsPanel = new JPanel(new GridBagLayout());
1340
+ optionsPanel = new cGridBag().setVertical(true);
12951341
12961342 optionsPanel.setName("Options");
12971343
1298
- AddOptions(optionsPanel, aConstraints);
1344
+ AddOptions(optionsPanel); //, aConstraints);
12991345
1300
- scenePanel.add(optionsPanel);
1301
-
1346
+ tabbedPane.add(optionsPanel);
1347
+
1348
+ scenePanel.add(tabbedPane);
13021349
13031350 /*
13041351 cTree jTree = new cTree(null);
....@@ -1389,8 +1436,8 @@
13891436
13901437 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13911438
1392
- frame.setSize(1024, 768);
1393
- frame.show();
1439
+ frame.setSize(1280, 860);
1440
+ frame.setVisible(true);
13941441
13951442 gridPanel.setDividerLocation(1.0);
13961443
....@@ -1405,7 +1452,7 @@
14051452 });
14061453 }
14071454
1408
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1455
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
14091456 {
14101457 }
14111458
....@@ -1420,260 +1467,173 @@
14201467 ctrlPanel.removeAll();
14211468 }
14221469
1423
- void SetupMaterial(JPanel ctrlPanel)
1470
+ void SetupMaterial(cGridBag panel)
14241471 {
1425
- aConstraints.weighty = 0;
1426
- //aConstraints.weightx = 1;
1427
- /*
1472
+ /*
14281473 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14291474 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1430
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1431
- aConstraints.gridx += 1;
14321475 */
14331476
1434
- aConstraints.gridwidth = 1;
1435
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1436
- aConstraints.gridx += 1;
1437
- aConstraints.weighty = 0;
1438
- aConstraints.gridwidth = 1;
1477
+ cGridBag editBar = new cGridBag().setVertical(false);
1478
+
1479
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1480
+ createMaterialButton.setToolTipText("Create material");
14391481
14401482 /*
14411483 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1442
- aConstraints.gridx += 1;
1443
- aConstraints.weighty = 0;
1444
- aConstraints.gridwidth = 1;
14451484 */
14461485
1447
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1448
- aConstraints.gridx += 1;
1486
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1487
+ clearMaterialButton.setToolTipText("Clear material");
1488
+
1489
+ if (Globals.ADVANCED)
1490
+ {
1491
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1492
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1493
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1494
+ }
14491495
1450
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1451
-
1452
- aConstraints.gridx += 1;
1453
-
1454
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1455
-
1456
- aConstraints.gridx += 1;
1457
-
1458
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1459
-
1460
- aConstraints.gridx = 0;
1461
- aConstraints.gridy += 1;
1462
- aConstraints.weighty = 0;
1463
- aConstraints.gridwidth = 1;
1496
+ editBar.preferredHeight = 15;
1497
+
1498
+ panel.add(editBar);
1499
+
14641500 /**/
14651501 //aConstraints.weighty = 0;
14661502 ////aConstraints.weightx = 1;
14671503 //aConstraints.weighty = 1;
14681504 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14691505 //aConstraints.gridx += 1;
1470
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1471
- aConstraints.weighty = 0;
1472
- aConstraints.gridx = 0;
1473
- aConstraints.gridy += 1;
1474
- aConstraints.gridwidth = 1;
1506
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14751507
1476
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1477
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1479
- aConstraints.gridx += 1;
1480
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1481
- //aConstraints.weightx = 0;
1482
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1483
- aConstraints.gridx = 0;
1484
- aConstraints.gridy += 1;
1485
- aConstraints.gridwidth = 1;
1508
+ cGridBag colorSection = new cGridBag().setVertical(true);
1509
+
1510
+ cGridBag color = new cGridBag();
1511
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1512
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1513
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1514
+ //colorField.preferredWidth = 200;
1515
+ colorSection.add(color);
14861516
1487
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1488
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1489
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1490
- aConstraints.gridx += 1;
1491
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1492
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1493
- aConstraints.gridx = 0;
1494
- aConstraints.gridy += 1;
1495
- aConstraints.gridwidth = 1;
1517
+ cGridBag modulation = new cGridBag();
1518
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1519
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1520
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1521
+ colorSection.add(modulation);
14961522
1497
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1498
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1499
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1500
- aConstraints.gridx += 1;
1501
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1502
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1503
- aConstraints.gridx = 0;
1504
- aConstraints.gridy += 1;
1505
- aConstraints.gridwidth = 1;
1523
+ cGridBag texture = new cGridBag();
1524
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1525
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1526
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1527
+ colorSection.add(texture);
15061528
1507
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1508
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1509
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1510
- aConstraints.gridx += 1;
1511
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1512
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1513
- aConstraints.gridx = 0;
1514
- aConstraints.gridy += 1;
1515
- aConstraints.gridwidth = 1;
1529
+ cGridBag anisoU = new cGridBag();
1530
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1531
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1533
+ colorSection.add(anisoU);
15161534
1517
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1518
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1519
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1520
- aConstraints.gridx += 1;
1521
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1522
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1523
- aConstraints.gridx = 0;
1524
- aConstraints.gridy += 1;
1525
- aConstraints.gridwidth = 1;
1535
+ cGridBag anisoV = new cGridBag();
1536
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1537
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1538
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1539
+ colorSection.add(anisoV);
15261540
1527
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1528
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1529
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1530
- aConstraints.gridx += 1;
1531
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1532
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1533
- aConstraints.gridx = 0;
1534
- aConstraints.gridy += 1;
1535
- aConstraints.gridwidth = 1;
1541
+ cGridBag shadowbias = new cGridBag();
1542
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1543
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1544
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1545
+ colorSection.add(shadowbias);
15361546
1537
- //aConstraints.weighty = 1;
1538
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1539
- //aConstraints.gridx += 1;
1540
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1541
- aConstraints.weighty = 0;
1542
- aConstraints.gridx = 0;
1543
- aConstraints.gridy += 1;
1544
- aConstraints.gridwidth = 1;
1547
+ panel.add(new JSeparator());
1548
+
1549
+ panel.add(colorSection);
1550
+
1551
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1552
+
1553
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1554
+
1555
+ cGridBag diffuse = new cGridBag();
1556
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1557
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1558
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1559
+ diffuseSection.add(diffuse);
15451560
1546
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1547
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1548
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1549
- aConstraints.gridx += 1;
1550
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1551
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1552
- aConstraints.gridx = 0;
1553
- aConstraints.gridy += 1;
1554
- aConstraints.gridwidth = 1;
1561
+ cGridBag diffuseness = new cGridBag();
1562
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1563
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1564
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1565
+ diffuseSection.add(diffuseness);
15551566
1556
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1557
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1558
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1559
- aConstraints.gridx += 1;
1560
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1561
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1562
- aConstraints.gridx = 0;
1563
- aConstraints.gridy += 1;
1564
- aConstraints.gridwidth = 1;
1567
+ cGridBag selfshadow = new cGridBag();
1568
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1569
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1570
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1571
+ diffuseSection.add(selfshadow);
15651572
1566
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1567
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1568
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1569
- aConstraints.gridx += 1;
1570
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1571
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1572
- aConstraints.gridx = 0;
1573
- aConstraints.gridy += 1;
1574
- aConstraints.gridwidth = 1;
1573
+ cGridBag sheen = new cGridBag();
1574
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1575
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1576
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1577
+ diffuseSection.add(sheen);
15751578
1576
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1577
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1578
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1579
- aConstraints.gridx += 1;
1580
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1581
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1582
- aConstraints.gridx = 0;
1583
- aConstraints.gridy += 1;
1584
- aConstraints.gridwidth = 1;
1579
+ cGridBag subsurface = new cGridBag();
1580
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1581
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1583
+ diffuseSection.add(subsurface);
15851584
1586
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1587
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1588
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1589
- aConstraints.gridx += 1;
1590
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1591
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1592
- aConstraints.gridx = 0;
1593
- aConstraints.gridy += 1;
1594
- aConstraints.gridwidth = 1;
1585
+ cGridBag shadow = new cGridBag();
1586
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1587
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1588
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1589
+ diffuseSection.add(shadow);
15951590
1596
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1597
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1598
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1599
- aConstraints.gridx += 1;
1600
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1601
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1602
- aConstraints.gridx = 0;
1603
- aConstraints.gridy += 1;
1604
- aConstraints.gridwidth = 1;
1591
+ cGridBag fakedepth = new cGridBag();
1592
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1593
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1595
+ diffuseSection.add(fakedepth);
16051596
1606
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1607
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1608
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1609
- aConstraints.gridx += 1;
1610
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1611
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1612
- aConstraints.gridx = 0;
1613
- aConstraints.gridy += 1;
1614
- aConstraints.gridwidth = 1;
1597
+ panel.add(new JSeparator());
1598
+
1599
+ panel.add(diffuseSection);
1600
+
1601
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1602
+
1603
+ cGridBag specularSection = new cGridBag().setVertical(true);
16151604
1616
- //aConstraints.weighty = 1;
1617
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1618
- //aConstraints.gridx += 1;
1619
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1620
- aConstraints.weighty = 0;
1621
- aConstraints.gridx = 0;
1622
- aConstraints.gridy += 1;
1623
- aConstraints.gridwidth = 1;
1605
+ cGridBag specular = new cGridBag();
1606
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1607
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1608
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1609
+ specularSection.add(specular);
16241610
1625
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1626
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1627
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1628
- aConstraints.gridx += 1;
1629
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1630
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1631
- aConstraints.gridx = 0;
1632
- aConstraints.gridy += 1;
1633
- aConstraints.gridwidth = 1;
1611
+ cGridBag lightarea = new cGridBag();
1612
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1613
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1614
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1615
+ specularSection.add(lightarea);
16341616
1635
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1636
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1637
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1638
- aConstraints.gridx += 1;
1639
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1640
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1641
- aConstraints.gridx = 0;
1642
- aConstraints.gridy += 1;
1643
- aConstraints.gridwidth = 1;
1617
+ cGridBag shininess = new cGridBag();
1618
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1619
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1620
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1621
+ specularSection.add(shininess);
16441622
1645
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1646
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1647
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1648
- aConstraints.gridx += 1;
1649
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1650
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1651
- aConstraints.gridx = 0;
1652
- aConstraints.gridy += 1;
1653
- aConstraints.gridwidth = 1;
1623
+ cGridBag metalness = new cGridBag();
1624
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1625
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1626
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1627
+ specularSection.add(metalness);
16541628
1655
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1656
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1658
- aConstraints.gridx += 1;
1659
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1660
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1661
- aConstraints.gridx = 0;
1662
- aConstraints.gridy += 1;
1663
- aConstraints.gridwidth = 1;
1629
+ cGridBag velvet = new cGridBag();
1630
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1631
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1632
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1633
+ specularSection.add(velvet);
16641634
1665
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1666
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1667
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1668
- aConstraints.gridx += 1;
1669
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1670
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1671
- aConstraints.gridx = 0;
1672
- aConstraints.gridy += 1;
1673
- aConstraints.gridwidth = 1;
1674
-
1675
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1676
- Return();
1635
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1636
+ //Return();
16771637 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16781638 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16791639 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1684,130 +1644,93 @@
16841644 // aConstraints.gridy += 1;
16851645 // aConstraints.gridwidth = 1;
16861646
1687
- //aConstraints.weighty = 1;
1688
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1689
- //aConstraints.gridx += 1;
1690
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1691
- aConstraints.weighty = 0;
1692
- aConstraints.gridx = 0;
1693
- aConstraints.gridy += 1;
1694
- aConstraints.gridwidth = 1;
16951647
1696
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1697
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1699
- aConstraints.gridx += 1;
1700
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1701
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1702
- aConstraints.gridx = 0;
1703
- aConstraints.gridy += 1;
1704
- aConstraints.gridwidth = 1;
1648
+ panel.add(new JSeparator());
1649
+
1650
+ panel.add(specularSection);
1651
+
1652
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1653
+
1654
+ cGridBag globalSection = new cGridBag().setVertical(true);
17051655
1706
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1707
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1709
- aConstraints.gridx += 1;
1710
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1711
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1712
- aConstraints.gridx = 0;
1713
- aConstraints.gridy += 1;
1714
- aConstraints.gridwidth = 1;
1656
+ cGridBag camera = new cGridBag();
1657
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1658
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1659
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1660
+ globalSection.add(camera);
17151661
1716
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1717
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1718
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1719
- aConstraints.gridx += 1;
1720
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1721
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1722
- aConstraints.gridx = 0;
1723
- aConstraints.gridy += 1;
1724
- aConstraints.gridwidth = 1;
1662
+ cGridBag ambient = new cGridBag();
1663
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1664
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1665
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1666
+ globalSection.add(ambient);
17251667
1726
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1727
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1728
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1729
- aConstraints.gridx += 1;
1730
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1731
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1732
- aConstraints.gridx = 0;
1733
- aConstraints.gridy += 1;
1734
- aConstraints.gridwidth = 1;
1735
- aConstraints.weighty = 0;
1668
+ cGridBag backlit = new cGridBag();
1669
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1670
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1672
+ globalSection.add(backlit);
17361673
1737
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1738
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1739
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1740
- aConstraints.gridx += 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1742
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1743
- aConstraints.gridx = 0;
1744
- aConstraints.gridy += 1;
1745
- aConstraints.gridwidth = 1;
1674
+ cGridBag opacity = new cGridBag();
1675
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1676
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1678
+ globalSection.add(opacity);
17461679
1747
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1748
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1749
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1750
- aConstraints.gridx += 1;
1751
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1752
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1753
- aConstraints.gridx = 0;
1754
- aConstraints.gridy += 1;
1755
- aConstraints.gridwidth = 1;
1680
+ panel.add(new JSeparator());
1681
+
1682
+ panel.add(globalSection);
1683
+
1684
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1685
+
1686
+ cGridBag textureSection = new cGridBag().setVertical(true);
17561687
1757
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1758
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1759
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1760
- aConstraints.gridx += 1;
1761
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1762
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1763
- aConstraints.gridx = 0;
1764
- aConstraints.gridy += 1;
1765
- aConstraints.gridwidth = 1;
1688
+ cGridBag bump = new cGridBag();
1689
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1690
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1691
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1692
+ textureSection.add(bump);
17661693
1767
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1768
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1769
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1770
- aConstraints.gridx += 1;
1771
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1772
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1773
- aConstraints.gridx = 0;
1774
- aConstraints.gridy += 1;
1775
- aConstraints.gridwidth = 1;
1694
+ cGridBag noise = new cGridBag();
1695
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1696
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1697
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1698
+ textureSection.add(noise);
17761699
1777
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1778
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1779
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1780
- aConstraints.gridx += 1;
1781
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1782
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1783
- aConstraints.gridx = 0;
1784
- aConstraints.gridy += 1;
1785
- aConstraints.gridwidth = 1;
1700
+ cGridBag power = new cGridBag();
1701
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1702
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1703
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1704
+ textureSection.add(power);
17861705
1787
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1788
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1789
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1790
- aConstraints.gridx += 1;
1791
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1792
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1793
- aConstraints.gridx = 0;
1794
- aConstraints.gridy += 1;
1795
- aConstraints.gridwidth = 1;
1706
+ cGridBag borderfade = new cGridBag();
1707
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1708
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1709
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1710
+ textureSection.add(borderfade);
17961711
1797
- //aConstraints.weighty = 1;
1798
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1799
- //aConstraints.gridx += 1;
1800
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1801
- aConstraints.weighty = 0;
1712
+ cGridBag fog = new cGridBag();
1713
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1714
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1715
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1716
+ textureSection.add(fog);
18021717
1803
- aConstraints.gridx = 0;
1804
- aConstraints.gridy = 0;
1805
- aConstraints.gridwidth = 1;
1718
+ cGridBag opacityPower = new cGridBag();
1719
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1720
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1721
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1722
+ textureSection.add(opacityPower);
1723
+
1724
+ panel.add(new JSeparator());
1725
+
1726
+ panel.add(textureSection);
1727
+
1728
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18061729
18071730 SetMaterial(copy); // .GetMaterial());
18081731
1809
- colorField.addChangeListener(this);
1810
- modulationField.addChangeListener(this);
1732
+ //colorField.addChangeListener(this);
1733
+// modulationField.addChangeListener(this);
18111734 metalnessField.addChangeListener(this);
18121735 diffuseField.addChangeListener(this);
18131736 specularField.addChangeListener(this);
....@@ -1837,12 +1760,15 @@
18371760 opacityPowerField.addChangeListener(this);
18381761 /**/
18391762
1840
- resetSlidersButton.addActionListener(this);
18411763 clearMaterialButton.addActionListener(this);
18421764 createMaterialButton.addActionListener(this);
1843
-
1844
- propagateToggle.addItemListener(this);
1845
- multiplyToggle.addItemListener(this);
1765
+
1766
+ if (Globals.ADVANCED)
1767
+ {
1768
+ resetSlidersButton.addActionListener(this);
1769
+ propagateToggle.addItemListener(this);
1770
+ multiplyToggle.addItemListener(this);
1771
+ }
18461772 }
18471773
18481774 void DropFile(java.io.File[] files, boolean textures)
....@@ -2013,7 +1939,7 @@
20131939
20141940 //? flashIt = false;
20151941 CameraPane pane = (CameraPane) cameraView;
2016
- pane.clickStart(location.x, location.y, 0);
1942
+ pane.clickStart(location.x, location.y, 0, 0);
20171943 pane.clickEnd(location.x, location.y, 0, true);
20181944
20191945 if (group.selection.size() == 1)
....@@ -2470,11 +2396,11 @@
24702396
24712397 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24722398 {
2473
- if (GrafreeD.standAlone)
2399
+ if (Grafreed.standAlone)
24742400 {
24752401 /**/
24762402 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2477
- browser.show();
2403
+ browser.setVisible(true);
24782404 String filename = browser.getFile();
24792405 if (filename != null && filename.length() > 0)
24802406 {
....@@ -2619,6 +2545,7 @@
26192545 }
26202546 if (input == null)
26212547 {
2548
+ new Exception().printStackTrace();
26222549 System.exit(0);
26232550 }
26242551
....@@ -2833,7 +2760,8 @@
28332760 return;
28342761 }
28352762
2836
- multiplyToggle.setSelected(mat.multiply);
2763
+ if (multiplyToggle != null)
2764
+ multiplyToggle.setSelected(mat.multiply);
28372765
28382766 assert (object.projectedVertices != null);
28392767
....@@ -3048,7 +2976,7 @@
30482976 frame.validate();
30492977
30502978 return;
3051
- } else if (event.getSource() == toggleRandomItem)
2979
+ } else if (event.getSource() == toggleSwitchItem)
30522980 {
30532981 cameraView.ToggleRandom();
30542982 cameraView.repaint();
....@@ -3093,6 +3021,7 @@
30933021 if (event.getSource() == randomCB)
30943022 {
30953023 copy.random ^= true;
3024
+ objEditor.refreshContents();
30963025 return;
30973026 }
30983027 if (event.getSource() == speedupCB)
....@@ -3316,7 +3245,7 @@
33163245 if (!Globals.ANIMATION)
33173246 {
33183247 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3319
- browser.show();
3248
+ browser.setVisible(true);
33203249 String filename = browser.getFile();
33213250 if (filename != null && filename.length() > 0)
33223251 {
....@@ -3326,8 +3255,8 @@
33263255
33273256 Globals.ANIMATION ^= true;
33283257
3329
- GrafreeD.wav.cursor = 0;
3330
- GrafreeD.wav.loop = 0;
3258
+ Grafreed.wav.cursor = 0;
3259
+ Grafreed.wav.loop = 0;
33313260 }
33323261 } else
33333262 {
....@@ -3377,7 +3306,7 @@
33773306 void CreateMaterial()
33783307 {
33793308 //copy.ClearMaterial(); // PATCH
3380
- copy.CreateMaterialS(multiplyToggle.isSelected());
3309
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33813310 if (copy.selection.size() > 0)
33823311 //SetMaterial(copy);
33833312 {
....@@ -3436,11 +3365,11 @@
34363365 {
34373366 copy.ResetBlockLoop(); // temporary problem
34383367
3439
- boolean random = CameraPane.RANDOM;
3440
- CameraPane.RANDOM = false; // parse everything
3368
+ boolean random = CameraPane.SWITCH;
3369
+ CameraPane.SWITCH = false; // parse everything
34413370 copy.ResetDisplayList();
34423371 copy.HardTouch();
3443
- CameraPane.RANDOM = random;
3372
+ CameraPane.SWITCH = random;
34443373 }
34453374
34463375 // public void applySelf()
....@@ -3510,10 +3439,40 @@
35103439 current.fakedepth = (float) fakedepthField.getFloat();
35113440 current.shadowbias = (float) shadowbiasField.getFloat();
35123441
3513
- if (!NumberSlider.frozen)
3442
+ if (!cNumberSlider.frozen)
35143443 {
35153444 //System.out.println("Propagate = " + propagate);
35163445 copy.UpdateMaterial(anchor, current, propagate);
3446
+
3447
+ if (copy.material != null)
3448
+ {
3449
+ cMaterial mat = copy.material;
3450
+
3451
+ colorField.SetToolTipValue((mat.color));
3452
+ modulationField.SetToolTipValue((mat.modulation));
3453
+ metalnessField.SetToolTipValue((mat.metalness));
3454
+ diffuseField.SetToolTipValue((mat.diffuse));
3455
+ specularField.SetToolTipValue((mat.specular));
3456
+ shininessField.SetToolTipValue((mat.shininess));
3457
+ shiftField.SetToolTipValue((mat.shift));
3458
+ ambientField.SetToolTipValue((mat.ambient));
3459
+ lightareaField.SetToolTipValue((mat.lightarea));
3460
+ diffusenessField.SetToolTipValue((mat.factor));
3461
+ velvetField.SetToolTipValue((mat.velvet));
3462
+ sheenField.SetToolTipValue((mat.sheen));
3463
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3464
+ backlitField.SetToolTipValue((mat.bump));
3465
+ anisoField.SetToolTipValue((mat.aniso));
3466
+ anisoVField.SetToolTipValue((mat.anisoV));
3467
+ cameraField.SetToolTipValue((mat.cameralight));
3468
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3469
+ shadowField.SetToolTipValue((mat.shadow));
3470
+ textureField.SetToolTipValue((mat.texture));
3471
+ opacityField.SetToolTipValue((mat.opacity));
3472
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3473
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3474
+ }
3475
+
35173476 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
35183477 {
35193478 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3558,6 +3517,7 @@
35583517 || e.getSource() == apertureField
35593518 || e.getSource() == shadowblurField)
35603519 {
3520
+ new Exception().printStackTrace();
35613521 System.exit(0);
35623522 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35633523 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3883,7 +3843,7 @@
38833843
38843844 radioPanel.revalidate();
38853845 radioPanel.repaint();
3886
- ctrlPanel.revalidate(); // ? new
3846
+ ctrlPanel.validate(); // ? new
38873847 ctrlPanel.repaint();
38883848 }
38893849 }
....@@ -4240,7 +4200,7 @@
42404200
42414201 void load() // throws ClassNotFoundException
42424202 {
4243
- if (GrafreeD.standAlone)
4203
+ if (Grafreed.standAlone)
42444204 {
42454205 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42464206 browser.show();
....@@ -4345,7 +4305,7 @@
43454305
43464306 void saveAs()
43474307 {
4348
- if (GrafreeD.standAlone)
4308
+ if (Grafreed.standAlone)
43494309 {
43504310 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43514311 browser.setVisible(true);
....@@ -4456,7 +4416,7 @@
44564416 Object3D objectparent = obj.parent;
44574417 obj.parent = null;
44584418
4459
- Object3D object = (Object3D) GrafreeD.clone(obj);
4419
+ Object3D object = (Object3D) Grafreed.clone(obj);
44604420
44614421 obj.parent = objectparent;
44624422
....@@ -4490,7 +4450,7 @@
44904450 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44914451 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44924452 copy.generatePOV(buffer);
4493
- if (GrafreeD.standAlone)
4453
+ if (Grafreed.standAlone)
44944454 {
44954455 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44964456 browser.show();
....@@ -4529,8 +4489,8 @@
45294489 //MenuItem normalLensItem;
45304490 MenuItem editCameraItem;
45314491 MenuItem revertCameraItem;
4532
- CheckboxMenuItem toggleLiveItem;
45334492 MenuItem stepItem;
4493
+ CheckboxMenuItem toggleLiveItem;
45344494 CheckboxMenuItem toggleFullScreenItem;
45354495 CheckboxMenuItem toggleTimelineItem;
45364496 CheckboxMenuItem toggleRenderItem;
....@@ -4539,7 +4499,7 @@
45394499 CheckboxMenuItem toggleFootContactItem;
45404500 CheckboxMenuItem toggleDLItem;
45414501 CheckboxMenuItem toggleTextureItem;
4542
- CheckboxMenuItem toggleRandomItem;
4502
+ CheckboxMenuItem toggleSwitchItem;
45434503 CheckboxMenuItem toggleRootItem;
45444504 CheckboxMenuItem animationItem;
45454505 CheckboxMenuItem toggleHandleItem;
....@@ -4547,20 +4507,20 @@
45474507 JSplitPane mainPanel;
45484508 JScrollPane scrollpane;
45494509 JPanel toolbarPanel;
4550
- JPanel treePanel;
4510
+ cGridBag treePanel;
45514511 JPanel radioPanel;
45524512 ButtonGroup buttonGroup;
4553
- JPanel ctrlPanel;
4554
- JPanel materialPanel;
4513
+ cGridBag ctrlPanel;
4514
+ cGridBag materialPanel;
45554515 JScrollPane infoPanel;
4556
- JPanel optionsPanel;
4516
+ cGridBag optionsPanel;
45574517 JTabbedPane objectPanel;
45584518 cGridBag XYZPanel;
45594519 JSplitPane gridPanel;
45604520 JSplitPane bigPanel;
45614521 cGridBag bigThree;
4562
- JTabbedPane scenePanel;
4563
- JPanel centralPanel;
4522
+ cGridBag scenePanel;
4523
+ cGridBag centralPanel;
45644524 JSplitPane cameraPanel;
45654525 JPanel timelinePanel;
45664526 JMenuBar timelineMenubar;
....@@ -4613,67 +4573,67 @@
46134573 // MATERIAL
46144574 JLabel materialLabel;
46154575 JLabel colorLabel;
4616
- NumberSlider colorField;
4576
+ cNumberSlider colorField;
46174577 JLabel modulationLabel;
4618
- NumberSlider modulationField;
4578
+ cNumberSlider modulationField;
46194579 JLabel metalnessLabel;
4620
- NumberSlider metalnessField;
4580
+ cNumberSlider metalnessField;
46214581 JLabel diffuseLabel;
4622
- NumberSlider diffuseField;
4582
+ cNumberSlider diffuseField;
46234583 JLabel specularLabel;
4624
- NumberSlider specularField;
4584
+ cNumberSlider specularField;
46254585 JLabel shininessLabel;
4626
- NumberSlider shininessField;
4586
+ cNumberSlider shininessField;
46274587 JLabel shiftLabel;
4628
- NumberSlider shiftField;
4588
+ cNumberSlider shiftField;
46294589 JLabel ambientLabel;
4630
- NumberSlider ambientField;
4590
+ cNumberSlider ambientField;
46314591 JLabel lightareaLabel;
4632
- NumberSlider lightareaField;
4592
+ cNumberSlider lightareaField;
46334593 JLabel diffusenessLabel;
4634
- NumberSlider diffusenessField;
4594
+ cNumberSlider diffusenessField;
46354595 JLabel velvetLabel;
4636
- NumberSlider velvetField;
4596
+ cNumberSlider velvetField;
46374597 JLabel sheenLabel;
4638
- NumberSlider sheenField;
4598
+ cNumberSlider sheenField;
46394599 JLabel subsurfaceLabel;
4640
- NumberSlider subsurfaceField;
4600
+ cNumberSlider subsurfaceField;
46414601 //JLabel bumpLabel;
46424602 //NumberSlider bumpField;
46434603 JLabel backlitLabel;
4644
- NumberSlider backlitField;
4604
+ cNumberSlider backlitField;
46454605 JLabel anisoLabel;
4646
- NumberSlider anisoField;
4606
+ cNumberSlider anisoField;
46474607 JLabel anisoVLabel;
4648
- NumberSlider anisoVField;
4608
+ cNumberSlider anisoVField;
46494609 JLabel cameraLabel;
4650
- NumberSlider cameraField;
4610
+ cNumberSlider cameraField;
46514611 JLabel selfshadowLabel;
4652
- NumberSlider selfshadowField;
4612
+ cNumberSlider selfshadowField;
46534613 JLabel shadowLabel;
4654
- NumberSlider shadowField;
4614
+ cNumberSlider shadowField;
46554615 JLabel textureLabel;
4656
- NumberSlider textureField;
4616
+ cNumberSlider textureField;
46574617 JLabel opacityLabel;
4658
- NumberSlider opacityField;
4618
+ cNumberSlider opacityField;
46594619 JLabel fakedepthLabel;
4660
- NumberSlider fakedepthField;
4620
+ cNumberSlider fakedepthField;
46614621 JLabel shadowbiasLabel;
4662
- NumberSlider shadowbiasField;
4622
+ cNumberSlider shadowbiasField;
46634623 JLabel bumpLabel;
4664
- NumberSlider bumpField;
4624
+ cNumberSlider bumpField;
46654625 JLabel noiseLabel;
4666
- NumberSlider noiseField;
4626
+ cNumberSlider noiseField;
46674627 JLabel powerLabel;
4668
- NumberSlider powerField;
4628
+ cNumberSlider powerField;
46694629 JLabel borderfadeLabel;
4670
- NumberSlider borderfadeField;
4630
+ cNumberSlider borderfadeField;
46714631 JLabel fogLabel;
4672
- NumberSlider fogField;
4632
+ cNumberSlider fogField;
46734633 JLabel opacityPowerLabel;
4674
- NumberSlider opacityPowerField;
4634
+ cNumberSlider opacityPowerField;
46754635 JTree jTree;
46764636 //ObjectUI parent;
46774637
4678
- NumberSlider normalpushField;
4638
+ cNumberSlider normalpushField;
46794639 }