Normand Briere
2019-06-09 3ae9b1de47e51e7c150412f2bb14383cb6a5f8f8
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);
....@@ -752,6 +784,7 @@
752784 // NumberSlider vDivsField;
753785 // JCheckBox endcaps;
754786 JCheckBox liveCB;
787
+ JCheckBox selectCB;
755788 JCheckBox hideCB;
756789 JCheckBox link2masterCB;
757790 JCheckBox markCB;
....@@ -767,115 +800,83 @@
767800 JButton slowerButton;
768801 JButton fasterButton;
769802 JButton remarkButton;
803
+
804
+ cGridBag namePanel;
805
+ cGridBag setupPanel;
806
+ cGridBag commandsPanel;
807
+ cGridBag pushPanel;
808
+ cGridBag fillPanel;
770809
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
810
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
772811 {
773812 JCheckBox cb;
774813
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);
814
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
780815 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
784816
785817 return cb;
786818 }
787819
788
- cButton AddButton(ObjEditor oe, String label)
820
+ cButton AddButton(cGridBag panel, String label)
789821 {
790822 cButton cb;
791823
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);
824
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
797825 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
801826
802827 return cb;
803828 }
804829
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
830
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
806831 {
807832 JComboBox combo;
808833
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;
834
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
812835 combo.addActionListener(this);
813836
814837 return combo;
815838 }
816839
817
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
840
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
818841 {
819
- NumberSlider combo;
842
+ cGridBag control = new cGridBag();
843
+
844
+ cNumberSlider combo;
820845
821846 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824847 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
-
848
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834850 combo.setFloat(current);
835
-
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
851
+
852
+ panel.add(control);
853
+
854
+ return control;
841855 }
842856
843
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
857
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
844858 {
845
- NumberSlider combo;
859
+ cGridBag control = new cGridBag();
860
+
861
+ cNumberSlider combo;
846862
847863 JLabel jlabel = new JLabel(label);
848
-
849
- aConstraints.fill = GridBagConstraints.VERTICAL;
850864 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
-
865
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
866
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860867 combo.setInteger(current);
861868
862
- combo.label = jlabel;
863
-
864
- combo.addChangeListener(this);
865
-
866
- return combo;
869
+ panel.add(control);
870
+
871
+ return control;
867872 }
868873
869
- JTextArea AddText(JPanel ctrlPanel, String name)
874
+ JTextArea AddText(cGridBag ctrlPanel, String name)
870875 {
871876 JTextArea text;
872877
873
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
874
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
875
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
878
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
876879 text.addCaretListener(this);
877
- aConstraints.gridx += 1;
878
- aConstraints.gridwidth = 1;
879880
880881 return text;
881882 }
....@@ -905,9 +906,16 @@
905906 objEditor.ctrlPanel.remove(j);
906907 }
907908
909
+ void Remove(cNumberSlider j)
910
+ {
911
+ j.removeChangeListener(this);
912
+ //objEditor.ctrlPanel.remove(j.label);
913
+ objEditor.ctrlPanel.remove(j);
914
+ }
915
+
908916 /*
909917 */
910
- void Return() // ObjEditor oe)
918
+ void Return0() // ObjEditor oe)
911919 {
912920 aConstraints.gridy += 1;
913921 aConstraints.gridx = 0;
....@@ -962,37 +970,72 @@
962970
963971 void SetupUI2(ObjEditor oe)
964972 {
965
-// oe.aConstraints.weightx = 0;
966
-// oe.aConstraints.weighty = 0;
967
-// oe.aConstraints.gridx = 0;
968
-// oe.aConstraints.gridy = 0;
969
- SetupName(oe);
973
+ //SetupName(oe);
974
+
975
+ namePanel = new cGridBag();
976
+
977
+ nameField = AddText(namePanel, copy.GetName());
978
+ namePanel.add(nameField);
979
+ oe.ctrlPanel.add(namePanel);
980
+
981
+ oe.ctrlPanel.Return();
970982
971983 if (!GroupEditor.allparams)
972984 return;
973985
974
- liveCB = AddCheckBox(oe, "Live", copy.live);
975
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
976
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
986
+ setupPanel = new cGridBag().setVertical(false);
987
+
988
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
989
+ liveCB.setToolTipText("Animate object");
990
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
991
+ selectCB.setToolTipText("Make object selectable");
977992 // 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");
993
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
994
+ hideCB.setToolTipText("Hide object");
995
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
996
+ markCB.setToolTipText("Set the animation target transform");
997
+
998
+ rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
999
+ rewindCB.setToolTipText("Rewind animation");
1000
+
1001
+ randomCB = AddCheckBox(setupPanel, "Random", copy.random);
1002
+ randomCB.setToolTipText("Option for switch node");
1003
+
1004
+ if (Globals.ADVANCED)
1005
+ {
1006
+ link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
1007
+ link2masterCB.setToolTipText("Attach to support");
1008
+ speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
1009
+ speedupCB.setToolTipText("Option motion capture");
1010
+ }
1011
+
1012
+ oe.ctrlPanel.add(setupPanel);
1013
+ oe.ctrlPanel.Return();
1014
+
1015
+ commandsPanel = new cGridBag().setVertical(false);
1016
+
1017
+ resetButton = AddButton(commandsPanel, "Reset");
1018
+ resetButton.setToolTipText("Jump to frame zero");
1019
+ stepButton = AddButton(commandsPanel, "Step");
1020
+ stepButton.setToolTipText("Step one frame");
9841021 // resetAllButton = AddButton(oe, "Reset All");
9851022 // stepAllButton = AddButton(oe, "Step All");
986
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9871023 // Return();
988
- slowerButton = AddButton(oe, "Slow");
989
- fasterButton = AddButton(oe, "Fast");
990
- remarkButton = AddButton(oe, "Rem");
1024
+ slowerButton = AddButton(commandsPanel, "Slow");
1025
+ slowerButton.setToolTipText("Decrease animation speed");
1026
+ fasterButton = AddButton(commandsPanel, "Fast");
1027
+ fasterButton.setToolTipText("Increase animation speed");
1028
+ remarkButton = AddButton(commandsPanel, "Remark");
1029
+ remarkButton.setToolTipText("Set the current transform as the target");
9911030
992
- Return();
1031
+ oe.ctrlPanel.add(commandsPanel);
1032
+ oe.ctrlPanel.Return();
9931033
994
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
995
- Return();
1034
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1035
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1036
+ //Return();
1037
+
1038
+ oe.ctrlPanel.Return();
9961039
9971040 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9981041 // ObjEditor.aConstraints.gridx += 1;
....@@ -1087,7 +1130,7 @@
10871130 oe.aConstraints.gridwidth = 1;
10881131 /**/
10891132 nameField = AddText(oe.ctrlPanel, copy.GetName());
1090
- Return();
1133
+ oe.ctrlPanel.Return();
10911134
10921135 //ctrlPanel.add(textureButton = new Button("Texture..."));
10931136 //textureButton.setEnabled(false);
....@@ -1264,10 +1307,11 @@
12641307 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12651308 //tmp.setName("Edit");
12661309 objectPanel.add(materialPanel);
1267
- JPanel north = new JPanel(new BorderLayout());
1268
- north.setName("Edit");
1269
- north.add(ctrlPanel, BorderLayout.NORTH);
1270
- objectPanel.add(north);
1310
+// JPanel north = new JPanel(new BorderLayout());
1311
+// north.setName("Edit");
1312
+// north.add(ctrlPanel, BorderLayout.NORTH);
1313
+// objectPanel.add(north);
1314
+ objectPanel.add(ctrlPanel);
12711315 objectPanel.add(infoPanel);
12721316
12731317 /*
....@@ -1289,18 +1333,18 @@
12891333 scrollpane.addMouseWheelListener(this); // Default not fast enough
12901334
12911335 /*JTabbedPane*/ scenePanel = new cGridBag();
1292
- scenePanel.preferredWidth = 7;
1336
+ scenePanel.preferredWidth = 6;
12931337
12941338 JTabbedPane tabbedPane = new JTabbedPane();
12951339 tabbedPane.add(scrollpane);
12961340
12971341 tabbedPane.add(FSPane = new cFileSystemPane(this));
12981342
1299
- optionsPanel = new JPanel(new GridBagLayout());
1343
+ optionsPanel = new cGridBag().setVertical(true);
13001344
13011345 optionsPanel.setName("Options");
13021346
1303
- AddOptions(optionsPanel, aConstraints);
1347
+ AddOptions(optionsPanel); //, aConstraints);
13041348
13051349 tabbedPane.add(optionsPanel);
13061350
....@@ -1395,8 +1439,8 @@
13951439
13961440 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13971441
1398
- frame.setSize(1024, 768);
1399
- frame.show();
1442
+ frame.setSize(1280, 860);
1443
+ frame.setVisible(true);
14001444
14011445 gridPanel.setDividerLocation(1.0);
14021446
....@@ -1411,7 +1455,7 @@
14111455 });
14121456 }
14131457
1414
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1458
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
14151459 {
14161460 }
14171461
....@@ -1426,260 +1470,173 @@
14261470 ctrlPanel.removeAll();
14271471 }
14281472
1429
- void SetupMaterial(JPanel ctrlPanel)
1473
+ void SetupMaterial(cGridBag panel)
14301474 {
1431
- aConstraints.weighty = 0;
1432
- //aConstraints.weightx = 1;
1433
- /*
1475
+ /*
14341476 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14351477 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1436
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1437
- aConstraints.gridx += 1;
14381478 */
14391479
1440
- aConstraints.gridwidth = 1;
1441
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1442
- aConstraints.gridx += 1;
1443
- aConstraints.weighty = 0;
1444
- aConstraints.gridwidth = 1;
1480
+ cGridBag editBar = new cGridBag().setVertical(false);
1481
+
1482
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1483
+ createMaterialButton.setToolTipText("Create material");
14451484
14461485 /*
14471486 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1448
- aConstraints.gridx += 1;
1449
- aConstraints.weighty = 0;
1450
- aConstraints.gridwidth = 1;
14511487 */
14521488
1453
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1454
- aConstraints.gridx += 1;
1489
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1490
+ clearMaterialButton.setToolTipText("Clear material");
1491
+
1492
+ if (Globals.ADVANCED)
1493
+ {
1494
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1495
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1496
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1497
+ }
14551498
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;
1499
+ editBar.preferredHeight = 15;
1500
+
1501
+ panel.add(editBar);
1502
+
14701503 /**/
14711504 //aConstraints.weighty = 0;
14721505 ////aConstraints.weightx = 1;
14731506 //aConstraints.weighty = 1;
14741507 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14751508 //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;
1509
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14811510
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;
1511
+ cGridBag colorSection = new cGridBag().setVertical(true);
1512
+
1513
+ cGridBag color = new cGridBag();
1514
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1515
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1516
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1517
+ //colorField.preferredWidth = 200;
1518
+ colorSection.add(color);
14921519
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;
1520
+ cGridBag modulation = new cGridBag();
1521
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1522
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1523
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1524
+ colorSection.add(modulation);
15021525
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;
1526
+ cGridBag texture = new cGridBag();
1527
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1528
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1529
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1530
+ colorSection.add(texture);
15121531
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;
1532
+ cGridBag anisoU = new cGridBag();
1533
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1534
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1535
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1536
+ colorSection.add(anisoU);
15221537
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;
1538
+ cGridBag anisoV = new cGridBag();
1539
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1540
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1541
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1542
+ colorSection.add(anisoV);
15321543
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;
1544
+ cGridBag shadowbias = new cGridBag();
1545
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1546
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1547
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1548
+ colorSection.add(shadowbias);
15421549
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;
1550
+ panel.add(new JSeparator());
1551
+
1552
+ panel.add(colorSection);
1553
+
1554
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1555
+
1556
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1557
+
1558
+ cGridBag diffuse = new cGridBag();
1559
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1560
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1561
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1562
+ diffuseSection.add(diffuse);
15511563
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;
1564
+ cGridBag diffuseness = new cGridBag();
1565
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1566
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1567
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1568
+ diffuseSection.add(diffuseness);
15611569
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;
1570
+ cGridBag selfshadow = new cGridBag();
1571
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1572
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1573
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1574
+ diffuseSection.add(selfshadow);
15711575
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;
1576
+ cGridBag sheen = new cGridBag();
1577
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1578
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1579
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1580
+ diffuseSection.add(sheen);
15811581
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;
1582
+ cGridBag subsurface = new cGridBag();
1583
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1584
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1585
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1586
+ diffuseSection.add(subsurface);
15911587
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;
1588
+ cGridBag shadow = new cGridBag();
1589
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1590
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1591
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1592
+ diffuseSection.add(shadow);
16011593
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;
1594
+ cGridBag fakedepth = new cGridBag();
1595
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1596
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1597
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1598
+ diffuseSection.add(fakedepth);
16111599
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;
1600
+ panel.add(new JSeparator());
1601
+
1602
+ panel.add(diffuseSection);
1603
+
1604
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1605
+
1606
+ cGridBag specularSection = new cGridBag().setVertical(true);
16211607
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;
1608
+ cGridBag specular = new cGridBag();
1609
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1610
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1612
+ specularSection.add(specular);
16301613
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;
1614
+ cGridBag lightarea = new cGridBag();
1615
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1616
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1617
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1618
+ specularSection.add(lightarea);
16401619
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;
1620
+ cGridBag shininess = new cGridBag();
1621
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1622
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1623
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1624
+ specularSection.add(shininess);
16501625
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;
1626
+ cGridBag metalness = new cGridBag();
1627
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1628
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1629
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1630
+ specularSection.add(metalness);
16601631
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;
1632
+ cGridBag velvet = new cGridBag();
1633
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1634
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1635
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1636
+ specularSection.add(velvet);
16701637
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();
1638
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1639
+ //Return();
16831640 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16841641 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16851642 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1690,130 +1647,93 @@
16901647 // aConstraints.gridy += 1;
16911648 // aConstraints.gridwidth = 1;
16921649
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;
17011650
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;
1651
+ panel.add(new JSeparator());
1652
+
1653
+ panel.add(specularSection);
1654
+
1655
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1656
+
1657
+ cGridBag globalSection = new cGridBag().setVertical(true);
17111658
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;
1659
+ cGridBag camera = new cGridBag();
1660
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1661
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1662
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1663
+ globalSection.add(camera);
17211664
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;
1665
+ cGridBag ambient = new cGridBag();
1666
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1667
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1668
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1669
+ globalSection.add(ambient);
17311670
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;
1671
+ cGridBag backlit = new cGridBag();
1672
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1673
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1674
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1675
+ globalSection.add(backlit);
17421676
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;
1677
+ cGridBag opacity = new cGridBag();
1678
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1679
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1680
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1681
+ globalSection.add(opacity);
17521682
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;
1683
+ panel.add(new JSeparator());
1684
+
1685
+ panel.add(globalSection);
1686
+
1687
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1688
+
1689
+ cGridBag textureSection = new cGridBag().setVertical(true);
17621690
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;
1691
+ cGridBag bump = new cGridBag();
1692
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1693
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1694
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1695
+ textureSection.add(bump);
17721696
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;
1697
+ cGridBag noise = new cGridBag();
1698
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1699
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1700
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1701
+ textureSection.add(noise);
17821702
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;
1703
+ cGridBag power = new cGridBag();
1704
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1705
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1706
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1707
+ textureSection.add(power);
17921708
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;
1709
+ cGridBag borderfade = new cGridBag();
1710
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1711
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1712
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1713
+ textureSection.add(borderfade);
18021714
1803
- //aConstraints.weighty = 1;
1804
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1805
- //aConstraints.gridx += 1;
1806
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1807
- aConstraints.weighty = 0;
1715
+ cGridBag fog = new cGridBag();
1716
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1717
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1718
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1719
+ textureSection.add(fog);
18081720
1809
- aConstraints.gridx = 0;
1810
- aConstraints.gridy = 0;
1811
- aConstraints.gridwidth = 1;
1721
+ cGridBag opacityPower = new cGridBag();
1722
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1723
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1724
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1725
+ textureSection.add(opacityPower);
1726
+
1727
+ panel.add(new JSeparator());
1728
+
1729
+ panel.add(textureSection);
1730
+
1731
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18121732
18131733 SetMaterial(copy); // .GetMaterial());
18141734
1815
- colorField.addChangeListener(this);
1816
- modulationField.addChangeListener(this);
1735
+ //colorField.addChangeListener(this);
1736
+// modulationField.addChangeListener(this);
18171737 metalnessField.addChangeListener(this);
18181738 diffuseField.addChangeListener(this);
18191739 specularField.addChangeListener(this);
....@@ -1843,12 +1763,15 @@
18431763 opacityPowerField.addChangeListener(this);
18441764 /**/
18451765
1846
- resetSlidersButton.addActionListener(this);
18471766 clearMaterialButton.addActionListener(this);
18481767 createMaterialButton.addActionListener(this);
1849
-
1850
- propagateToggle.addItemListener(this);
1851
- multiplyToggle.addItemListener(this);
1768
+
1769
+ if (Globals.ADVANCED)
1770
+ {
1771
+ resetSlidersButton.addActionListener(this);
1772
+ propagateToggle.addItemListener(this);
1773
+ multiplyToggle.addItemListener(this);
1774
+ }
18521775 }
18531776
18541777 void DropFile(java.io.File[] files, boolean textures)
....@@ -2019,7 +1942,7 @@
20191942
20201943 //? flashIt = false;
20211944 CameraPane pane = (CameraPane) cameraView;
2022
- pane.clickStart(location.x, location.y, 0);
1945
+ pane.clickStart(location.x, location.y, 0, 0);
20231946 pane.clickEnd(location.x, location.y, 0, true);
20241947
20251948 if (group.selection.size() == 1)
....@@ -2476,11 +2399,11 @@
24762399
24772400 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24782401 {
2479
- if (GrafreeD.standAlone)
2402
+ if (Grafreed.standAlone)
24802403 {
24812404 /**/
24822405 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2483
- browser.show();
2406
+ browser.setVisible(true);
24842407 String filename = browser.getFile();
24852408 if (filename != null && filename.length() > 0)
24862409 {
....@@ -2625,6 +2548,7 @@
26252548 }
26262549 if (input == null)
26272550 {
2551
+ new Exception().printStackTrace();
26282552 System.exit(0);
26292553 }
26302554
....@@ -2839,7 +2763,8 @@
28392763 return;
28402764 }
28412765
2842
- multiplyToggle.setSelected(mat.multiply);
2766
+ if (multiplyToggle != null)
2767
+ multiplyToggle.setSelected(mat.multiply);
28432768
28442769 assert (object.projectedVertices != null);
28452770
....@@ -3054,7 +2979,7 @@
30542979 frame.validate();
30552980
30562981 return;
3057
- } else if (event.getSource() == toggleRandomItem)
2982
+ } else if (event.getSource() == toggleSwitchItem)
30582983 {
30592984 cameraView.ToggleRandom();
30602985 cameraView.repaint();
....@@ -3085,6 +3010,10 @@
30853010 {
30863011 copy.live ^= true;
30873012 return;
3013
+ } else if (event.getSource() == selectCB)
3014
+ {
3015
+ copy.dontselect ^= true;
3016
+ return;
30883017 } else if (event.getSource() == hideCB)
30893018 {
30903019 copy.hide ^= true;
....@@ -3099,6 +3028,7 @@
30993028 if (event.getSource() == randomCB)
31003029 {
31013030 copy.random ^= true;
3031
+ objEditor.refreshContents();
31023032 return;
31033033 }
31043034 if (event.getSource() == speedupCB)
....@@ -3322,7 +3252,7 @@
33223252 if (!Globals.ANIMATION)
33233253 {
33243254 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3325
- browser.show();
3255
+ browser.setVisible(true);
33263256 String filename = browser.getFile();
33273257 if (filename != null && filename.length() > 0)
33283258 {
....@@ -3332,8 +3262,8 @@
33323262
33333263 Globals.ANIMATION ^= true;
33343264
3335
- GrafreeD.wav.cursor = 0;
3336
- GrafreeD.wav.loop = 0;
3265
+ Grafreed.wav.cursor = 0;
3266
+ Grafreed.wav.loop = 0;
33373267 }
33383268 } else
33393269 {
....@@ -3383,7 +3313,7 @@
33833313 void CreateMaterial()
33843314 {
33853315 //copy.ClearMaterial(); // PATCH
3386
- copy.CreateMaterialS(multiplyToggle.isSelected());
3316
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33873317 if (copy.selection.size() > 0)
33883318 //SetMaterial(copy);
33893319 {
....@@ -3442,11 +3372,11 @@
34423372 {
34433373 copy.ResetBlockLoop(); // temporary problem
34443374
3445
- boolean random = CameraPane.RANDOM;
3446
- CameraPane.RANDOM = false; // parse everything
3375
+ boolean random = CameraPane.SWITCH;
3376
+ CameraPane.SWITCH = false; // parse everything
34473377 copy.ResetDisplayList();
34483378 copy.HardTouch();
3449
- CameraPane.RANDOM = random;
3379
+ CameraPane.SWITCH = random;
34503380 }
34513381
34523382 // public void applySelf()
....@@ -3516,10 +3446,40 @@
35163446 current.fakedepth = (float) fakedepthField.getFloat();
35173447 current.shadowbias = (float) shadowbiasField.getFloat();
35183448
3519
- if (!NumberSlider.frozen)
3449
+ if (!cNumberSlider.frozen)
35203450 {
35213451 //System.out.println("Propagate = " + propagate);
35223452 copy.UpdateMaterial(anchor, current, propagate);
3453
+
3454
+ if (copy.material != null)
3455
+ {
3456
+ cMaterial mat = copy.material;
3457
+
3458
+ colorField.SetToolTipValue((mat.color));
3459
+ modulationField.SetToolTipValue((mat.modulation));
3460
+ metalnessField.SetToolTipValue((mat.metalness));
3461
+ diffuseField.SetToolTipValue((mat.diffuse));
3462
+ specularField.SetToolTipValue((mat.specular));
3463
+ shininessField.SetToolTipValue((mat.shininess));
3464
+ shiftField.SetToolTipValue((mat.shift));
3465
+ ambientField.SetToolTipValue((mat.ambient));
3466
+ lightareaField.SetToolTipValue((mat.lightarea));
3467
+ diffusenessField.SetToolTipValue((mat.factor));
3468
+ velvetField.SetToolTipValue((mat.velvet));
3469
+ sheenField.SetToolTipValue((mat.sheen));
3470
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3471
+ backlitField.SetToolTipValue((mat.bump));
3472
+ anisoField.SetToolTipValue((mat.aniso));
3473
+ anisoVField.SetToolTipValue((mat.anisoV));
3474
+ cameraField.SetToolTipValue((mat.cameralight));
3475
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3476
+ shadowField.SetToolTipValue((mat.shadow));
3477
+ textureField.SetToolTipValue((mat.texture));
3478
+ opacityField.SetToolTipValue((mat.opacity));
3479
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3480
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3481
+ }
3482
+
35233483 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
35243484 {
35253485 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3564,6 +3524,7 @@
35643524 || e.getSource() == apertureField
35653525 || e.getSource() == shadowblurField)
35663526 {
3527
+ new Exception().printStackTrace();
35673528 System.exit(0);
35683529 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35693530 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3634,7 +3595,7 @@
36343595 }
36353596
36363597 if (normalpushField != null)
3637
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
3598
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36383599 }
36393600
36403601 void SnapObject()
....@@ -3889,7 +3850,7 @@
38893850
38903851 radioPanel.revalidate();
38913852 radioPanel.repaint();
3892
- ctrlPanel.revalidate(); // ? new
3853
+ ctrlPanel.validate(); // ? new
38933854 ctrlPanel.repaint();
38943855 }
38953856 }
....@@ -4246,7 +4207,7 @@
42464207
42474208 void load() // throws ClassNotFoundException
42484209 {
4249
- if (GrafreeD.standAlone)
4210
+ if (Grafreed.standAlone)
42504211 {
42514212 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42524213 browser.show();
....@@ -4351,7 +4312,7 @@
43514312
43524313 void saveAs()
43534314 {
4354
- if (GrafreeD.standAlone)
4315
+ if (Grafreed.standAlone)
43554316 {
43564317 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43574318 browser.setVisible(true);
....@@ -4462,7 +4423,7 @@
44624423 Object3D objectparent = obj.parent;
44634424 obj.parent = null;
44644425
4465
- Object3D object = (Object3D) GrafreeD.clone(obj);
4426
+ Object3D object = (Object3D) Grafreed.clone(obj);
44664427
44674428 obj.parent = objectparent;
44684429
....@@ -4496,7 +4457,7 @@
44964457 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44974458 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44984459 copy.generatePOV(buffer);
4499
- if (GrafreeD.standAlone)
4460
+ if (Grafreed.standAlone)
45004461 {
45014462 FileDialog browser = new FileDialog(frame, "Export POV", 1);
45024463 browser.show();
....@@ -4535,8 +4496,8 @@
45354496 //MenuItem normalLensItem;
45364497 MenuItem editCameraItem;
45374498 MenuItem revertCameraItem;
4538
- CheckboxMenuItem toggleLiveItem;
45394499 MenuItem stepItem;
4500
+ CheckboxMenuItem toggleLiveItem;
45404501 CheckboxMenuItem toggleFullScreenItem;
45414502 CheckboxMenuItem toggleTimelineItem;
45424503 CheckboxMenuItem toggleRenderItem;
....@@ -4545,7 +4506,7 @@
45454506 CheckboxMenuItem toggleFootContactItem;
45464507 CheckboxMenuItem toggleDLItem;
45474508 CheckboxMenuItem toggleTextureItem;
4548
- CheckboxMenuItem toggleRandomItem;
4509
+ CheckboxMenuItem toggleSwitchItem;
45494510 CheckboxMenuItem toggleRootItem;
45504511 CheckboxMenuItem animationItem;
45514512 CheckboxMenuItem toggleHandleItem;
....@@ -4553,13 +4514,13 @@
45534514 JSplitPane mainPanel;
45544515 JScrollPane scrollpane;
45554516 JPanel toolbarPanel;
4556
- JPanel treePanel;
4517
+ cGridBag treePanel;
45574518 JPanel radioPanel;
45584519 ButtonGroup buttonGroup;
4559
- JPanel ctrlPanel;
4560
- JPanel materialPanel;
4520
+ cGridBag ctrlPanel;
4521
+ cGridBag materialPanel;
45614522 JScrollPane infoPanel;
4562
- JPanel optionsPanel;
4523
+ cGridBag optionsPanel;
45634524 JTabbedPane objectPanel;
45644525 cGridBag XYZPanel;
45654526 JSplitPane gridPanel;
....@@ -4619,67 +4580,67 @@
46194580 // MATERIAL
46204581 JLabel materialLabel;
46214582 JLabel colorLabel;
4622
- NumberSlider colorField;
4583
+ cNumberSlider colorField;
46234584 JLabel modulationLabel;
4624
- NumberSlider modulationField;
4585
+ cNumberSlider modulationField;
46254586 JLabel metalnessLabel;
4626
- NumberSlider metalnessField;
4587
+ cNumberSlider metalnessField;
46274588 JLabel diffuseLabel;
4628
- NumberSlider diffuseField;
4589
+ cNumberSlider diffuseField;
46294590 JLabel specularLabel;
4630
- NumberSlider specularField;
4591
+ cNumberSlider specularField;
46314592 JLabel shininessLabel;
4632
- NumberSlider shininessField;
4593
+ cNumberSlider shininessField;
46334594 JLabel shiftLabel;
4634
- NumberSlider shiftField;
4595
+ cNumberSlider shiftField;
46354596 JLabel ambientLabel;
4636
- NumberSlider ambientField;
4597
+ cNumberSlider ambientField;
46374598 JLabel lightareaLabel;
4638
- NumberSlider lightareaField;
4599
+ cNumberSlider lightareaField;
46394600 JLabel diffusenessLabel;
4640
- NumberSlider diffusenessField;
4601
+ cNumberSlider diffusenessField;
46414602 JLabel velvetLabel;
4642
- NumberSlider velvetField;
4603
+ cNumberSlider velvetField;
46434604 JLabel sheenLabel;
4644
- NumberSlider sheenField;
4605
+ cNumberSlider sheenField;
46454606 JLabel subsurfaceLabel;
4646
- NumberSlider subsurfaceField;
4607
+ cNumberSlider subsurfaceField;
46474608 //JLabel bumpLabel;
46484609 //NumberSlider bumpField;
46494610 JLabel backlitLabel;
4650
- NumberSlider backlitField;
4611
+ cNumberSlider backlitField;
46514612 JLabel anisoLabel;
4652
- NumberSlider anisoField;
4613
+ cNumberSlider anisoField;
46534614 JLabel anisoVLabel;
4654
- NumberSlider anisoVField;
4615
+ cNumberSlider anisoVField;
46554616 JLabel cameraLabel;
4656
- NumberSlider cameraField;
4617
+ cNumberSlider cameraField;
46574618 JLabel selfshadowLabel;
4658
- NumberSlider selfshadowField;
4619
+ cNumberSlider selfshadowField;
46594620 JLabel shadowLabel;
4660
- NumberSlider shadowField;
4621
+ cNumberSlider shadowField;
46614622 JLabel textureLabel;
4662
- NumberSlider textureField;
4623
+ cNumberSlider textureField;
46634624 JLabel opacityLabel;
4664
- NumberSlider opacityField;
4625
+ cNumberSlider opacityField;
46654626 JLabel fakedepthLabel;
4666
- NumberSlider fakedepthField;
4627
+ cNumberSlider fakedepthField;
46674628 JLabel shadowbiasLabel;
4668
- NumberSlider shadowbiasField;
4629
+ cNumberSlider shadowbiasField;
46694630 JLabel bumpLabel;
4670
- NumberSlider bumpField;
4631
+ cNumberSlider bumpField;
46714632 JLabel noiseLabel;
4672
- NumberSlider noiseField;
4633
+ cNumberSlider noiseField;
46734634 JLabel powerLabel;
4674
- NumberSlider powerField;
4635
+ cNumberSlider powerField;
46754636 JLabel borderfadeLabel;
4676
- NumberSlider borderfadeField;
4637
+ cNumberSlider borderfadeField;
46774638 JLabel fogLabel;
4678
- NumberSlider fogField;
4639
+ cNumberSlider fogField;
46794640 JLabel opacityPowerLabel;
4680
- NumberSlider opacityPowerField;
4641
+ cNumberSlider opacityPowerField;
46814642 JTree jTree;
46824643 //ObjectUI parent;
46834644
4684
- NumberSlider normalpushField;
4645
+ cNumberSlider normalpushField;
46854646 }