Normand Briere
2019-05-13 f924d3e00db476c06f55f3d5aaef307e17575340
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 {
....@@ -475,13 +501,13 @@
475501 //SendInfo("Name:", "bold");
476502 if (sel.GetTextures() != null || debug)
477503 {
478
- si.SendInfo(sel.toString(), "bold");
504
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
479505 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
480506 if (sel.Size() > 0)
481507 {
482508 si.SendInfo("#children = " + sel.Size(), "regular");
483509 }
484
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
510
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
485511 if (debug)
486512 {
487513 try
....@@ -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 {
....@@ -520,7 +549,7 @@
520549 }
521550 if (sel.support != null)
522551 {
523
- si.SendInfo(" support: " + sel.support, "regular");
552
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
524553 }
525554 if (sel.scriptnode != null)
526555 {
....@@ -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);
....@@ -1264,10 +1304,11 @@
12641304 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12651305 //tmp.setName("Edit");
12661306 objectPanel.add(materialPanel);
1267
- JPanel north = new JPanel(new BorderLayout());
1268
- north.setName("Edit");
1269
- north.add(ctrlPanel, BorderLayout.NORTH);
1270
- 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);
12711312 objectPanel.add(infoPanel);
12721313
12731314 /*
....@@ -1289,18 +1330,18 @@
12891330 scrollpane.addMouseWheelListener(this); // Default not fast enough
12901331
12911332 /*JTabbedPane*/ scenePanel = new cGridBag();
1292
- scenePanel.preferredWidth = 7;
1333
+ scenePanel.preferredWidth = 6;
12931334
12941335 JTabbedPane tabbedPane = new JTabbedPane();
12951336 tabbedPane.add(scrollpane);
12961337
12971338 tabbedPane.add(FSPane = new cFileSystemPane(this));
12981339
1299
- optionsPanel = new JPanel(new GridBagLayout());
1340
+ optionsPanel = new cGridBag().setVertical(true);
13001341
13011342 optionsPanel.setName("Options");
13021343
1303
- AddOptions(optionsPanel, aConstraints);
1344
+ AddOptions(optionsPanel); //, aConstraints);
13041345
13051346 tabbedPane.add(optionsPanel);
13061347
....@@ -1395,8 +1436,8 @@
13951436
13961437 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13971438
1398
- frame.setSize(1024, 768);
1399
- frame.show();
1439
+ frame.setSize(1280, 860);
1440
+ frame.setVisible(true);
14001441
14011442 gridPanel.setDividerLocation(1.0);
14021443
....@@ -1411,7 +1452,7 @@
14111452 });
14121453 }
14131454
1414
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1455
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
14151456 {
14161457 }
14171458
....@@ -1426,260 +1467,173 @@
14261467 ctrlPanel.removeAll();
14271468 }
14281469
1429
- void SetupMaterial(JPanel ctrlPanel)
1470
+ void SetupMaterial(cGridBag panel)
14301471 {
1431
- aConstraints.weighty = 0;
1432
- //aConstraints.weightx = 1;
1433
- /*
1472
+ /*
14341473 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14351474 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1436
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1437
- aConstraints.gridx += 1;
14381475 */
14391476
1440
- aConstraints.gridwidth = 1;
1441
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1442
- aConstraints.gridx += 1;
1443
- aConstraints.weighty = 0;
1444
- 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");
14451481
14461482 /*
14471483 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1448
- aConstraints.gridx += 1;
1449
- aConstraints.weighty = 0;
1450
- aConstraints.gridwidth = 1;
14511484 */
14521485
1453
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1454
- 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
+ }
14551495
1456
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1457
-
1458
- aConstraints.gridx += 1;
1459
-
1460
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1461
-
1462
- aConstraints.gridx += 1;
1463
-
1464
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1465
-
1466
- aConstraints.gridx = 0;
1467
- aConstraints.gridy += 1;
1468
- aConstraints.weighty = 0;
1469
- aConstraints.gridwidth = 1;
1496
+ editBar.preferredHeight = 15;
1497
+
1498
+ panel.add(editBar);
1499
+
14701500 /**/
14711501 //aConstraints.weighty = 0;
14721502 ////aConstraints.weightx = 1;
14731503 //aConstraints.weighty = 1;
14741504 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14751505 //aConstraints.gridx += 1;
1476
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1477
- aConstraints.weighty = 0;
1478
- aConstraints.gridx = 0;
1479
- aConstraints.gridy += 1;
1480
- aConstraints.gridwidth = 1;
1506
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14811507
1482
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1483
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1484
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1485
- aConstraints.gridx += 1;
1486
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1487
- //aConstraints.weightx = 0;
1488
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1489
- aConstraints.gridx = 0;
1490
- aConstraints.gridy += 1;
1491
- 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);
14921516
1493
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1494
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1495
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1496
- aConstraints.gridx += 1;
1497
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1498
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1499
- aConstraints.gridx = 0;
1500
- aConstraints.gridy += 1;
1501
- 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);
15021522
1503
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1504
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1505
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1506
- aConstraints.gridx += 1;
1507
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1508
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1509
- aConstraints.gridx = 0;
1510
- aConstraints.gridy += 1;
1511
- 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);
15121528
1513
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1514
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1515
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1516
- aConstraints.gridx += 1;
1517
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1518
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1519
- aConstraints.gridx = 0;
1520
- aConstraints.gridy += 1;
1521
- 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);
15221534
1523
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1524
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1525
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1526
- aConstraints.gridx += 1;
1527
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1528
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1529
- aConstraints.gridx = 0;
1530
- aConstraints.gridy += 1;
1531
- 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);
15321540
1533
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1534
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1535
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1536
- aConstraints.gridx += 1;
1537
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1538
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1539
- aConstraints.gridx = 0;
1540
- aConstraints.gridy += 1;
1541
- 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);
15421546
1543
- //aConstraints.weighty = 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1545
- //aConstraints.gridx += 1;
1546
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1547
- aConstraints.weighty = 0;
1548
- aConstraints.gridx = 0;
1549
- aConstraints.gridy += 1;
1550
- 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);
15511560
1552
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1553
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1554
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1555
- aConstraints.gridx += 1;
1556
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1557
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1558
- aConstraints.gridx = 0;
1559
- aConstraints.gridy += 1;
1560
- 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);
15611566
1562
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1563
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1564
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1565
- aConstraints.gridx += 1;
1566
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1567
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1568
- aConstraints.gridx = 0;
1569
- aConstraints.gridy += 1;
1570
- 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);
15711572
1572
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1573
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1574
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1575
- aConstraints.gridx += 1;
1576
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1577
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1578
- aConstraints.gridx = 0;
1579
- aConstraints.gridy += 1;
1580
- 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);
15811578
1582
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1583
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1584
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1585
- aConstraints.gridx += 1;
1586
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1587
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1588
- aConstraints.gridx = 0;
1589
- aConstraints.gridy += 1;
1590
- 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);
15911584
1592
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1593
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1595
- aConstraints.gridx += 1;
1596
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1597
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1598
- aConstraints.gridx = 0;
1599
- aConstraints.gridy += 1;
1600
- 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);
16011590
1602
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1603
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1604
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1605
- aConstraints.gridx += 1;
1606
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1607
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1608
- aConstraints.gridx = 0;
1609
- aConstraints.gridy += 1;
1610
- 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);
16111596
1612
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1613
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1614
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1615
- aConstraints.gridx += 1;
1616
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1617
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1618
- aConstraints.gridx = 0;
1619
- aConstraints.gridy += 1;
1620
- 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);
16211604
1622
- //aConstraints.weighty = 1;
1623
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1624
- //aConstraints.gridx += 1;
1625
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1626
- aConstraints.weighty = 0;
1627
- aConstraints.gridx = 0;
1628
- aConstraints.gridy += 1;
1629
- 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);
16301610
1631
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1632
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1633
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1634
- aConstraints.gridx += 1;
1635
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1636
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1637
- aConstraints.gridx = 0;
1638
- aConstraints.gridy += 1;
1639
- 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);
16401616
1641
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1642
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1643
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1644
- aConstraints.gridx += 1;
1645
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1646
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1647
- aConstraints.gridx = 0;
1648
- aConstraints.gridy += 1;
1649
- 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);
16501622
1651
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1652
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1653
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1654
- aConstraints.gridx += 1;
1655
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1656
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1657
- aConstraints.gridx = 0;
1658
- aConstraints.gridy += 1;
1659
- 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);
16601628
1661
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1662
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1663
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1664
- aConstraints.gridx += 1;
1665
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1666
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1667
- aConstraints.gridx = 0;
1668
- aConstraints.gridy += 1;
1669
- 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);
16701634
1671
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1672
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1673
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1674
- aConstraints.gridx += 1;
1675
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1676
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1677
- aConstraints.gridx = 0;
1678
- aConstraints.gridy += 1;
1679
- aConstraints.gridwidth = 1;
1680
-
1681
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1682
- Return();
1635
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1636
+ //Return();
16831637 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16841638 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16851639 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1690,130 +1644,93 @@
16901644 // aConstraints.gridy += 1;
16911645 // aConstraints.gridwidth = 1;
16921646
1693
- //aConstraints.weighty = 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1695
- //aConstraints.gridx += 1;
1696
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1697
- aConstraints.weighty = 0;
1698
- aConstraints.gridx = 0;
1699
- aConstraints.gridy += 1;
1700
- aConstraints.gridwidth = 1;
17011647
1702
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1703
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1704
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1705
- aConstraints.gridx += 1;
1706
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1707
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1708
- aConstraints.gridx = 0;
1709
- aConstraints.gridy += 1;
1710
- 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);
17111655
1712
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1713
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1714
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1715
- aConstraints.gridx += 1;
1716
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1717
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1718
- aConstraints.gridx = 0;
1719
- aConstraints.gridy += 1;
1720
- 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);
17211661
1722
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1723
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1724
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1725
- aConstraints.gridx += 1;
1726
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1727
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1728
- aConstraints.gridx = 0;
1729
- aConstraints.gridy += 1;
1730
- 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);
17311667
1732
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1733
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1734
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1735
- aConstraints.gridx += 1;
1736
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1737
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1738
- aConstraints.gridx = 0;
1739
- aConstraints.gridy += 1;
1740
- aConstraints.gridwidth = 1;
1741
- 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);
17421673
1743
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1744
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1745
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1746
- aConstraints.gridx += 1;
1747
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1748
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1749
- aConstraints.gridx = 0;
1750
- aConstraints.gridy += 1;
1751
- 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);
17521679
1753
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1754
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1755
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1756
- aConstraints.gridx += 1;
1757
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1758
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1759
- aConstraints.gridx = 0;
1760
- aConstraints.gridy += 1;
1761
- 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);
17621687
1763
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1764
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1765
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1766
- aConstraints.gridx += 1;
1767
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1768
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1769
- aConstraints.gridx = 0;
1770
- aConstraints.gridy += 1;
1771
- 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);
17721693
1773
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1774
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1775
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1776
- aConstraints.gridx += 1;
1777
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1778
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1779
- aConstraints.gridx = 0;
1780
- aConstraints.gridy += 1;
1781
- 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);
17821699
1783
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1784
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1785
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1786
- aConstraints.gridx += 1;
1787
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1788
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1789
- aConstraints.gridx = 0;
1790
- aConstraints.gridy += 1;
1791
- 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);
17921705
1793
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1794
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1795
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1796
- aConstraints.gridx += 1;
1797
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1798
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1799
- aConstraints.gridx = 0;
1800
- aConstraints.gridy += 1;
1801
- 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);
18021711
1803
- //aConstraints.weighty = 1;
1804
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1805
- //aConstraints.gridx += 1;
1806
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1807
- 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);
18081717
1809
- aConstraints.gridx = 0;
1810
- aConstraints.gridy = 0;
1811
- 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);
18121729
18131730 SetMaterial(copy); // .GetMaterial());
18141731
1815
- colorField.addChangeListener(this);
1816
- modulationField.addChangeListener(this);
1732
+ //colorField.addChangeListener(this);
1733
+// modulationField.addChangeListener(this);
18171734 metalnessField.addChangeListener(this);
18181735 diffuseField.addChangeListener(this);
18191736 specularField.addChangeListener(this);
....@@ -1843,12 +1760,15 @@
18431760 opacityPowerField.addChangeListener(this);
18441761 /**/
18451762
1846
- resetSlidersButton.addActionListener(this);
18471763 clearMaterialButton.addActionListener(this);
18481764 createMaterialButton.addActionListener(this);
1849
-
1850
- propagateToggle.addItemListener(this);
1851
- multiplyToggle.addItemListener(this);
1765
+
1766
+ if (Globals.ADVANCED)
1767
+ {
1768
+ resetSlidersButton.addActionListener(this);
1769
+ propagateToggle.addItemListener(this);
1770
+ multiplyToggle.addItemListener(this);
1771
+ }
18521772 }
18531773
18541774 void DropFile(java.io.File[] files, boolean textures)
....@@ -2019,7 +1939,7 @@
20191939
20201940 //? flashIt = false;
20211941 CameraPane pane = (CameraPane) cameraView;
2022
- pane.clickStart(location.x, location.y, 0);
1942
+ pane.clickStart(location.x, location.y, 0, 0);
20231943 pane.clickEnd(location.x, location.y, 0, true);
20241944
20251945 if (group.selection.size() == 1)
....@@ -2476,11 +2396,11 @@
24762396
24772397 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24782398 {
2479
- if (GrafreeD.standAlone)
2399
+ if (Grafreed.standAlone)
24802400 {
24812401 /**/
24822402 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2483
- browser.show();
2403
+ browser.setVisible(true);
24842404 String filename = browser.getFile();
24852405 if (filename != null && filename.length() > 0)
24862406 {
....@@ -2625,6 +2545,7 @@
26252545 }
26262546 if (input == null)
26272547 {
2548
+ new Exception().printStackTrace();
26282549 System.exit(0);
26292550 }
26302551
....@@ -2839,7 +2760,8 @@
28392760 return;
28402761 }
28412762
2842
- multiplyToggle.setSelected(mat.multiply);
2763
+ if (multiplyToggle != null)
2764
+ multiplyToggle.setSelected(mat.multiply);
28432765
28442766 assert (object.projectedVertices != null);
28452767
....@@ -3054,7 +2976,7 @@
30542976 frame.validate();
30552977
30562978 return;
3057
- } else if (event.getSource() == toggleRandomItem)
2979
+ } else if (event.getSource() == toggleSwitchItem)
30582980 {
30592981 cameraView.ToggleRandom();
30602982 cameraView.repaint();
....@@ -3099,6 +3021,7 @@
30993021 if (event.getSource() == randomCB)
31003022 {
31013023 copy.random ^= true;
3024
+ objEditor.refreshContents();
31023025 return;
31033026 }
31043027 if (event.getSource() == speedupCB)
....@@ -3322,7 +3245,7 @@
33223245 if (!Globals.ANIMATION)
33233246 {
33243247 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3325
- browser.show();
3248
+ browser.setVisible(true);
33263249 String filename = browser.getFile();
33273250 if (filename != null && filename.length() > 0)
33283251 {
....@@ -3332,8 +3255,8 @@
33323255
33333256 Globals.ANIMATION ^= true;
33343257
3335
- GrafreeD.wav.cursor = 0;
3336
- GrafreeD.wav.loop = 0;
3258
+ Grafreed.wav.cursor = 0;
3259
+ Grafreed.wav.loop = 0;
33373260 }
33383261 } else
33393262 {
....@@ -3383,7 +3306,7 @@
33833306 void CreateMaterial()
33843307 {
33853308 //copy.ClearMaterial(); // PATCH
3386
- copy.CreateMaterialS(multiplyToggle.isSelected());
3309
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33873310 if (copy.selection.size() > 0)
33883311 //SetMaterial(copy);
33893312 {
....@@ -3442,11 +3365,11 @@
34423365 {
34433366 copy.ResetBlockLoop(); // temporary problem
34443367
3445
- boolean random = CameraPane.RANDOM;
3446
- CameraPane.RANDOM = false; // parse everything
3368
+ boolean random = CameraPane.SWITCH;
3369
+ CameraPane.SWITCH = false; // parse everything
34473370 copy.ResetDisplayList();
34483371 copy.HardTouch();
3449
- CameraPane.RANDOM = random;
3372
+ CameraPane.SWITCH = random;
34503373 }
34513374
34523375 // public void applySelf()
....@@ -3516,10 +3439,40 @@
35163439 current.fakedepth = (float) fakedepthField.getFloat();
35173440 current.shadowbias = (float) shadowbiasField.getFloat();
35183441
3519
- if (!NumberSlider.frozen)
3442
+ if (!cNumberSlider.frozen)
35203443 {
35213444 //System.out.println("Propagate = " + propagate);
35223445 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
+
35233476 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
35243477 {
35253478 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3564,6 +3517,7 @@
35643517 || e.getSource() == apertureField
35653518 || e.getSource() == shadowblurField)
35663519 {
3520
+ new Exception().printStackTrace();
35673521 System.exit(0);
35683522 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35693523 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3889,7 +3843,7 @@
38893843
38903844 radioPanel.revalidate();
38913845 radioPanel.repaint();
3892
- ctrlPanel.revalidate(); // ? new
3846
+ ctrlPanel.validate(); // ? new
38933847 ctrlPanel.repaint();
38943848 }
38953849 }
....@@ -4246,7 +4200,7 @@
42464200
42474201 void load() // throws ClassNotFoundException
42484202 {
4249
- if (GrafreeD.standAlone)
4203
+ if (Grafreed.standAlone)
42504204 {
42514205 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42524206 browser.show();
....@@ -4351,7 +4305,7 @@
43514305
43524306 void saveAs()
43534307 {
4354
- if (GrafreeD.standAlone)
4308
+ if (Grafreed.standAlone)
43554309 {
43564310 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43574311 browser.setVisible(true);
....@@ -4462,7 +4416,7 @@
44624416 Object3D objectparent = obj.parent;
44634417 obj.parent = null;
44644418
4465
- Object3D object = (Object3D) GrafreeD.clone(obj);
4419
+ Object3D object = (Object3D) Grafreed.clone(obj);
44664420
44674421 obj.parent = objectparent;
44684422
....@@ -4496,7 +4450,7 @@
44964450 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44974451 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44984452 copy.generatePOV(buffer);
4499
- if (GrafreeD.standAlone)
4453
+ if (Grafreed.standAlone)
45004454 {
45014455 FileDialog browser = new FileDialog(frame, "Export POV", 1);
45024456 browser.show();
....@@ -4535,8 +4489,8 @@
45354489 //MenuItem normalLensItem;
45364490 MenuItem editCameraItem;
45374491 MenuItem revertCameraItem;
4538
- CheckboxMenuItem toggleLiveItem;
45394492 MenuItem stepItem;
4493
+ CheckboxMenuItem toggleLiveItem;
45404494 CheckboxMenuItem toggleFullScreenItem;
45414495 CheckboxMenuItem toggleTimelineItem;
45424496 CheckboxMenuItem toggleRenderItem;
....@@ -4545,7 +4499,7 @@
45454499 CheckboxMenuItem toggleFootContactItem;
45464500 CheckboxMenuItem toggleDLItem;
45474501 CheckboxMenuItem toggleTextureItem;
4548
- CheckboxMenuItem toggleRandomItem;
4502
+ CheckboxMenuItem toggleSwitchItem;
45494503 CheckboxMenuItem toggleRootItem;
45504504 CheckboxMenuItem animationItem;
45514505 CheckboxMenuItem toggleHandleItem;
....@@ -4553,13 +4507,13 @@
45534507 JSplitPane mainPanel;
45544508 JScrollPane scrollpane;
45554509 JPanel toolbarPanel;
4556
- JPanel treePanel;
4510
+ cGridBag treePanel;
45574511 JPanel radioPanel;
45584512 ButtonGroup buttonGroup;
4559
- JPanel ctrlPanel;
4560
- JPanel materialPanel;
4513
+ cGridBag ctrlPanel;
4514
+ cGridBag materialPanel;
45614515 JScrollPane infoPanel;
4562
- JPanel optionsPanel;
4516
+ cGridBag optionsPanel;
45634517 JTabbedPane objectPanel;
45644518 cGridBag XYZPanel;
45654519 JSplitPane gridPanel;
....@@ -4619,67 +4573,67 @@
46194573 // MATERIAL
46204574 JLabel materialLabel;
46214575 JLabel colorLabel;
4622
- NumberSlider colorField;
4576
+ cNumberSlider colorField;
46234577 JLabel modulationLabel;
4624
- NumberSlider modulationField;
4578
+ cNumberSlider modulationField;
46254579 JLabel metalnessLabel;
4626
- NumberSlider metalnessField;
4580
+ cNumberSlider metalnessField;
46274581 JLabel diffuseLabel;
4628
- NumberSlider diffuseField;
4582
+ cNumberSlider diffuseField;
46294583 JLabel specularLabel;
4630
- NumberSlider specularField;
4584
+ cNumberSlider specularField;
46314585 JLabel shininessLabel;
4632
- NumberSlider shininessField;
4586
+ cNumberSlider shininessField;
46334587 JLabel shiftLabel;
4634
- NumberSlider shiftField;
4588
+ cNumberSlider shiftField;
46354589 JLabel ambientLabel;
4636
- NumberSlider ambientField;
4590
+ cNumberSlider ambientField;
46374591 JLabel lightareaLabel;
4638
- NumberSlider lightareaField;
4592
+ cNumberSlider lightareaField;
46394593 JLabel diffusenessLabel;
4640
- NumberSlider diffusenessField;
4594
+ cNumberSlider diffusenessField;
46414595 JLabel velvetLabel;
4642
- NumberSlider velvetField;
4596
+ cNumberSlider velvetField;
46434597 JLabel sheenLabel;
4644
- NumberSlider sheenField;
4598
+ cNumberSlider sheenField;
46454599 JLabel subsurfaceLabel;
4646
- NumberSlider subsurfaceField;
4600
+ cNumberSlider subsurfaceField;
46474601 //JLabel bumpLabel;
46484602 //NumberSlider bumpField;
46494603 JLabel backlitLabel;
4650
- NumberSlider backlitField;
4604
+ cNumberSlider backlitField;
46514605 JLabel anisoLabel;
4652
- NumberSlider anisoField;
4606
+ cNumberSlider anisoField;
46534607 JLabel anisoVLabel;
4654
- NumberSlider anisoVField;
4608
+ cNumberSlider anisoVField;
46554609 JLabel cameraLabel;
4656
- NumberSlider cameraField;
4610
+ cNumberSlider cameraField;
46574611 JLabel selfshadowLabel;
4658
- NumberSlider selfshadowField;
4612
+ cNumberSlider selfshadowField;
46594613 JLabel shadowLabel;
4660
- NumberSlider shadowField;
4614
+ cNumberSlider shadowField;
46614615 JLabel textureLabel;
4662
- NumberSlider textureField;
4616
+ cNumberSlider textureField;
46634617 JLabel opacityLabel;
4664
- NumberSlider opacityField;
4618
+ cNumberSlider opacityField;
46654619 JLabel fakedepthLabel;
4666
- NumberSlider fakedepthField;
4620
+ cNumberSlider fakedepthField;
46674621 JLabel shadowbiasLabel;
4668
- NumberSlider shadowbiasField;
4622
+ cNumberSlider shadowbiasField;
46694623 JLabel bumpLabel;
4670
- NumberSlider bumpField;
4624
+ cNumberSlider bumpField;
46714625 JLabel noiseLabel;
4672
- NumberSlider noiseField;
4626
+ cNumberSlider noiseField;
46734627 JLabel powerLabel;
4674
- NumberSlider powerField;
4628
+ cNumberSlider powerField;
46754629 JLabel borderfadeLabel;
4676
- NumberSlider borderfadeField;
4630
+ cNumberSlider borderfadeField;
46774631 JLabel fogLabel;
4678
- NumberSlider fogField;
4632
+ cNumberSlider fogField;
46794633 JLabel opacityPowerLabel;
4680
- NumberSlider opacityPowerField;
4634
+ cNumberSlider opacityPowerField;
46814635 JTree jTree;
46824636 //ObjectUI parent;
46834637
4684
- NumberSlider normalpushField;
4638
+ cNumberSlider normalpushField;
46854639 }