Normand Briere
2019-05-13 f924d3e00db476c06f55f3d5aaef307e17575340
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);
....@@ -763,115 +799,83 @@
763799 JButton slowerButton;
764800 JButton fasterButton;
765801 JButton remarkButton;
802
+
803
+ cGridBag namePanel;
804
+ cGridBag setupPanel;
805
+ cGridBag commandsPanel;
806
+ cGridBag pushPanel;
807
+ cGridBag fillPanel;
766808
767
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
809
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
768810 {
769811 JCheckBox cb;
770812
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);
813
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
776814 cb.addItemListener(this);
777
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
778
- oe.aConstraints.gridwidth = 1;
779
- oe.aConstraints.gridx += 1;
780815
781816 return cb;
782817 }
783818
784
- cButton AddButton(ObjEditor oe, String label)
819
+ cButton AddButton(cGridBag panel, String label)
785820 {
786821 cButton cb;
787822
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);
823
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
793824 cb.addActionListener(this);
794
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
795
- oe.aConstraints.gridwidth = 1;
796
- oe.aConstraints.gridx += 1;
797825
798826 return cb;
799827 }
800828
801
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
829
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
802830 {
803831 JComboBox combo;
804832
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;
833
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808834 combo.addActionListener(this);
809835
810836 return combo;
811837 }
812838
813
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
839
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
814840 {
815
- NumberSlider combo;
841
+ cGridBag control = new cGridBag();
842
+
843
+ cNumberSlider combo;
816844
817845 JLabel jlabel = new JLabel(label);
818
-
819
- aConstraints.fill = GridBagConstraints.VERTICAL;
820846 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
-
847
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830849 combo.setFloat(current);
831
-
832
- combo.label = jlabel;
833
-
834
- combo.addChangeListener(this);
835
-
836
- return combo;
850
+
851
+ panel.add(control);
852
+
853
+ return control;
837854 }
838855
839
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
856
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
840857 {
841
- NumberSlider combo;
858
+ cGridBag control = new cGridBag();
859
+
860
+ cNumberSlider combo;
842861
843862 JLabel jlabel = new JLabel(label);
844
-
845
- aConstraints.fill = GridBagConstraints.VERTICAL;
846863 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
-
864
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
865
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
856866 combo.setInteger(current);
857867
858
- combo.label = jlabel;
859
-
860
- combo.addChangeListener(this);
861
-
862
- return combo;
868
+ panel.add(control);
869
+
870
+ return control;
863871 }
864872
865
- JTextArea AddText(JPanel ctrlPanel, String name)
873
+ JTextArea AddText(cGridBag ctrlPanel, String name)
866874 {
867875 JTextArea text;
868876
869
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
870
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
871
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
877
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
872878 text.addCaretListener(this);
873
- aConstraints.gridx += 1;
874
- aConstraints.gridwidth = 1;
875879
876880 return text;
877881 }
....@@ -901,9 +905,16 @@
901905 objEditor.ctrlPanel.remove(j);
902906 }
903907
908
+ void Remove(cNumberSlider j)
909
+ {
910
+ j.removeChangeListener(this);
911
+ //objEditor.ctrlPanel.remove(j.label);
912
+ objEditor.ctrlPanel.remove(j);
913
+ }
914
+
904915 /*
905916 */
906
- void Return() // ObjEditor oe)
917
+ void Return0() // ObjEditor oe)
907918 {
908919 aConstraints.gridy += 1;
909920 aConstraints.gridx = 0;
....@@ -958,37 +969,70 @@
958969
959970 void SetupUI2(ObjEditor oe)
960971 {
961
-// oe.aConstraints.weightx = 0;
962
-// oe.aConstraints.weighty = 0;
963
-// oe.aConstraints.gridx = 0;
964
-// oe.aConstraints.gridy = 0;
965
- SetupName(oe);
972
+ //SetupName(oe);
973
+
974
+ namePanel = new cGridBag();
975
+
976
+ nameField = AddText(namePanel, copy.GetName());
977
+ namePanel.add(nameField);
978
+ oe.ctrlPanel.add(namePanel);
979
+
980
+ oe.ctrlPanel.Return();
966981
967982 if (!GroupEditor.allparams)
968983 return;
969984
970
- liveCB = AddCheckBox(oe, "Live", copy.live);
971
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
972
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
985
+ setupPanel = new cGridBag().setVertical(false);
986
+
987
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
988
+ liveCB.setToolTipText("Animate object");
989
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
990
+ hideCB.setToolTipText("Hide object");
973991 // 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");
992
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
993
+ markCB.setToolTipText("Set the animation target transform");
994
+
995
+ rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
996
+ rewindCB.setToolTipText("Rewind animation");
997
+
998
+ randomCB = AddCheckBox(setupPanel, "Random", copy.random);
999
+ randomCB.setToolTipText("Option for switch node");
1000
+
1001
+ if (Globals.ADVANCED)
1002
+ {
1003
+ link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
1004
+ link2masterCB.setToolTipText("Attach to support");
1005
+ speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
1006
+ speedupCB.setToolTipText("Option motion capture");
1007
+ }
1008
+
1009
+ oe.ctrlPanel.add(setupPanel);
1010
+ oe.ctrlPanel.Return();
1011
+
1012
+ commandsPanel = new cGridBag().setVertical(false);
1013
+
1014
+ resetButton = AddButton(commandsPanel, "Reset");
1015
+ resetButton.setToolTipText("Jump to frame zero");
1016
+ stepButton = AddButton(commandsPanel, "Step");
1017
+ stepButton.setToolTipText("Step one frame");
9801018 // resetAllButton = AddButton(oe, "Reset All");
9811019 // stepAllButton = AddButton(oe, "Step All");
982
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9831020 // Return();
984
- slowerButton = AddButton(oe, "Slow");
985
- fasterButton = AddButton(oe, "Fast");
986
- remarkButton = AddButton(oe, "Rem");
1021
+ slowerButton = AddButton(commandsPanel, "Slow");
1022
+ slowerButton.setToolTipText("Decrease animation speed");
1023
+ fasterButton = AddButton(commandsPanel, "Fast");
1024
+ fasterButton.setToolTipText("Increase animation speed");
1025
+ remarkButton = AddButton(commandsPanel, "Remark");
1026
+ remarkButton.setToolTipText("Set the current transform as the target");
9871027
988
- Return();
1028
+ oe.ctrlPanel.add(commandsPanel);
1029
+ oe.ctrlPanel.Return();
9891030
990
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
991
- Return();
1031
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1032
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1033
+ //Return();
1034
+
1035
+ oe.ctrlPanel.Return();
9921036
9931037 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9941038 // ObjEditor.aConstraints.gridx += 1;
....@@ -1083,7 +1127,7 @@
10831127 oe.aConstraints.gridwidth = 1;
10841128 /**/
10851129 nameField = AddText(oe.ctrlPanel, copy.GetName());
1086
- Return();
1130
+ oe.ctrlPanel.Return();
10871131
10881132 //ctrlPanel.add(textureButton = new Button("Texture..."));
10891133 //textureButton.setEnabled(false);
....@@ -1185,10 +1229,18 @@
11851229 //JPanel worldPanel =
11861230 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11871231 //worldPanel.setName("World");
1188
- centralPanel = new JPanel(new BorderLayout());
1232
+ centralPanel = new cGridBag();
1233
+ centralPanel.preferredWidth = 20;
11891234 timelinePanel = new JPanel(new BorderLayout());
11901235 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11911236
1237
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1238
+ cameraPanel.setContinuousLayout(true);
1239
+ cameraPanel.setOneTouchExpandable(true);
1240
+// cameraPanel.setDividerLocation(0.9);
1241
+// cameraPanel.setDividerSize(9);
1242
+ cameraPanel.setResizeWeight(1.0);
1243
+
11921244 centralPanel.add(cameraView);
11931245 //frame.setJMenuBar(timelineMenubar);
11941246 //centralPanel.add(timelinePanel);
....@@ -1208,12 +1260,13 @@
12081260 //frontView.object = copy;
12091261 //sideView.object = copy;
12101262
1211
- XYZPanel = new JPanel();
1212
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1263
+ XYZPanel = new cGridBag().setVertical(true);
1264
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12131265
1214
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1215
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1216
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1266
+ XYZPanel.preferredWidth = 5;
1267
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1268
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1269
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12171270
12181271 /*
12191272 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1251,10 +1304,11 @@
12511304 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12521305 //tmp.setName("Edit");
12531306 objectPanel.add(materialPanel);
1254
- JPanel north = new JPanel(new BorderLayout());
1255
- north.setName("Edit");
1256
- north.add(ctrlPanel, BorderLayout.NORTH);
1257
- objectPanel.add(north);
1307
+// JPanel north = new JPanel(new BorderLayout());
1308
+// north.setName("Edit");
1309
+// north.add(ctrlPanel, BorderLayout.NORTH);
1310
+// objectPanel.add(north);
1311
+ objectPanel.add(ctrlPanel);
12581312 objectPanel.add(infoPanel);
12591313
12601314 /*
....@@ -1275,16 +1329,23 @@
12751329 scrollpane.setWheelScrollingEnabled(true);
12761330 scrollpane.addMouseWheelListener(this); // Default not fast enough
12771331
1278
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1279
- scenePanel.add(scrollpane);
1332
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1333
+ scenePanel.preferredWidth = 6;
1334
+
1335
+ JTabbedPane tabbedPane = new JTabbedPane();
1336
+ tabbedPane.add(scrollpane);
12801337
1281
- scenePanel.add(FSPane = new cFileSystemPane(this));
1338
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12821339
1283
- optionsPanel = new JPanel(new GridBagLayout());
1340
+ optionsPanel = new cGridBag().setVertical(true);
12841341
12851342 optionsPanel.setName("Options");
1286
- scenePanel.add(optionsPanel);
1287
-
1343
+
1344
+ AddOptions(optionsPanel); //, aConstraints);
1345
+
1346
+ tabbedPane.add(optionsPanel);
1347
+
1348
+ scenePanel.add(tabbedPane);
12881349
12891350 /*
12901351 cTree jTree = new cTree(null);
....@@ -1318,6 +1379,7 @@
13181379 //bigPanel.setSize(new Dimension(10,10));
13191380 //bigPanel.add(ctrlPanel);
13201381 //bigPanel.add(gridPanel);
1382
+ /**
13211383 bigThree = new JPanel();
13221384 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13231385 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1341,7 +1403,13 @@
13411403 // aConstraints.gridheight = 3;
13421404 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13431405 bigThree.add(XYZPanel, aWindowConstraints);
1406
+ /**/
13441407
1408
+ bigThree = new cGridBag();
1409
+ bigThree.addComponent(scenePanel);
1410
+ bigThree.addComponent(centralPanel);
1411
+ bigThree.addComponent(XYZPanel);
1412
+
13451413 // // SIDE EFFECT!!!
13461414 // aConstraints.gridx = 0;
13471415 // aConstraints.gridy = 0;
....@@ -1362,13 +1430,14 @@
13621430 //worldPane.add(bigPanel);
13631431 //worldPane.add(worldPanel);
13641432 /**/
1365
- frame.getContentPane().add(/*"Center",*/framePanel);
1433
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1434
+ frame.add(/*"Center",*/framePanel);
13661435 //frame.getContentPane().add(/*"Center",*/ worldPane);
13671436
13681437 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13691438
1370
- frame.setSize(1024, 768);
1371
- frame.show();
1439
+ frame.setSize(1280, 860);
1440
+ frame.setVisible(true);
13721441
13731442 gridPanel.setDividerLocation(1.0);
13741443
....@@ -1383,6 +1452,10 @@
13831452 });
13841453 }
13851454
1455
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1456
+ {
1457
+ }
1458
+
13861459 JTree GetTree()
13871460 {
13881461 return objEditor.jTree;
....@@ -1394,260 +1467,173 @@
13941467 ctrlPanel.removeAll();
13951468 }
13961469
1397
- void SetupMaterial(JPanel ctrlPanel)
1470
+ void SetupMaterial(cGridBag panel)
13981471 {
1399
- aConstraints.weighty = 0;
1400
- //aConstraints.weightx = 1;
1401
- /*
1472
+ /*
14021473 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14031474 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1404
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1405
- aConstraints.gridx += 1;
14061475 */
14071476
1408
- aConstraints.gridwidth = 1;
1409
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1410
- aConstraints.gridx += 1;
1411
- aConstraints.weighty = 0;
1412
- aConstraints.gridwidth = 1;
1477
+ cGridBag editBar = new cGridBag().setVertical(false);
1478
+
1479
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1480
+ createMaterialButton.setToolTipText("Create material");
14131481
14141482 /*
14151483 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1416
- aConstraints.gridx += 1;
1417
- aConstraints.weighty = 0;
1418
- aConstraints.gridwidth = 1;
14191484 */
14201485
1421
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1422
- aConstraints.gridx += 1;
1486
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1487
+ clearMaterialButton.setToolTipText("Clear material");
1488
+
1489
+ if (Globals.ADVANCED)
1490
+ {
1491
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1492
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1493
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1494
+ }
14231495
1424
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1425
-
1426
- aConstraints.gridx += 1;
1427
-
1428
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1429
-
1430
- aConstraints.gridx += 1;
1431
-
1432
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1433
-
1434
- aConstraints.gridx = 0;
1435
- aConstraints.gridy += 1;
1436
- aConstraints.weighty = 0;
1437
- aConstraints.gridwidth = 1;
1496
+ editBar.preferredHeight = 15;
1497
+
1498
+ panel.add(editBar);
1499
+
14381500 /**/
14391501 //aConstraints.weighty = 0;
14401502 ////aConstraints.weightx = 1;
14411503 //aConstraints.weighty = 1;
14421504 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14431505 //aConstraints.gridx += 1;
1444
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1445
- aConstraints.weighty = 0;
1446
- aConstraints.gridx = 0;
1447
- aConstraints.gridy += 1;
1448
- aConstraints.gridwidth = 1;
1506
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14491507
1450
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1451
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1452
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1453
- aConstraints.gridx += 1;
1454
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1455
- //aConstraints.weightx = 0;
1456
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1457
- aConstraints.gridx = 0;
1458
- aConstraints.gridy += 1;
1459
- aConstraints.gridwidth = 1;
1508
+ cGridBag colorSection = new cGridBag().setVertical(true);
1509
+
1510
+ cGridBag color = new cGridBag();
1511
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1512
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1513
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1514
+ //colorField.preferredWidth = 200;
1515
+ colorSection.add(color);
14601516
1461
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1462
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1463
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1464
- aConstraints.gridx += 1;
1465
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1466
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1467
- aConstraints.gridx = 0;
1468
- aConstraints.gridy += 1;
1469
- aConstraints.gridwidth = 1;
1517
+ cGridBag modulation = new cGridBag();
1518
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1519
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1520
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1521
+ colorSection.add(modulation);
14701522
1471
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1472
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1473
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1474
- aConstraints.gridx += 1;
1475
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1476
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1477
- aConstraints.gridx = 0;
1478
- aConstraints.gridy += 1;
1479
- aConstraints.gridwidth = 1;
1523
+ cGridBag texture = new cGridBag();
1524
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1525
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1526
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1527
+ colorSection.add(texture);
14801528
1481
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1482
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1483
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1484
- aConstraints.gridx += 1;
1485
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1486
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1487
- aConstraints.gridx = 0;
1488
- aConstraints.gridy += 1;
1489
- aConstraints.gridwidth = 1;
1529
+ cGridBag anisoU = new cGridBag();
1530
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1531
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1533
+ colorSection.add(anisoU);
14901534
1491
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1492
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1493
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1494
- aConstraints.gridx += 1;
1495
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1496
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1497
- aConstraints.gridx = 0;
1498
- aConstraints.gridy += 1;
1499
- aConstraints.gridwidth = 1;
1535
+ cGridBag anisoV = new cGridBag();
1536
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1537
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1538
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1539
+ colorSection.add(anisoV);
15001540
1501
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1502
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1503
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1504
- aConstraints.gridx += 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1506
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1507
- aConstraints.gridx = 0;
1508
- aConstraints.gridy += 1;
1509
- aConstraints.gridwidth = 1;
1541
+ cGridBag shadowbias = new cGridBag();
1542
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1543
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1544
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1545
+ colorSection.add(shadowbias);
15101546
1511
- //aConstraints.weighty = 1;
1512
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1513
- //aConstraints.gridx += 1;
1514
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1515
- aConstraints.weighty = 0;
1516
- aConstraints.gridx = 0;
1517
- aConstraints.gridy += 1;
1518
- aConstraints.gridwidth = 1;
1547
+ panel.add(new JSeparator());
1548
+
1549
+ panel.add(colorSection);
1550
+
1551
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1552
+
1553
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1554
+
1555
+ cGridBag diffuse = new cGridBag();
1556
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1557
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1558
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1559
+ diffuseSection.add(diffuse);
15191560
1520
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1521
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1522
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1523
- aConstraints.gridx += 1;
1524
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1525
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1526
- aConstraints.gridx = 0;
1527
- aConstraints.gridy += 1;
1528
- aConstraints.gridwidth = 1;
1561
+ cGridBag diffuseness = new cGridBag();
1562
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1563
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1564
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1565
+ diffuseSection.add(diffuseness);
15291566
1530
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1531
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1533
- aConstraints.gridx += 1;
1534
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1535
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1536
- aConstraints.gridx = 0;
1537
- aConstraints.gridy += 1;
1538
- aConstraints.gridwidth = 1;
1567
+ cGridBag selfshadow = new cGridBag();
1568
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1569
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1570
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1571
+ diffuseSection.add(selfshadow);
15391572
1540
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1541
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1542
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1543
- aConstraints.gridx += 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1545
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1546
- aConstraints.gridx = 0;
1547
- aConstraints.gridy += 1;
1548
- aConstraints.gridwidth = 1;
1573
+ cGridBag sheen = new cGridBag();
1574
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1575
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1576
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1577
+ diffuseSection.add(sheen);
15491578
1550
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1551
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1552
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1553
- aConstraints.gridx += 1;
1554
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1555
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1556
- aConstraints.gridx = 0;
1557
- aConstraints.gridy += 1;
1558
- aConstraints.gridwidth = 1;
1579
+ cGridBag subsurface = new cGridBag();
1580
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1581
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1583
+ diffuseSection.add(subsurface);
15591584
1560
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1561
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1562
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1563
- aConstraints.gridx += 1;
1564
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1565
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1566
- aConstraints.gridx = 0;
1567
- aConstraints.gridy += 1;
1568
- aConstraints.gridwidth = 1;
1585
+ cGridBag shadow = new cGridBag();
1586
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1587
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1588
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1589
+ diffuseSection.add(shadow);
15691590
1570
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1571
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1572
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1573
- aConstraints.gridx += 1;
1574
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1575
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1576
- aConstraints.gridx = 0;
1577
- aConstraints.gridy += 1;
1578
- aConstraints.gridwidth = 1;
1591
+ cGridBag fakedepth = new cGridBag();
1592
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1593
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1595
+ diffuseSection.add(fakedepth);
15791596
1580
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1581
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1583
- aConstraints.gridx += 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1585
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1586
- aConstraints.gridx = 0;
1587
- aConstraints.gridy += 1;
1588
- aConstraints.gridwidth = 1;
1597
+ panel.add(new JSeparator());
1598
+
1599
+ panel.add(diffuseSection);
1600
+
1601
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1602
+
1603
+ cGridBag specularSection = new cGridBag().setVertical(true);
15891604
1590
- //aConstraints.weighty = 1;
1591
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1592
- //aConstraints.gridx += 1;
1593
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1594
- aConstraints.weighty = 0;
1595
- aConstraints.gridx = 0;
1596
- aConstraints.gridy += 1;
1597
- aConstraints.gridwidth = 1;
1605
+ cGridBag specular = new cGridBag();
1606
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1607
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1608
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1609
+ specularSection.add(specular);
15981610
1599
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1600
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1601
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1602
- aConstraints.gridx += 1;
1603
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1604
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1605
- aConstraints.gridx = 0;
1606
- aConstraints.gridy += 1;
1607
- aConstraints.gridwidth = 1;
1611
+ cGridBag lightarea = new cGridBag();
1612
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1613
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1614
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1615
+ specularSection.add(lightarea);
16081616
1609
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1610
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1612
- aConstraints.gridx += 1;
1613
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1614
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1615
- aConstraints.gridx = 0;
1616
- aConstraints.gridy += 1;
1617
- aConstraints.gridwidth = 1;
1617
+ cGridBag shininess = new cGridBag();
1618
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1619
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1620
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1621
+ specularSection.add(shininess);
16181622
1619
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1620
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1621
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1622
- aConstraints.gridx += 1;
1623
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1624
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1625
- aConstraints.gridx = 0;
1626
- aConstraints.gridy += 1;
1627
- aConstraints.gridwidth = 1;
1623
+ cGridBag metalness = new cGridBag();
1624
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1625
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1626
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1627
+ specularSection.add(metalness);
16281628
1629
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1630
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1632
- aConstraints.gridx += 1;
1633
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1634
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
1629
+ cGridBag velvet = new cGridBag();
1630
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1631
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1632
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1633
+ specularSection.add(velvet);
16381634
1639
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1640
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- aConstraints.gridwidth = 1;
1648
-
1649
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1650
- Return();
1635
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1636
+ //Return();
16511637 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16521638 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16531639 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1658,130 +1644,93 @@
16581644 // aConstraints.gridy += 1;
16591645 // aConstraints.gridwidth = 1;
16601646
1661
- //aConstraints.weighty = 1;
1662
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1663
- //aConstraints.gridx += 1;
1664
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1665
- aConstraints.weighty = 0;
1666
- aConstraints.gridx = 0;
1667
- aConstraints.gridy += 1;
1668
- aConstraints.gridwidth = 1;
16691647
1670
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1671
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1672
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1673
- aConstraints.gridx += 1;
1674
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1675
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1676
- aConstraints.gridx = 0;
1677
- aConstraints.gridy += 1;
1678
- aConstraints.gridwidth = 1;
1648
+ panel.add(new JSeparator());
1649
+
1650
+ panel.add(specularSection);
1651
+
1652
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1653
+
1654
+ cGridBag globalSection = new cGridBag().setVertical(true);
16791655
1680
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1681
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- aConstraints.gridwidth = 1;
1656
+ cGridBag camera = new cGridBag();
1657
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1658
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1659
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1660
+ globalSection.add(camera);
16891661
1690
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1691
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- aConstraints.gridwidth = 1;
1662
+ cGridBag ambient = new cGridBag();
1663
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1664
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1665
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1666
+ globalSection.add(ambient);
16991667
1700
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1701
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- aConstraints.gridwidth = 1;
1709
- aConstraints.weighty = 0;
1668
+ cGridBag backlit = new cGridBag();
1669
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1670
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1672
+ globalSection.add(backlit);
17101673
1711
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1712
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1713
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1714
- aConstraints.gridx += 1;
1715
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1716
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1717
- aConstraints.gridx = 0;
1718
- aConstraints.gridy += 1;
1719
- aConstraints.gridwidth = 1;
1674
+ cGridBag opacity = new cGridBag();
1675
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1676
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1678
+ globalSection.add(opacity);
17201679
1721
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1722
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1723
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1724
- aConstraints.gridx += 1;
1725
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1726
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1727
- aConstraints.gridx = 0;
1728
- aConstraints.gridy += 1;
1729
- aConstraints.gridwidth = 1;
1680
+ panel.add(new JSeparator());
1681
+
1682
+ panel.add(globalSection);
1683
+
1684
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1685
+
1686
+ cGridBag textureSection = new cGridBag().setVertical(true);
17301687
1731
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1732
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1733
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1734
- aConstraints.gridx += 1;
1735
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1736
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1737
- aConstraints.gridx = 0;
1738
- aConstraints.gridy += 1;
1739
- aConstraints.gridwidth = 1;
1688
+ cGridBag bump = new cGridBag();
1689
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1690
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1691
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1692
+ textureSection.add(bump);
17401693
1741
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1742
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1743
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1744
- aConstraints.gridx += 1;
1745
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1746
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1747
- aConstraints.gridx = 0;
1748
- aConstraints.gridy += 1;
1749
- aConstraints.gridwidth = 1;
1694
+ cGridBag noise = new cGridBag();
1695
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1696
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1697
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1698
+ textureSection.add(noise);
17501699
1751
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1752
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1753
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1754
- aConstraints.gridx += 1;
1755
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1756
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1757
- aConstraints.gridx = 0;
1758
- aConstraints.gridy += 1;
1759
- aConstraints.gridwidth = 1;
1700
+ cGridBag power = new cGridBag();
1701
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1702
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1703
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1704
+ textureSection.add(power);
17601705
1761
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1762
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1763
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1764
- aConstraints.gridx += 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1766
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1767
- aConstraints.gridx = 0;
1768
- aConstraints.gridy += 1;
1769
- aConstraints.gridwidth = 1;
1706
+ cGridBag borderfade = new cGridBag();
1707
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1708
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1709
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1710
+ textureSection.add(borderfade);
17701711
1771
- //aConstraints.weighty = 1;
1772
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1773
- //aConstraints.gridx += 1;
1774
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1775
- aConstraints.weighty = 0;
1712
+ cGridBag fog = new cGridBag();
1713
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1714
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1715
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1716
+ textureSection.add(fog);
17761717
1777
- aConstraints.gridx = 0;
1778
- aConstraints.gridy = 0;
1779
- aConstraints.gridwidth = 1;
1718
+ cGridBag opacityPower = new cGridBag();
1719
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1720
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1721
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1722
+ textureSection.add(opacityPower);
1723
+
1724
+ panel.add(new JSeparator());
1725
+
1726
+ panel.add(textureSection);
1727
+
1728
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17801729
17811730 SetMaterial(copy); // .GetMaterial());
17821731
1783
- colorField.addChangeListener(this);
1784
- modulationField.addChangeListener(this);
1732
+ //colorField.addChangeListener(this);
1733
+// modulationField.addChangeListener(this);
17851734 metalnessField.addChangeListener(this);
17861735 diffuseField.addChangeListener(this);
17871736 specularField.addChangeListener(this);
....@@ -1811,12 +1760,15 @@
18111760 opacityPowerField.addChangeListener(this);
18121761 /**/
18131762
1814
- resetSlidersButton.addActionListener(this);
18151763 clearMaterialButton.addActionListener(this);
18161764 createMaterialButton.addActionListener(this);
1817
-
1818
- propagateToggle.addItemListener(this);
1819
- multiplyToggle.addItemListener(this);
1765
+
1766
+ if (Globals.ADVANCED)
1767
+ {
1768
+ resetSlidersButton.addActionListener(this);
1769
+ propagateToggle.addItemListener(this);
1770
+ multiplyToggle.addItemListener(this);
1771
+ }
18201772 }
18211773
18221774 void DropFile(java.io.File[] files, boolean textures)
....@@ -1987,7 +1939,7 @@
19871939
19881940 //? flashIt = false;
19891941 CameraPane pane = (CameraPane) cameraView;
1990
- pane.clickStart(location.x, location.y, 0);
1942
+ pane.clickStart(location.x, location.y, 0, 0);
19911943 pane.clickEnd(location.x, location.y, 0, true);
19921944
19931945 if (group.selection.size() == 1)
....@@ -2444,11 +2396,11 @@
24442396
24452397 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24462398 {
2447
- if (GrafreeD.standAlone)
2399
+ if (Grafreed.standAlone)
24482400 {
24492401 /**/
24502402 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2451
- browser.show();
2403
+ browser.setVisible(true);
24522404 String filename = browser.getFile();
24532405 if (filename != null && filename.length() > 0)
24542406 {
....@@ -2593,6 +2545,7 @@
25932545 }
25942546 if (input == null)
25952547 {
2548
+ new Exception().printStackTrace();
25962549 System.exit(0);
25972550 }
25982551
....@@ -2807,7 +2760,8 @@
28072760 return;
28082761 }
28092762
2810
- multiplyToggle.setSelected(mat.multiply);
2763
+ if (multiplyToggle != null)
2764
+ multiplyToggle.setSelected(mat.multiply);
28112765
28122766 assert (object.projectedVertices != null);
28132767
....@@ -2996,7 +2950,8 @@
29962950 if (timeline)
29972951 {
29982952 centralPanel.remove(cameraView);
2999
- centralPanel.add(timelinePanel);
2953
+ cameraPanel.add(cameraView);
2954
+ centralPanel.add(cameraPanel);
30002955 frame.setJMenuBar(timelineMenubar);
30012956 wasFullScreen = CameraPane.FULLSCREEN;
30022957 if (!CameraPane.FULLSCREEN)
....@@ -3005,7 +2960,7 @@
30052960 }
30062961 else
30072962 {
3008
- centralPanel.remove(timelinePanel);
2963
+ centralPanel.remove(cameraPanel);
30092964 centralPanel.add(cameraView);
30102965 frame.setJMenuBar(null);
30112966 if (!wasFullScreen)
....@@ -3021,7 +2976,7 @@
30212976 frame.validate();
30222977
30232978 return;
3024
- } else if (event.getSource() == toggleRandomItem)
2979
+ } else if (event.getSource() == toggleSwitchItem)
30252980 {
30262981 cameraView.ToggleRandom();
30272982 cameraView.repaint();
....@@ -3066,6 +3021,7 @@
30663021 if (event.getSource() == randomCB)
30673022 {
30683023 copy.random ^= true;
3024
+ objEditor.refreshContents();
30693025 return;
30703026 }
30713027 if (event.getSource() == speedupCB)
....@@ -3128,7 +3084,8 @@
31283084 objEditor.refreshContents();
31293085 } else if (event.getSource() == stepItem)
31303086 {
3131
- cameraView.ONESTEP = true;
3087
+ //cameraView.ONESTEP = true;
3088
+ Globals.ONESTEP = true;
31323089 cameraView.repaint();
31333090 return;
31343091 } else if (event.getSource() == stepButton)
....@@ -3285,25 +3242,25 @@
32853242
32863243 void ToggleAnimation()
32873244 {
3288
- if (!CameraPane.ANIMATION)
3245
+ if (!Globals.ANIMATION)
32893246 {
32903247 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3291
- browser.show();
3248
+ browser.setVisible(true);
32923249 String filename = browser.getFile();
32933250 if (filename != null && filename.length() > 0)
32943251 {
3295
- CameraPane.filename = browser.getDirectory() + filename;
3252
+ Globals.filename = browser.getDirectory() + filename;
32963253 //CameraPane.framecount = 0;
3297
- CameraPane.imagecount = 0;
3254
+ Globals.imagecount = 0;
32983255
3299
- CameraPane.ANIMATION ^= true;
3256
+ Globals.ANIMATION ^= true;
33003257
3301
- GrafreeD.wav.cursor = 0;
3302
- GrafreeD.wav.loop = 0;
3258
+ Grafreed.wav.cursor = 0;
3259
+ Grafreed.wav.loop = 0;
33033260 }
33043261 } else
33053262 {
3306
- CameraPane.ANIMATION ^= true;
3263
+ Globals.ANIMATION ^= true;
33073264 }
33083265 }
33093266
....@@ -3349,7 +3306,7 @@
33493306 void CreateMaterial()
33503307 {
33513308 //copy.ClearMaterial(); // PATCH
3352
- copy.CreateMaterialS(multiplyToggle.isSelected());
3309
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33533310 if (copy.selection.size() > 0)
33543311 //SetMaterial(copy);
33553312 {
....@@ -3408,11 +3365,11 @@
34083365 {
34093366 copy.ResetBlockLoop(); // temporary problem
34103367
3411
- boolean random = CameraPane.RANDOM;
3412
- CameraPane.RANDOM = false; // parse everything
3368
+ boolean random = CameraPane.SWITCH;
3369
+ CameraPane.SWITCH = false; // parse everything
34133370 copy.ResetDisplayList();
34143371 copy.HardTouch();
3415
- CameraPane.RANDOM = random;
3372
+ CameraPane.SWITCH = random;
34163373 }
34173374
34183375 // public void applySelf()
....@@ -3482,10 +3439,40 @@
34823439 current.fakedepth = (float) fakedepthField.getFloat();
34833440 current.shadowbias = (float) shadowbiasField.getFloat();
34843441
3485
- if (!NumberSlider.frozen)
3442
+ if (!cNumberSlider.frozen)
34863443 {
34873444 //System.out.println("Propagate = " + propagate);
34883445 copy.UpdateMaterial(anchor, current, propagate);
3446
+
3447
+ if (copy.material != null)
3448
+ {
3449
+ cMaterial mat = copy.material;
3450
+
3451
+ colorField.SetToolTipValue((mat.color));
3452
+ modulationField.SetToolTipValue((mat.modulation));
3453
+ metalnessField.SetToolTipValue((mat.metalness));
3454
+ diffuseField.SetToolTipValue((mat.diffuse));
3455
+ specularField.SetToolTipValue((mat.specular));
3456
+ shininessField.SetToolTipValue((mat.shininess));
3457
+ shiftField.SetToolTipValue((mat.shift));
3458
+ ambientField.SetToolTipValue((mat.ambient));
3459
+ lightareaField.SetToolTipValue((mat.lightarea));
3460
+ diffusenessField.SetToolTipValue((mat.factor));
3461
+ velvetField.SetToolTipValue((mat.velvet));
3462
+ sheenField.SetToolTipValue((mat.sheen));
3463
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3464
+ backlitField.SetToolTipValue((mat.bump));
3465
+ anisoField.SetToolTipValue((mat.aniso));
3466
+ anisoVField.SetToolTipValue((mat.anisoV));
3467
+ cameraField.SetToolTipValue((mat.cameralight));
3468
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3469
+ shadowField.SetToolTipValue((mat.shadow));
3470
+ textureField.SetToolTipValue((mat.texture));
3471
+ opacityField.SetToolTipValue((mat.opacity));
3472
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3473
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3474
+ }
3475
+
34893476 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34903477 {
34913478 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3530,6 +3517,7 @@
35303517 || e.getSource() == apertureField
35313518 || e.getSource() == shadowblurField)
35323519 {
3520
+ new Exception().printStackTrace();
35333521 System.exit(0);
35343522 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35353523 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3855,7 +3843,7 @@
38553843
38563844 radioPanel.revalidate();
38573845 radioPanel.repaint();
3858
- ctrlPanel.revalidate(); // ? new
3846
+ ctrlPanel.validate(); // ? new
38593847 ctrlPanel.repaint();
38603848 }
38613849 }
....@@ -4212,7 +4200,7 @@
42124200
42134201 void load() // throws ClassNotFoundException
42144202 {
4215
- if (GrafreeD.standAlone)
4203
+ if (Grafreed.standAlone)
42164204 {
42174205 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42184206 browser.show();
....@@ -4317,7 +4305,7 @@
43174305
43184306 void saveAs()
43194307 {
4320
- if (GrafreeD.standAlone)
4308
+ if (Grafreed.standAlone)
43214309 {
43224310 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43234311 browser.setVisible(true);
....@@ -4428,7 +4416,7 @@
44284416 Object3D objectparent = obj.parent;
44294417 obj.parent = null;
44304418
4431
- Object3D object = (Object3D) GrafreeD.clone(obj);
4419
+ Object3D object = (Object3D) Grafreed.clone(obj);
44324420
44334421 obj.parent = objectparent;
44344422
....@@ -4462,7 +4450,7 @@
44624450 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44634451 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44644452 copy.generatePOV(buffer);
4465
- if (GrafreeD.standAlone)
4453
+ if (Grafreed.standAlone)
44664454 {
44674455 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44684456 browser.show();
....@@ -4501,8 +4489,8 @@
45014489 //MenuItem normalLensItem;
45024490 MenuItem editCameraItem;
45034491 MenuItem revertCameraItem;
4504
- CheckboxMenuItem toggleLiveItem;
45054492 MenuItem stepItem;
4493
+ CheckboxMenuItem toggleLiveItem;
45064494 CheckboxMenuItem toggleFullScreenItem;
45074495 CheckboxMenuItem toggleTimelineItem;
45084496 CheckboxMenuItem toggleRenderItem;
....@@ -4511,7 +4499,7 @@
45114499 CheckboxMenuItem toggleFootContactItem;
45124500 CheckboxMenuItem toggleDLItem;
45134501 CheckboxMenuItem toggleTextureItem;
4514
- CheckboxMenuItem toggleRandomItem;
4502
+ CheckboxMenuItem toggleSwitchItem;
45154503 CheckboxMenuItem toggleRootItem;
45164504 CheckboxMenuItem animationItem;
45174505 CheckboxMenuItem toggleHandleItem;
....@@ -4519,20 +4507,21 @@
45194507 JSplitPane mainPanel;
45204508 JScrollPane scrollpane;
45214509 JPanel toolbarPanel;
4522
- JPanel treePanel;
4510
+ cGridBag treePanel;
45234511 JPanel radioPanel;
45244512 ButtonGroup buttonGroup;
4525
- JPanel ctrlPanel;
4526
- JPanel materialPanel;
4513
+ cGridBag ctrlPanel;
4514
+ cGridBag materialPanel;
45274515 JScrollPane infoPanel;
4528
- JPanel optionsPanel;
4516
+ cGridBag optionsPanel;
45294517 JTabbedPane objectPanel;
4530
- JPanel XYZPanel;
4518
+ cGridBag XYZPanel;
45314519 JSplitPane gridPanel;
45324520 JSplitPane bigPanel;
4533
- JPanel bigThree;
4534
- JTabbedPane scenePanel;
4535
- JPanel centralPanel;
4521
+ cGridBag bigThree;
4522
+ cGridBag scenePanel;
4523
+ cGridBag centralPanel;
4524
+ JSplitPane cameraPanel;
45364525 JPanel timelinePanel;
45374526 JMenuBar timelineMenubar;
45384527 JSplitPane framePanel;
....@@ -4584,67 +4573,67 @@
45844573 // MATERIAL
45854574 JLabel materialLabel;
45864575 JLabel colorLabel;
4587
- NumberSlider colorField;
4576
+ cNumberSlider colorField;
45884577 JLabel modulationLabel;
4589
- NumberSlider modulationField;
4578
+ cNumberSlider modulationField;
45904579 JLabel metalnessLabel;
4591
- NumberSlider metalnessField;
4580
+ cNumberSlider metalnessField;
45924581 JLabel diffuseLabel;
4593
- NumberSlider diffuseField;
4582
+ cNumberSlider diffuseField;
45944583 JLabel specularLabel;
4595
- NumberSlider specularField;
4584
+ cNumberSlider specularField;
45964585 JLabel shininessLabel;
4597
- NumberSlider shininessField;
4586
+ cNumberSlider shininessField;
45984587 JLabel shiftLabel;
4599
- NumberSlider shiftField;
4588
+ cNumberSlider shiftField;
46004589 JLabel ambientLabel;
4601
- NumberSlider ambientField;
4590
+ cNumberSlider ambientField;
46024591 JLabel lightareaLabel;
4603
- NumberSlider lightareaField;
4592
+ cNumberSlider lightareaField;
46044593 JLabel diffusenessLabel;
4605
- NumberSlider diffusenessField;
4594
+ cNumberSlider diffusenessField;
46064595 JLabel velvetLabel;
4607
- NumberSlider velvetField;
4596
+ cNumberSlider velvetField;
46084597 JLabel sheenLabel;
4609
- NumberSlider sheenField;
4598
+ cNumberSlider sheenField;
46104599 JLabel subsurfaceLabel;
4611
- NumberSlider subsurfaceField;
4600
+ cNumberSlider subsurfaceField;
46124601 //JLabel bumpLabel;
46134602 //NumberSlider bumpField;
46144603 JLabel backlitLabel;
4615
- NumberSlider backlitField;
4604
+ cNumberSlider backlitField;
46164605 JLabel anisoLabel;
4617
- NumberSlider anisoField;
4606
+ cNumberSlider anisoField;
46184607 JLabel anisoVLabel;
4619
- NumberSlider anisoVField;
4608
+ cNumberSlider anisoVField;
46204609 JLabel cameraLabel;
4621
- NumberSlider cameraField;
4610
+ cNumberSlider cameraField;
46224611 JLabel selfshadowLabel;
4623
- NumberSlider selfshadowField;
4612
+ cNumberSlider selfshadowField;
46244613 JLabel shadowLabel;
4625
- NumberSlider shadowField;
4614
+ cNumberSlider shadowField;
46264615 JLabel textureLabel;
4627
- NumberSlider textureField;
4616
+ cNumberSlider textureField;
46284617 JLabel opacityLabel;
4629
- NumberSlider opacityField;
4618
+ cNumberSlider opacityField;
46304619 JLabel fakedepthLabel;
4631
- NumberSlider fakedepthField;
4620
+ cNumberSlider fakedepthField;
46324621 JLabel shadowbiasLabel;
4633
- NumberSlider shadowbiasField;
4622
+ cNumberSlider shadowbiasField;
46344623 JLabel bumpLabel;
4635
- NumberSlider bumpField;
4624
+ cNumberSlider bumpField;
46364625 JLabel noiseLabel;
4637
- NumberSlider noiseField;
4626
+ cNumberSlider noiseField;
46384627 JLabel powerLabel;
4639
- NumberSlider powerField;
4628
+ cNumberSlider powerField;
46404629 JLabel borderfadeLabel;
4641
- NumberSlider borderfadeField;
4630
+ cNumberSlider borderfadeField;
46424631 JLabel fogLabel;
4643
- NumberSlider fogField;
4632
+ cNumberSlider fogField;
46444633 JLabel opacityPowerLabel;
4645
- NumberSlider opacityPowerField;
4634
+ cNumberSlider opacityPowerField;
46464635 JTree jTree;
46474636 //ObjectUI parent;
46484637
4649
- NumberSlider normalpushField;
4638
+ cNumberSlider normalpushField;
46504639 }