Normand Briere
2019-05-05 631719825b865aaf9fa1cb124d9fc5bd9dd78bd4
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,51 +126,61 @@
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);
169
+
170
+ objEditor.ctrlPanel.remove(setupPanel);
171
+ objEditor.ctrlPanel.remove(commandsPanel);
172
+ objEditor.ctrlPanel.remove(pushPanel);
173
+ //objEditor.ctrlPanel.remove(fillPanel);
174
+
175
+ //Remove(normalpushField);
163176 }
164177
165178 public ObjEditor GetEditor()
166179 {
167180 return objEditor; //.GetEditor();
168181 }
182
+
183
+ // Sometimes myself, sometimes my callee's.
169184 ObjEditor objEditor;
170185
171186 /*
....@@ -294,44 +309,61 @@
294309 //normalLensItem.addActionListener(this);
295310 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
296311 revertCameraItem.addActionListener(this);
297
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
298
- toggleTimelineItem.addItemListener(this);
312
+
299313 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
300314 toggleFullScreenItem.addItemListener(this);
301315 toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
302316 cameraMenu.add("-");
317
+
303318 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
304319 toggleTextureItem.addItemListener(this);
305320 toggleTextureItem.setState(CameraPane.textureon);
306
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
307
- toggleLiveItem.addItemListener(this);
308
- toggleLiveItem.setState(CameraPane.isLIVE());
309
- cameraMenu.add(stepItem = new MenuItem("Step"));
310
- stepItem.addActionListener(this);
311
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
312
-// toggleDLItem.addItemListener(this);
313
-// toggleDLItem.setState(false);
314
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
315
- toggleRenderItem.addItemListener(this);
316
- toggleRenderItem.setState(!CameraPane.frozen);
317
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
318
- toggleDebugItem.addItemListener(this);
319
- toggleDebugItem.setState(CameraPane.DEBUG);
320
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
321
- toggleFrustumItem.addItemListener(this);
322
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
323
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
324
- toggleFootContactItem.addItemListener(this);
325
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
326
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
327
- toggleRandomItem.addItemListener(this);
328
- toggleRandomItem.setState(CameraPane.RANDOM);
321
+
322
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
323
+ toggleSwitchItem.addItemListener(this);
324
+ toggleSwitchItem.setState(CameraPane.SWITCH);
325
+
329326 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
330327 toggleHandleItem.addItemListener(this);
331328 toggleHandleItem.setState(CameraPane.HANDLES);
329
+
332330 cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
333331 togglePaintItem.addItemListener(this);
334332 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
+
335367 // cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
336368 // toggleRootItem.addItemListener(this);
337369 // toggleRootItem.setState(false);
....@@ -345,21 +377,23 @@
345377 objectPanel = new JTabbedPane();
346378 toolbarPanel = new JPanel();
347379 toolbarPanel.setName("Toolbar");
348
- treePanel = new JPanel();
380
+ treePanel = new cGridBag();
349381 treePanel.setName("Tree");
350
- ctrlPanel = new JPanel(); // new GridBagLayout());
382
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
351383 ctrlPanel.setName("Edit");
352
- materialPanel = new JPanel();
384
+ materialPanel = new cGridBag().setVertical(true);
353385 materialPanel.setName("Material");
354386 /*JTextPane*/
355387 infoarea = createTextPane();
388
+ doc = infoarea.getStyledDocument();
389
+
356390 infoarea.setEditable(true);
357391 SetText();
358392 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
359393 // infoarea.setOpaque(false);
360394 // //infoarea.setForeground(textcolor);
361
- infoarea.setLineWrap(true);
362
- infoarea.setWrapStyleWord(true);
395
+// TEXTAREA infoarea.setLineWrap(true);
396
+// TEXTAREA infoarea.setWrapStyleWord(true);
363397 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
364398 infoPanel.setPreferredSize(new Dimension(50, 200));
365399 infoPanel.setName("Info");
....@@ -370,16 +404,16 @@
370404 mainPanel.setName("Main");
371405 mainPanel.setContinuousLayout(true);
372406 mainPanel.setOneTouchExpandable(true);
373
- mainPanel.setDividerLocation(1.0);
374407 mainPanel.setDividerSize(9);
375
- mainPanel.setResizeWeight(0);
408
+ mainPanel.setDividerLocation(0.5); //1.0);
409
+ mainPanel.setResizeWeight(0.5);
376410
377411 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
378412 //mainPanel.setLayout(new GridBagLayout());
379413 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
380
- treePanel.setLayout(new GridBagLayout());
381
- ctrlPanel.setLayout(new GridBagLayout());
382
- materialPanel.setLayout(new GridBagLayout());
414
+// treePanel.setLayout(new GridBagLayout());
415
+ //ctrlPanel.setLayout(new GridBagLayout());
416
+ //materialPanel.setLayout(new GridBagLayout());
383417
384418 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
385419 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -418,7 +452,7 @@
418452 static String newline = "\n";
419453 protected static final String buttonString = "JButton";
420454 StyledDocument doc;
421
- JTextArea infoarea;
455
+ JTextPane infoarea;
422456
423457 void ClearInfo()
424458 {
....@@ -485,7 +519,10 @@
485519 }
486520
487521 if (full)
488
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
522
+ {
523
+ si.SendInfo(" BBox min: " + minima, "regular");
524
+ si.SendInfo(" BBox max: " + maxima, "regular");
525
+ }
489526
490527 if (sel.bRep != null)
491528 {
....@@ -583,6 +620,9 @@
583620 {
584621 CameraPane.pointflow = (PointFlow) sel;
585622 }
623
+
624
+ si.SendInfo("_____________________", "regular");
625
+ si.SendInfo("", "regular");
586626 }
587627 }
588628
....@@ -614,52 +654,52 @@
614654 cameraView.ToggleFullScreen();
615655 }
616656
617
- private JTextArea createTextPane()
657
+ private JTextPane createTextPane()
618658 {
619
- String[] initString =
620
- {
621
- "This is an editable JTextPane, ", //regular
622
- "another ", //italic
623
- "styled ", //bold
624
- "text ", //small
625
- "component, ", //large
626
- "which supports embedded components..." + newline,//regular
627
- " " + newline, //button
628
- "...and embedded icons..." + newline, //regular
629
- " ", //icon
630
- newline + "JTextPane is a subclass of JEditorPane that "
631
- + "uses a StyledEditorKit and StyledDocument, and provides "
632
- + "cover methods for interacting with those objects."
633
- };
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
+// }
634701
635
- String[] initStyles =
636
- {
637
- "regular", "italic", "bold", "small", "large",
638
- "regular", "button", "regular", "icon",
639
- "regular"
640
- };
641
-
642
- JTextPane textPane = new JTextPane();
643
- textPane.setEditable(true);
644
- /*StyledDocument*/ doc = textPane.getStyledDocument();
645
- addStylesToDocument(doc);
646
-
647
- try
648
- {
649
- for (int j = 0; j < 2; j++)
650
- {
651
- for (int i = 0; i < initString.length; i++)
652
- {
653
- doc.insertString(doc.getLength(), initString[i],
654
- doc.getStyle(initStyles[i]));
655
- }
656
- }
657
- } catch (BadLocationException ble)
658
- {
659
- System.err.println("Couldn't insert initial text into text pane.");
660
- }
661
-
662
- return new JTextArea(); // textPane;
702
+ return new JTextPane(); // textPane;
663703 }
664704
665705 protected void addStylesToDocument(StyledDocument doc)
....@@ -759,115 +799,83 @@
759799 JButton slowerButton;
760800 JButton fasterButton;
761801 JButton remarkButton;
802
+
803
+ cGridBag namePanel;
804
+ cGridBag setupPanel;
805
+ cGridBag commandsPanel;
806
+ cGridBag pushPanel;
807
+ cGridBag fillPanel;
762808
763
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
809
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
764810 {
765811 JCheckBox cb;
766812
767
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
768
- oe.aConstraints.gridwidth = 1; // 3;
769
-// oe.aConstraints.weightx = 1;
770
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
771
- 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);
772814 cb.addItemListener(this);
773
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
774
- oe.aConstraints.gridwidth = 1;
775
- oe.aConstraints.gridx += 1;
776815
777816 return cb;
778817 }
779818
780
- cButton AddButton(ObjEditor oe, String label)
819
+ cButton AddButton(cGridBag panel, String label)
781820 {
782821 cButton cb;
783822
784
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
785
- oe.aConstraints.gridwidth = 1;
786
-// oe.aConstraints.weightx = 1;
787
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
788
- 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);
789824 cb.addActionListener(this);
790
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
791
- oe.aConstraints.gridwidth = 1;
792
- oe.aConstraints.gridx += 1;
793825
794826 return cb;
795827 }
796828
797
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
829
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
798830 {
799831 JComboBox combo;
800832
801
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
802
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
803
- oe.aConstraints.gridx += 1;
833
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
804834 combo.addActionListener(this);
805835
806836 return combo;
807837 }
808838
809
- 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)
810840 {
811
- NumberSlider combo;
841
+ cGridBag control = new cGridBag();
842
+
843
+ cNumberSlider combo;
812844
813845 JLabel jlabel = new JLabel(label);
814
-
815
- aConstraints.fill = GridBagConstraints.VERTICAL;
816846 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
817
- aConstraints.gridwidth = 2;
818
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
819
- aConstraints.gridx += 1;
820
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
821
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
822
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
823
- aConstraints.gridx += 1;
824
- aConstraints.gridwidth = 1;
825
-
847
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
826849 combo.setFloat(current);
827
-
828
- combo.label = jlabel;
829
-
830
- combo.addChangeListener(this);
831
-
832
- return combo;
850
+
851
+ panel.add(control);
852
+
853
+ return control;
833854 }
834855
835
- 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)
836857 {
837
- NumberSlider combo;
858
+ cGridBag control = new cGridBag();
859
+
860
+ cNumberSlider combo;
838861
839862 JLabel jlabel = new JLabel(label);
840
-
841
- aConstraints.fill = GridBagConstraints.VERTICAL;
842863 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
843
- aConstraints.gridwidth = 2;
844
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
845
- aConstraints.gridx += 1;
846
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
847
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
848
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
851
-
864
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
865
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
852866 combo.setInteger(current);
853867
854
- combo.label = jlabel;
855
-
856
- combo.addChangeListener(this);
857
-
858
- return combo;
868
+ panel.add(control);
869
+
870
+ return control;
859871 }
860872
861
- JTextArea AddText(JPanel ctrlPanel, String name)
873
+ JTextArea AddText(cGridBag ctrlPanel, String name)
862874 {
863875 JTextArea text;
864876
865
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
866
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
867
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
877
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
868878 text.addCaretListener(this);
869
- aConstraints.gridx += 1;
870
- aConstraints.gridwidth = 1;
871879
872880 return text;
873881 }
....@@ -897,9 +905,16 @@
897905 objEditor.ctrlPanel.remove(j);
898906 }
899907
908
+ void Remove(cNumberSlider j)
909
+ {
910
+ j.removeChangeListener(this);
911
+ //objEditor.ctrlPanel.remove(j.label);
912
+ objEditor.ctrlPanel.remove(j);
913
+ }
914
+
900915 /*
901916 */
902
- void Return() // ObjEditor oe)
917
+ void Return0() // ObjEditor oe)
903918 {
904919 aConstraints.gridy += 1;
905920 aConstraints.gridx = 0;
....@@ -954,35 +969,71 @@
954969
955970 void SetupUI2(ObjEditor oe)
956971 {
957
-// oe.aConstraints.weightx = 0;
958
-// oe.aConstraints.weighty = 0;
959
-// oe.aConstraints.gridx = 0;
960
-// oe.aConstraints.gridy = 0;
961
- 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();
962981
963982 if (!GroupEditor.allparams)
964983 return;
965984
966
- liveCB = AddCheckBox(oe, "Live", copy.live);
967
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
968
- 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");
969991 // Return();
970
- markCB = AddCheckBox(oe, "Mark", copy.marked);
971
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
972
- randomCB = AddCheckBox(oe, "Rand", copy.random);
973
- Return();
974
- resetButton = AddButton(oe, "Reset");
975
- 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");
9761018 // resetAllButton = AddButton(oe, "Reset All");
9771019 // stepAllButton = AddButton(oe, "Step All");
978
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9791020 // Return();
980
- slowerButton = AddButton(oe, "Slow");
981
- fasterButton = AddButton(oe, "Fast");
982
- 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");
9831027
984
- Return();
1028
+ oe.ctrlPanel.add(commandsPanel);
1029
+ oe.ctrlPanel.Return();
9851030
1031
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1032
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1033
+ //Return();
1034
+
1035
+ oe.ctrlPanel.Return();
1036
+
9861037 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871038 // ObjEditor.aConstraints.gridx += 1;
9881039
....@@ -1076,7 +1127,7 @@
10761127 oe.aConstraints.gridwidth = 1;
10771128 /**/
10781129 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1130
+ oe.ctrlPanel.Return();
10801131
10811132 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821133 //textureButton.setEnabled(false);
....@@ -1178,10 +1229,18 @@
11781229 //JPanel worldPanel =
11791230 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11801231 //worldPanel.setName("World");
1181
- centralPanel = new JPanel(new BorderLayout());
1232
+ centralPanel = new cGridBag();
1233
+ centralPanel.preferredWidth = 20;
11821234 timelinePanel = new JPanel(new BorderLayout());
11831235 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11841236
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
+
11851244 centralPanel.add(cameraView);
11861245 //frame.setJMenuBar(timelineMenubar);
11871246 //centralPanel.add(timelinePanel);
....@@ -1201,12 +1260,13 @@
12011260 //frontView.object = copy;
12021261 //sideView.object = copy;
12031262
1204
- XYZPanel = new JPanel();
1205
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1263
+ XYZPanel = new cGridBag().setVertical(true);
1264
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12061265
1207
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1208
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1209
- 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);
12101270
12111271 /*
12121272 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1244,10 +1304,11 @@
12441304 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12451305 //tmp.setName("Edit");
12461306 objectPanel.add(materialPanel);
1247
- JPanel north = new JPanel(new BorderLayout());
1248
- north.setName("Edit");
1249
- north.add(ctrlPanel, BorderLayout.NORTH);
1250
- 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);
12511312 objectPanel.add(infoPanel);
12521313
12531314 /*
....@@ -1268,16 +1329,23 @@
12681329 scrollpane.setWheelScrollingEnabled(true);
12691330 scrollpane.addMouseWheelListener(this); // Default not fast enough
12701331
1271
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1272
- scenePanel.add(scrollpane);
1332
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1333
+ scenePanel.preferredWidth = 6;
1334
+
1335
+ JTabbedPane tabbedPane = new JTabbedPane();
1336
+ tabbedPane.add(scrollpane);
12731337
1274
- scenePanel.add(FSPane = new cFileSystemPane(this));
1338
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12751339
1276
- optionsPanel = new JPanel(new GridBagLayout());
1340
+ optionsPanel = new cGridBag().setVertical(true);
12771341
12781342 optionsPanel.setName("Options");
1279
- scenePanel.add(optionsPanel);
1280
-
1343
+
1344
+ AddOptions(optionsPanel); //, aConstraints);
1345
+
1346
+ tabbedPane.add(optionsPanel);
1347
+
1348
+ scenePanel.add(tabbedPane);
12811349
12821350 /*
12831351 cTree jTree = new cTree(null);
....@@ -1311,6 +1379,7 @@
13111379 //bigPanel.setSize(new Dimension(10,10));
13121380 //bigPanel.add(ctrlPanel);
13131381 //bigPanel.add(gridPanel);
1382
+ /**
13141383 bigThree = new JPanel();
13151384 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13161385 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1334,7 +1403,13 @@
13341403 // aConstraints.gridheight = 3;
13351404 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13361405 bigThree.add(XYZPanel, aWindowConstraints);
1406
+ /**/
13371407
1408
+ bigThree = new cGridBag();
1409
+ bigThree.addComponent(scenePanel);
1410
+ bigThree.addComponent(centralPanel);
1411
+ bigThree.addComponent(XYZPanel);
1412
+
13381413 // // SIDE EFFECT!!!
13391414 // aConstraints.gridx = 0;
13401415 // aConstraints.gridy = 0;
....@@ -1355,13 +1430,14 @@
13551430 //worldPane.add(bigPanel);
13561431 //worldPane.add(worldPanel);
13571432 /**/
1358
- frame.getContentPane().add(/*"Center",*/framePanel);
1433
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1434
+ frame.add(/*"Center",*/framePanel);
13591435 //frame.getContentPane().add(/*"Center",*/ worldPane);
13601436
13611437 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13621438
1363
- frame.setSize(1024, 768);
1364
- frame.show();
1439
+ frame.setSize(1280, 860);
1440
+ frame.setVisible(true);
13651441
13661442 gridPanel.setDividerLocation(1.0);
13671443
....@@ -1376,6 +1452,10 @@
13761452 });
13771453 }
13781454
1455
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1456
+ {
1457
+ }
1458
+
13791459 JTree GetTree()
13801460 {
13811461 return objEditor.jTree;
....@@ -1387,260 +1467,173 @@
13871467 ctrlPanel.removeAll();
13881468 }
13891469
1390
- void SetupMaterial(JPanel ctrlPanel)
1470
+ void SetupMaterial(cGridBag panel)
13911471 {
1392
- aConstraints.weighty = 0;
1393
- //aConstraints.weightx = 1;
1394
- /*
1472
+ /*
13951473 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13961474 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1397
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1398
- aConstraints.gridx += 1;
13991475 */
14001476
1401
- aConstraints.gridwidth = 1;
1402
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1403
- aConstraints.gridx += 1;
1404
- aConstraints.weighty = 0;
1405
- 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");
14061481
14071482 /*
14081483 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1409
- aConstraints.gridx += 1;
1410
- aConstraints.weighty = 0;
1411
- aConstraints.gridwidth = 1;
14121484 */
14131485
1414
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1415
- 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
+ }
14161495
1417
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1418
-
1419
- aConstraints.gridx += 1;
1420
-
1421
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1422
-
1423
- aConstraints.gridx += 1;
1424
-
1425
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1426
-
1427
- aConstraints.gridx = 0;
1428
- aConstraints.gridy += 1;
1429
- aConstraints.weighty = 0;
1430
- aConstraints.gridwidth = 1;
1496
+ editBar.preferredHeight = 15;
1497
+
1498
+ panel.add(editBar);
1499
+
14311500 /**/
14321501 //aConstraints.weighty = 0;
14331502 ////aConstraints.weightx = 1;
14341503 //aConstraints.weighty = 1;
14351504 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14361505 //aConstraints.gridx += 1;
1437
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1438
- aConstraints.weighty = 0;
1439
- aConstraints.gridx = 0;
1440
- aConstraints.gridy += 1;
1441
- aConstraints.gridwidth = 1;
1506
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14421507
1443
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1444
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1445
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1446
- aConstraints.gridx += 1;
1447
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1448
- //aConstraints.weightx = 0;
1449
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1450
- aConstraints.gridx = 0;
1451
- aConstraints.gridy += 1;
1452
- 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);
14531516
1454
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1455
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1456
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1457
- aConstraints.gridx += 1;
1458
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1459
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1460
- aConstraints.gridx = 0;
1461
- aConstraints.gridy += 1;
1462
- 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);
14631522
1464
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1465
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1466
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1467
- aConstraints.gridx += 1;
1468
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1469
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1470
- aConstraints.gridx = 0;
1471
- aConstraints.gridy += 1;
1472
- 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);
14731528
1474
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1475
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1476
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1477
- aConstraints.gridx += 1;
1478
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1479
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1480
- aConstraints.gridx = 0;
1481
- aConstraints.gridy += 1;
1482
- 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);
14831534
1484
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1485
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1486
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1487
- aConstraints.gridx += 1;
1488
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1489
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1490
- aConstraints.gridx = 0;
1491
- aConstraints.gridy += 1;
1492
- 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);
14931540
1494
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1495
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1496
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1497
- aConstraints.gridx += 1;
1498
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1499
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1500
- aConstraints.gridx = 0;
1501
- aConstraints.gridy += 1;
1502
- 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);
15031546
1504
- //aConstraints.weighty = 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1506
- //aConstraints.gridx += 1;
1507
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1508
- aConstraints.weighty = 0;
1509
- aConstraints.gridx = 0;
1510
- aConstraints.gridy += 1;
1511
- 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);
15121560
1513
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1514
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1515
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1516
- aConstraints.gridx += 1;
1517
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1518
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1519
- aConstraints.gridx = 0;
1520
- aConstraints.gridy += 1;
1521
- 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);
15221566
1523
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1524
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1525
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1526
- aConstraints.gridx += 1;
1527
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1528
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1529
- aConstraints.gridx = 0;
1530
- aConstraints.gridy += 1;
1531
- 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);
15321572
1533
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1534
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1535
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1536
- aConstraints.gridx += 1;
1537
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1538
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1539
- aConstraints.gridx = 0;
1540
- aConstraints.gridy += 1;
1541
- 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);
15421578
1543
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1544
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1545
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1546
- aConstraints.gridx += 1;
1547
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1548
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1549
- aConstraints.gridx = 0;
1550
- aConstraints.gridy += 1;
1551
- 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);
15521584
1553
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1554
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1555
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1556
- aConstraints.gridx += 1;
1557
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1558
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1559
- aConstraints.gridx = 0;
1560
- aConstraints.gridy += 1;
1561
- 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);
15621590
1563
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1564
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1565
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1566
- aConstraints.gridx += 1;
1567
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1568
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1569
- aConstraints.gridx = 0;
1570
- aConstraints.gridy += 1;
1571
- 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);
15721596
1573
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1574
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1575
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1576
- aConstraints.gridx += 1;
1577
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1578
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1579
- aConstraints.gridx = 0;
1580
- aConstraints.gridy += 1;
1581
- 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);
15821604
1583
- //aConstraints.weighty = 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1585
- //aConstraints.gridx += 1;
1586
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1587
- aConstraints.weighty = 0;
1588
- aConstraints.gridx = 0;
1589
- aConstraints.gridy += 1;
1590
- 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);
15911610
1592
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1593
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1595
- aConstraints.gridx += 1;
1596
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1597
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1598
- aConstraints.gridx = 0;
1599
- aConstraints.gridy += 1;
1600
- 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);
16011616
1602
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1603
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1604
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1605
- aConstraints.gridx += 1;
1606
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1607
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1608
- aConstraints.gridx = 0;
1609
- aConstraints.gridy += 1;
1610
- 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);
16111622
1612
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1613
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1614
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1615
- aConstraints.gridx += 1;
1616
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1617
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1618
- aConstraints.gridx = 0;
1619
- aConstraints.gridy += 1;
1620
- 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);
16211628
1622
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1623
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1624
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1625
- aConstraints.gridx += 1;
1626
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1627
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1628
- aConstraints.gridx = 0;
1629
- aConstraints.gridy += 1;
1630
- 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);
16311634
1632
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1633
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1634
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1635
- aConstraints.gridx += 1;
1636
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1637
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1638
- aConstraints.gridx = 0;
1639
- aConstraints.gridy += 1;
1640
- aConstraints.gridwidth = 1;
1641
-
1642
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1643
- Return();
1635
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1636
+ //Return();
16441637 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16451638 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16461639 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1651,130 +1644,93 @@
16511644 // aConstraints.gridy += 1;
16521645 // aConstraints.gridwidth = 1;
16531646
1654
- //aConstraints.weighty = 1;
1655
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1656
- //aConstraints.gridx += 1;
1657
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1658
- aConstraints.weighty = 0;
1659
- aConstraints.gridx = 0;
1660
- aConstraints.gridy += 1;
1661
- aConstraints.gridwidth = 1;
16621647
1663
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1664
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1665
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1666
- aConstraints.gridx += 1;
1667
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1668
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1669
- aConstraints.gridx = 0;
1670
- aConstraints.gridy += 1;
1671
- 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);
16721655
1673
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1674
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1675
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1676
- aConstraints.gridx += 1;
1677
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1678
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1679
- aConstraints.gridx = 0;
1680
- aConstraints.gridy += 1;
1681
- 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);
16821661
1683
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1684
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1685
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1686
- aConstraints.gridx += 1;
1687
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1688
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1689
- aConstraints.gridx = 0;
1690
- aConstraints.gridy += 1;
1691
- 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);
16921667
1693
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1694
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1695
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1696
- aConstraints.gridx += 1;
1697
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1698
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1699
- aConstraints.gridx = 0;
1700
- aConstraints.gridy += 1;
1701
- aConstraints.gridwidth = 1;
1702
- 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);
17031673
1704
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1705
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1706
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1707
- aConstraints.gridx += 1;
1708
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1709
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1710
- aConstraints.gridx = 0;
1711
- aConstraints.gridy += 1;
1712
- 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);
17131679
1714
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1715
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1716
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1717
- aConstraints.gridx += 1;
1718
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1719
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1720
- aConstraints.gridx = 0;
1721
- aConstraints.gridy += 1;
1722
- 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);
17231687
1724
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1725
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1726
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1727
- aConstraints.gridx += 1;
1728
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1729
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1730
- aConstraints.gridx = 0;
1731
- aConstraints.gridy += 1;
1732
- 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);
17331693
1734
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1735
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1736
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1737
- aConstraints.gridx += 1;
1738
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1739
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1740
- aConstraints.gridx = 0;
1741
- aConstraints.gridy += 1;
1742
- 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);
17431699
1744
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1745
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1746
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1747
- aConstraints.gridx += 1;
1748
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1749
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1750
- aConstraints.gridx = 0;
1751
- aConstraints.gridy += 1;
1752
- 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);
17531705
1754
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1755
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1756
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1757
- aConstraints.gridx += 1;
1758
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1759
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1760
- aConstraints.gridx = 0;
1761
- aConstraints.gridy += 1;
1762
- 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);
17631711
1764
- //aConstraints.weighty = 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1766
- //aConstraints.gridx += 1;
1767
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1768
- 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);
17691717
1770
- aConstraints.gridx = 0;
1771
- aConstraints.gridy = 0;
1772
- 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);
17731729
17741730 SetMaterial(copy); // .GetMaterial());
17751731
1776
- colorField.addChangeListener(this);
1777
- modulationField.addChangeListener(this);
1732
+ //colorField.addChangeListener(this);
1733
+// modulationField.addChangeListener(this);
17781734 metalnessField.addChangeListener(this);
17791735 diffuseField.addChangeListener(this);
17801736 specularField.addChangeListener(this);
....@@ -1804,12 +1760,15 @@
18041760 opacityPowerField.addChangeListener(this);
18051761 /**/
18061762
1807
- resetSlidersButton.addActionListener(this);
18081763 clearMaterialButton.addActionListener(this);
18091764 createMaterialButton.addActionListener(this);
1810
-
1811
- propagateToggle.addItemListener(this);
1812
- multiplyToggle.addItemListener(this);
1765
+
1766
+ if (Globals.ADVANCED)
1767
+ {
1768
+ resetSlidersButton.addActionListener(this);
1769
+ propagateToggle.addItemListener(this);
1770
+ multiplyToggle.addItemListener(this);
1771
+ }
18131772 }
18141773
18151774 void DropFile(java.io.File[] files, boolean textures)
....@@ -1980,7 +1939,7 @@
19801939
19811940 //? flashIt = false;
19821941 CameraPane pane = (CameraPane) cameraView;
1983
- pane.clickStart(location.x, location.y, 0);
1942
+ pane.clickStart(location.x, location.y, 0, 0);
19841943 pane.clickEnd(location.x, location.y, 0, true);
19851944
19861945 if (group.selection.size() == 1)
....@@ -2441,7 +2400,7 @@
24412400 {
24422401 /**/
24432402 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2444
- browser.show();
2403
+ browser.setVisible(true);
24452404 String filename = browser.getFile();
24462405 if (filename != null && filename.length() > 0)
24472406 {
....@@ -2586,6 +2545,7 @@
25862545 }
25872546 if (input == null)
25882547 {
2548
+ new Exception().printStackTrace();
25892549 System.exit(0);
25902550 }
25912551
....@@ -2800,7 +2760,8 @@
28002760 return;
28012761 }
28022762
2803
- multiplyToggle.setSelected(mat.multiply);
2763
+ if (multiplyToggle != null)
2764
+ multiplyToggle.setSelected(mat.multiply);
28042765
28052766 assert (object.projectedVertices != null);
28062767
....@@ -2989,7 +2950,8 @@
29892950 if (timeline)
29902951 {
29912952 centralPanel.remove(cameraView);
2992
- centralPanel.add(timelinePanel);
2953
+ cameraPanel.add(cameraView);
2954
+ centralPanel.add(cameraPanel);
29932955 frame.setJMenuBar(timelineMenubar);
29942956 wasFullScreen = CameraPane.FULLSCREEN;
29952957 if (!CameraPane.FULLSCREEN)
....@@ -2998,7 +2960,7 @@
29982960 }
29992961 else
30002962 {
3001
- centralPanel.remove(timelinePanel);
2963
+ centralPanel.remove(cameraPanel);
30022964 centralPanel.add(cameraView);
30032965 frame.setJMenuBar(null);
30042966 if (!wasFullScreen)
....@@ -3014,7 +2976,7 @@
30142976 frame.validate();
30152977
30162978 return;
3017
- } else if (event.getSource() == toggleRandomItem)
2979
+ } else if (event.getSource() == toggleSwitchItem)
30182980 {
30192981 cameraView.ToggleRandom();
30202982 cameraView.repaint();
....@@ -3059,6 +3021,7 @@
30593021 if (event.getSource() == randomCB)
30603022 {
30613023 copy.random ^= true;
3024
+ objEditor.refreshContents();
30623025 return;
30633026 }
30643027 if (event.getSource() == speedupCB)
....@@ -3121,7 +3084,8 @@
31213084 objEditor.refreshContents();
31223085 } else if (event.getSource() == stepItem)
31233086 {
3124
- cameraView.ONESTEP = true;
3087
+ //cameraView.ONESTEP = true;
3088
+ Globals.ONESTEP = true;
31253089 cameraView.repaint();
31263090 return;
31273091 } else if (event.getSource() == stepButton)
....@@ -3278,25 +3242,25 @@
32783242
32793243 void ToggleAnimation()
32803244 {
3281
- if (!CameraPane.ANIMATION)
3245
+ if (!Globals.ANIMATION)
32823246 {
32833247 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3284
- browser.show();
3248
+ browser.setVisible(true);
32853249 String filename = browser.getFile();
32863250 if (filename != null && filename.length() > 0)
32873251 {
3288
- CameraPane.filename = browser.getDirectory() + filename;
3252
+ Globals.filename = browser.getDirectory() + filename;
32893253 //CameraPane.framecount = 0;
3290
- CameraPane.imagecount = 0;
3254
+ Globals.imagecount = 0;
32913255
3292
- CameraPane.ANIMATION ^= true;
3256
+ Globals.ANIMATION ^= true;
32933257
32943258 GrafreeD.wav.cursor = 0;
32953259 GrafreeD.wav.loop = 0;
32963260 }
32973261 } else
32983262 {
3299
- CameraPane.ANIMATION ^= true;
3263
+ Globals.ANIMATION ^= true;
33003264 }
33013265 }
33023266
....@@ -3342,7 +3306,7 @@
33423306 void CreateMaterial()
33433307 {
33443308 //copy.ClearMaterial(); // PATCH
3345
- copy.CreateMaterialS(multiplyToggle.isSelected());
3309
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33463310 if (copy.selection.size() > 0)
33473311 //SetMaterial(copy);
33483312 {
....@@ -3401,11 +3365,11 @@
34013365 {
34023366 copy.ResetBlockLoop(); // temporary problem
34033367
3404
- boolean random = CameraPane.RANDOM;
3405
- CameraPane.RANDOM = false; // parse everything
3368
+ boolean random = CameraPane.SWITCH;
3369
+ CameraPane.SWITCH = false; // parse everything
34063370 copy.ResetDisplayList();
34073371 copy.HardTouch();
3408
- CameraPane.RANDOM = random;
3372
+ CameraPane.SWITCH = random;
34093373 }
34103374
34113375 // public void applySelf()
....@@ -3475,7 +3439,7 @@
34753439 current.fakedepth = (float) fakedepthField.getFloat();
34763440 current.shadowbias = (float) shadowbiasField.getFloat();
34773441
3478
- if (!NumberSlider.frozen)
3442
+ if (!cNumberSlider.frozen)
34793443 {
34803444 //System.out.println("Propagate = " + propagate);
34813445 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3523,6 +3487,7 @@
35233487 || e.getSource() == apertureField
35243488 || e.getSource() == shadowblurField)
35253489 {
3490
+ new Exception().printStackTrace();
35263491 System.exit(0);
35273492 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35283493 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3549,7 +3514,13 @@
35493514 //System.out.println("PARENT = " + parent);
35503515 //if (parent != null)
35513516 // parent.applySelf();
3552
- refreshContents();
3517
+ if (e.getSource() == normalpushField)
3518
+ {
3519
+ objEditor.refreshContents();
3520
+ //Refresh();
3521
+ }
3522
+ else
3523
+ refreshContents();
35533524 // ??? client.refreshEditWindow();
35543525 }
35553526 //else
....@@ -3561,7 +3532,7 @@
35613532 //group.name = nameField.getText();
35623533 //objEditor.applySelf();
35633534
3564
- assert (objEditor == this);
3535
+ // OCT2018: assert (objEditor == this);
35653536 if (copy.selection == null || copy.selection.size() == 0)
35663537 //super.applySelf()
35673538 ; else
....@@ -3585,6 +3556,9 @@
35853556 objEditor.copy = keep;
35863557 }
35873558 }
3559
+
3560
+ if (normalpushField != null)
3561
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
35883562 }
35893563
35903564 void SnapObject()
....@@ -3839,7 +3813,7 @@
38393813
38403814 radioPanel.revalidate();
38413815 radioPanel.repaint();
3842
- ctrlPanel.revalidate(); // ? new
3816
+ ctrlPanel.validate(); // ? new
38433817 ctrlPanel.repaint();
38443818 }
38453819 }
....@@ -4485,8 +4459,8 @@
44854459 //MenuItem normalLensItem;
44864460 MenuItem editCameraItem;
44874461 MenuItem revertCameraItem;
4488
- CheckboxMenuItem toggleLiveItem;
44894462 MenuItem stepItem;
4463
+ CheckboxMenuItem toggleLiveItem;
44904464 CheckboxMenuItem toggleFullScreenItem;
44914465 CheckboxMenuItem toggleTimelineItem;
44924466 CheckboxMenuItem toggleRenderItem;
....@@ -4495,7 +4469,7 @@
44954469 CheckboxMenuItem toggleFootContactItem;
44964470 CheckboxMenuItem toggleDLItem;
44974471 CheckboxMenuItem toggleTextureItem;
4498
- CheckboxMenuItem toggleRandomItem;
4472
+ CheckboxMenuItem toggleSwitchItem;
44994473 CheckboxMenuItem toggleRootItem;
45004474 CheckboxMenuItem animationItem;
45014475 CheckboxMenuItem toggleHandleItem;
....@@ -4503,20 +4477,21 @@
45034477 JSplitPane mainPanel;
45044478 JScrollPane scrollpane;
45054479 JPanel toolbarPanel;
4506
- JPanel treePanel;
4480
+ cGridBag treePanel;
45074481 JPanel radioPanel;
45084482 ButtonGroup buttonGroup;
4509
- JPanel ctrlPanel;
4510
- JPanel materialPanel;
4483
+ cGridBag ctrlPanel;
4484
+ cGridBag materialPanel;
45114485 JScrollPane infoPanel;
4512
- JPanel optionsPanel;
4486
+ cGridBag optionsPanel;
45134487 JTabbedPane objectPanel;
4514
- JPanel XYZPanel;
4488
+ cGridBag XYZPanel;
45154489 JSplitPane gridPanel;
45164490 JSplitPane bigPanel;
4517
- JPanel bigThree;
4518
- JTabbedPane scenePanel;
4519
- JPanel centralPanel;
4491
+ cGridBag bigThree;
4492
+ cGridBag scenePanel;
4493
+ cGridBag centralPanel;
4494
+ JSplitPane cameraPanel;
45204495 JPanel timelinePanel;
45214496 JMenuBar timelineMenubar;
45224497 JSplitPane framePanel;
....@@ -4568,65 +4543,67 @@
45684543 // MATERIAL
45694544 JLabel materialLabel;
45704545 JLabel colorLabel;
4571
- NumberSlider colorField;
4546
+ cNumberSlider colorField;
45724547 JLabel modulationLabel;
4573
- NumberSlider modulationField;
4548
+ cNumberSlider modulationField;
45744549 JLabel metalnessLabel;
4575
- NumberSlider metalnessField;
4550
+ cNumberSlider metalnessField;
45764551 JLabel diffuseLabel;
4577
- NumberSlider diffuseField;
4552
+ cNumberSlider diffuseField;
45784553 JLabel specularLabel;
4579
- NumberSlider specularField;
4554
+ cNumberSlider specularField;
45804555 JLabel shininessLabel;
4581
- NumberSlider shininessField;
4556
+ cNumberSlider shininessField;
45824557 JLabel shiftLabel;
4583
- NumberSlider shiftField;
4558
+ cNumberSlider shiftField;
45844559 JLabel ambientLabel;
4585
- NumberSlider ambientField;
4560
+ cNumberSlider ambientField;
45864561 JLabel lightareaLabel;
4587
- NumberSlider lightareaField;
4562
+ cNumberSlider lightareaField;
45884563 JLabel diffusenessLabel;
4589
- NumberSlider diffusenessField;
4564
+ cNumberSlider diffusenessField;
45904565 JLabel velvetLabel;
4591
- NumberSlider velvetField;
4566
+ cNumberSlider velvetField;
45924567 JLabel sheenLabel;
4593
- NumberSlider sheenField;
4568
+ cNumberSlider sheenField;
45944569 JLabel subsurfaceLabel;
4595
- NumberSlider subsurfaceField;
4570
+ cNumberSlider subsurfaceField;
45964571 //JLabel bumpLabel;
45974572 //NumberSlider bumpField;
45984573 JLabel backlitLabel;
4599
- NumberSlider backlitField;
4574
+ cNumberSlider backlitField;
46004575 JLabel anisoLabel;
4601
- NumberSlider anisoField;
4576
+ cNumberSlider anisoField;
46024577 JLabel anisoVLabel;
4603
- NumberSlider anisoVField;
4578
+ cNumberSlider anisoVField;
46044579 JLabel cameraLabel;
4605
- NumberSlider cameraField;
4580
+ cNumberSlider cameraField;
46064581 JLabel selfshadowLabel;
4607
- NumberSlider selfshadowField;
4582
+ cNumberSlider selfshadowField;
46084583 JLabel shadowLabel;
4609
- NumberSlider shadowField;
4584
+ cNumberSlider shadowField;
46104585 JLabel textureLabel;
4611
- NumberSlider textureField;
4586
+ cNumberSlider textureField;
46124587 JLabel opacityLabel;
4613
- NumberSlider opacityField;
4588
+ cNumberSlider opacityField;
46144589 JLabel fakedepthLabel;
4615
- NumberSlider fakedepthField;
4590
+ cNumberSlider fakedepthField;
46164591 JLabel shadowbiasLabel;
4617
- NumberSlider shadowbiasField;
4592
+ cNumberSlider shadowbiasField;
46184593 JLabel bumpLabel;
4619
- NumberSlider bumpField;
4594
+ cNumberSlider bumpField;
46204595 JLabel noiseLabel;
4621
- NumberSlider noiseField;
4596
+ cNumberSlider noiseField;
46224597 JLabel powerLabel;
4623
- NumberSlider powerField;
4598
+ cNumberSlider powerField;
46244599 JLabel borderfadeLabel;
4625
- NumberSlider borderfadeField;
4600
+ cNumberSlider borderfadeField;
46264601 JLabel fogLabel;
4627
- NumberSlider fogField;
4602
+ cNumberSlider fogField;
46284603 JLabel opacityPowerLabel;
4629
- NumberSlider opacityPowerField;
4604
+ cNumberSlider opacityPowerField;
46304605 JTree jTree;
46314606 //ObjectUI parent;
4607
+
4608
+ cNumberSlider normalpushField;
46324609 }