Normand Briere
2019-06-09 3ae9b1de47e51e7c150412f2bb14383cb6a5f8f8
ObjEditor.java
....@@ -19,6 +19,8 @@
1919 import //weka.core.
2020 matrix.Matrix;
2121
22
+import grafeme.ui.*;
23
+
2224 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2325 ActionListener, ChangeListener,
2426 InputMethodListener,
....@@ -31,6 +33,9 @@
3133 boolean timeline;
3234 boolean wasFullScreen;
3335
36
+ GroupEditor callee;
37
+ JFrame frame;
38
+
3439 // SCRIPT
3540
3641 transient JFrame textpanel = null;
....@@ -121,47 +126,53 @@
121126 void keyPressed(int key, int modifiers)
122127 {
123128 System.out.println("KEY PRESSED");
124
- CameraPane.theRenderer.keyPressed(key, modifiers);
129
+ Globals.theRenderer.keyPressed(key, modifiers);
125130 }
126131 */
127132
128133 static GridBagConstraints aConstraints;
129134 static GridBagConstraints aWindowConstraints;
130
- GroupEditor callee;
131
- JFrame frame;
135
+
132136 static int GRIDWIDTH = 100; // 4;
133137
134138 public void closeUI()
135139 {
136140 //new Exception().printStackTrace();
137
- System.out.println("this = " + this);
138
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
139143 //nameField.removeActionListener(this);
140
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
145
+
146
+ objEditor.ctrlPanel.remove(namePanel);
141147
142148 if (!GroupEditor.allparams)
143149 return;
144150
145
- objEditor.ctrlPanel.remove(liveCB);
146
- objEditor.ctrlPanel.remove(hideCB);
147
- objEditor.ctrlPanel.remove(markCB);
148
-
149
- objEditor.ctrlPanel.remove(randomCB);
150
- objEditor.ctrlPanel.remove(speedupCB);
151
- objEditor.ctrlPanel.remove(rewindCB);
152
-
153
- objEditor.ctrlPanel.remove(resetButton);
154
- objEditor.ctrlPanel.remove(stepButton);
155
-// objEditor.ctrlPanel.remove(stepAllButton);
156
-// objEditor.ctrlPanel.remove(resetAllButton);
157
- objEditor.ctrlPanel.remove(link2masterCB);
158
- //objEditor.ctrlPanel.remove(flipVCB);
159
- //objEditor.ctrlPanel.remove(texresMenu);
160
- objEditor.ctrlPanel.remove(slowerButton);
161
- objEditor.ctrlPanel.remove(fasterButton);
162
- 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);
163169
164
- 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);
165176 }
166177
167178 public ObjEditor GetEditor()
....@@ -298,44 +309,61 @@
298309 //normalLensItem.addActionListener(this);
299310 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
300311 revertCameraItem.addActionListener(this);
301
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
302
- toggleTimelineItem.addItemListener(this);
312
+
303313 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
304314 toggleFullScreenItem.addItemListener(this);
305315 toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
306316 cameraMenu.add("-");
317
+
307318 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
308319 toggleTextureItem.addItemListener(this);
309320 toggleTextureItem.setState(CameraPane.textureon);
310
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
311
- toggleLiveItem.addItemListener(this);
312
- toggleLiveItem.setState(CameraPane.isLIVE());
313
- cameraMenu.add(stepItem = new MenuItem("Step"));
314
- stepItem.addActionListener(this);
315
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
316
-// toggleDLItem.addItemListener(this);
317
-// toggleDLItem.setState(false);
318
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
319
- toggleRenderItem.addItemListener(this);
320
- toggleRenderItem.setState(!CameraPane.frozen);
321
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
322
- toggleDebugItem.addItemListener(this);
323
- toggleDebugItem.setState(CameraPane.DEBUG);
324
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
325
- toggleFrustumItem.addItemListener(this);
326
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
327
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
328
- toggleFootContactItem.addItemListener(this);
329
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
330
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
331
- toggleRandomItem.addItemListener(this);
332
- toggleRandomItem.setState(CameraPane.RANDOM);
321
+
322
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
323
+ toggleSwitchItem.addItemListener(this);
324
+ toggleSwitchItem.setState(CameraPane.SWITCH);
325
+
333326 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
334327 toggleHandleItem.addItemListener(this);
335328 toggleHandleItem.setState(CameraPane.HANDLES);
329
+
336330 cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
337331 togglePaintItem.addItemListener(this);
338332 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
+
339367 // cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
340368 // toggleRootItem.addItemListener(this);
341369 // toggleRootItem.setState(false);
....@@ -349,21 +377,23 @@
349377 objectPanel = new JTabbedPane();
350378 toolbarPanel = new JPanel();
351379 toolbarPanel.setName("Toolbar");
352
- treePanel = new JPanel();
380
+ treePanel = new cGridBag();
353381 treePanel.setName("Tree");
354
- ctrlPanel = new JPanel(); // new GridBagLayout());
382
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
355383 ctrlPanel.setName("Edit");
356
- materialPanel = new JPanel();
384
+ materialPanel = new cGridBag().setVertical(true);
357385 materialPanel.setName("Material");
358386 /*JTextPane*/
359387 infoarea = createTextPane();
388
+ doc = infoarea.getStyledDocument();
389
+
360390 infoarea.setEditable(true);
361391 SetText();
362392 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
363393 // infoarea.setOpaque(false);
364394 // //infoarea.setForeground(textcolor);
365
- infoarea.setLineWrap(true);
366
- infoarea.setWrapStyleWord(true);
395
+// TEXTAREA infoarea.setLineWrap(true);
396
+// TEXTAREA infoarea.setWrapStyleWord(true);
367397 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
368398 infoPanel.setPreferredSize(new Dimension(50, 200));
369399 infoPanel.setName("Info");
....@@ -374,16 +404,16 @@
374404 mainPanel.setName("Main");
375405 mainPanel.setContinuousLayout(true);
376406 mainPanel.setOneTouchExpandable(true);
377
- mainPanel.setDividerLocation(1.0);
378407 mainPanel.setDividerSize(9);
379
- mainPanel.setResizeWeight(0);
408
+ mainPanel.setDividerLocation(0.5); //1.0);
409
+ mainPanel.setResizeWeight(0.5);
380410
381411 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
382412 //mainPanel.setLayout(new GridBagLayout());
383413 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
384
- treePanel.setLayout(new GridBagLayout());
385
- ctrlPanel.setLayout(new GridBagLayout());
386
- materialPanel.setLayout(new GridBagLayout());
414
+// treePanel.setLayout(new GridBagLayout());
415
+ //ctrlPanel.setLayout(new GridBagLayout());
416
+ //materialPanel.setLayout(new GridBagLayout());
387417
388418 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
389419 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -422,7 +452,7 @@
422452 static String newline = "\n";
423453 protected static final String buttonString = "JButton";
424454 StyledDocument doc;
425
- JTextArea infoarea;
455
+ JTextPane infoarea;
426456
427457 void ClearInfo()
428458 {
....@@ -471,13 +501,13 @@
471501 //SendInfo("Name:", "bold");
472502 if (sel.GetTextures() != null || debug)
473503 {
474
- si.SendInfo(sel.toString(), "bold");
504
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
475505 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
476506 if (sel.Size() > 0)
477507 {
478508 si.SendInfo("#children = " + sel.Size(), "regular");
479509 }
480
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
510
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
481511 if (debug)
482512 {
483513 try
....@@ -489,7 +519,10 @@
489519 }
490520
491521 if (full)
492
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
522
+ {
523
+ si.SendInfo(" BBox min: " + minima, "regular");
524
+ si.SendInfo(" BBox max: " + maxima, "regular");
525
+ }
493526
494527 if (sel.bRep != null)
495528 {
....@@ -516,7 +549,7 @@
516549 }
517550 if (sel.support != null)
518551 {
519
- si.SendInfo(" support: " + sel.support, "regular");
552
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
520553 }
521554 if (sel.scriptnode != null)
522555 {
....@@ -587,6 +620,9 @@
587620 {
588621 CameraPane.pointflow = (PointFlow) sel;
589622 }
623
+
624
+ si.SendInfo("_____________________", "regular");
625
+ si.SendInfo("", "regular");
590626 }
591627 }
592628
....@@ -618,52 +654,52 @@
618654 cameraView.ToggleFullScreen();
619655 }
620656
621
- private JTextArea createTextPane()
657
+ private JTextPane createTextPane()
622658 {
623
- String[] initString =
624
- {
625
- "This is an editable JTextPane, ", //regular
626
- "another ", //italic
627
- "styled ", //bold
628
- "text ", //small
629
- "component, ", //large
630
- "which supports embedded components..." + newline,//regular
631
- " " + newline, //button
632
- "...and embedded icons..." + newline, //regular
633
- " ", //icon
634
- newline + "JTextPane is a subclass of JEditorPane that "
635
- + "uses a StyledEditorKit and StyledDocument, and provides "
636
- + "cover methods for interacting with those objects."
637
- };
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
+// }
638701
639
- String[] initStyles =
640
- {
641
- "regular", "italic", "bold", "small", "large",
642
- "regular", "button", "regular", "icon",
643
- "regular"
644
- };
645
-
646
- JTextPane textPane = new JTextPane();
647
- textPane.setEditable(true);
648
- /*StyledDocument*/ doc = textPane.getStyledDocument();
649
- addStylesToDocument(doc);
650
-
651
- try
652
- {
653
- for (int j = 0; j < 2; j++)
654
- {
655
- for (int i = 0; i < initString.length; i++)
656
- {
657
- doc.insertString(doc.getLength(), initString[i],
658
- doc.getStyle(initStyles[i]));
659
- }
660
- }
661
- } catch (BadLocationException ble)
662
- {
663
- System.err.println("Couldn't insert initial text into text pane.");
664
- }
665
-
666
- return new JTextArea(); // textPane;
702
+ return new JTextPane(); // textPane;
667703 }
668704
669705 protected void addStylesToDocument(StyledDocument doc)
....@@ -716,7 +752,7 @@
716752 protected static ImageIcon createImageIcon(String path,
717753 String description)
718754 {
719
- java.net.URL imgURL = GrafreeD.class.getResource(path);
755
+ java.net.URL imgURL = Grafreed.class.getResource(path);
720756 if (imgURL != null)
721757 {
722758 return new ImageIcon(imgURL, description);
....@@ -748,6 +784,7 @@
748784 // NumberSlider vDivsField;
749785 // JCheckBox endcaps;
750786 JCheckBox liveCB;
787
+ JCheckBox selectCB;
751788 JCheckBox hideCB;
752789 JCheckBox link2masterCB;
753790 JCheckBox markCB;
....@@ -763,115 +800,83 @@
763800 JButton slowerButton;
764801 JButton fasterButton;
765802 JButton remarkButton;
803
+
804
+ cGridBag namePanel;
805
+ cGridBag setupPanel;
806
+ cGridBag commandsPanel;
807
+ cGridBag pushPanel;
808
+ cGridBag fillPanel;
766809
767
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
810
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
768811 {
769812 JCheckBox cb;
770813
771
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
772
- oe.aConstraints.gridwidth = 1; // 3;
773
-// oe.aConstraints.weightx = 1;
774
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
775
- 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);
776815 cb.addItemListener(this);
777
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
778
- oe.aConstraints.gridwidth = 1;
779
- oe.aConstraints.gridx += 1;
780816
781817 return cb;
782818 }
783819
784
- cButton AddButton(ObjEditor oe, String label)
820
+ cButton AddButton(cGridBag panel, String label)
785821 {
786822 cButton cb;
787823
788
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
789
- oe.aConstraints.gridwidth = 1;
790
-// oe.aConstraints.weightx = 1;
791
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
792
- 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);
793825 cb.addActionListener(this);
794
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
795
- oe.aConstraints.gridwidth = 1;
796
- oe.aConstraints.gridx += 1;
797826
798827 return cb;
799828 }
800829
801
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
830
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
802831 {
803832 JComboBox combo;
804833
805
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
806
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
807
- oe.aConstraints.gridx += 1;
834
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808835 combo.addActionListener(this);
809836
810837 return combo;
811838 }
812839
813
- 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)
814841 {
815
- NumberSlider combo;
842
+ cGridBag control = new cGridBag();
843
+
844
+ cNumberSlider combo;
816845
817846 JLabel jlabel = new JLabel(label);
818
-
819
- aConstraints.fill = GridBagConstraints.VERTICAL;
820847 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
821
- aConstraints.gridwidth = 1;
822
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
823
- aConstraints.gridx += 1;
824
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
825
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
826
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.gridwidth = 1;
829
-
848
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830850 combo.setFloat(current);
831
-
832
- combo.label = jlabel;
833
-
834
- combo.addChangeListener(this);
835
-
836
- return combo;
851
+
852
+ panel.add(control);
853
+
854
+ return control;
837855 }
838856
839
- 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)
840858 {
841
- NumberSlider combo;
859
+ cGridBag control = new cGridBag();
860
+
861
+ cNumberSlider combo;
842862
843863 JLabel jlabel = new JLabel(label);
844
-
845
- aConstraints.fill = GridBagConstraints.VERTICAL;
846864 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
847
- aConstraints.gridwidth = 2;
848
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
- aConstraints.gridx += 1;
850
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
851
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
852
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
853
- aConstraints.gridx += 1;
854
- aConstraints.gridwidth = 1;
855
-
865
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
866
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
856867 combo.setInteger(current);
857868
858
- combo.label = jlabel;
859
-
860
- combo.addChangeListener(this);
861
-
862
- return combo;
869
+ panel.add(control);
870
+
871
+ return control;
863872 }
864873
865
- JTextArea AddText(JPanel ctrlPanel, String name)
874
+ JTextArea AddText(cGridBag ctrlPanel, String name)
866875 {
867876 JTextArea text;
868877
869
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
870
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
871
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
878
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
872879 text.addCaretListener(this);
873
- aConstraints.gridx += 1;
874
- aConstraints.gridwidth = 1;
875880
876881 return text;
877882 }
....@@ -901,9 +906,16 @@
901906 objEditor.ctrlPanel.remove(j);
902907 }
903908
909
+ void Remove(cNumberSlider j)
910
+ {
911
+ j.removeChangeListener(this);
912
+ //objEditor.ctrlPanel.remove(j.label);
913
+ objEditor.ctrlPanel.remove(j);
914
+ }
915
+
904916 /*
905917 */
906
- void Return() // ObjEditor oe)
918
+ void Return0() // ObjEditor oe)
907919 {
908920 aConstraints.gridy += 1;
909921 aConstraints.gridx = 0;
....@@ -958,37 +970,72 @@
958970
959971 void SetupUI2(ObjEditor oe)
960972 {
961
-// oe.aConstraints.weightx = 0;
962
-// oe.aConstraints.weighty = 0;
963
-// oe.aConstraints.gridx = 0;
964
-// oe.aConstraints.gridy = 0;
965
- 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();
966982
967983 if (!GroupEditor.allparams)
968984 return;
969985
970
- liveCB = AddCheckBox(oe, "Live", copy.live);
971
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
972
- 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");
973992 // Return();
974
- markCB = AddCheckBox(oe, "Mark", copy.marked);
975
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
976
- randomCB = AddCheckBox(oe, "Rand", copy.random);
977
- Return();
978
- resetButton = AddButton(oe, "Reset");
979
- 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");
9801021 // resetAllButton = AddButton(oe, "Reset All");
9811022 // stepAllButton = AddButton(oe, "Step All");
982
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9831023 // Return();
984
- slowerButton = AddButton(oe, "Slow");
985
- fasterButton = AddButton(oe, "Fast");
986
- 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");
9871030
988
- Return();
1031
+ oe.ctrlPanel.add(commandsPanel);
1032
+ oe.ctrlPanel.Return();
9891033
990
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
991
- 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();
9921039
9931040 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9941041 // ObjEditor.aConstraints.gridx += 1;
....@@ -1083,7 +1130,7 @@
10831130 oe.aConstraints.gridwidth = 1;
10841131 /**/
10851132 nameField = AddText(oe.ctrlPanel, copy.GetName());
1086
- Return();
1133
+ oe.ctrlPanel.Return();
10871134
10881135 //ctrlPanel.add(textureButton = new Button("Texture..."));
10891136 //textureButton.setEnabled(false);
....@@ -1185,7 +1232,8 @@
11851232 //JPanel worldPanel =
11861233 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11871234 //worldPanel.setName("World");
1188
- centralPanel = new JPanel(new BorderLayout());
1235
+ centralPanel = new cGridBag();
1236
+ centralPanel.preferredWidth = 20;
11891237 timelinePanel = new JPanel(new BorderLayout());
11901238 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11911239
....@@ -1215,12 +1263,13 @@
12151263 //frontView.object = copy;
12161264 //sideView.object = copy;
12171265
1218
- XYZPanel = new JPanel();
1219
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1266
+ XYZPanel = new cGridBag().setVertical(true);
1267
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12201268
1221
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1222
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1223
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1269
+ XYZPanel.preferredWidth = 5;
1270
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1271
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1272
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12241273
12251274 /*
12261275 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1258,10 +1307,11 @@
12581307 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12591308 //tmp.setName("Edit");
12601309 objectPanel.add(materialPanel);
1261
- JPanel north = new JPanel(new BorderLayout());
1262
- north.setName("Edit");
1263
- north.add(ctrlPanel, BorderLayout.NORTH);
1264
- 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);
12651315 objectPanel.add(infoPanel);
12661316
12671317 /*
....@@ -1282,16 +1332,23 @@
12821332 scrollpane.setWheelScrollingEnabled(true);
12831333 scrollpane.addMouseWheelListener(this); // Default not fast enough
12841334
1285
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1286
- scenePanel.add(scrollpane);
1335
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1336
+ scenePanel.preferredWidth = 6;
1337
+
1338
+ JTabbedPane tabbedPane = new JTabbedPane();
1339
+ tabbedPane.add(scrollpane);
12871340
1288
- scenePanel.add(FSPane = new cFileSystemPane(this));
1341
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12891342
1290
- optionsPanel = new JPanel(new GridBagLayout());
1343
+ optionsPanel = new cGridBag().setVertical(true);
12911344
12921345 optionsPanel.setName("Options");
1293
- scenePanel.add(optionsPanel);
1294
-
1346
+
1347
+ AddOptions(optionsPanel); //, aConstraints);
1348
+
1349
+ tabbedPane.add(optionsPanel);
1350
+
1351
+ scenePanel.add(tabbedPane);
12951352
12961353 /*
12971354 cTree jTree = new cTree(null);
....@@ -1325,6 +1382,7 @@
13251382 //bigPanel.setSize(new Dimension(10,10));
13261383 //bigPanel.add(ctrlPanel);
13271384 //bigPanel.add(gridPanel);
1385
+ /**
13281386 bigThree = new JPanel();
13291387 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13301388 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1348,7 +1406,13 @@
13481406 // aConstraints.gridheight = 3;
13491407 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13501408 bigThree.add(XYZPanel, aWindowConstraints);
1409
+ /**/
13511410
1411
+ bigThree = new cGridBag();
1412
+ bigThree.addComponent(scenePanel);
1413
+ bigThree.addComponent(centralPanel);
1414
+ bigThree.addComponent(XYZPanel);
1415
+
13521416 // // SIDE EFFECT!!!
13531417 // aConstraints.gridx = 0;
13541418 // aConstraints.gridy = 0;
....@@ -1369,13 +1433,14 @@
13691433 //worldPane.add(bigPanel);
13701434 //worldPane.add(worldPanel);
13711435 /**/
1372
- frame.getContentPane().add(/*"Center",*/framePanel);
1436
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1437
+ frame.add(/*"Center",*/framePanel);
13731438 //frame.getContentPane().add(/*"Center",*/ worldPane);
13741439
13751440 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13761441
1377
- frame.setSize(1024, 768);
1378
- frame.show();
1442
+ frame.setSize(1280, 860);
1443
+ frame.setVisible(true);
13791444
13801445 gridPanel.setDividerLocation(1.0);
13811446
....@@ -1390,6 +1455,10 @@
13901455 });
13911456 }
13921457
1458
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1459
+ {
1460
+ }
1461
+
13931462 JTree GetTree()
13941463 {
13951464 return objEditor.jTree;
....@@ -1401,260 +1470,173 @@
14011470 ctrlPanel.removeAll();
14021471 }
14031472
1404
- void SetupMaterial(JPanel ctrlPanel)
1473
+ void SetupMaterial(cGridBag panel)
14051474 {
1406
- aConstraints.weighty = 0;
1407
- //aConstraints.weightx = 1;
1408
- /*
1475
+ /*
14091476 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14101477 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1411
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1412
- aConstraints.gridx += 1;
14131478 */
14141479
1415
- aConstraints.gridwidth = 1;
1416
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1417
- aConstraints.gridx += 1;
1418
- aConstraints.weighty = 0;
1419
- 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");
14201484
14211485 /*
14221486 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1423
- aConstraints.gridx += 1;
1424
- aConstraints.weighty = 0;
1425
- aConstraints.gridwidth = 1;
14261487 */
14271488
1428
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1429
- 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
+ }
14301498
1431
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1432
-
1433
- aConstraints.gridx += 1;
1434
-
1435
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1436
-
1437
- aConstraints.gridx += 1;
1438
-
1439
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1440
-
1441
- aConstraints.gridx = 0;
1442
- aConstraints.gridy += 1;
1443
- aConstraints.weighty = 0;
1444
- aConstraints.gridwidth = 1;
1499
+ editBar.preferredHeight = 15;
1500
+
1501
+ panel.add(editBar);
1502
+
14451503 /**/
14461504 //aConstraints.weighty = 0;
14471505 ////aConstraints.weightx = 1;
14481506 //aConstraints.weighty = 1;
14491507 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14501508 //aConstraints.gridx += 1;
1451
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1452
- aConstraints.weighty = 0;
1453
- aConstraints.gridx = 0;
1454
- aConstraints.gridy += 1;
1455
- aConstraints.gridwidth = 1;
1509
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14561510
1457
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1458
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1459
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1460
- aConstraints.gridx += 1;
1461
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1462
- //aConstraints.weightx = 0;
1463
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1464
- aConstraints.gridx = 0;
1465
- aConstraints.gridy += 1;
1466
- 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);
14671519
1468
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1469
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1470
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1471
- aConstraints.gridx += 1;
1472
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1473
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1474
- aConstraints.gridx = 0;
1475
- aConstraints.gridy += 1;
1476
- 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);
14771525
1478
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1479
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1480
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1481
- aConstraints.gridx += 1;
1482
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1483
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1484
- aConstraints.gridx = 0;
1485
- aConstraints.gridy += 1;
1486
- 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);
14871531
1488
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1489
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1490
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1491
- aConstraints.gridx += 1;
1492
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1493
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1494
- aConstraints.gridx = 0;
1495
- aConstraints.gridy += 1;
1496
- 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);
14971537
1498
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1499
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1500
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1501
- aConstraints.gridx += 1;
1502
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1503
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1504
- aConstraints.gridx = 0;
1505
- aConstraints.gridy += 1;
1506
- 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);
15071543
1508
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1509
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1510
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1511
- aConstraints.gridx += 1;
1512
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1513
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1514
- aConstraints.gridx = 0;
1515
- aConstraints.gridy += 1;
1516
- 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);
15171549
1518
- //aConstraints.weighty = 1;
1519
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1520
- //aConstraints.gridx += 1;
1521
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1522
- aConstraints.weighty = 0;
1523
- aConstraints.gridx = 0;
1524
- aConstraints.gridy += 1;
1525
- 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);
15261563
1527
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1528
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1529
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1530
- aConstraints.gridx += 1;
1531
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1532
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1533
- aConstraints.gridx = 0;
1534
- aConstraints.gridy += 1;
1535
- 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);
15361569
1537
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1538
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1539
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1540
- aConstraints.gridx += 1;
1541
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1542
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1543
- aConstraints.gridx = 0;
1544
- aConstraints.gridy += 1;
1545
- 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);
15461575
1547
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1548
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1549
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1550
- aConstraints.gridx += 1;
1551
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1552
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1553
- aConstraints.gridx = 0;
1554
- aConstraints.gridy += 1;
1555
- 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);
15561581
1557
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1558
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1559
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1560
- aConstraints.gridx += 1;
1561
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1562
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1563
- aConstraints.gridx = 0;
1564
- aConstraints.gridy += 1;
1565
- 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);
15661587
1567
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1568
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1569
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1570
- aConstraints.gridx += 1;
1571
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1572
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1573
- aConstraints.gridx = 0;
1574
- aConstraints.gridy += 1;
1575
- 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);
15761593
1577
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1578
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1579
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1580
- aConstraints.gridx += 1;
1581
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1582
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1583
- aConstraints.gridx = 0;
1584
- aConstraints.gridy += 1;
1585
- 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);
15861599
1587
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1588
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1589
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1590
- aConstraints.gridx += 1;
1591
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1592
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1593
- aConstraints.gridx = 0;
1594
- aConstraints.gridy += 1;
1595
- 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);
15961607
1597
- //aConstraints.weighty = 1;
1598
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1599
- //aConstraints.gridx += 1;
1600
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1601
- aConstraints.weighty = 0;
1602
- aConstraints.gridx = 0;
1603
- aConstraints.gridy += 1;
1604
- 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);
16051613
1606
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1607
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1608
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1609
- aConstraints.gridx += 1;
1610
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1611
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1612
- aConstraints.gridx = 0;
1613
- aConstraints.gridy += 1;
1614
- 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);
16151619
1616
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1617
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1618
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1619
- aConstraints.gridx += 1;
1620
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1621
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1622
- aConstraints.gridx = 0;
1623
- aConstraints.gridy += 1;
1624
- 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);
16251625
1626
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1627
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1628
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1629
- aConstraints.gridx += 1;
1630
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1631
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1632
- aConstraints.gridx = 0;
1633
- aConstraints.gridy += 1;
1634
- 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);
16351631
1636
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1637
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1638
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1639
- aConstraints.gridx += 1;
1640
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1641
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1642
- aConstraints.gridx = 0;
1643
- aConstraints.gridy += 1;
1644
- 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);
16451637
1646
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1647
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1648
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1649
- aConstraints.gridx += 1;
1650
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1651
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1652
- aConstraints.gridx = 0;
1653
- aConstraints.gridy += 1;
1654
- aConstraints.gridwidth = 1;
1655
-
1656
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1657
- Return();
1638
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1639
+ //Return();
16581640 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16591641 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16601642 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1665,130 +1647,93 @@
16651647 // aConstraints.gridy += 1;
16661648 // aConstraints.gridwidth = 1;
16671649
1668
- //aConstraints.weighty = 1;
1669
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1670
- //aConstraints.gridx += 1;
1671
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1672
- aConstraints.weighty = 0;
1673
- aConstraints.gridx = 0;
1674
- aConstraints.gridy += 1;
1675
- aConstraints.gridwidth = 1;
16761650
1677
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1678
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1679
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1680
- aConstraints.gridx += 1;
1681
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1682
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1683
- aConstraints.gridx = 0;
1684
- aConstraints.gridy += 1;
1685
- 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);
16861658
1687
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1688
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1689
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1690
- aConstraints.gridx += 1;
1691
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1692
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1693
- aConstraints.gridx = 0;
1694
- aConstraints.gridy += 1;
1695
- 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);
16961664
1697
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1698
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1699
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1700
- aConstraints.gridx += 1;
1701
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1702
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1703
- aConstraints.gridx = 0;
1704
- aConstraints.gridy += 1;
1705
- 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);
17061670
1707
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1708
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1709
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1710
- aConstraints.gridx += 1;
1711
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1712
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1713
- aConstraints.gridx = 0;
1714
- aConstraints.gridy += 1;
1715
- aConstraints.gridwidth = 1;
1716
- 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);
17171676
1718
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1719
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1720
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1721
- aConstraints.gridx += 1;
1722
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1723
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1724
- aConstraints.gridx = 0;
1725
- aConstraints.gridy += 1;
1726
- 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);
17271682
1728
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1729
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1730
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1731
- aConstraints.gridx += 1;
1732
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1733
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1734
- aConstraints.gridx = 0;
1735
- aConstraints.gridy += 1;
1736
- 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);
17371690
1738
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1739
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1740
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1741
- aConstraints.gridx += 1;
1742
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1743
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1744
- aConstraints.gridx = 0;
1745
- aConstraints.gridy += 1;
1746
- 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);
17471696
1748
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1749
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1750
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1751
- aConstraints.gridx += 1;
1752
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1753
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1754
- aConstraints.gridx = 0;
1755
- aConstraints.gridy += 1;
1756
- 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);
17571702
1758
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1759
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1760
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1761
- aConstraints.gridx += 1;
1762
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1763
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1764
- aConstraints.gridx = 0;
1765
- aConstraints.gridy += 1;
1766
- 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);
17671708
1768
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1769
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1770
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1771
- aConstraints.gridx += 1;
1772
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1773
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1774
- aConstraints.gridx = 0;
1775
- aConstraints.gridy += 1;
1776
- 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);
17771714
1778
- //aConstraints.weighty = 1;
1779
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1780
- //aConstraints.gridx += 1;
1781
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1782
- 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);
17831720
1784
- aConstraints.gridx = 0;
1785
- aConstraints.gridy = 0;
1786
- 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);
17871732
17881733 SetMaterial(copy); // .GetMaterial());
17891734
1790
- colorField.addChangeListener(this);
1791
- modulationField.addChangeListener(this);
1735
+ //colorField.addChangeListener(this);
1736
+// modulationField.addChangeListener(this);
17921737 metalnessField.addChangeListener(this);
17931738 diffuseField.addChangeListener(this);
17941739 specularField.addChangeListener(this);
....@@ -1818,12 +1763,15 @@
18181763 opacityPowerField.addChangeListener(this);
18191764 /**/
18201765
1821
- resetSlidersButton.addActionListener(this);
18221766 clearMaterialButton.addActionListener(this);
18231767 createMaterialButton.addActionListener(this);
1824
-
1825
- propagateToggle.addItemListener(this);
1826
- multiplyToggle.addItemListener(this);
1768
+
1769
+ if (Globals.ADVANCED)
1770
+ {
1771
+ resetSlidersButton.addActionListener(this);
1772
+ propagateToggle.addItemListener(this);
1773
+ multiplyToggle.addItemListener(this);
1774
+ }
18271775 }
18281776
18291777 void DropFile(java.io.File[] files, boolean textures)
....@@ -1994,7 +1942,7 @@
19941942
19951943 //? flashIt = false;
19961944 CameraPane pane = (CameraPane) cameraView;
1997
- pane.clickStart(location.x, location.y, 0);
1945
+ pane.clickStart(location.x, location.y, 0, 0);
19981946 pane.clickEnd(location.x, location.y, 0, true);
19991947
20001948 if (group.selection.size() == 1)
....@@ -2451,11 +2399,11 @@
24512399
24522400 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24532401 {
2454
- if (GrafreeD.standAlone)
2402
+ if (Grafreed.standAlone)
24552403 {
24562404 /**/
24572405 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2458
- browser.show();
2406
+ browser.setVisible(true);
24592407 String filename = browser.getFile();
24602408 if (filename != null && filename.length() > 0)
24612409 {
....@@ -2600,6 +2548,7 @@
26002548 }
26012549 if (input == null)
26022550 {
2551
+ new Exception().printStackTrace();
26032552 System.exit(0);
26042553 }
26052554
....@@ -2814,7 +2763,8 @@
28142763 return;
28152764 }
28162765
2817
- multiplyToggle.setSelected(mat.multiply);
2766
+ if (multiplyToggle != null)
2767
+ multiplyToggle.setSelected(mat.multiply);
28182768
28192769 assert (object.projectedVertices != null);
28202770
....@@ -3029,7 +2979,7 @@
30292979 frame.validate();
30302980
30312981 return;
3032
- } else if (event.getSource() == toggleRandomItem)
2982
+ } else if (event.getSource() == toggleSwitchItem)
30332983 {
30342984 cameraView.ToggleRandom();
30352985 cameraView.repaint();
....@@ -3060,6 +3010,10 @@
30603010 {
30613011 copy.live ^= true;
30623012 return;
3013
+ } else if (event.getSource() == selectCB)
3014
+ {
3015
+ copy.dontselect ^= true;
3016
+ return;
30633017 } else if (event.getSource() == hideCB)
30643018 {
30653019 copy.hide ^= true;
....@@ -3074,6 +3028,7 @@
30743028 if (event.getSource() == randomCB)
30753029 {
30763030 copy.random ^= true;
3031
+ objEditor.refreshContents();
30773032 return;
30783033 }
30793034 if (event.getSource() == speedupCB)
....@@ -3136,7 +3091,8 @@
31363091 objEditor.refreshContents();
31373092 } else if (event.getSource() == stepItem)
31383093 {
3139
- cameraView.ONESTEP = true;
3094
+ //cameraView.ONESTEP = true;
3095
+ Globals.ONESTEP = true;
31403096 cameraView.repaint();
31413097 return;
31423098 } else if (event.getSource() == stepButton)
....@@ -3293,25 +3249,25 @@
32933249
32943250 void ToggleAnimation()
32953251 {
3296
- if (!CameraPane.ANIMATION)
3252
+ if (!Globals.ANIMATION)
32973253 {
32983254 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3299
- browser.show();
3255
+ browser.setVisible(true);
33003256 String filename = browser.getFile();
33013257 if (filename != null && filename.length() > 0)
33023258 {
3303
- CameraPane.filename = browser.getDirectory() + filename;
3259
+ Globals.filename = browser.getDirectory() + filename;
33043260 //CameraPane.framecount = 0;
3305
- CameraPane.imagecount = 0;
3261
+ Globals.imagecount = 0;
33063262
3307
- CameraPane.ANIMATION ^= true;
3263
+ Globals.ANIMATION ^= true;
33083264
3309
- GrafreeD.wav.cursor = 0;
3310
- GrafreeD.wav.loop = 0;
3265
+ Grafreed.wav.cursor = 0;
3266
+ Grafreed.wav.loop = 0;
33113267 }
33123268 } else
33133269 {
3314
- CameraPane.ANIMATION ^= true;
3270
+ Globals.ANIMATION ^= true;
33153271 }
33163272 }
33173273
....@@ -3357,7 +3313,7 @@
33573313 void CreateMaterial()
33583314 {
33593315 //copy.ClearMaterial(); // PATCH
3360
- copy.CreateMaterialS(multiplyToggle.isSelected());
3316
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33613317 if (copy.selection.size() > 0)
33623318 //SetMaterial(copy);
33633319 {
....@@ -3416,11 +3372,11 @@
34163372 {
34173373 copy.ResetBlockLoop(); // temporary problem
34183374
3419
- boolean random = CameraPane.RANDOM;
3420
- CameraPane.RANDOM = false; // parse everything
3375
+ boolean random = CameraPane.SWITCH;
3376
+ CameraPane.SWITCH = false; // parse everything
34213377 copy.ResetDisplayList();
34223378 copy.HardTouch();
3423
- CameraPane.RANDOM = random;
3379
+ CameraPane.SWITCH = random;
34243380 }
34253381
34263382 // public void applySelf()
....@@ -3490,10 +3446,40 @@
34903446 current.fakedepth = (float) fakedepthField.getFloat();
34913447 current.shadowbias = (float) shadowbiasField.getFloat();
34923448
3493
- if (!NumberSlider.frozen)
3449
+ if (!cNumberSlider.frozen)
34943450 {
34953451 //System.out.println("Propagate = " + propagate);
34963452 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
+
34973483 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34983484 {
34993485 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3538,6 +3524,7 @@
35383524 || e.getSource() == apertureField
35393525 || e.getSource() == shadowblurField)
35403526 {
3527
+ new Exception().printStackTrace();
35413528 System.exit(0);
35423529 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35433530 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3608,7 +3595,7 @@
36083595 }
36093596
36103597 if (normalpushField != null)
3611
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
3598
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36123599 }
36133600
36143601 void SnapObject()
....@@ -3863,7 +3850,7 @@
38633850
38643851 radioPanel.revalidate();
38653852 radioPanel.repaint();
3866
- ctrlPanel.revalidate(); // ? new
3853
+ ctrlPanel.validate(); // ? new
38673854 ctrlPanel.repaint();
38683855 }
38693856 }
....@@ -4220,7 +4207,7 @@
42204207
42214208 void load() // throws ClassNotFoundException
42224209 {
4223
- if (GrafreeD.standAlone)
4210
+ if (Grafreed.standAlone)
42244211 {
42254212 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42264213 browser.show();
....@@ -4325,7 +4312,7 @@
43254312
43264313 void saveAs()
43274314 {
4328
- if (GrafreeD.standAlone)
4315
+ if (Grafreed.standAlone)
43294316 {
43304317 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43314318 browser.setVisible(true);
....@@ -4436,7 +4423,7 @@
44364423 Object3D objectparent = obj.parent;
44374424 obj.parent = null;
44384425
4439
- Object3D object = (Object3D) GrafreeD.clone(obj);
4426
+ Object3D object = (Object3D) Grafreed.clone(obj);
44404427
44414428 obj.parent = objectparent;
44424429
....@@ -4470,7 +4457,7 @@
44704457 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44714458 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44724459 copy.generatePOV(buffer);
4473
- if (GrafreeD.standAlone)
4460
+ if (Grafreed.standAlone)
44744461 {
44754462 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44764463 browser.show();
....@@ -4509,8 +4496,8 @@
45094496 //MenuItem normalLensItem;
45104497 MenuItem editCameraItem;
45114498 MenuItem revertCameraItem;
4512
- CheckboxMenuItem toggleLiveItem;
45134499 MenuItem stepItem;
4500
+ CheckboxMenuItem toggleLiveItem;
45144501 CheckboxMenuItem toggleFullScreenItem;
45154502 CheckboxMenuItem toggleTimelineItem;
45164503 CheckboxMenuItem toggleRenderItem;
....@@ -4519,7 +4506,7 @@
45194506 CheckboxMenuItem toggleFootContactItem;
45204507 CheckboxMenuItem toggleDLItem;
45214508 CheckboxMenuItem toggleTextureItem;
4522
- CheckboxMenuItem toggleRandomItem;
4509
+ CheckboxMenuItem toggleSwitchItem;
45234510 CheckboxMenuItem toggleRootItem;
45244511 CheckboxMenuItem animationItem;
45254512 CheckboxMenuItem toggleHandleItem;
....@@ -4527,20 +4514,20 @@
45274514 JSplitPane mainPanel;
45284515 JScrollPane scrollpane;
45294516 JPanel toolbarPanel;
4530
- JPanel treePanel;
4517
+ cGridBag treePanel;
45314518 JPanel radioPanel;
45324519 ButtonGroup buttonGroup;
4533
- JPanel ctrlPanel;
4534
- JPanel materialPanel;
4520
+ cGridBag ctrlPanel;
4521
+ cGridBag materialPanel;
45354522 JScrollPane infoPanel;
4536
- JPanel optionsPanel;
4523
+ cGridBag optionsPanel;
45374524 JTabbedPane objectPanel;
4538
- JPanel XYZPanel;
4525
+ cGridBag XYZPanel;
45394526 JSplitPane gridPanel;
45404527 JSplitPane bigPanel;
4541
- JPanel bigThree;
4542
- JTabbedPane scenePanel;
4543
- JPanel centralPanel;
4528
+ cGridBag bigThree;
4529
+ cGridBag scenePanel;
4530
+ cGridBag centralPanel;
45444531 JSplitPane cameraPanel;
45454532 JPanel timelinePanel;
45464533 JMenuBar timelineMenubar;
....@@ -4593,67 +4580,67 @@
45934580 // MATERIAL
45944581 JLabel materialLabel;
45954582 JLabel colorLabel;
4596
- NumberSlider colorField;
4583
+ cNumberSlider colorField;
45974584 JLabel modulationLabel;
4598
- NumberSlider modulationField;
4585
+ cNumberSlider modulationField;
45994586 JLabel metalnessLabel;
4600
- NumberSlider metalnessField;
4587
+ cNumberSlider metalnessField;
46014588 JLabel diffuseLabel;
4602
- NumberSlider diffuseField;
4589
+ cNumberSlider diffuseField;
46034590 JLabel specularLabel;
4604
- NumberSlider specularField;
4591
+ cNumberSlider specularField;
46054592 JLabel shininessLabel;
4606
- NumberSlider shininessField;
4593
+ cNumberSlider shininessField;
46074594 JLabel shiftLabel;
4608
- NumberSlider shiftField;
4595
+ cNumberSlider shiftField;
46094596 JLabel ambientLabel;
4610
- NumberSlider ambientField;
4597
+ cNumberSlider ambientField;
46114598 JLabel lightareaLabel;
4612
- NumberSlider lightareaField;
4599
+ cNumberSlider lightareaField;
46134600 JLabel diffusenessLabel;
4614
- NumberSlider diffusenessField;
4601
+ cNumberSlider diffusenessField;
46154602 JLabel velvetLabel;
4616
- NumberSlider velvetField;
4603
+ cNumberSlider velvetField;
46174604 JLabel sheenLabel;
4618
- NumberSlider sheenField;
4605
+ cNumberSlider sheenField;
46194606 JLabel subsurfaceLabel;
4620
- NumberSlider subsurfaceField;
4607
+ cNumberSlider subsurfaceField;
46214608 //JLabel bumpLabel;
46224609 //NumberSlider bumpField;
46234610 JLabel backlitLabel;
4624
- NumberSlider backlitField;
4611
+ cNumberSlider backlitField;
46254612 JLabel anisoLabel;
4626
- NumberSlider anisoField;
4613
+ cNumberSlider anisoField;
46274614 JLabel anisoVLabel;
4628
- NumberSlider anisoVField;
4615
+ cNumberSlider anisoVField;
46294616 JLabel cameraLabel;
4630
- NumberSlider cameraField;
4617
+ cNumberSlider cameraField;
46314618 JLabel selfshadowLabel;
4632
- NumberSlider selfshadowField;
4619
+ cNumberSlider selfshadowField;
46334620 JLabel shadowLabel;
4634
- NumberSlider shadowField;
4621
+ cNumberSlider shadowField;
46354622 JLabel textureLabel;
4636
- NumberSlider textureField;
4623
+ cNumberSlider textureField;
46374624 JLabel opacityLabel;
4638
- NumberSlider opacityField;
4625
+ cNumberSlider opacityField;
46394626 JLabel fakedepthLabel;
4640
- NumberSlider fakedepthField;
4627
+ cNumberSlider fakedepthField;
46414628 JLabel shadowbiasLabel;
4642
- NumberSlider shadowbiasField;
4629
+ cNumberSlider shadowbiasField;
46434630 JLabel bumpLabel;
4644
- NumberSlider bumpField;
4631
+ cNumberSlider bumpField;
46454632 JLabel noiseLabel;
4646
- NumberSlider noiseField;
4633
+ cNumberSlider noiseField;
46474634 JLabel powerLabel;
4648
- NumberSlider powerField;
4635
+ cNumberSlider powerField;
46494636 JLabel borderfadeLabel;
4650
- NumberSlider borderfadeField;
4637
+ cNumberSlider borderfadeField;
46514638 JLabel fogLabel;
4652
- NumberSlider fogField;
4639
+ cNumberSlider fogField;
46534640 JLabel opacityPowerLabel;
4654
- NumberSlider opacityPowerField;
4641
+ cNumberSlider opacityPowerField;
46554642 JTree jTree;
46564643 //ObjectUI parent;
46574644
4658
- NumberSlider normalpushField;
4645
+ cNumberSlider normalpushField;
46594646 }