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,16 +309,18 @@
292309 //normalLensItem.addActionListener(this);
293310 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294311 revertCameraItem.addActionListener(this);
295
- cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullItem.addItemListener(this);
297
- toggleFullItem.setState(CameraPane.FULLSCREEN);
312
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
313
+ toggleTimelineItem.addItemListener(this);
314
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
315
+ toggleFullScreenItem.addItemListener(this);
316
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
298317 cameraMenu.add("-");
299318 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
300319 toggleTextureItem.addItemListener(this);
301320 toggleTextureItem.setState(CameraPane.textureon);
302321 cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
303322 toggleLiveItem.addItemListener(this);
304
- toggleLiveItem.setState(CameraPane.isLIVE());
323
+ toggleLiveItem.setState(Globals.isLIVE());
305324 cameraMenu.add(stepItem = new MenuItem("Step"));
306325 stepItem.addActionListener(this);
307326 // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
....@@ -341,21 +360,23 @@
341360 objectPanel = new JTabbedPane();
342361 toolbarPanel = new JPanel();
343362 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
363
+ treePanel = new cGridBag();
345364 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
365
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
347366 ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
367
+ materialPanel = new cGridBag().setVertical(true);
349368 materialPanel.setName("Material");
350369 /*JTextPane*/
351370 infoarea = createTextPane();
371
+ doc = infoarea.getStyledDocument();
372
+
352373 infoarea.setEditable(true);
353374 SetText();
354375 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355376 // infoarea.setOpaque(false);
356377 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
378
+// TEXTAREA infoarea.setLineWrap(true);
379
+// TEXTAREA infoarea.setWrapStyleWord(true);
359380 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
360381 infoPanel.setPreferredSize(new Dimension(50, 200));
361382 infoPanel.setName("Info");
....@@ -366,16 +387,16 @@
366387 mainPanel.setName("Main");
367388 mainPanel.setContinuousLayout(true);
368389 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370390 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
391
+ mainPanel.setDividerLocation(0.5); //1.0);
392
+ mainPanel.setResizeWeight(0.5);
372393
373394 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374395 //mainPanel.setLayout(new GridBagLayout());
375396 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
397
+// treePanel.setLayout(new GridBagLayout());
398
+ //ctrlPanel.setLayout(new GridBagLayout());
399
+ //materialPanel.setLayout(new GridBagLayout());
379400
380401 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381402 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +435,7 @@
414435 static String newline = "\n";
415436 protected static final String buttonString = "JButton";
416437 StyledDocument doc;
417
- JTextArea infoarea;
438
+ JTextPane infoarea;
418439
419440 void ClearInfo()
420441 {
....@@ -481,7 +502,10 @@
481502 }
482503
483504 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
505
+ {
506
+ si.SendInfo(" BBox min: " + minima, "regular");
507
+ si.SendInfo(" BBox max: " + maxima, "regular");
508
+ }
485509
486510 if (sel.bRep != null)
487511 {
....@@ -579,6 +603,9 @@
579603 {
580604 CameraPane.pointflow = (PointFlow) sel;
581605 }
606
+
607
+ si.SendInfo("_____________________", "regular");
608
+ si.SendInfo("", "regular");
582609 }
583610 }
584611
....@@ -594,52 +621,68 @@
594621 }
595622 }
596623
597
- private JTextArea createTextPane()
598
- {
599
- String[] initString =
624
+ void ToggleFullScreen()
600625 {
601
- "This is an editable JTextPane, ", //regular
602
- "another ", //italic
603
- "styled ", //bold
604
- "text ", //small
605
- "component, ", //large
606
- "which supports embedded components..." + newline,//regular
607
- " " + newline, //button
608
- "...and embedded icons..." + newline, //regular
609
- " ", //icon
610
- newline + "JTextPane is a subclass of JEditorPane that "
611
- + "uses a StyledEditorKit and StyledDocument, and provides "
612
- + "cover methods for interacting with those objects."
613
- };
614
-
615
- String[] initStyles =
616
- {
617
- "regular", "italic", "bold", "small", "large",
618
- "regular", "button", "regular", "icon",
619
- "regular"
620
- };
621
-
622
- JTextPane textPane = new JTextPane();
623
- textPane.setEditable(true);
624
- /*StyledDocument*/ doc = textPane.getStyledDocument();
625
- addStylesToDocument(doc);
626
-
627
- try
628
- {
629
- for (int j = 0; j < 2; j++)
630
- {
631
- for (int i = 0; i < initString.length; i++)
626
+ if (CameraPane.FULLSCREEN)
632627 {
633
- doc.insertString(doc.getLength(), initString[i],
634
- 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);
635636 }
636
- }
637
- } catch (BadLocationException ble)
638
- {
639
- System.err.println("Couldn't insert initial text into text pane.");
637
+ cameraView.ToggleFullScreen();
640638 }
641639
642
- 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;
643686 }
644687
645688 protected void addStylesToDocument(StyledDocument doc)
....@@ -739,115 +782,83 @@
739782 JButton slowerButton;
740783 JButton fasterButton;
741784 JButton remarkButton;
785
+
786
+ cGridBag namePanel;
787
+ cGridBag setupPanel;
788
+ cGridBag commandsPanel;
789
+ cGridBag pushPanel;
790
+ cGridBag fillPanel;
742791
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
792
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
744793 {
745794 JCheckBox cb;
746795
747
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
748
- oe.aConstraints.gridwidth = 1; // 3;
749
-// oe.aConstraints.weightx = 1;
750
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
751
- 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);
752797 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
756798
757799 return cb;
758800 }
759801
760
- cButton AddButton(ObjEditor oe, String label)
802
+ cButton AddButton(cGridBag panel, String label)
761803 {
762804 cButton cb;
763805
764
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
765
- oe.aConstraints.gridwidth = 1;
766
-// oe.aConstraints.weightx = 1;
767
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
768
- 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);
769807 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
773808
774809 return cb;
775810 }
776811
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
812
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
778813 {
779814 JComboBox combo;
780815
781
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
782
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
783
- oe.aConstraints.gridx += 1;
816
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
784817 combo.addActionListener(this);
785818
786819 return combo;
787820 }
788821
789
- 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)
790823 {
791
- NumberSlider combo;
824
+ cGridBag control = new cGridBag();
825
+
826
+ cNumberSlider combo;
792827
793828 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
796829 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
797
- aConstraints.gridwidth = 2;
798
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
799
- aConstraints.gridx += 1;
800
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
801
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
802
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
803
- aConstraints.gridx += 1;
804
- aConstraints.gridwidth = 1;
805
-
830
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
806832 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
833
+
834
+ panel.add(control);
835
+
836
+ return control;
813837 }
814838
815
- 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)
816840 {
817
- NumberSlider combo;
841
+ cGridBag control = new cGridBag();
842
+
843
+ cNumberSlider combo;
818844
819845 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822846 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
823
- aConstraints.gridwidth = 2;
824
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
825
- aConstraints.gridx += 1;
826
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
827
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
828
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
829
- aConstraints.gridx += 1;
830
- aConstraints.gridwidth = 1;
831
-
847
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832849 combo.setInteger(current);
833850
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
851
+ panel.add(control);
852
+
853
+ return control;
839854 }
840855
841
- JTextArea AddText(JPanel ctrlPanel, String name)
856
+ JTextArea AddText(cGridBag ctrlPanel, String name)
842857 {
843858 JTextArea text;
844859
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848861 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
851862
852863 return text;
853864 }
....@@ -877,9 +888,16 @@
877888 objEditor.ctrlPanel.remove(j);
878889 }
879890
891
+ void Remove(cNumberSlider j)
892
+ {
893
+ j.removeChangeListener(this);
894
+ //objEditor.ctrlPanel.remove(j.label);
895
+ objEditor.ctrlPanel.remove(j);
896
+ }
897
+
880898 /*
881899 */
882
- void Return() // ObjEditor oe)
900
+ void Return0() // ObjEditor oe)
883901 {
884902 aConstraints.gridy += 1;
885903 aConstraints.gridx = 0;
....@@ -934,35 +952,71 @@
934952
935953 void SetupUI2(ObjEditor oe)
936954 {
937
-// oe.aConstraints.weightx = 0;
938
-// oe.aConstraints.weighty = 0;
939
-// oe.aConstraints.gridx = 0;
940
-// oe.aConstraints.gridy = 0;
941
- 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();
942964
943965 if (!GroupEditor.allparams)
944966 return;
945967
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- 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");
949974 // Return();
950
- markCB = AddCheckBox(oe, "Mark", copy.marked);
951
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
952
- randomCB = AddCheckBox(oe, "Rand", copy.random);
953
- Return();
954
- resetButton = AddButton(oe, "Reset");
955
- 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");
9561001 // resetAllButton = AddButton(oe, "Reset All");
9571002 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9591003 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- 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");
9631010
964
- Return();
1011
+ oe.ctrlPanel.add(commandsPanel);
1012
+ oe.ctrlPanel.Return();
9651013
1014
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1015
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1016
+ //Return();
1017
+
1018
+ oe.ctrlPanel.Return();
1019
+
9661020 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671021 // ObjEditor.aConstraints.gridx += 1;
9681022
....@@ -1056,7 +1110,7 @@
10561110 oe.aConstraints.gridwidth = 1;
10571111 /**/
10581112 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1113
+ oe.ctrlPanel.Return();
10601114
10611115 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621116 //textureButton.setEnabled(false);
....@@ -1158,11 +1212,22 @@
11581212 //JPanel worldPanel =
11591213 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601214 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1164
- //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame);
1215
+ centralPanel = new cGridBag();
1216
+ centralPanel.preferredWidth = 20;
1217
+ timelinePanel = new JPanel(new BorderLayout());
1218
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11651219
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
+
1227
+ centralPanel.add(cameraView);
1228
+ //frame.setJMenuBar(timelineMenubar);
1229
+ //centralPanel.add(timelinePanel);
1230
+
11661231 //topView.camera = ;
11671232 //frontView.camera = new Camera(2);
11681233 //sideView.camera = new Camera(3);
....@@ -1178,12 +1243,13 @@
11781243 //frontView.object = copy;
11791244 //sideView.object = copy;
11801245
1181
- XYZPanel = new JPanel();
1182
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1246
+ XYZPanel = new cGridBag().setVertical(true);
1247
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11831248
1184
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1186
- 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);
11871253
11881254 /*
11891255 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1192,7 +1258,7 @@
11921258 gridPanel.add(cameraView);
11931259 gridPanel.add(XYZPanel);
11941260 */
1195
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1261
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11961262 gridPanel.setContinuousLayout(true);
11971263 gridPanel.setOneTouchExpandable(true);
11981264 gridPanel.setDividerLocation(1.0);
....@@ -1221,10 +1287,11 @@
12211287 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12221288 //tmp.setName("Edit");
12231289 objectPanel.add(materialPanel);
1224
- JPanel north = new JPanel(new BorderLayout());
1225
- north.setName("Edit");
1226
- north.add(ctrlPanel, BorderLayout.NORTH);
1227
- 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);
12281295 objectPanel.add(infoPanel);
12291296
12301297 /*
....@@ -1245,16 +1312,23 @@
12451312 scrollpane.setWheelScrollingEnabled(true);
12461313 scrollpane.addMouseWheelListener(this); // Default not fast enough
12471314
1248
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1249
- scenePanel.add(scrollpane);
1315
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1316
+ scenePanel.preferredWidth = 7;
1317
+
1318
+ JTabbedPane tabbedPane = new JTabbedPane();
1319
+ tabbedPane.add(scrollpane);
12501320
1251
- scenePanel.add(FSPane = new cFileSystemPane(this));
1321
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12521322
1253
- optionsPanel = new JPanel(new GridBagLayout());
1323
+ optionsPanel = new cGridBag().setVertical(true);
12541324
12551325 optionsPanel.setName("Options");
1256
- scenePanel.add(optionsPanel);
1257
-
1326
+
1327
+ AddOptions(optionsPanel); //, aConstraints);
1328
+
1329
+ tabbedPane.add(optionsPanel);
1330
+
1331
+ scenePanel.add(tabbedPane);
12581332
12591333 /*
12601334 cTree jTree = new cTree(null);
....@@ -1288,6 +1362,7 @@
12881362 //bigPanel.setSize(new Dimension(10,10));
12891363 //bigPanel.add(ctrlPanel);
12901364 //bigPanel.add(gridPanel);
1365
+ /**
12911366 bigThree = new JPanel();
12921367 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12931368 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1304,14 +1379,20 @@
13041379 // aConstraints.gridheight = 3;
13051380 aWindowConstraints.gridx = 1;
13061381 aWindowConstraints.fill = GridBagConstraints.BOTH;
1307
- bigThree.add(cameraPanel, aWindowConstraints);
1382
+ bigThree.add(centralPanel, aWindowConstraints);
13081383 aWindowConstraints.weightx = 0;
13091384 aWindowConstraints.gridx = 4;
13101385 aWindowConstraints.gridwidth = 1;
13111386 // aConstraints.gridheight = 3;
13121387 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13131388 bigThree.add(XYZPanel, aWindowConstraints);
1389
+ /**/
13141390
1391
+ bigThree = new cGridBag();
1392
+ bigThree.addComponent(scenePanel);
1393
+ bigThree.addComponent(centralPanel);
1394
+ bigThree.addComponent(XYZPanel);
1395
+
13151396 // // SIDE EFFECT!!!
13161397 // aConstraints.gridx = 0;
13171398 // aConstraints.gridy = 0;
....@@ -1332,7 +1413,8 @@
13321413 //worldPane.add(bigPanel);
13331414 //worldPane.add(worldPanel);
13341415 /**/
1335
- frame.getContentPane().add(/*"Center",*/framePanel);
1416
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1417
+ frame.add(/*"Center",*/framePanel);
13361418 //frame.getContentPane().add(/*"Center",*/ worldPane);
13371419
13381420 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
....@@ -1353,6 +1435,10 @@
13531435 });
13541436 }
13551437
1438
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1439
+ {
1440
+ }
1441
+
13561442 JTree GetTree()
13571443 {
13581444 return objEditor.jTree;
....@@ -1364,260 +1450,170 @@
13641450 ctrlPanel.removeAll();
13651451 }
13661452
1367
- void SetupMaterial(JPanel ctrlPanel)
1453
+ void SetupMaterial(cGridBag panel)
13681454 {
1369
- aConstraints.weighty = 0;
1370
- //aConstraints.weightx = 1;
1371
- /*
1455
+ /*
13721456 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13731457 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1374
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1375
- aConstraints.gridx += 1;
13761458 */
13771459
1378
- aConstraints.gridwidth = 1;
1379
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1380
- aConstraints.gridx += 1;
1381
- aConstraints.weighty = 0;
1382
- 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");
13831464
13841465 /*
13851466 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1386
- aConstraints.gridx += 1;
1387
- aConstraints.weighty = 0;
1388
- aConstraints.gridwidth = 1;
13891467 */
13901468
1391
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1392
- 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);
13931475
1394
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1395
-
1396
- aConstraints.gridx += 1;
1397
-
1398
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1399
-
1400
- aConstraints.gridx += 1;
1401
-
1402
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1403
-
1404
- aConstraints.gridx = 0;
1405
- aConstraints.gridy += 1;
1406
- aConstraints.weighty = 0;
1407
- aConstraints.gridwidth = 1;
1476
+ editBar.preferredHeight = 15;
1477
+
1478
+ panel.add(editBar);
1479
+
14081480 /**/
14091481 //aConstraints.weighty = 0;
14101482 ////aConstraints.weightx = 1;
14111483 //aConstraints.weighty = 1;
14121484 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14131485 //aConstraints.gridx += 1;
1414
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1415
- aConstraints.weighty = 0;
1416
- aConstraints.gridx = 0;
1417
- aConstraints.gridy += 1;
1418
- aConstraints.gridwidth = 1;
1486
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14191487
1420
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1421
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1422
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1423
- aConstraints.gridx += 1;
1424
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1425
- //aConstraints.weightx = 0;
1426
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1427
- aConstraints.gridx = 0;
1428
- aConstraints.gridy += 1;
1429
- 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);
14301496
1431
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1432
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1433
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1434
- aConstraints.gridx += 1;
1435
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1436
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1437
- aConstraints.gridx = 0;
1438
- aConstraints.gridy += 1;
1439
- 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);
14401502
1441
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1442
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1443
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1444
- aConstraints.gridx += 1;
1445
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1446
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1447
- aConstraints.gridx = 0;
1448
- aConstraints.gridy += 1;
1449
- 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);
14501508
1451
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1452
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1453
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1454
- aConstraints.gridx += 1;
1455
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1456
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1457
- aConstraints.gridx = 0;
1458
- aConstraints.gridy += 1;
1459
- 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);
14601514
1461
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1462
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1463
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1464
- aConstraints.gridx += 1;
1465
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1466
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1467
- aConstraints.gridx = 0;
1468
- aConstraints.gridy += 1;
1469
- 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);
14701520
1471
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1472
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1473
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1474
- aConstraints.gridx += 1;
1475
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1476
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1477
- aConstraints.gridx = 0;
1478
- aConstraints.gridy += 1;
1479
- 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);
14801526
1481
- //aConstraints.weighty = 1;
1482
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1483
- //aConstraints.gridx += 1;
1484
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1485
- aConstraints.weighty = 0;
1486
- aConstraints.gridx = 0;
1487
- aConstraints.gridy += 1;
1488
- 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);
14891540
1490
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1491
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1492
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1493
- aConstraints.gridx += 1;
1494
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1495
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1496
- aConstraints.gridx = 0;
1497
- aConstraints.gridy += 1;
1498
- 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);
14991546
1500
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1501
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1502
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1503
- aConstraints.gridx += 1;
1504
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1505
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1506
- aConstraints.gridx = 0;
1507
- aConstraints.gridy += 1;
1508
- 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);
15091552
1510
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1511
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1512
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1513
- aConstraints.gridx += 1;
1514
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1515
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1516
- aConstraints.gridx = 0;
1517
- aConstraints.gridy += 1;
1518
- 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);
15191558
1520
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1521
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1522
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1523
- aConstraints.gridx += 1;
1524
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1525
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1526
- aConstraints.gridx = 0;
1527
- aConstraints.gridy += 1;
1528
- 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);
15291564
1530
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1531
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1533
- aConstraints.gridx += 1;
1534
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1535
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1536
- aConstraints.gridx = 0;
1537
- aConstraints.gridy += 1;
1538
- 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);
15391570
1540
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1541
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1542
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1543
- aConstraints.gridx += 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1545
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1546
- aConstraints.gridx = 0;
1547
- aConstraints.gridy += 1;
1548
- 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);
15491576
1550
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1551
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1552
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1553
- aConstraints.gridx += 1;
1554
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1555
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1556
- aConstraints.gridx = 0;
1557
- aConstraints.gridy += 1;
1558
- 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);
15591584
1560
- //aConstraints.weighty = 1;
1561
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1562
- //aConstraints.gridx += 1;
1563
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1564
- aConstraints.weighty = 0;
1565
- aConstraints.gridx = 0;
1566
- aConstraints.gridy += 1;
1567
- 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);
15681590
1569
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1570
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1571
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1572
- aConstraints.gridx += 1;
1573
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1574
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1575
- aConstraints.gridx = 0;
1576
- aConstraints.gridy += 1;
1577
- 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);
15781596
1579
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1580
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1581
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1582
- aConstraints.gridx += 1;
1583
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1584
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1585
- aConstraints.gridx = 0;
1586
- aConstraints.gridy += 1;
1587
- 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);
15881602
1589
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1590
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1591
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1592
- aConstraints.gridx += 1;
1593
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1594
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1595
- aConstraints.gridx = 0;
1596
- aConstraints.gridy += 1;
1597
- 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);
15981608
1599
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1600
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1601
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1602
- aConstraints.gridx += 1;
1603
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1604
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1605
- aConstraints.gridx = 0;
1606
- aConstraints.gridy += 1;
1607
- 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);
16081614
1609
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1610
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1612
- aConstraints.gridx += 1;
1613
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1614
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1615
- aConstraints.gridx = 0;
1616
- aConstraints.gridy += 1;
1617
- aConstraints.gridwidth = 1;
1618
-
1619
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1620
- Return();
1615
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1616
+ //Return();
16211617 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16221618 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16231619 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1628,130 +1624,93 @@
16281624 // aConstraints.gridy += 1;
16291625 // aConstraints.gridwidth = 1;
16301626
1631
- //aConstraints.weighty = 1;
1632
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1633
- //aConstraints.gridx += 1;
1634
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1635
- aConstraints.weighty = 0;
1636
- aConstraints.gridx = 0;
1637
- aConstraints.gridy += 1;
1638
- aConstraints.gridwidth = 1;
16391627
1640
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1641
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1642
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1643
- aConstraints.gridx += 1;
1644
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1645
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1646
- aConstraints.gridx = 0;
1647
- aConstraints.gridy += 1;
1648
- 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);
16491635
1650
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1651
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1652
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1653
- aConstraints.gridx += 1;
1654
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1655
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1656
- aConstraints.gridx = 0;
1657
- aConstraints.gridy += 1;
1658
- 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);
16591641
1660
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1661
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1662
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1663
- aConstraints.gridx += 1;
1664
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1665
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1666
- aConstraints.gridx = 0;
1667
- aConstraints.gridy += 1;
1668
- 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);
16691647
1670
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1671
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1672
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1673
- aConstraints.gridx += 1;
1674
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1675
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1676
- aConstraints.gridx = 0;
1677
- aConstraints.gridy += 1;
1678
- aConstraints.gridwidth = 1;
1679
- 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);
16801653
1681
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1682
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1683
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1684
- aConstraints.gridx += 1;
1685
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1686
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1687
- aConstraints.gridx = 0;
1688
- aConstraints.gridy += 1;
1689
- 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);
16901659
1691
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1692
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1693
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1694
- aConstraints.gridx += 1;
1695
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1696
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1697
- aConstraints.gridx = 0;
1698
- aConstraints.gridy += 1;
1699
- 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);
17001667
1701
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1702
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1703
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1704
- aConstraints.gridx += 1;
1705
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1706
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1707
- aConstraints.gridx = 0;
1708
- aConstraints.gridy += 1;
1709
- 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);
17101673
1711
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1712
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1713
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1714
- aConstraints.gridx += 1;
1715
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1716
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1717
- aConstraints.gridx = 0;
1718
- aConstraints.gridy += 1;
1719
- 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);
17201679
1721
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1722
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1723
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1724
- aConstraints.gridx += 1;
1725
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1726
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1727
- aConstraints.gridx = 0;
1728
- aConstraints.gridy += 1;
1729
- 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);
17301685
1731
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1732
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1733
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1734
- aConstraints.gridx += 1;
1735
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1736
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1737
- aConstraints.gridx = 0;
1738
- aConstraints.gridy += 1;
1739
- 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);
17401691
1741
- //aConstraints.weighty = 1;
1742
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1743
- //aConstraints.gridx += 1;
1744
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1745
- 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);
17461697
1747
- aConstraints.gridx = 0;
1748
- aConstraints.gridy = 0;
1749
- 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);
17501709
17511710 SetMaterial(copy); // .GetMaterial());
17521711
1753
- colorField.addChangeListener(this);
1754
- modulationField.addChangeListener(this);
1712
+ //colorField.addChangeListener(this);
1713
+// modulationField.addChangeListener(this);
17551714 metalnessField.addChangeListener(this);
17561715 diffuseField.addChangeListener(this);
17571716 specularField.addChangeListener(this);
....@@ -2563,6 +2522,7 @@
25632522 }
25642523 if (input == null)
25652524 {
2525
+ new Exception().printStackTrace();
25662526 System.exit(0);
25672527 }
25682528
....@@ -2959,20 +2919,37 @@
29592919 // june 2013 copy.HardTouch();
29602920 cameraView.repaint();
29612921 return;
2962
- } else if (event.getSource() == toggleFullItem)
2922
+ } else if (event.getSource() == toggleTimelineItem)
29632923 {
2964
- if (CameraPane.FULLSCREEN)
2924
+ timeline ^= true;
2925
+
2926
+ if (timeline)
29652927 {
2966
- frame.getContentPane().remove(/*"Center",*/bigThree);
2967
- framePanel.add(bigThree);
2968
- frame.getContentPane().add(/*"Center",*/framePanel);
2969
- } else
2970
- {
2971
- frame.getContentPane().remove(/*"Center",*/framePanel);
2972
- frame.getContentPane().add(/*"Center",*/bigThree);
2928
+ centralPanel.remove(cameraView);
2929
+ cameraPanel.add(cameraView);
2930
+ centralPanel.add(cameraPanel);
2931
+ frame.setJMenuBar(timelineMenubar);
2932
+ wasFullScreen = CameraPane.FULLSCREEN;
2933
+ if (!CameraPane.FULLSCREEN)
2934
+ ToggleFullScreen();
2935
+ toggleFullScreenItem.setEnabled(false);
29732936 }
2937
+ else
2938
+ {
2939
+ centralPanel.remove(cameraPanel);
2940
+ centralPanel.add(cameraView);
2941
+ frame.setJMenuBar(null);
2942
+ if (!wasFullScreen)
2943
+ ToggleFullScreen();
2944
+ toggleFullScreenItem.setEnabled(true);
2945
+ }
2946
+
29742947 frame.validate();
2975
- cameraView.ToggleFullScreen();
2948
+ return;
2949
+ } else if (event.getSource() == toggleFullScreenItem)
2950
+ {
2951
+ ToggleFullScreen();
2952
+ frame.validate();
29762953
29772954 return;
29782955 } else if (event.getSource() == toggleRandomItem)
....@@ -3020,6 +2997,7 @@
30202997 if (event.getSource() == randomCB)
30212998 {
30222999 copy.random ^= true;
3000
+ objEditor.refreshContents();
30233001 return;
30243002 }
30253003 if (event.getSource() == speedupCB)
....@@ -3082,7 +3060,8 @@
30823060 objEditor.refreshContents();
30833061 } else if (event.getSource() == stepItem)
30843062 {
3085
- cameraView.ONESTEP = true;
3063
+ //cameraView.ONESTEP = true;
3064
+ Globals.ONESTEP = true;
30863065 cameraView.repaint();
30873066 return;
30883067 } else if (event.getSource() == stepButton)
....@@ -3221,9 +3200,9 @@
32213200 cameraView.RevertCamera();
32223201 cameraView.repaint();
32233202 return;
3224
- } else if (event.getSource() == textureButton)
3225
- {
3226
- return; // true;
3203
+// } else if (event.getSource() == textureButton)
3204
+// {
3205
+// return; // true;
32273206 } else // combos...
32283207 if (event.getSource() == texresMenu)
32293208 {
....@@ -3239,25 +3218,25 @@
32393218
32403219 void ToggleAnimation()
32413220 {
3242
- if (!CameraPane.ANIMATION)
3221
+ if (!Globals.ANIMATION)
32433222 {
32443223 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3245
- browser.show();
3224
+ browser.setVisible(true);
32463225 String filename = browser.getFile();
32473226 if (filename != null && filename.length() > 0)
32483227 {
3249
- CameraPane.filename = browser.getDirectory() + filename;
3228
+ Globals.filename = browser.getDirectory() + filename;
32503229 //CameraPane.framecount = 0;
3251
- CameraPane.imagecount = 0;
3230
+ Globals.imagecount = 0;
32523231
3253
- CameraPane.ANIMATION ^= true;
3232
+ Globals.ANIMATION ^= true;
32543233
32553234 GrafreeD.wav.cursor = 0;
32563235 GrafreeD.wav.loop = 0;
32573236 }
32583237 } else
32593238 {
3260
- CameraPane.ANIMATION ^= true;
3239
+ Globals.ANIMATION ^= true;
32613240 }
32623241 }
32633242
....@@ -3274,6 +3253,7 @@
32743253 callee.refreshContents();
32753254 } else
32763255 {
3256
+ new Exception().printStackTrace();
32773257 System.exit(0);
32783258 }
32793259 }
....@@ -3436,7 +3416,7 @@
34363416 current.fakedepth = (float) fakedepthField.getFloat();
34373417 current.shadowbias = (float) shadowbiasField.getFloat();
34383418
3439
- if (!NumberSlider.frozen)
3419
+ if (!cNumberSlider.frozen)
34403420 {
34413421 //System.out.println("Propagate = " + propagate);
34423422 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3484,6 +3464,7 @@
34843464 || e.getSource() == apertureField
34853465 || e.getSource() == shadowblurField)
34863466 {
3467
+ new Exception().printStackTrace();
34873468 System.exit(0);
34883469 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34893470 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3510,7 +3491,13 @@
35103491 //System.out.println("PARENT = " + parent);
35113492 //if (parent != null)
35123493 // parent.applySelf();
3513
- refreshContents();
3494
+ if (e.getSource() == normalpushField)
3495
+ {
3496
+ objEditor.refreshContents();
3497
+ //Refresh();
3498
+ }
3499
+ else
3500
+ refreshContents();
35143501 // ??? client.refreshEditWindow();
35153502 }
35163503 //else
....@@ -3522,7 +3509,7 @@
35223509 //group.name = nameField.getText();
35233510 //objEditor.applySelf();
35243511
3525
- assert (objEditor == this);
3512
+ // OCT2018: assert (objEditor == this);
35263513 if (copy.selection == null || copy.selection.size() == 0)
35273514 //super.applySelf()
35283515 ; else
....@@ -3546,12 +3533,18 @@
35463533 objEditor.copy = keep;
35473534 }
35483535 }
3536
+
3537
+ if (normalpushField != null)
3538
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
35493539 }
35503540
35513541 void SnapObject()
35523542 {
3553
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3554
- SnapObject(obj);
3543
+ if (copy.selection.size() > 0)
3544
+ {
3545
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3546
+ SnapObject(obj);
3547
+ }
35553548 }
35563549
35573550 void SnapObject(Object3D obj)
....@@ -3797,7 +3790,7 @@
37973790
37983791 radioPanel.revalidate();
37993792 radioPanel.repaint();
3800
- ctrlPanel.revalidate(); // ? new
3793
+ ctrlPanel.validate(); // ? new
38013794 ctrlPanel.repaint();
38023795 }
38033796 }
....@@ -4443,9 +4436,10 @@
44434436 //MenuItem normalLensItem;
44444437 MenuItem editCameraItem;
44454438 MenuItem revertCameraItem;
4446
- CheckboxMenuItem toggleLiveItem;
44474439 MenuItem stepItem;
4448
- CheckboxMenuItem toggleFullItem;
4440
+ CheckboxMenuItem toggleLiveItem;
4441
+ CheckboxMenuItem toggleFullScreenItem;
4442
+ CheckboxMenuItem toggleTimelineItem;
44494443 CheckboxMenuItem toggleRenderItem;
44504444 CheckboxMenuItem toggleDebugItem;
44514445 CheckboxMenuItem toggleFrustumItem;
....@@ -4460,23 +4454,26 @@
44604454 JSplitPane mainPanel;
44614455 JScrollPane scrollpane;
44624456 JPanel toolbarPanel;
4463
- JPanel treePanel;
4457
+ cGridBag treePanel;
44644458 JPanel radioPanel;
44654459 ButtonGroup buttonGroup;
4466
- JPanel ctrlPanel;
4467
- JPanel materialPanel;
4460
+ cGridBag ctrlPanel;
4461
+ cGridBag materialPanel;
44684462 JScrollPane infoPanel;
4469
- JPanel optionsPanel;
4463
+ cGridBag optionsPanel;
44704464 JTabbedPane objectPanel;
4471
- JPanel XYZPanel;
4465
+ cGridBag XYZPanel;
44724466 JSplitPane gridPanel;
44734467 JSplitPane bigPanel;
4474
- JPanel bigThree;
4475
- JTabbedPane scenePanel;
4476
- JPanel cameraPanel;
4468
+ cGridBag bigThree;
4469
+ cGridBag scenePanel;
4470
+ cGridBag centralPanel;
4471
+ JSplitPane cameraPanel;
4472
+ JPanel timelinePanel;
4473
+ JMenuBar timelineMenubar;
44774474 JSplitPane framePanel;
44784475 JTextArea/*Field*/ nameField;
4479
- cButton textureButton;
4476
+ //cButton textureButton;
44804477 cButton okButton;
44814478 cButton applyButton;
44824479 cButton cancelButton;
....@@ -4523,65 +4520,67 @@
45234520 // MATERIAL
45244521 JLabel materialLabel;
45254522 JLabel colorLabel;
4526
- NumberSlider colorField;
4523
+ cNumberSlider colorField;
45274524 JLabel modulationLabel;
4528
- NumberSlider modulationField;
4525
+ cNumberSlider modulationField;
45294526 JLabel metalnessLabel;
4530
- NumberSlider metalnessField;
4527
+ cNumberSlider metalnessField;
45314528 JLabel diffuseLabel;
4532
- NumberSlider diffuseField;
4529
+ cNumberSlider diffuseField;
45334530 JLabel specularLabel;
4534
- NumberSlider specularField;
4531
+ cNumberSlider specularField;
45354532 JLabel shininessLabel;
4536
- NumberSlider shininessField;
4533
+ cNumberSlider shininessField;
45374534 JLabel shiftLabel;
4538
- NumberSlider shiftField;
4535
+ cNumberSlider shiftField;
45394536 JLabel ambientLabel;
4540
- NumberSlider ambientField;
4537
+ cNumberSlider ambientField;
45414538 JLabel lightareaLabel;
4542
- NumberSlider lightareaField;
4539
+ cNumberSlider lightareaField;
45434540 JLabel diffusenessLabel;
4544
- NumberSlider diffusenessField;
4541
+ cNumberSlider diffusenessField;
45454542 JLabel velvetLabel;
4546
- NumberSlider velvetField;
4543
+ cNumberSlider velvetField;
45474544 JLabel sheenLabel;
4548
- NumberSlider sheenField;
4545
+ cNumberSlider sheenField;
45494546 JLabel subsurfaceLabel;
4550
- NumberSlider subsurfaceField;
4547
+ cNumberSlider subsurfaceField;
45514548 //JLabel bumpLabel;
45524549 //NumberSlider bumpField;
45534550 JLabel backlitLabel;
4554
- NumberSlider backlitField;
4551
+ cNumberSlider backlitField;
45554552 JLabel anisoLabel;
4556
- NumberSlider anisoField;
4553
+ cNumberSlider anisoField;
45574554 JLabel anisoVLabel;
4558
- NumberSlider anisoVField;
4555
+ cNumberSlider anisoVField;
45594556 JLabel cameraLabel;
4560
- NumberSlider cameraField;
4557
+ cNumberSlider cameraField;
45614558 JLabel selfshadowLabel;
4562
- NumberSlider selfshadowField;
4559
+ cNumberSlider selfshadowField;
45634560 JLabel shadowLabel;
4564
- NumberSlider shadowField;
4561
+ cNumberSlider shadowField;
45654562 JLabel textureLabel;
4566
- NumberSlider textureField;
4563
+ cNumberSlider textureField;
45674564 JLabel opacityLabel;
4568
- NumberSlider opacityField;
4565
+ cNumberSlider opacityField;
45694566 JLabel fakedepthLabel;
4570
- NumberSlider fakedepthField;
4567
+ cNumberSlider fakedepthField;
45714568 JLabel shadowbiasLabel;
4572
- NumberSlider shadowbiasField;
4569
+ cNumberSlider shadowbiasField;
45734570 JLabel bumpLabel;
4574
- NumberSlider bumpField;
4571
+ cNumberSlider bumpField;
45754572 JLabel noiseLabel;
4576
- NumberSlider noiseField;
4573
+ cNumberSlider noiseField;
45774574 JLabel powerLabel;
4578
- NumberSlider powerField;
4575
+ cNumberSlider powerField;
45794576 JLabel borderfadeLabel;
4580
- NumberSlider borderfadeField;
4577
+ cNumberSlider borderfadeField;
45814578 JLabel fogLabel;
4582
- NumberSlider fogField;
4579
+ cNumberSlider fogField;
45834580 JLabel opacityPowerLabel;
4584
- NumberSlider opacityPowerField;
4581
+ cNumberSlider opacityPowerField;
45854582 JTree jTree;
45864583 //ObjectUI parent;
4584
+
4585
+ cNumberSlider normalpushField;
45874586 }