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,
....@@ -124,7 +126,7 @@
124126 void keyPressed(int key, int modifiers)
125127 {
126128 System.out.println("KEY PRESSED");
127
- CameraPane.theRenderer.keyPressed(key, modifiers);
129
+ Globals.theRenderer.keyPressed(key, modifiers);
128130 }
129131 */
130132
....@@ -136,34 +138,41 @@
136138 public void closeUI()
137139 {
138140 //new Exception().printStackTrace();
139
- System.out.println("this = " + this);
140
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
141143 //nameField.removeActionListener(this);
142
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
145
+
146
+ objEditor.ctrlPanel.remove(namePanel);
143147
144148 if (!GroupEditor.allparams)
145149 return;
146150
147
- objEditor.ctrlPanel.remove(liveCB);
148
- objEditor.ctrlPanel.remove(hideCB);
149
- objEditor.ctrlPanel.remove(markCB);
150
-
151
- objEditor.ctrlPanel.remove(randomCB);
152
- objEditor.ctrlPanel.remove(speedupCB);
153
- objEditor.ctrlPanel.remove(rewindCB);
154
-
155
- objEditor.ctrlPanel.remove(resetButton);
156
- objEditor.ctrlPanel.remove(stepButton);
157
-// objEditor.ctrlPanel.remove(stepAllButton);
158
-// objEditor.ctrlPanel.remove(resetAllButton);
159
- objEditor.ctrlPanel.remove(link2masterCB);
160
- //objEditor.ctrlPanel.remove(flipVCB);
161
- //objEditor.ctrlPanel.remove(texresMenu);
162
- objEditor.ctrlPanel.remove(slowerButton);
163
- objEditor.ctrlPanel.remove(fasterButton);
164
- 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);
165169
166
- 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);
167176 }
168177
169178 public ObjEditor GetEditor()
....@@ -300,44 +309,61 @@
300309 //normalLensItem.addActionListener(this);
301310 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
302311 revertCameraItem.addActionListener(this);
303
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
304
- toggleTimelineItem.addItemListener(this);
312
+
305313 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
306314 toggleFullScreenItem.addItemListener(this);
307315 toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
308316 cameraMenu.add("-");
317
+
309318 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
310319 toggleTextureItem.addItemListener(this);
311320 toggleTextureItem.setState(CameraPane.textureon);
312
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
313
- toggleLiveItem.addItemListener(this);
314
- toggleLiveItem.setState(Globals.isLIVE());
315
- cameraMenu.add(stepItem = new MenuItem("Step"));
316
- stepItem.addActionListener(this);
317
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
318
-// toggleDLItem.addItemListener(this);
319
-// toggleDLItem.setState(false);
320
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
321
- toggleRenderItem.addItemListener(this);
322
- toggleRenderItem.setState(!CameraPane.frozen);
323
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
324
- toggleDebugItem.addItemListener(this);
325
- toggleDebugItem.setState(CameraPane.DEBUG);
326
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
327
- toggleFrustumItem.addItemListener(this);
328
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
329
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
330
- toggleFootContactItem.addItemListener(this);
331
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
332
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
333
- toggleRandomItem.addItemListener(this);
334
- toggleRandomItem.setState(CameraPane.RANDOM);
321
+
322
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
323
+ toggleSwitchItem.addItemListener(this);
324
+ toggleSwitchItem.setState(CameraPane.SWITCH);
325
+
335326 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
336327 toggleHandleItem.addItemListener(this);
337328 toggleHandleItem.setState(CameraPane.HANDLES);
329
+
338330 cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
339331 togglePaintItem.addItemListener(this);
340332 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
+
341367 // cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
342368 // toggleRootItem.addItemListener(this);
343369 // toggleRootItem.setState(false);
....@@ -351,21 +377,23 @@
351377 objectPanel = new JTabbedPane();
352378 toolbarPanel = new JPanel();
353379 toolbarPanel.setName("Toolbar");
354
- treePanel = new JPanel();
380
+ treePanel = new cGridBag();
355381 treePanel.setName("Tree");
356
- ctrlPanel = new JPanel(); // new GridBagLayout());
382
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
357383 ctrlPanel.setName("Edit");
358
- materialPanel = new JPanel();
384
+ materialPanel = new cGridBag().setVertical(true);
359385 materialPanel.setName("Material");
360386 /*JTextPane*/
361387 infoarea = createTextPane();
388
+ doc = infoarea.getStyledDocument();
389
+
362390 infoarea.setEditable(true);
363391 SetText();
364392 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
365393 // infoarea.setOpaque(false);
366394 // //infoarea.setForeground(textcolor);
367
- infoarea.setLineWrap(true);
368
- infoarea.setWrapStyleWord(true);
395
+// TEXTAREA infoarea.setLineWrap(true);
396
+// TEXTAREA infoarea.setWrapStyleWord(true);
369397 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
370398 infoPanel.setPreferredSize(new Dimension(50, 200));
371399 infoPanel.setName("Info");
....@@ -376,16 +404,16 @@
376404 mainPanel.setName("Main");
377405 mainPanel.setContinuousLayout(true);
378406 mainPanel.setOneTouchExpandable(true);
379
- mainPanel.setDividerLocation(1.0);
380407 mainPanel.setDividerSize(9);
381
- mainPanel.setResizeWeight(0);
408
+ mainPanel.setDividerLocation(0.5); //1.0);
409
+ mainPanel.setResizeWeight(0.5);
382410
383411 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
384412 //mainPanel.setLayout(new GridBagLayout());
385413 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
386
- treePanel.setLayout(new GridBagLayout());
387
- ctrlPanel.setLayout(new GridBagLayout());
388
- materialPanel.setLayout(new GridBagLayout());
414
+// treePanel.setLayout(new GridBagLayout());
415
+ //ctrlPanel.setLayout(new GridBagLayout());
416
+ //materialPanel.setLayout(new GridBagLayout());
389417
390418 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
391419 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -424,7 +452,7 @@
424452 static String newline = "\n";
425453 protected static final String buttonString = "JButton";
426454 StyledDocument doc;
427
- JTextArea infoarea;
455
+ JTextPane infoarea;
428456
429457 void ClearInfo()
430458 {
....@@ -473,13 +501,13 @@
473501 //SendInfo("Name:", "bold");
474502 if (sel.GetTextures() != null || debug)
475503 {
476
- si.SendInfo(sel.toString(), "bold");
504
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
477505 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
478506 if (sel.Size() > 0)
479507 {
480508 si.SendInfo("#children = " + sel.Size(), "regular");
481509 }
482
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
510
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
483511 if (debug)
484512 {
485513 try
....@@ -491,7 +519,10 @@
491519 }
492520
493521 if (full)
494
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
522
+ {
523
+ si.SendInfo(" BBox min: " + minima, "regular");
524
+ si.SendInfo(" BBox max: " + maxima, "regular");
525
+ }
495526
496527 if (sel.bRep != null)
497528 {
....@@ -518,7 +549,7 @@
518549 }
519550 if (sel.support != null)
520551 {
521
- si.SendInfo(" support: " + sel.support, "regular");
552
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
522553 }
523554 if (sel.scriptnode != null)
524555 {
....@@ -589,6 +620,9 @@
589620 {
590621 CameraPane.pointflow = (PointFlow) sel;
591622 }
623
+
624
+ si.SendInfo("_____________________", "regular");
625
+ si.SendInfo("", "regular");
592626 }
593627 }
594628
....@@ -620,52 +654,52 @@
620654 cameraView.ToggleFullScreen();
621655 }
622656
623
- private JTextArea createTextPane()
657
+ private JTextPane createTextPane()
624658 {
625
- String[] initString =
626
- {
627
- "This is an editable JTextPane, ", //regular
628
- "another ", //italic
629
- "styled ", //bold
630
- "text ", //small
631
- "component, ", //large
632
- "which supports embedded components..." + newline,//regular
633
- " " + newline, //button
634
- "...and embedded icons..." + newline, //regular
635
- " ", //icon
636
- newline + "JTextPane is a subclass of JEditorPane that "
637
- + "uses a StyledEditorKit and StyledDocument, and provides "
638
- + "cover methods for interacting with those objects."
639
- };
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
+// }
640701
641
- String[] initStyles =
642
- {
643
- "regular", "italic", "bold", "small", "large",
644
- "regular", "button", "regular", "icon",
645
- "regular"
646
- };
647
-
648
- JTextPane textPane = new JTextPane();
649
- textPane.setEditable(true);
650
- /*StyledDocument*/ doc = textPane.getStyledDocument();
651
- addStylesToDocument(doc);
652
-
653
- try
654
- {
655
- for (int j = 0; j < 2; j++)
656
- {
657
- for (int i = 0; i < initString.length; i++)
658
- {
659
- doc.insertString(doc.getLength(), initString[i],
660
- doc.getStyle(initStyles[i]));
661
- }
662
- }
663
- } catch (BadLocationException ble)
664
- {
665
- System.err.println("Couldn't insert initial text into text pane.");
666
- }
667
-
668
- return new JTextArea(); // textPane;
702
+ return new JTextPane(); // textPane;
669703 }
670704
671705 protected void addStylesToDocument(StyledDocument doc)
....@@ -718,7 +752,7 @@
718752 protected static ImageIcon createImageIcon(String path,
719753 String description)
720754 {
721
- java.net.URL imgURL = GrafreeD.class.getResource(path);
755
+ java.net.URL imgURL = Grafreed.class.getResource(path);
722756 if (imgURL != null)
723757 {
724758 return new ImageIcon(imgURL, description);
....@@ -750,6 +784,7 @@
750784 // NumberSlider vDivsField;
751785 // JCheckBox endcaps;
752786 JCheckBox liveCB;
787
+ JCheckBox selectCB;
753788 JCheckBox hideCB;
754789 JCheckBox link2masterCB;
755790 JCheckBox markCB;
....@@ -765,115 +800,83 @@
765800 JButton slowerButton;
766801 JButton fasterButton;
767802 JButton remarkButton;
803
+
804
+ cGridBag namePanel;
805
+ cGridBag setupPanel;
806
+ cGridBag commandsPanel;
807
+ cGridBag pushPanel;
808
+ cGridBag fillPanel;
768809
769
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
810
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
770811 {
771812 JCheckBox cb;
772813
773
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
774
- oe.aConstraints.gridwidth = 1; // 3;
775
-// oe.aConstraints.weightx = 1;
776
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
777
- 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);
778815 cb.addItemListener(this);
779
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
780
- oe.aConstraints.gridwidth = 1;
781
- oe.aConstraints.gridx += 1;
782816
783817 return cb;
784818 }
785819
786
- cButton AddButton(ObjEditor oe, String label)
820
+ cButton AddButton(cGridBag panel, String label)
787821 {
788822 cButton cb;
789823
790
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
791
- oe.aConstraints.gridwidth = 1;
792
-// oe.aConstraints.weightx = 1;
793
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
794
- 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);
795825 cb.addActionListener(this);
796
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
797
- oe.aConstraints.gridwidth = 1;
798
- oe.aConstraints.gridx += 1;
799826
800827 return cb;
801828 }
802829
803
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
830
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
804831 {
805832 JComboBox combo;
806833
807
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
808
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
809
- oe.aConstraints.gridx += 1;
834
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
810835 combo.addActionListener(this);
811836
812837 return combo;
813838 }
814839
815
- 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)
816841 {
817
- NumberSlider combo;
842
+ cGridBag control = new cGridBag();
843
+
844
+ cNumberSlider combo;
818845
819846 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822847 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
823
- aConstraints.gridwidth = 1;
824
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
825
- aConstraints.gridx += 1;
826
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
827
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
828
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
829
- aConstraints.gridx += 1;
830
- aConstraints.gridwidth = 1;
831
-
848
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832850 combo.setFloat(current);
833
-
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
851
+
852
+ panel.add(control);
853
+
854
+ return control;
839855 }
840856
841
- 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)
842858 {
843
- NumberSlider combo;
859
+ cGridBag control = new cGridBag();
860
+
861
+ cNumberSlider combo;
844862
845863 JLabel jlabel = new JLabel(label);
846
-
847
- aConstraints.fill = GridBagConstraints.VERTICAL;
848864 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
849
- aConstraints.gridwidth = 2;
850
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
851
- aConstraints.gridx += 1;
852
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
853
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
854
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
855
- aConstraints.gridx += 1;
856
- aConstraints.gridwidth = 1;
857
-
865
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
866
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
858867 combo.setInteger(current);
859868
860
- combo.label = jlabel;
861
-
862
- combo.addChangeListener(this);
863
-
864
- return combo;
869
+ panel.add(control);
870
+
871
+ return control;
865872 }
866873
867
- JTextArea AddText(JPanel ctrlPanel, String name)
874
+ JTextArea AddText(cGridBag ctrlPanel, String name)
868875 {
869876 JTextArea text;
870877
871
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
872
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
873
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
878
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
874879 text.addCaretListener(this);
875
- aConstraints.gridx += 1;
876
- aConstraints.gridwidth = 1;
877880
878881 return text;
879882 }
....@@ -903,9 +906,16 @@
903906 objEditor.ctrlPanel.remove(j);
904907 }
905908
909
+ void Remove(cNumberSlider j)
910
+ {
911
+ j.removeChangeListener(this);
912
+ //objEditor.ctrlPanel.remove(j.label);
913
+ objEditor.ctrlPanel.remove(j);
914
+ }
915
+
906916 /*
907917 */
908
- void Return() // ObjEditor oe)
918
+ void Return0() // ObjEditor oe)
909919 {
910920 aConstraints.gridy += 1;
911921 aConstraints.gridx = 0;
....@@ -960,37 +970,72 @@
960970
961971 void SetupUI2(ObjEditor oe)
962972 {
963
-// oe.aConstraints.weightx = 0;
964
-// oe.aConstraints.weighty = 0;
965
-// oe.aConstraints.gridx = 0;
966
-// oe.aConstraints.gridy = 0;
967
- 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();
968982
969983 if (!GroupEditor.allparams)
970984 return;
971985
972
- liveCB = AddCheckBox(oe, "Live", copy.live);
973
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
974
- 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");
975992 // Return();
976
- markCB = AddCheckBox(oe, "Mark", copy.marked);
977
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
978
- randomCB = AddCheckBox(oe, "Rand", copy.random);
979
- Return();
980
- resetButton = AddButton(oe, "Reset");
981
- 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");
9821021 // resetAllButton = AddButton(oe, "Reset All");
9831022 // stepAllButton = AddButton(oe, "Step All");
984
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9851023 // Return();
986
- slowerButton = AddButton(oe, "Slow");
987
- fasterButton = AddButton(oe, "Fast");
988
- 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");
9891030
990
- Return();
1031
+ oe.ctrlPanel.add(commandsPanel);
1032
+ oe.ctrlPanel.Return();
9911033
992
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
993
- 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();
9941039
9951040 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9961041 // ObjEditor.aConstraints.gridx += 1;
....@@ -1085,7 +1130,7 @@
10851130 oe.aConstraints.gridwidth = 1;
10861131 /**/
10871132 nameField = AddText(oe.ctrlPanel, copy.GetName());
1088
- Return();
1133
+ oe.ctrlPanel.Return();
10891134
10901135 //ctrlPanel.add(textureButton = new Button("Texture..."));
10911136 //textureButton.setEnabled(false);
....@@ -1187,7 +1232,8 @@
11871232 //JPanel worldPanel =
11881233 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11891234 //worldPanel.setName("World");
1190
- centralPanel = new JPanel(new BorderLayout());
1235
+ centralPanel = new cGridBag();
1236
+ centralPanel.preferredWidth = 20;
11911237 timelinePanel = new JPanel(new BorderLayout());
11921238 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11931239
....@@ -1217,12 +1263,13 @@
12171263 //frontView.object = copy;
12181264 //sideView.object = copy;
12191265
1220
- XYZPanel = new JPanel();
1221
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1266
+ XYZPanel = new cGridBag().setVertical(true);
1267
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12221268
1223
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1224
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1225
- 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);
12261273
12271274 /*
12281275 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1260,10 +1307,11 @@
12601307 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12611308 //tmp.setName("Edit");
12621309 objectPanel.add(materialPanel);
1263
- JPanel north = new JPanel(new BorderLayout());
1264
- north.setName("Edit");
1265
- north.add(ctrlPanel, BorderLayout.NORTH);
1266
- 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);
12671315 objectPanel.add(infoPanel);
12681316
12691317 /*
....@@ -1284,16 +1332,23 @@
12841332 scrollpane.setWheelScrollingEnabled(true);
12851333 scrollpane.addMouseWheelListener(this); // Default not fast enough
12861334
1287
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1288
- scenePanel.add(scrollpane);
1335
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1336
+ scenePanel.preferredWidth = 6;
1337
+
1338
+ JTabbedPane tabbedPane = new JTabbedPane();
1339
+ tabbedPane.add(scrollpane);
12891340
1290
- scenePanel.add(FSPane = new cFileSystemPane(this));
1341
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12911342
1292
- optionsPanel = new JPanel(new GridBagLayout());
1343
+ optionsPanel = new cGridBag().setVertical(true);
12931344
12941345 optionsPanel.setName("Options");
1295
- scenePanel.add(optionsPanel);
1296
-
1346
+
1347
+ AddOptions(optionsPanel); //, aConstraints);
1348
+
1349
+ tabbedPane.add(optionsPanel);
1350
+
1351
+ scenePanel.add(tabbedPane);
12971352
12981353 /*
12991354 cTree jTree = new cTree(null);
....@@ -1327,6 +1382,7 @@
13271382 //bigPanel.setSize(new Dimension(10,10));
13281383 //bigPanel.add(ctrlPanel);
13291384 //bigPanel.add(gridPanel);
1385
+ /**
13301386 bigThree = new JPanel();
13311387 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13321388 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1350,7 +1406,13 @@
13501406 // aConstraints.gridheight = 3;
13511407 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13521408 bigThree.add(XYZPanel, aWindowConstraints);
1409
+ /**/
13531410
1411
+ bigThree = new cGridBag();
1412
+ bigThree.addComponent(scenePanel);
1413
+ bigThree.addComponent(centralPanel);
1414
+ bigThree.addComponent(XYZPanel);
1415
+
13541416 // // SIDE EFFECT!!!
13551417 // aConstraints.gridx = 0;
13561418 // aConstraints.gridy = 0;
....@@ -1377,8 +1439,8 @@
13771439
13781440 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13791441
1380
- frame.setSize(1024, 768);
1381
- frame.show();
1442
+ frame.setSize(1280, 860);
1443
+ frame.setVisible(true);
13821444
13831445 gridPanel.setDividerLocation(1.0);
13841446
....@@ -1393,6 +1455,10 @@
13931455 });
13941456 }
13951457
1458
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1459
+ {
1460
+ }
1461
+
13961462 JTree GetTree()
13971463 {
13981464 return objEditor.jTree;
....@@ -1404,260 +1470,173 @@
14041470 ctrlPanel.removeAll();
14051471 }
14061472
1407
- void SetupMaterial(JPanel ctrlPanel)
1473
+ void SetupMaterial(cGridBag panel)
14081474 {
1409
- aConstraints.weighty = 0;
1410
- //aConstraints.weightx = 1;
1411
- /*
1475
+ /*
14121476 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14131477 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1414
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1415
- aConstraints.gridx += 1;
14161478 */
14171479
1418
- aConstraints.gridwidth = 1;
1419
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1420
- aConstraints.gridx += 1;
1421
- aConstraints.weighty = 0;
1422
- 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");
14231484
14241485 /*
14251486 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1426
- aConstraints.gridx += 1;
1427
- aConstraints.weighty = 0;
1428
- aConstraints.gridwidth = 1;
14291487 */
14301488
1431
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1432
- 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
+ }
14331498
1434
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1435
-
1436
- aConstraints.gridx += 1;
1437
-
1438
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1439
-
1440
- aConstraints.gridx += 1;
1441
-
1442
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1443
-
1444
- aConstraints.gridx = 0;
1445
- aConstraints.gridy += 1;
1446
- aConstraints.weighty = 0;
1447
- aConstraints.gridwidth = 1;
1499
+ editBar.preferredHeight = 15;
1500
+
1501
+ panel.add(editBar);
1502
+
14481503 /**/
14491504 //aConstraints.weighty = 0;
14501505 ////aConstraints.weightx = 1;
14511506 //aConstraints.weighty = 1;
14521507 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14531508 //aConstraints.gridx += 1;
1454
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1455
- aConstraints.weighty = 0;
1456
- aConstraints.gridx = 0;
1457
- aConstraints.gridy += 1;
1458
- aConstraints.gridwidth = 1;
1509
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14591510
1460
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1461
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1462
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1463
- aConstraints.gridx += 1;
1464
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1465
- //aConstraints.weightx = 0;
1466
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1467
- aConstraints.gridx = 0;
1468
- aConstraints.gridy += 1;
1469
- 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);
14701519
1471
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1472
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1473
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1474
- aConstraints.gridx += 1;
1475
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1476
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1477
- aConstraints.gridx = 0;
1478
- aConstraints.gridy += 1;
1479
- 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);
14801525
1481
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1482
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1483
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1484
- aConstraints.gridx += 1;
1485
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1486
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1487
- aConstraints.gridx = 0;
1488
- aConstraints.gridy += 1;
1489
- 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);
14901531
1491
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1492
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1493
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1494
- aConstraints.gridx += 1;
1495
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1496
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1497
- aConstraints.gridx = 0;
1498
- aConstraints.gridy += 1;
1499
- 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);
15001537
1501
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1502
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1503
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1504
- aConstraints.gridx += 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1506
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1507
- aConstraints.gridx = 0;
1508
- aConstraints.gridy += 1;
1509
- 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);
15101543
1511
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1512
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1513
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1514
- aConstraints.gridx += 1;
1515
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1516
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1517
- aConstraints.gridx = 0;
1518
- aConstraints.gridy += 1;
1519
- 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);
15201549
1521
- //aConstraints.weighty = 1;
1522
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1523
- //aConstraints.gridx += 1;
1524
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1525
- aConstraints.weighty = 0;
1526
- aConstraints.gridx = 0;
1527
- aConstraints.gridy += 1;
1528
- 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);
15291563
1530
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1531
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1533
- aConstraints.gridx += 1;
1534
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1535
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1536
- aConstraints.gridx = 0;
1537
- aConstraints.gridy += 1;
1538
- 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);
15391569
1540
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1541
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1542
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1543
- aConstraints.gridx += 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1545
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1546
- aConstraints.gridx = 0;
1547
- aConstraints.gridy += 1;
1548
- 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);
15491575
1550
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1551
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1552
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1553
- aConstraints.gridx += 1;
1554
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1555
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1556
- aConstraints.gridx = 0;
1557
- aConstraints.gridy += 1;
1558
- 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);
15591581
1560
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1561
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1562
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1563
- aConstraints.gridx += 1;
1564
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1565
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1566
- aConstraints.gridx = 0;
1567
- aConstraints.gridy += 1;
1568
- 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);
15691587
1570
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1571
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1572
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1573
- aConstraints.gridx += 1;
1574
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1575
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1576
- aConstraints.gridx = 0;
1577
- aConstraints.gridy += 1;
1578
- 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);
15791593
1580
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1581
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1583
- aConstraints.gridx += 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1585
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1586
- aConstraints.gridx = 0;
1587
- aConstraints.gridy += 1;
1588
- 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);
15891599
1590
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1591
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1592
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1593
- aConstraints.gridx += 1;
1594
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1595
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1596
- aConstraints.gridx = 0;
1597
- aConstraints.gridy += 1;
1598
- 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);
15991607
1600
- //aConstraints.weighty = 1;
1601
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1602
- //aConstraints.gridx += 1;
1603
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1604
- aConstraints.weighty = 0;
1605
- aConstraints.gridx = 0;
1606
- aConstraints.gridy += 1;
1607
- 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);
16081613
1609
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1610
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1612
- aConstraints.gridx += 1;
1613
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1614
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1615
- aConstraints.gridx = 0;
1616
- aConstraints.gridy += 1;
1617
- 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);
16181619
1619
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1620
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1621
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1622
- aConstraints.gridx += 1;
1623
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1624
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1625
- aConstraints.gridx = 0;
1626
- aConstraints.gridy += 1;
1627
- 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);
16281625
1629
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1630
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1632
- aConstraints.gridx += 1;
1633
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1634
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- 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);
16381631
1639
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1640
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- 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);
16481637
1649
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1650
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1652
- aConstraints.gridx += 1;
1653
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1654
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1655
- aConstraints.gridx = 0;
1656
- aConstraints.gridy += 1;
1657
- aConstraints.gridwidth = 1;
1658
-
1659
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1660
- Return();
1638
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1639
+ //Return();
16611640 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16621641 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16631642 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1668,130 +1647,93 @@
16681647 // aConstraints.gridy += 1;
16691648 // aConstraints.gridwidth = 1;
16701649
1671
- //aConstraints.weighty = 1;
1672
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1673
- //aConstraints.gridx += 1;
1674
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1675
- aConstraints.weighty = 0;
1676
- aConstraints.gridx = 0;
1677
- aConstraints.gridy += 1;
1678
- aConstraints.gridwidth = 1;
16791650
1680
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1681
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- 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);
16891658
1690
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1691
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- 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);
16991664
1700
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1701
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- 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);
17091670
1710
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1711
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1712
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1713
- aConstraints.gridx += 1;
1714
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1715
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1716
- aConstraints.gridx = 0;
1717
- aConstraints.gridy += 1;
1718
- aConstraints.gridwidth = 1;
1719
- 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);
17201676
1721
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1722
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1723
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1724
- aConstraints.gridx += 1;
1725
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1726
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1727
- aConstraints.gridx = 0;
1728
- aConstraints.gridy += 1;
1729
- 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);
17301682
1731
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1732
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1733
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1734
- aConstraints.gridx += 1;
1735
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1736
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1737
- aConstraints.gridx = 0;
1738
- aConstraints.gridy += 1;
1739
- 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);
17401690
1741
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1742
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1743
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1744
- aConstraints.gridx += 1;
1745
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1746
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1747
- aConstraints.gridx = 0;
1748
- aConstraints.gridy += 1;
1749
- 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);
17501696
1751
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1752
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1753
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1754
- aConstraints.gridx += 1;
1755
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1756
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1757
- aConstraints.gridx = 0;
1758
- aConstraints.gridy += 1;
1759
- 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);
17601702
1761
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1762
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1763
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1764
- aConstraints.gridx += 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1766
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1767
- aConstraints.gridx = 0;
1768
- aConstraints.gridy += 1;
1769
- 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);
17701708
1771
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1772
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1773
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1774
- aConstraints.gridx += 1;
1775
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1776
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1777
- aConstraints.gridx = 0;
1778
- aConstraints.gridy += 1;
1779
- 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);
17801714
1781
- //aConstraints.weighty = 1;
1782
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1783
- //aConstraints.gridx += 1;
1784
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1785
- 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);
17861720
1787
- aConstraints.gridx = 0;
1788
- aConstraints.gridy = 0;
1789
- 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);
17901732
17911733 SetMaterial(copy); // .GetMaterial());
17921734
1793
- colorField.addChangeListener(this);
1794
- modulationField.addChangeListener(this);
1735
+ //colorField.addChangeListener(this);
1736
+// modulationField.addChangeListener(this);
17951737 metalnessField.addChangeListener(this);
17961738 diffuseField.addChangeListener(this);
17971739 specularField.addChangeListener(this);
....@@ -1821,12 +1763,15 @@
18211763 opacityPowerField.addChangeListener(this);
18221764 /**/
18231765
1824
- resetSlidersButton.addActionListener(this);
18251766 clearMaterialButton.addActionListener(this);
18261767 createMaterialButton.addActionListener(this);
1827
-
1828
- propagateToggle.addItemListener(this);
1829
- multiplyToggle.addItemListener(this);
1768
+
1769
+ if (Globals.ADVANCED)
1770
+ {
1771
+ resetSlidersButton.addActionListener(this);
1772
+ propagateToggle.addItemListener(this);
1773
+ multiplyToggle.addItemListener(this);
1774
+ }
18301775 }
18311776
18321777 void DropFile(java.io.File[] files, boolean textures)
....@@ -1997,7 +1942,7 @@
19971942
19981943 //? flashIt = false;
19991944 CameraPane pane = (CameraPane) cameraView;
2000
- pane.clickStart(location.x, location.y, 0);
1945
+ pane.clickStart(location.x, location.y, 0, 0);
20011946 pane.clickEnd(location.x, location.y, 0, true);
20021947
20031948 if (group.selection.size() == 1)
....@@ -2454,11 +2399,11 @@
24542399
24552400 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24562401 {
2457
- if (GrafreeD.standAlone)
2402
+ if (Grafreed.standAlone)
24582403 {
24592404 /**/
24602405 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2461
- browser.show();
2406
+ browser.setVisible(true);
24622407 String filename = browser.getFile();
24632408 if (filename != null && filename.length() > 0)
24642409 {
....@@ -2603,6 +2548,7 @@
26032548 }
26042549 if (input == null)
26052550 {
2551
+ new Exception().printStackTrace();
26062552 System.exit(0);
26072553 }
26082554
....@@ -2817,7 +2763,8 @@
28172763 return;
28182764 }
28192765
2820
- multiplyToggle.setSelected(mat.multiply);
2766
+ if (multiplyToggle != null)
2767
+ multiplyToggle.setSelected(mat.multiply);
28212768
28222769 assert (object.projectedVertices != null);
28232770
....@@ -3032,7 +2979,7 @@
30322979 frame.validate();
30332980
30342981 return;
3035
- } else if (event.getSource() == toggleRandomItem)
2982
+ } else if (event.getSource() == toggleSwitchItem)
30362983 {
30372984 cameraView.ToggleRandom();
30382985 cameraView.repaint();
....@@ -3063,6 +3010,10 @@
30633010 {
30643011 copy.live ^= true;
30653012 return;
3013
+ } else if (event.getSource() == selectCB)
3014
+ {
3015
+ copy.dontselect ^= true;
3016
+ return;
30663017 } else if (event.getSource() == hideCB)
30673018 {
30683019 copy.hide ^= true;
....@@ -3077,6 +3028,7 @@
30773028 if (event.getSource() == randomCB)
30783029 {
30793030 copy.random ^= true;
3031
+ objEditor.refreshContents();
30803032 return;
30813033 }
30823034 if (event.getSource() == speedupCB)
....@@ -3300,7 +3252,7 @@
33003252 if (!Globals.ANIMATION)
33013253 {
33023254 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3303
- browser.show();
3255
+ browser.setVisible(true);
33043256 String filename = browser.getFile();
33053257 if (filename != null && filename.length() > 0)
33063258 {
....@@ -3310,8 +3262,8 @@
33103262
33113263 Globals.ANIMATION ^= true;
33123264
3313
- GrafreeD.wav.cursor = 0;
3314
- GrafreeD.wav.loop = 0;
3265
+ Grafreed.wav.cursor = 0;
3266
+ Grafreed.wav.loop = 0;
33153267 }
33163268 } else
33173269 {
....@@ -3361,7 +3313,7 @@
33613313 void CreateMaterial()
33623314 {
33633315 //copy.ClearMaterial(); // PATCH
3364
- copy.CreateMaterialS(multiplyToggle.isSelected());
3316
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33653317 if (copy.selection.size() > 0)
33663318 //SetMaterial(copy);
33673319 {
....@@ -3420,11 +3372,11 @@
34203372 {
34213373 copy.ResetBlockLoop(); // temporary problem
34223374
3423
- boolean random = CameraPane.RANDOM;
3424
- CameraPane.RANDOM = false; // parse everything
3375
+ boolean random = CameraPane.SWITCH;
3376
+ CameraPane.SWITCH = false; // parse everything
34253377 copy.ResetDisplayList();
34263378 copy.HardTouch();
3427
- CameraPane.RANDOM = random;
3379
+ CameraPane.SWITCH = random;
34283380 }
34293381
34303382 // public void applySelf()
....@@ -3494,10 +3446,40 @@
34943446 current.fakedepth = (float) fakedepthField.getFloat();
34953447 current.shadowbias = (float) shadowbiasField.getFloat();
34963448
3497
- if (!NumberSlider.frozen)
3449
+ if (!cNumberSlider.frozen)
34983450 {
34993451 //System.out.println("Propagate = " + propagate);
35003452 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
+
35013483 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
35023484 {
35033485 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3542,6 +3524,7 @@
35423524 || e.getSource() == apertureField
35433525 || e.getSource() == shadowblurField)
35443526 {
3527
+ new Exception().printStackTrace();
35453528 System.exit(0);
35463529 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35473530 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3612,7 +3595,7 @@
36123595 }
36133596
36143597 if (normalpushField != null)
3615
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
3598
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36163599 }
36173600
36183601 void SnapObject()
....@@ -3867,7 +3850,7 @@
38673850
38683851 radioPanel.revalidate();
38693852 radioPanel.repaint();
3870
- ctrlPanel.revalidate(); // ? new
3853
+ ctrlPanel.validate(); // ? new
38713854 ctrlPanel.repaint();
38723855 }
38733856 }
....@@ -4224,7 +4207,7 @@
42244207
42254208 void load() // throws ClassNotFoundException
42264209 {
4227
- if (GrafreeD.standAlone)
4210
+ if (Grafreed.standAlone)
42284211 {
42294212 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42304213 browser.show();
....@@ -4329,7 +4312,7 @@
43294312
43304313 void saveAs()
43314314 {
4332
- if (GrafreeD.standAlone)
4315
+ if (Grafreed.standAlone)
43334316 {
43344317 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43354318 browser.setVisible(true);
....@@ -4440,7 +4423,7 @@
44404423 Object3D objectparent = obj.parent;
44414424 obj.parent = null;
44424425
4443
- Object3D object = (Object3D) GrafreeD.clone(obj);
4426
+ Object3D object = (Object3D) Grafreed.clone(obj);
44444427
44454428 obj.parent = objectparent;
44464429
....@@ -4474,7 +4457,7 @@
44744457 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44754458 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44764459 copy.generatePOV(buffer);
4477
- if (GrafreeD.standAlone)
4460
+ if (Grafreed.standAlone)
44784461 {
44794462 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44804463 browser.show();
....@@ -4513,8 +4496,8 @@
45134496 //MenuItem normalLensItem;
45144497 MenuItem editCameraItem;
45154498 MenuItem revertCameraItem;
4516
- CheckboxMenuItem toggleLiveItem;
45174499 MenuItem stepItem;
4500
+ CheckboxMenuItem toggleLiveItem;
45184501 CheckboxMenuItem toggleFullScreenItem;
45194502 CheckboxMenuItem toggleTimelineItem;
45204503 CheckboxMenuItem toggleRenderItem;
....@@ -4523,7 +4506,7 @@
45234506 CheckboxMenuItem toggleFootContactItem;
45244507 CheckboxMenuItem toggleDLItem;
45254508 CheckboxMenuItem toggleTextureItem;
4526
- CheckboxMenuItem toggleRandomItem;
4509
+ CheckboxMenuItem toggleSwitchItem;
45274510 CheckboxMenuItem toggleRootItem;
45284511 CheckboxMenuItem animationItem;
45294512 CheckboxMenuItem toggleHandleItem;
....@@ -4531,20 +4514,20 @@
45314514 JSplitPane mainPanel;
45324515 JScrollPane scrollpane;
45334516 JPanel toolbarPanel;
4534
- JPanel treePanel;
4517
+ cGridBag treePanel;
45354518 JPanel radioPanel;
45364519 ButtonGroup buttonGroup;
4537
- JPanel ctrlPanel;
4538
- JPanel materialPanel;
4520
+ cGridBag ctrlPanel;
4521
+ cGridBag materialPanel;
45394522 JScrollPane infoPanel;
4540
- JPanel optionsPanel;
4523
+ cGridBag optionsPanel;
45414524 JTabbedPane objectPanel;
4542
- JPanel XYZPanel;
4525
+ cGridBag XYZPanel;
45434526 JSplitPane gridPanel;
45444527 JSplitPane bigPanel;
4545
- JPanel bigThree;
4546
- JTabbedPane scenePanel;
4547
- JPanel centralPanel;
4528
+ cGridBag bigThree;
4529
+ cGridBag scenePanel;
4530
+ cGridBag centralPanel;
45484531 JSplitPane cameraPanel;
45494532 JPanel timelinePanel;
45504533 JMenuBar timelineMenubar;
....@@ -4597,67 +4580,67 @@
45974580 // MATERIAL
45984581 JLabel materialLabel;
45994582 JLabel colorLabel;
4600
- NumberSlider colorField;
4583
+ cNumberSlider colorField;
46014584 JLabel modulationLabel;
4602
- NumberSlider modulationField;
4585
+ cNumberSlider modulationField;
46034586 JLabel metalnessLabel;
4604
- NumberSlider metalnessField;
4587
+ cNumberSlider metalnessField;
46054588 JLabel diffuseLabel;
4606
- NumberSlider diffuseField;
4589
+ cNumberSlider diffuseField;
46074590 JLabel specularLabel;
4608
- NumberSlider specularField;
4591
+ cNumberSlider specularField;
46094592 JLabel shininessLabel;
4610
- NumberSlider shininessField;
4593
+ cNumberSlider shininessField;
46114594 JLabel shiftLabel;
4612
- NumberSlider shiftField;
4595
+ cNumberSlider shiftField;
46134596 JLabel ambientLabel;
4614
- NumberSlider ambientField;
4597
+ cNumberSlider ambientField;
46154598 JLabel lightareaLabel;
4616
- NumberSlider lightareaField;
4599
+ cNumberSlider lightareaField;
46174600 JLabel diffusenessLabel;
4618
- NumberSlider diffusenessField;
4601
+ cNumberSlider diffusenessField;
46194602 JLabel velvetLabel;
4620
- NumberSlider velvetField;
4603
+ cNumberSlider velvetField;
46214604 JLabel sheenLabel;
4622
- NumberSlider sheenField;
4605
+ cNumberSlider sheenField;
46234606 JLabel subsurfaceLabel;
4624
- NumberSlider subsurfaceField;
4607
+ cNumberSlider subsurfaceField;
46254608 //JLabel bumpLabel;
46264609 //NumberSlider bumpField;
46274610 JLabel backlitLabel;
4628
- NumberSlider backlitField;
4611
+ cNumberSlider backlitField;
46294612 JLabel anisoLabel;
4630
- NumberSlider anisoField;
4613
+ cNumberSlider anisoField;
46314614 JLabel anisoVLabel;
4632
- NumberSlider anisoVField;
4615
+ cNumberSlider anisoVField;
46334616 JLabel cameraLabel;
4634
- NumberSlider cameraField;
4617
+ cNumberSlider cameraField;
46354618 JLabel selfshadowLabel;
4636
- NumberSlider selfshadowField;
4619
+ cNumberSlider selfshadowField;
46374620 JLabel shadowLabel;
4638
- NumberSlider shadowField;
4621
+ cNumberSlider shadowField;
46394622 JLabel textureLabel;
4640
- NumberSlider textureField;
4623
+ cNumberSlider textureField;
46414624 JLabel opacityLabel;
4642
- NumberSlider opacityField;
4625
+ cNumberSlider opacityField;
46434626 JLabel fakedepthLabel;
4644
- NumberSlider fakedepthField;
4627
+ cNumberSlider fakedepthField;
46454628 JLabel shadowbiasLabel;
4646
- NumberSlider shadowbiasField;
4629
+ cNumberSlider shadowbiasField;
46474630 JLabel bumpLabel;
4648
- NumberSlider bumpField;
4631
+ cNumberSlider bumpField;
46494632 JLabel noiseLabel;
4650
- NumberSlider noiseField;
4633
+ cNumberSlider noiseField;
46514634 JLabel powerLabel;
4652
- NumberSlider powerField;
4635
+ cNumberSlider powerField;
46534636 JLabel borderfadeLabel;
4654
- NumberSlider borderfadeField;
4637
+ cNumberSlider borderfadeField;
46554638 JLabel fogLabel;
4656
- NumberSlider fogField;
4639
+ cNumberSlider fogField;
46574640 JLabel opacityPowerLabel;
4658
- NumberSlider opacityPowerField;
4641
+ cNumberSlider opacityPowerField;
46594642 JTree jTree;
46604643 //ObjectUI parent;
46614644
4662
- NumberSlider normalpushField;
4645
+ cNumberSlider normalpushField;
46634646 }