Normand Briere
2019-05-02 a76491b66a2e304d9ae27a162f407b98c70fbafa
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,
....@@ -28,7 +30,12 @@
2830 iSendInfo
2931 //KeyListener
3032 {
33
+ boolean timeline;
34
+ boolean wasFullScreen;
3135
36
+ GroupEditor callee;
37
+ JFrame frame;
38
+
3239 // SCRIPT
3340
3441 transient JFrame textpanel = null;
....@@ -119,51 +126,61 @@
119126 void keyPressed(int key, int modifiers)
120127 {
121128 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
129
+ Globals.theRenderer.keyPressed(key, modifiers);
123130 }
124131 */
125132
126133 static GridBagConstraints aConstraints;
127134 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
135
+
130136 static int GRIDWIDTH = 100; // 4;
131137
132138 public void closeUI()
133139 {
134140 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
137143 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
145
+
146
+ objEditor.ctrlPanel.remove(namePanel);
139147
140148 if (!GroupEditor.allparams)
141149 return;
142150
143
- objEditor.ctrlPanel.remove(liveCB);
144
- objEditor.ctrlPanel.remove(hideCB);
145
- objEditor.ctrlPanel.remove(markCB);
146
-
147
- objEditor.ctrlPanel.remove(randomCB);
148
- objEditor.ctrlPanel.remove(speedupCB);
149
- objEditor.ctrlPanel.remove(rewindCB);
150
-
151
- objEditor.ctrlPanel.remove(resetButton);
152
- objEditor.ctrlPanel.remove(stepButton);
153
-// objEditor.ctrlPanel.remove(stepAllButton);
154
-// objEditor.ctrlPanel.remove(resetAllButton);
155
- objEditor.ctrlPanel.remove(link2masterCB);
156
- //objEditor.ctrlPanel.remove(flipVCB);
157
- //objEditor.ctrlPanel.remove(texresMenu);
158
- objEditor.ctrlPanel.remove(slowerButton);
159
- objEditor.ctrlPanel.remove(fasterButton);
160
- 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);
161176 }
162177
163178 public ObjEditor GetEditor()
164179 {
165180 return objEditor; //.GetEditor();
166181 }
182
+
183
+ // Sometimes myself, sometimes my callee's.
167184 ObjEditor objEditor;
168185
169186 /*
....@@ -238,7 +255,7 @@
238255 //if (!isDisplayable())
239256 //setUndecorated(true);
240257
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
258
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242259 client = inClient;
243260 copy = localCopy;
244261 copy.editWindow = this;
....@@ -292,18 +309,18 @@
292309 //normalLensItem.addActionListener(this);
293310 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294311 revertCameraItem.addActionListener(this);
312
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
313
+ toggleTimelineItem.addItemListener(this);
295314 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
296315 toggleFullScreenItem.addItemListener(this);
297316 toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
298
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
299
- toggleTimelineItem.addItemListener(this);
300317 cameraMenu.add("-");
301318 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
302319 toggleTextureItem.addItemListener(this);
303320 toggleTextureItem.setState(CameraPane.textureon);
304321 cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
305322 toggleLiveItem.addItemListener(this);
306
- toggleLiveItem.setState(CameraPane.isLIVE());
323
+ toggleLiveItem.setState(Globals.isLIVE());
307324 cameraMenu.add(stepItem = new MenuItem("Step"));
308325 stepItem.addActionListener(this);
309326 // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
....@@ -343,21 +360,23 @@
343360 objectPanel = new JTabbedPane();
344361 toolbarPanel = new JPanel();
345362 toolbarPanel.setName("Toolbar");
346
- treePanel = new JPanel();
363
+ treePanel = new cGridBag();
347364 treePanel.setName("Tree");
348
- ctrlPanel = new JPanel(); // new GridBagLayout());
365
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
349366 ctrlPanel.setName("Edit");
350
- materialPanel = new JPanel();
367
+ materialPanel = new cGridBag().setVertical(true);
351368 materialPanel.setName("Material");
352369 /*JTextPane*/
353370 infoarea = createTextPane();
371
+ doc = infoarea.getStyledDocument();
372
+
354373 infoarea.setEditable(true);
355374 SetText();
356375 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
357376 // infoarea.setOpaque(false);
358377 // //infoarea.setForeground(textcolor);
359
- infoarea.setLineWrap(true);
360
- infoarea.setWrapStyleWord(true);
378
+// TEXTAREA infoarea.setLineWrap(true);
379
+// TEXTAREA infoarea.setWrapStyleWord(true);
361380 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
362381 infoPanel.setPreferredSize(new Dimension(50, 200));
363382 infoPanel.setName("Info");
....@@ -368,16 +387,16 @@
368387 mainPanel.setName("Main");
369388 mainPanel.setContinuousLayout(true);
370389 mainPanel.setOneTouchExpandable(true);
371
- mainPanel.setDividerLocation(1.0);
372390 mainPanel.setDividerSize(9);
373
- mainPanel.setResizeWeight(0);
391
+ mainPanel.setDividerLocation(0.5); //1.0);
392
+ mainPanel.setResizeWeight(0.5);
374393
375394 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
376395 //mainPanel.setLayout(new GridBagLayout());
377396 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
378
- treePanel.setLayout(new GridBagLayout());
379
- ctrlPanel.setLayout(new GridBagLayout());
380
- materialPanel.setLayout(new GridBagLayout());
397
+// treePanel.setLayout(new GridBagLayout());
398
+ //ctrlPanel.setLayout(new GridBagLayout());
399
+ //materialPanel.setLayout(new GridBagLayout());
381400
382401 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
383402 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -416,7 +435,7 @@
416435 static String newline = "\n";
417436 protected static final String buttonString = "JButton";
418437 StyledDocument doc;
419
- JTextArea infoarea;
438
+ JTextPane infoarea;
420439
421440 void ClearInfo()
422441 {
....@@ -483,7 +502,10 @@
483502 }
484503
485504 if (full)
486
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
505
+ {
506
+ si.SendInfo(" BBox min: " + minima, "regular");
507
+ si.SendInfo(" BBox max: " + maxima, "regular");
508
+ }
487509
488510 if (sel.bRep != null)
489511 {
....@@ -581,6 +603,9 @@
581603 {
582604 CameraPane.pointflow = (PointFlow) sel;
583605 }
606
+
607
+ si.SendInfo("_____________________", "regular");
608
+ si.SendInfo("", "regular");
584609 }
585610 }
586611
....@@ -596,52 +621,68 @@
596621 }
597622 }
598623
599
- private JTextArea createTextPane()
600
- {
601
- String[] initString =
624
+ void ToggleFullScreen()
602625 {
603
- "This is an editable JTextPane, ", //regular
604
- "another ", //italic
605
- "styled ", //bold
606
- "text ", //small
607
- "component, ", //large
608
- "which supports embedded components..." + newline,//regular
609
- " " + newline, //button
610
- "...and embedded icons..." + newline, //regular
611
- " ", //icon
612
- newline + "JTextPane is a subclass of JEditorPane that "
613
- + "uses a StyledEditorKit and StyledDocument, and provides "
614
- + "cover methods for interacting with those objects."
615
- };
616
-
617
- String[] initStyles =
618
- {
619
- "regular", "italic", "bold", "small", "large",
620
- "regular", "button", "regular", "icon",
621
- "regular"
622
- };
623
-
624
- JTextPane textPane = new JTextPane();
625
- textPane.setEditable(true);
626
- /*StyledDocument*/ doc = textPane.getStyledDocument();
627
- addStylesToDocument(doc);
628
-
629
- try
630
- {
631
- for (int j = 0; j < 2; j++)
632
- {
633
- for (int i = 0; i < initString.length; i++)
626
+ if (CameraPane.FULLSCREEN)
634627 {
635
- doc.insertString(doc.getLength(), initString[i],
636
- doc.getStyle(initStyles[i]));
628
+ frame.getContentPane().remove(/*"Center",*/bigThree);
629
+ framePanel.add(bigThree);
630
+ frame.getContentPane().add(/*"Center",*/framePanel);
631
+ } else
632
+ {
633
+ frame.getContentPane().remove(/*"Center",*/framePanel);
634
+ framePanel.remove(bigThree);
635
+ frame.getContentPane().add(/*"Center",*/bigThree);
637636 }
638
- }
639
- } catch (BadLocationException ble)
640
- {
641
- System.err.println("Couldn't insert initial text into text pane.");
637
+ cameraView.ToggleFullScreen();
642638 }
643639
644
- return new JTextArea(); // textPane;
640
+ private JTextPane createTextPane()
641
+ {
642
+// TEXTAREA String[] initString =
643
+// {
644
+// "This is an editable JTextPane, ", //regular
645
+// "another ", //italic
646
+// "styled ", //bold
647
+// "text ", //small
648
+// "component, ", //large
649
+// "which supports embedded components..." + newline,//regular
650
+// " " + newline, //button
651
+// "...and embedded icons..." + newline, //regular
652
+// " ", //icon
653
+// newline + "JTextPane is a subclass of JEditorPane that "
654
+// + "uses a StyledEditorKit and StyledDocument, and provides "
655
+// + "cover methods for interacting with those objects."
656
+// };
657
+//
658
+// String[] initStyles =
659
+// {
660
+// "regular", "italic", "bold", "small", "large",
661
+// "regular", "button", "regular", "icon",
662
+// "regular"
663
+// };
664
+//
665
+// JTextPane textPane = new JTextPane();
666
+// textPane.setEditable(true);
667
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
668
+// addStylesToDocument(doc);
669
+//
670
+// try
671
+// {
672
+// for (int j = 0; j < 2; j++)
673
+// {
674
+// for (int i = 0; i < initString.length; i++)
675
+// {
676
+// doc.insertString(doc.getLength(), initString[i],
677
+// doc.getStyle(initStyles[i]));
678
+// }
679
+// }
680
+// } catch (BadLocationException ble)
681
+// {
682
+// System.err.println("Couldn't insert initial text into text pane.");
683
+// }
684
+
685
+ return new JTextPane(); // textPane;
645686 }
646687
647688 protected void addStylesToDocument(StyledDocument doc)
....@@ -741,115 +782,83 @@
741782 JButton slowerButton;
742783 JButton fasterButton;
743784 JButton remarkButton;
785
+
786
+ cGridBag namePanel;
787
+ cGridBag setupPanel;
788
+ cGridBag commandsPanel;
789
+ cGridBag pushPanel;
790
+ cGridBag fillPanel;
744791
745
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
792
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
746793 {
747794 JCheckBox cb;
748795
749
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
750
- oe.aConstraints.gridwidth = 1; // 3;
751
-// oe.aConstraints.weightx = 1;
752
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
753
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
796
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
754797 cb.addItemListener(this);
755
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
756
- oe.aConstraints.gridwidth = 1;
757
- oe.aConstraints.gridx += 1;
758798
759799 return cb;
760800 }
761801
762
- cButton AddButton(ObjEditor oe, String label)
802
+ cButton AddButton(cGridBag panel, String label)
763803 {
764804 cButton cb;
765805
766
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
767
- oe.aConstraints.gridwidth = 1;
768
-// oe.aConstraints.weightx = 1;
769
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
770
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
806
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
771807 cb.addActionListener(this);
772
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
773
- oe.aConstraints.gridwidth = 1;
774
- oe.aConstraints.gridx += 1;
775808
776809 return cb;
777810 }
778811
779
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
812
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
780813 {
781814 JComboBox combo;
782815
783
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
784
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
785
- oe.aConstraints.gridx += 1;
816
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
786817 combo.addActionListener(this);
787818
788819 return combo;
789820 }
790821
791
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
822
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
792823 {
793
- NumberSlider combo;
824
+ cGridBag control = new cGridBag();
825
+
826
+ cNumberSlider combo;
794827
795828 JLabel jlabel = new JLabel(label);
796
-
797
- aConstraints.fill = GridBagConstraints.VERTICAL;
798829 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
799
- aConstraints.gridwidth = 2;
800
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
801
- aConstraints.gridx += 1;
802
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
803
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
804
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
805
- aConstraints.gridx += 1;
806
- aConstraints.gridwidth = 1;
807
-
830
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808832 combo.setFloat(current);
809
-
810
- combo.label = jlabel;
811
-
812
- combo.addChangeListener(this);
813
-
814
- return combo;
833
+
834
+ panel.add(control);
835
+
836
+ return control;
815837 }
816838
817
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
839
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
818840 {
819
- NumberSlider combo;
841
+ cGridBag control = new cGridBag();
842
+
843
+ cNumberSlider combo;
820844
821845 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824846 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
825
- aConstraints.gridwidth = 2;
826
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
829
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
830
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
- aConstraints.gridx += 1;
832
- aConstraints.gridwidth = 1;
833
-
847
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834849 combo.setInteger(current);
835850
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
851
+ panel.add(control);
852
+
853
+ return control;
841854 }
842855
843
- JTextArea AddText(JPanel ctrlPanel, String name)
856
+ JTextArea AddText(cGridBag ctrlPanel, String name)
844857 {
845858 JTextArea text;
846859
847
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
848
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
849
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
850861 text.addCaretListener(this);
851
- aConstraints.gridx += 1;
852
- aConstraints.gridwidth = 1;
853862
854863 return text;
855864 }
....@@ -879,9 +888,16 @@
879888 objEditor.ctrlPanel.remove(j);
880889 }
881890
891
+ void Remove(cNumberSlider j)
892
+ {
893
+ j.removeChangeListener(this);
894
+ //objEditor.ctrlPanel.remove(j.label);
895
+ objEditor.ctrlPanel.remove(j);
896
+ }
897
+
882898 /*
883899 */
884
- void Return() // ObjEditor oe)
900
+ void Return0() // ObjEditor oe)
885901 {
886902 aConstraints.gridy += 1;
887903 aConstraints.gridx = 0;
....@@ -936,35 +952,71 @@
936952
937953 void SetupUI2(ObjEditor oe)
938954 {
939
-// oe.aConstraints.weightx = 0;
940
-// oe.aConstraints.weighty = 0;
941
-// oe.aConstraints.gridx = 0;
942
-// oe.aConstraints.gridy = 0;
943
- SetupName(oe);
955
+ //SetupName(oe);
956
+
957
+ namePanel = new cGridBag();
958
+
959
+ nameField = AddText(namePanel, copy.GetName());
960
+ namePanel.add(nameField);
961
+ oe.ctrlPanel.add(namePanel);
962
+
963
+ oe.ctrlPanel.Return();
944964
945965 if (!GroupEditor.allparams)
946966 return;
947967
948
- liveCB = AddCheckBox(oe, "Live", copy.live);
949
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
950
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
968
+ setupPanel = new cGridBag().setVertical(false);
969
+
970
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
971
+ liveCB.setToolTipText("Animate object");
972
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
973
+ hideCB.setToolTipText("Hide object");
951974 // Return();
952
- markCB = AddCheckBox(oe, "Mark", copy.marked);
953
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
954
- randomCB = AddCheckBox(oe, "Rand", copy.random);
955
- Return();
956
- resetButton = AddButton(oe, "Reset");
957
- stepButton = AddButton(oe, "Step");
975
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
976
+ markCB.setToolTipText("Set the animation target transform");
977
+
978
+ rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
979
+ rewindCB.setToolTipText("Rewind animation");
980
+
981
+ randomCB = AddCheckBox(setupPanel, "Random", copy.random);
982
+ randomCB.setToolTipText("Option for switch node");
983
+
984
+ if (Globals.ADVANCED)
985
+ {
986
+ link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
987
+ link2masterCB.setToolTipText("Attach to support");
988
+ speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
989
+ speedupCB.setToolTipText("Option motion capture");
990
+ }
991
+
992
+ oe.ctrlPanel.add(setupPanel);
993
+ oe.ctrlPanel.Return();
994
+
995
+ commandsPanel = new cGridBag().setVertical(false);
996
+
997
+ resetButton = AddButton(commandsPanel, "Reset");
998
+ resetButton.setToolTipText("Jump to frame zero");
999
+ stepButton = AddButton(commandsPanel, "Step");
1000
+ stepButton.setToolTipText("Step one frame");
9581001 // resetAllButton = AddButton(oe, "Reset All");
9591002 // stepAllButton = AddButton(oe, "Step All");
960
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9611003 // Return();
962
- slowerButton = AddButton(oe, "Slow");
963
- fasterButton = AddButton(oe, "Fast");
964
- remarkButton = AddButton(oe, "Rem");
1004
+ slowerButton = AddButton(commandsPanel, "Slow");
1005
+ slowerButton.setToolTipText("Decrease animation speed");
1006
+ fasterButton = AddButton(commandsPanel, "Fast");
1007
+ fasterButton.setToolTipText("Increase animation speed");
1008
+ remarkButton = AddButton(commandsPanel, "Remark");
1009
+ remarkButton.setToolTipText("Set the current transform as the target");
9651010
966
- Return();
1011
+ oe.ctrlPanel.add(commandsPanel);
1012
+ oe.ctrlPanel.Return();
9671013
1014
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1015
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1016
+ //Return();
1017
+
1018
+ oe.ctrlPanel.Return();
1019
+
9681020 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9691021 // ObjEditor.aConstraints.gridx += 1;
9701022
....@@ -1058,7 +1110,7 @@
10581110 oe.aConstraints.gridwidth = 1;
10591111 /**/
10601112 nameField = AddText(oe.ctrlPanel, copy.GetName());
1061
- Return();
1113
+ oe.ctrlPanel.Return();
10621114
10631115 //ctrlPanel.add(textureButton = new Button("Texture..."));
10641116 //textureButton.setEnabled(false);
....@@ -1160,10 +1212,18 @@
11601212 //JPanel worldPanel =
11611213 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11621214 //worldPanel.setName("World");
1163
- centralPanel = new JPanel(new BorderLayout());
1215
+ centralPanel = new cGridBag();
1216
+ centralPanel.preferredWidth = 20;
11641217 timelinePanel = new JPanel(new BorderLayout());
11651218 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11661219
1220
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1221
+ cameraPanel.setContinuousLayout(true);
1222
+ cameraPanel.setOneTouchExpandable(true);
1223
+// cameraPanel.setDividerLocation(0.9);
1224
+// cameraPanel.setDividerSize(9);
1225
+ cameraPanel.setResizeWeight(1.0);
1226
+
11671227 centralPanel.add(cameraView);
11681228 //frame.setJMenuBar(timelineMenubar);
11691229 //centralPanel.add(timelinePanel);
....@@ -1183,12 +1243,13 @@
11831243 //frontView.object = copy;
11841244 //sideView.object = copy;
11851245
1186
- XYZPanel = new JPanel();
1187
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1246
+ XYZPanel = new cGridBag().setVertical(true);
1247
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11881248
1189
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1190
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1191
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1249
+ XYZPanel.preferredWidth = 5;
1250
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1251
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1252
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
11921253
11931254 /*
11941255 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1226,10 +1287,11 @@
12261287 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12271288 //tmp.setName("Edit");
12281289 objectPanel.add(materialPanel);
1229
- JPanel north = new JPanel(new BorderLayout());
1230
- north.setName("Edit");
1231
- north.add(ctrlPanel, BorderLayout.NORTH);
1232
- objectPanel.add(north);
1290
+// JPanel north = new JPanel(new BorderLayout());
1291
+// north.setName("Edit");
1292
+// north.add(ctrlPanel, BorderLayout.NORTH);
1293
+// objectPanel.add(north);
1294
+ objectPanel.add(ctrlPanel);
12331295 objectPanel.add(infoPanel);
12341296
12351297 /*
....@@ -1250,16 +1312,23 @@
12501312 scrollpane.setWheelScrollingEnabled(true);
12511313 scrollpane.addMouseWheelListener(this); // Default not fast enough
12521314
1253
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1254
- scenePanel.add(scrollpane);
1315
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1316
+ scenePanel.preferredWidth = 7;
1317
+
1318
+ JTabbedPane tabbedPane = new JTabbedPane();
1319
+ tabbedPane.add(scrollpane);
12551320
1256
- scenePanel.add(FSPane = new cFileSystemPane(this));
1321
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12571322
1258
- optionsPanel = new JPanel(new GridBagLayout());
1323
+ optionsPanel = new cGridBag().setVertical(true);
12591324
12601325 optionsPanel.setName("Options");
1261
- scenePanel.add(optionsPanel);
1262
-
1326
+
1327
+ AddOptions(optionsPanel); //, aConstraints);
1328
+
1329
+ tabbedPane.add(optionsPanel);
1330
+
1331
+ scenePanel.add(tabbedPane);
12631332
12641333 /*
12651334 cTree jTree = new cTree(null);
....@@ -1293,6 +1362,7 @@
12931362 //bigPanel.setSize(new Dimension(10,10));
12941363 //bigPanel.add(ctrlPanel);
12951364 //bigPanel.add(gridPanel);
1365
+ /**
12961366 bigThree = new JPanel();
12971367 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12981368 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1316,7 +1386,13 @@
13161386 // aConstraints.gridheight = 3;
13171387 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13181388 bigThree.add(XYZPanel, aWindowConstraints);
1389
+ /**/
13191390
1391
+ bigThree = new cGridBag();
1392
+ bigThree.addComponent(scenePanel);
1393
+ bigThree.addComponent(centralPanel);
1394
+ bigThree.addComponent(XYZPanel);
1395
+
13201396 // // SIDE EFFECT!!!
13211397 // aConstraints.gridx = 0;
13221398 // aConstraints.gridy = 0;
....@@ -1337,7 +1413,8 @@
13371413 //worldPane.add(bigPanel);
13381414 //worldPane.add(worldPanel);
13391415 /**/
1340
- frame.getContentPane().add(/*"Center",*/framePanel);
1416
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1417
+ frame.add(/*"Center",*/framePanel);
13411418 //frame.getContentPane().add(/*"Center",*/ worldPane);
13421419
13431420 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
....@@ -1358,6 +1435,10 @@
13581435 });
13591436 }
13601437
1438
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1439
+ {
1440
+ }
1441
+
13611442 JTree GetTree()
13621443 {
13631444 return objEditor.jTree;
....@@ -1369,260 +1450,170 @@
13691450 ctrlPanel.removeAll();
13701451 }
13711452
1372
- void SetupMaterial(JPanel ctrlPanel)
1453
+ void SetupMaterial(cGridBag panel)
13731454 {
1374
- aConstraints.weighty = 0;
1375
- //aConstraints.weightx = 1;
1376
- /*
1455
+ /*
13771456 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13781457 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1379
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1380
- aConstraints.gridx += 1;
13811458 */
13821459
1383
- aConstraints.gridwidth = 1;
1384
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
1460
+ cGridBag editBar = new cGridBag().setVertical(false);
1461
+
1462
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1463
+ createMaterialButton.setToolTipText("Create material");
13881464
13891465 /*
13901466 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1391
- aConstraints.gridx += 1;
1392
- aConstraints.weighty = 0;
1393
- aConstraints.gridwidth = 1;
13941467 */
13951468
1396
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1397
- aConstraints.gridx += 1;
1469
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1470
+ clearMaterialButton.setToolTipText("Clear material");
1471
+
1472
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1473
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1474
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
13981475
1399
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1400
-
1401
- aConstraints.gridx += 1;
1402
-
1403
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1404
-
1405
- aConstraints.gridx += 1;
1406
-
1407
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1408
-
1409
- aConstraints.gridx = 0;
1410
- aConstraints.gridy += 1;
1411
- aConstraints.weighty = 0;
1412
- aConstraints.gridwidth = 1;
1476
+ editBar.preferredHeight = 15;
1477
+
1478
+ panel.add(editBar);
1479
+
14131480 /**/
14141481 //aConstraints.weighty = 0;
14151482 ////aConstraints.weightx = 1;
14161483 //aConstraints.weighty = 1;
14171484 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14181485 //aConstraints.gridx += 1;
1419
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1420
- aConstraints.weighty = 0;
1421
- aConstraints.gridx = 0;
1422
- aConstraints.gridy += 1;
1423
- aConstraints.gridwidth = 1;
1486
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14241487
1425
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1426
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1427
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1428
- aConstraints.gridx += 1;
1429
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1430
- //aConstraints.weightx = 0;
1431
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1432
- aConstraints.gridx = 0;
1433
- aConstraints.gridy += 1;
1434
- aConstraints.gridwidth = 1;
1488
+ cGridBag colorSection = new cGridBag().setVertical(true);
1489
+
1490
+ cGridBag color = new cGridBag();
1491
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1492
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1493
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1494
+ //colorField.preferredWidth = 200;
1495
+ colorSection.add(color);
14351496
1436
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1437
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1438
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1439
- aConstraints.gridx += 1;
1440
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1441
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1442
- aConstraints.gridx = 0;
1443
- aConstraints.gridy += 1;
1444
- aConstraints.gridwidth = 1;
1497
+ cGridBag modulation = new cGridBag();
1498
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1499
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1500
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1501
+ colorSection.add(modulation);
14451502
1446
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1447
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1448
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1449
- aConstraints.gridx += 1;
1450
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1451
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1452
- aConstraints.gridx = 0;
1453
- aConstraints.gridy += 1;
1454
- aConstraints.gridwidth = 1;
1503
+ cGridBag texture = new cGridBag();
1504
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1505
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1506
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1507
+ colorSection.add(texture);
14551508
1456
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1457
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1458
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1459
- aConstraints.gridx += 1;
1460
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1461
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1462
- aConstraints.gridx = 0;
1463
- aConstraints.gridy += 1;
1464
- aConstraints.gridwidth = 1;
1509
+ cGridBag anisoU = new cGridBag();
1510
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1511
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1512
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1513
+ colorSection.add(anisoU);
14651514
1466
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1467
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1468
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1469
- aConstraints.gridx += 1;
1470
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1471
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1472
- aConstraints.gridx = 0;
1473
- aConstraints.gridy += 1;
1474
- aConstraints.gridwidth = 1;
1515
+ cGridBag anisoV = new cGridBag();
1516
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1517
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1518
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1519
+ colorSection.add(anisoV);
14751520
1476
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1477
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1479
- aConstraints.gridx += 1;
1480
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1481
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1482
- aConstraints.gridx = 0;
1483
- aConstraints.gridy += 1;
1484
- aConstraints.gridwidth = 1;
1521
+ cGridBag shadowbias = new cGridBag();
1522
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1523
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1524
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1525
+ colorSection.add(shadowbias);
14851526
1486
- //aConstraints.weighty = 1;
1487
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1488
- //aConstraints.gridx += 1;
1489
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1490
- aConstraints.weighty = 0;
1491
- aConstraints.gridx = 0;
1492
- aConstraints.gridy += 1;
1493
- aConstraints.gridwidth = 1;
1527
+ panel.add(new JSeparator());
1528
+
1529
+ panel.add(colorSection);
1530
+
1531
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1532
+
1533
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1534
+
1535
+ cGridBag diffuse = new cGridBag();
1536
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1537
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1538
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1539
+ diffuseSection.add(diffuse);
14941540
1495
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1496
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1497
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1498
- aConstraints.gridx += 1;
1499
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1500
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1501
- aConstraints.gridx = 0;
1502
- aConstraints.gridy += 1;
1503
- aConstraints.gridwidth = 1;
1541
+ cGridBag diffuseness = new cGridBag();
1542
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1543
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1544
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1545
+ diffuseSection.add(diffuseness);
15041546
1505
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1506
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1507
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1508
- aConstraints.gridx += 1;
1509
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1510
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1511
- aConstraints.gridx = 0;
1512
- aConstraints.gridy += 1;
1513
- aConstraints.gridwidth = 1;
1547
+ cGridBag selfshadow = new cGridBag();
1548
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1549
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1550
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1551
+ diffuseSection.add(selfshadow);
15141552
1515
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1516
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1517
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1518
- aConstraints.gridx += 1;
1519
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1520
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1521
- aConstraints.gridx = 0;
1522
- aConstraints.gridy += 1;
1523
- aConstraints.gridwidth = 1;
1553
+ cGridBag sheen = new cGridBag();
1554
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1555
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1556
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1557
+ diffuseSection.add(sheen);
15241558
1525
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1526
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1527
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1528
- aConstraints.gridx += 1;
1529
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1530
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1531
- aConstraints.gridx = 0;
1532
- aConstraints.gridy += 1;
1533
- aConstraints.gridwidth = 1;
1559
+ cGridBag subsurface = new cGridBag();
1560
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1561
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1562
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1563
+ diffuseSection.add(subsurface);
15341564
1535
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1536
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1537
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1538
- aConstraints.gridx += 1;
1539
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1540
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1541
- aConstraints.gridx = 0;
1542
- aConstraints.gridy += 1;
1543
- aConstraints.gridwidth = 1;
1565
+ cGridBag shadow = new cGridBag();
1566
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1567
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1568
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1569
+ diffuseSection.add(shadow);
15441570
1545
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1546
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1547
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1548
- aConstraints.gridx += 1;
1549
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1550
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1551
- aConstraints.gridx = 0;
1552
- aConstraints.gridy += 1;
1553
- aConstraints.gridwidth = 1;
1571
+ cGridBag fakedepth = new cGridBag();
1572
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1573
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1574
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1575
+ diffuseSection.add(fakedepth);
15541576
1555
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1556
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1557
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1558
- aConstraints.gridx += 1;
1559
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1560
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1561
- aConstraints.gridx = 0;
1562
- aConstraints.gridy += 1;
1563
- aConstraints.gridwidth = 1;
1577
+ panel.add(new JSeparator());
1578
+
1579
+ panel.add(diffuseSection);
1580
+
1581
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1582
+
1583
+ cGridBag specularSection = new cGridBag().setVertical(true);
15641584
1565
- //aConstraints.weighty = 1;
1566
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1567
- //aConstraints.gridx += 1;
1568
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1569
- aConstraints.weighty = 0;
1570
- aConstraints.gridx = 0;
1571
- aConstraints.gridy += 1;
1572
- aConstraints.gridwidth = 1;
1585
+ cGridBag specular = new cGridBag();
1586
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1587
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1588
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1589
+ specularSection.add(specular);
15731590
1574
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1575
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1576
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1577
- aConstraints.gridx += 1;
1578
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1579
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1580
- aConstraints.gridx = 0;
1581
- aConstraints.gridy += 1;
1582
- aConstraints.gridwidth = 1;
1591
+ cGridBag lightarea = new cGridBag();
1592
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1593
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1595
+ specularSection.add(lightarea);
15831596
1584
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1585
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1586
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1587
- aConstraints.gridx += 1;
1588
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1589
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1590
- aConstraints.gridx = 0;
1591
- aConstraints.gridy += 1;
1592
- aConstraints.gridwidth = 1;
1597
+ cGridBag shininess = new cGridBag();
1598
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1599
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1600
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1601
+ specularSection.add(shininess);
15931602
1594
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1595
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1596
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1597
- aConstraints.gridx += 1;
1598
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1599
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1600
- aConstraints.gridx = 0;
1601
- aConstraints.gridy += 1;
1602
- aConstraints.gridwidth = 1;
1603
+ cGridBag metalness = new cGridBag();
1604
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1605
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1606
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1607
+ specularSection.add(metalness);
16031608
1604
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1605
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1606
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1607
- aConstraints.gridx += 1;
1608
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1609
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1610
- aConstraints.gridx = 0;
1611
- aConstraints.gridy += 1;
1612
- aConstraints.gridwidth = 1;
1609
+ cGridBag velvet = new cGridBag();
1610
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1611
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1612
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1613
+ specularSection.add(velvet);
16131614
1614
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1615
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1616
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1617
- aConstraints.gridx += 1;
1618
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1619
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1620
- aConstraints.gridx = 0;
1621
- aConstraints.gridy += 1;
1622
- aConstraints.gridwidth = 1;
1623
-
1624
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1625
- Return();
1615
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1616
+ //Return();
16261617 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16271618 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16281619 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1633,130 +1624,93 @@
16331624 // aConstraints.gridy += 1;
16341625 // aConstraints.gridwidth = 1;
16351626
1636
- //aConstraints.weighty = 1;
1637
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1638
- //aConstraints.gridx += 1;
1639
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1640
- aConstraints.weighty = 0;
1641
- aConstraints.gridx = 0;
1642
- aConstraints.gridy += 1;
1643
- aConstraints.gridwidth = 1;
16441627
1645
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1646
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1647
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1648
- aConstraints.gridx += 1;
1649
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1650
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1651
- aConstraints.gridx = 0;
1652
- aConstraints.gridy += 1;
1653
- aConstraints.gridwidth = 1;
1628
+ panel.add(new JSeparator());
1629
+
1630
+ panel.add(specularSection);
1631
+
1632
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1633
+
1634
+ cGridBag globalSection = new cGridBag().setVertical(true);
16541635
1655
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1656
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1658
- aConstraints.gridx += 1;
1659
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1660
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1661
- aConstraints.gridx = 0;
1662
- aConstraints.gridy += 1;
1663
- aConstraints.gridwidth = 1;
1636
+ cGridBag camera = new cGridBag();
1637
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1638
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1639
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1640
+ globalSection.add(camera);
16641641
1665
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1666
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1667
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1668
- aConstraints.gridx += 1;
1669
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1670
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1671
- aConstraints.gridx = 0;
1672
- aConstraints.gridy += 1;
1673
- aConstraints.gridwidth = 1;
1642
+ cGridBag ambient = new cGridBag();
1643
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1644
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1645
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1646
+ globalSection.add(ambient);
16741647
1675
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1676
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1678
- aConstraints.gridx += 1;
1679
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1680
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1681
- aConstraints.gridx = 0;
1682
- aConstraints.gridy += 1;
1683
- aConstraints.gridwidth = 1;
1684
- aConstraints.weighty = 0;
1648
+ cGridBag backlit = new cGridBag();
1649
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1650
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1652
+ globalSection.add(backlit);
16851653
1686
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1687
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1689
- aConstraints.gridx += 1;
1690
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1691
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1692
- aConstraints.gridx = 0;
1693
- aConstraints.gridy += 1;
1694
- aConstraints.gridwidth = 1;
1654
+ cGridBag opacity = new cGridBag();
1655
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1656
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1658
+ globalSection.add(opacity);
16951659
1696
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1697
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1699
- aConstraints.gridx += 1;
1700
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1701
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1702
- aConstraints.gridx = 0;
1703
- aConstraints.gridy += 1;
1704
- aConstraints.gridwidth = 1;
1660
+ panel.add(new JSeparator());
1661
+
1662
+ panel.add(globalSection);
1663
+
1664
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1665
+
1666
+ cGridBag textureSection = new cGridBag().setVertical(true);
17051667
1706
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1707
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1709
- aConstraints.gridx += 1;
1710
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1711
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1712
- aConstraints.gridx = 0;
1713
- aConstraints.gridy += 1;
1714
- aConstraints.gridwidth = 1;
1668
+ cGridBag bump = new cGridBag();
1669
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1670
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1672
+ textureSection.add(bump);
17151673
1716
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1717
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1718
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1719
- aConstraints.gridx += 1;
1720
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1721
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1722
- aConstraints.gridx = 0;
1723
- aConstraints.gridy += 1;
1724
- aConstraints.gridwidth = 1;
1674
+ cGridBag noise = new cGridBag();
1675
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1676
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1678
+ textureSection.add(noise);
17251679
1726
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1727
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1728
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1729
- aConstraints.gridx += 1;
1730
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1731
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1732
- aConstraints.gridx = 0;
1733
- aConstraints.gridy += 1;
1734
- aConstraints.gridwidth = 1;
1680
+ cGridBag power = new cGridBag();
1681
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1682
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1683
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1684
+ textureSection.add(power);
17351685
1736
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1737
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1738
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1739
- aConstraints.gridx += 1;
1740
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1741
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1742
- aConstraints.gridx = 0;
1743
- aConstraints.gridy += 1;
1744
- aConstraints.gridwidth = 1;
1686
+ cGridBag borderfade = new cGridBag();
1687
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1688
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1689
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1690
+ textureSection.add(borderfade);
17451691
1746
- //aConstraints.weighty = 1;
1747
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1748
- //aConstraints.gridx += 1;
1749
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1750
- aConstraints.weighty = 0;
1692
+ cGridBag fog = new cGridBag();
1693
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1694
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1695
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1696
+ textureSection.add(fog);
17511697
1752
- aConstraints.gridx = 0;
1753
- aConstraints.gridy = 0;
1754
- aConstraints.gridwidth = 1;
1698
+ cGridBag opacityPower = new cGridBag();
1699
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1700
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1701
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1702
+ textureSection.add(opacityPower);
1703
+
1704
+ panel.add(new JSeparator());
1705
+
1706
+ panel.add(textureSection);
1707
+
1708
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17551709
17561710 SetMaterial(copy); // .GetMaterial());
17571711
1758
- colorField.addChangeListener(this);
1759
- modulationField.addChangeListener(this);
1712
+ //colorField.addChangeListener(this);
1713
+// modulationField.addChangeListener(this);
17601714 metalnessField.addChangeListener(this);
17611715 diffuseField.addChangeListener(this);
17621716 specularField.addChangeListener(this);
....@@ -2568,6 +2522,7 @@
25682522 }
25692523 if (input == null)
25702524 {
2525
+ new Exception().printStackTrace();
25712526 System.exit(0);
25722527 }
25732528
....@@ -2966,37 +2921,35 @@
29662921 return;
29672922 } else if (event.getSource() == toggleTimelineItem)
29682923 {
2969
- copy.timeline ^= true;
2924
+ timeline ^= true;
29702925
2971
- if (copy.timeline)
2926
+ if (timeline)
29722927 {
29732928 centralPanel.remove(cameraView);
2974
- centralPanel.add(timelinePanel);
2929
+ cameraPanel.add(cameraView);
2930
+ centralPanel.add(cameraPanel);
29752931 frame.setJMenuBar(timelineMenubar);
2932
+ wasFullScreen = CameraPane.FULLSCREEN;
2933
+ if (!CameraPane.FULLSCREEN)
2934
+ ToggleFullScreen();
2935
+ toggleFullScreenItem.setEnabled(false);
29762936 }
29772937 else
29782938 {
2979
- centralPanel.remove(timelinePanel);
2939
+ centralPanel.remove(cameraPanel);
29802940 centralPanel.add(cameraView);
29812941 frame.setJMenuBar(null);
2942
+ if (!wasFullScreen)
2943
+ ToggleFullScreen();
2944
+ toggleFullScreenItem.setEnabled(true);
29822945 }
29832946
29842947 frame.validate();
29852948 return;
29862949 } else if (event.getSource() == toggleFullScreenItem)
29872950 {
2988
- if (CameraPane.FULLSCREEN)
2989
- {
2990
- frame.getContentPane().remove(/*"Center",*/bigThree);
2991
- framePanel.add(bigThree);
2992
- frame.getContentPane().add(/*"Center",*/framePanel);
2993
- } else
2994
- {
2995
- frame.getContentPane().remove(/*"Center",*/framePanel);
2996
- frame.getContentPane().add(/*"Center",*/bigThree);
2997
- }
2951
+ ToggleFullScreen();
29982952 frame.validate();
2999
- cameraView.ToggleFullScreen();
30002953
30012954 return;
30022955 } else if (event.getSource() == toggleRandomItem)
....@@ -3044,6 +2997,7 @@
30442997 if (event.getSource() == randomCB)
30452998 {
30462999 copy.random ^= true;
3000
+ objEditor.refreshContents();
30473001 return;
30483002 }
30493003 if (event.getSource() == speedupCB)
....@@ -3106,7 +3060,8 @@
31063060 objEditor.refreshContents();
31073061 } else if (event.getSource() == stepItem)
31083062 {
3109
- cameraView.ONESTEP = true;
3063
+ //cameraView.ONESTEP = true;
3064
+ Globals.ONESTEP = true;
31103065 cameraView.repaint();
31113066 return;
31123067 } else if (event.getSource() == stepButton)
....@@ -3263,25 +3218,25 @@
32633218
32643219 void ToggleAnimation()
32653220 {
3266
- if (!CameraPane.ANIMATION)
3221
+ if (!Globals.ANIMATION)
32673222 {
32683223 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3269
- browser.show();
3224
+ browser.setVisible(true);
32703225 String filename = browser.getFile();
32713226 if (filename != null && filename.length() > 0)
32723227 {
3273
- CameraPane.filename = browser.getDirectory() + filename;
3228
+ Globals.filename = browser.getDirectory() + filename;
32743229 //CameraPane.framecount = 0;
3275
- CameraPane.imagecount = 0;
3230
+ Globals.imagecount = 0;
32763231
3277
- CameraPane.ANIMATION ^= true;
3232
+ Globals.ANIMATION ^= true;
32783233
32793234 GrafreeD.wav.cursor = 0;
32803235 GrafreeD.wav.loop = 0;
32813236 }
32823237 } else
32833238 {
3284
- CameraPane.ANIMATION ^= true;
3239
+ Globals.ANIMATION ^= true;
32853240 }
32863241 }
32873242
....@@ -3298,6 +3253,7 @@
32983253 callee.refreshContents();
32993254 } else
33003255 {
3256
+ new Exception().printStackTrace();
33013257 System.exit(0);
33023258 }
33033259 }
....@@ -3460,7 +3416,7 @@
34603416 current.fakedepth = (float) fakedepthField.getFloat();
34613417 current.shadowbias = (float) shadowbiasField.getFloat();
34623418
3463
- if (!NumberSlider.frozen)
3419
+ if (!cNumberSlider.frozen)
34643420 {
34653421 //System.out.println("Propagate = " + propagate);
34663422 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3508,6 +3464,7 @@
35083464 || e.getSource() == apertureField
35093465 || e.getSource() == shadowblurField)
35103466 {
3467
+ new Exception().printStackTrace();
35113468 System.exit(0);
35123469 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35133470 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3534,7 +3491,13 @@
35343491 //System.out.println("PARENT = " + parent);
35353492 //if (parent != null)
35363493 // parent.applySelf();
3537
- refreshContents();
3494
+ if (e.getSource() == normalpushField)
3495
+ {
3496
+ objEditor.refreshContents();
3497
+ //Refresh();
3498
+ }
3499
+ else
3500
+ refreshContents();
35383501 // ??? client.refreshEditWindow();
35393502 }
35403503 //else
....@@ -3546,7 +3509,7 @@
35463509 //group.name = nameField.getText();
35473510 //objEditor.applySelf();
35483511
3549
- assert (objEditor == this);
3512
+ // OCT2018: assert (objEditor == this);
35503513 if (copy.selection == null || copy.selection.size() == 0)
35513514 //super.applySelf()
35523515 ; else
....@@ -3570,12 +3533,18 @@
35703533 objEditor.copy = keep;
35713534 }
35723535 }
3536
+
3537
+ if (normalpushField != null)
3538
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
35733539 }
35743540
35753541 void SnapObject()
35763542 {
3577
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3578
- SnapObject(obj);
3543
+ if (copy.selection.size() > 0)
3544
+ {
3545
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3546
+ SnapObject(obj);
3547
+ }
35793548 }
35803549
35813550 void SnapObject(Object3D obj)
....@@ -3821,7 +3790,7 @@
38213790
38223791 radioPanel.revalidate();
38233792 radioPanel.repaint();
3824
- ctrlPanel.revalidate(); // ? new
3793
+ ctrlPanel.validate(); // ? new
38253794 ctrlPanel.repaint();
38263795 }
38273796 }
....@@ -4467,8 +4436,8 @@
44674436 //MenuItem normalLensItem;
44684437 MenuItem editCameraItem;
44694438 MenuItem revertCameraItem;
4470
- CheckboxMenuItem toggleLiveItem;
44714439 MenuItem stepItem;
4440
+ CheckboxMenuItem toggleLiveItem;
44724441 CheckboxMenuItem toggleFullScreenItem;
44734442 CheckboxMenuItem toggleTimelineItem;
44744443 CheckboxMenuItem toggleRenderItem;
....@@ -4485,20 +4454,21 @@
44854454 JSplitPane mainPanel;
44864455 JScrollPane scrollpane;
44874456 JPanel toolbarPanel;
4488
- JPanel treePanel;
4457
+ cGridBag treePanel;
44894458 JPanel radioPanel;
44904459 ButtonGroup buttonGroup;
4491
- JPanel ctrlPanel;
4492
- JPanel materialPanel;
4460
+ cGridBag ctrlPanel;
4461
+ cGridBag materialPanel;
44934462 JScrollPane infoPanel;
4494
- JPanel optionsPanel;
4463
+ cGridBag optionsPanel;
44954464 JTabbedPane objectPanel;
4496
- JPanel XYZPanel;
4465
+ cGridBag XYZPanel;
44974466 JSplitPane gridPanel;
44984467 JSplitPane bigPanel;
4499
- JPanel bigThree;
4500
- JTabbedPane scenePanel;
4501
- JPanel centralPanel;
4468
+ cGridBag bigThree;
4469
+ cGridBag scenePanel;
4470
+ cGridBag centralPanel;
4471
+ JSplitPane cameraPanel;
45024472 JPanel timelinePanel;
45034473 JMenuBar timelineMenubar;
45044474 JSplitPane framePanel;
....@@ -4550,65 +4520,67 @@
45504520 // MATERIAL
45514521 JLabel materialLabel;
45524522 JLabel colorLabel;
4553
- NumberSlider colorField;
4523
+ cNumberSlider colorField;
45544524 JLabel modulationLabel;
4555
- NumberSlider modulationField;
4525
+ cNumberSlider modulationField;
45564526 JLabel metalnessLabel;
4557
- NumberSlider metalnessField;
4527
+ cNumberSlider metalnessField;
45584528 JLabel diffuseLabel;
4559
- NumberSlider diffuseField;
4529
+ cNumberSlider diffuseField;
45604530 JLabel specularLabel;
4561
- NumberSlider specularField;
4531
+ cNumberSlider specularField;
45624532 JLabel shininessLabel;
4563
- NumberSlider shininessField;
4533
+ cNumberSlider shininessField;
45644534 JLabel shiftLabel;
4565
- NumberSlider shiftField;
4535
+ cNumberSlider shiftField;
45664536 JLabel ambientLabel;
4567
- NumberSlider ambientField;
4537
+ cNumberSlider ambientField;
45684538 JLabel lightareaLabel;
4569
- NumberSlider lightareaField;
4539
+ cNumberSlider lightareaField;
45704540 JLabel diffusenessLabel;
4571
- NumberSlider diffusenessField;
4541
+ cNumberSlider diffusenessField;
45724542 JLabel velvetLabel;
4573
- NumberSlider velvetField;
4543
+ cNumberSlider velvetField;
45744544 JLabel sheenLabel;
4575
- NumberSlider sheenField;
4545
+ cNumberSlider sheenField;
45764546 JLabel subsurfaceLabel;
4577
- NumberSlider subsurfaceField;
4547
+ cNumberSlider subsurfaceField;
45784548 //JLabel bumpLabel;
45794549 //NumberSlider bumpField;
45804550 JLabel backlitLabel;
4581
- NumberSlider backlitField;
4551
+ cNumberSlider backlitField;
45824552 JLabel anisoLabel;
4583
- NumberSlider anisoField;
4553
+ cNumberSlider anisoField;
45844554 JLabel anisoVLabel;
4585
- NumberSlider anisoVField;
4555
+ cNumberSlider anisoVField;
45864556 JLabel cameraLabel;
4587
- NumberSlider cameraField;
4557
+ cNumberSlider cameraField;
45884558 JLabel selfshadowLabel;
4589
- NumberSlider selfshadowField;
4559
+ cNumberSlider selfshadowField;
45904560 JLabel shadowLabel;
4591
- NumberSlider shadowField;
4561
+ cNumberSlider shadowField;
45924562 JLabel textureLabel;
4593
- NumberSlider textureField;
4563
+ cNumberSlider textureField;
45944564 JLabel opacityLabel;
4595
- NumberSlider opacityField;
4565
+ cNumberSlider opacityField;
45964566 JLabel fakedepthLabel;
4597
- NumberSlider fakedepthField;
4567
+ cNumberSlider fakedepthField;
45984568 JLabel shadowbiasLabel;
4599
- NumberSlider shadowbiasField;
4569
+ cNumberSlider shadowbiasField;
46004570 JLabel bumpLabel;
4601
- NumberSlider bumpField;
4571
+ cNumberSlider bumpField;
46024572 JLabel noiseLabel;
4603
- NumberSlider noiseField;
4573
+ cNumberSlider noiseField;
46044574 JLabel powerLabel;
4605
- NumberSlider powerField;
4575
+ cNumberSlider powerField;
46064576 JLabel borderfadeLabel;
4607
- NumberSlider borderfadeField;
4577
+ cNumberSlider borderfadeField;
46084578 JLabel fogLabel;
4609
- NumberSlider fogField;
4579
+ cNumberSlider fogField;
46104580 JLabel opacityPowerLabel;
4611
- NumberSlider opacityPowerField;
4581
+ cNumberSlider opacityPowerField;
46124582 JTree jTree;
46134583 //ObjectUI parent;
4584
+
4585
+ cNumberSlider normalpushField;
46144586 }