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,10 +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);
1215
+ centralPanel = new cGridBag();
1216
+ centralPanel.preferredWidth = 20;
1217
+ timelinePanel = new JPanel(new BorderLayout());
1218
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11641219
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
+
11651231 //topView.camera = ;
11661232 //frontView.camera = new Camera(2);
11671233 //sideView.camera = new Camera(3);
....@@ -1177,12 +1243,13 @@
11771243 //frontView.object = copy;
11781244 //sideView.object = copy;
11791245
1180
- XYZPanel = new JPanel();
1181
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1246
+ XYZPanel = new cGridBag().setVertical(true);
1247
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11821248
1183
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1184
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1185
- 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);
11861253
11871254 /*
11881255 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1191,7 +1258,7 @@
11911258 gridPanel.add(cameraView);
11921259 gridPanel.add(XYZPanel);
11931260 */
1194
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1261
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11951262 gridPanel.setContinuousLayout(true);
11961263 gridPanel.setOneTouchExpandable(true);
11971264 gridPanel.setDividerLocation(1.0);
....@@ -1220,10 +1287,11 @@
12201287 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12211288 //tmp.setName("Edit");
12221289 objectPanel.add(materialPanel);
1223
- JPanel north = new JPanel(new BorderLayout());
1224
- north.setName("Edit");
1225
- north.add(ctrlPanel, BorderLayout.NORTH);
1226
- 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);
12271295 objectPanel.add(infoPanel);
12281296
12291297 /*
....@@ -1244,16 +1312,23 @@
12441312 scrollpane.setWheelScrollingEnabled(true);
12451313 scrollpane.addMouseWheelListener(this); // Default not fast enough
12461314
1247
- /*JTabbedPane*/ jtp = new JTabbedPane();
1248
- jtp.add(scrollpane);
1315
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1316
+ scenePanel.preferredWidth = 7;
1317
+
1318
+ JTabbedPane tabbedPane = new JTabbedPane();
1319
+ tabbedPane.add(scrollpane);
12491320
1250
- jtp.add(FSPane = new cFileSystemPane(this));
1321
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12511322
1252
- optionsPanel = new JPanel(new GridBagLayout());
1323
+ optionsPanel = new cGridBag().setVertical(true);
12531324
12541325 optionsPanel.setName("Options");
1255
- jtp.add(optionsPanel);
1256
-
1326
+
1327
+ AddOptions(optionsPanel); //, aConstraints);
1328
+
1329
+ tabbedPane.add(optionsPanel);
1330
+
1331
+ scenePanel.add(tabbedPane);
12571332
12581333 /*
12591334 cTree jTree = new cTree(null);
....@@ -1275,7 +1350,7 @@
12751350 jtp.add(tree);
12761351 */
12771352
1278
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);
1353
+ bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
12791354 bigPanel.setContinuousLayout(true);
12801355 bigPanel.setOneTouchExpandable(true);
12811356 bigPanel.setDividerLocation(0.8);
....@@ -1287,6 +1362,7 @@
12871362 //bigPanel.setSize(new Dimension(10,10));
12881363 //bigPanel.add(ctrlPanel);
12891364 //bigPanel.add(gridPanel);
1365
+ /**
12901366 bigThree = new JPanel();
12911367 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12921368 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1297,20 +1373,26 @@
12971373 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
12981374 aWindowConstraints.weightx = 0;
12991375 aWindowConstraints.weighty = 1;
1300
- bigThree.add(jtp, aWindowConstraints);
1376
+ bigThree.add(scenePanel, aWindowConstraints);
13011377 aWindowConstraints.weightx = 1;
13021378 aWindowConstraints.gridwidth = 3;
13031379 // aConstraints.gridheight = 3;
13041380 aWindowConstraints.gridx = 1;
13051381 aWindowConstraints.fill = GridBagConstraints.BOTH;
1306
- bigThree.add(cameraPanel, aWindowConstraints);
1382
+ bigThree.add(centralPanel, aWindowConstraints);
13071383 aWindowConstraints.weightx = 0;
13081384 aWindowConstraints.gridx = 4;
13091385 aWindowConstraints.gridwidth = 1;
13101386 // aConstraints.gridheight = 3;
13111387 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13121388 bigThree.add(XYZPanel, aWindowConstraints);
1389
+ /**/
13131390
1391
+ bigThree = new cGridBag();
1392
+ bigThree.addComponent(scenePanel);
1393
+ bigThree.addComponent(centralPanel);
1394
+ bigThree.addComponent(XYZPanel);
1395
+
13141396 // // SIDE EFFECT!!!
13151397 // aConstraints.gridx = 0;
13161398 // aConstraints.gridy = 0;
....@@ -1331,7 +1413,8 @@
13311413 //worldPane.add(bigPanel);
13321414 //worldPane.add(worldPanel);
13331415 /**/
1334
- frame.getContentPane().add(/*"Center",*/framePanel);
1416
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1417
+ frame.add(/*"Center",*/framePanel);
13351418 //frame.getContentPane().add(/*"Center",*/ worldPane);
13361419
13371420 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
....@@ -1352,6 +1435,10 @@
13521435 });
13531436 }
13541437
1438
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1439
+ {
1440
+ }
1441
+
13551442 JTree GetTree()
13561443 {
13571444 return objEditor.jTree;
....@@ -1363,260 +1450,170 @@
13631450 ctrlPanel.removeAll();
13641451 }
13651452
1366
- void SetupMaterial(JPanel ctrlPanel)
1453
+ void SetupMaterial(cGridBag panel)
13671454 {
1368
- aConstraints.weighty = 0;
1369
- //aConstraints.weightx = 1;
1370
- /*
1455
+ /*
13711456 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13721457 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1373
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1374
- aConstraints.gridx += 1;
13751458 */
13761459
1377
- aConstraints.gridwidth = 1;
1378
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1379
- aConstraints.gridx += 1;
1380
- aConstraints.weighty = 0;
1381
- 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");
13821464
13831465 /*
13841466 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
13881467 */
13891468
1390
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1391
- 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);
13921475
1393
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1394
-
1395
- aConstraints.gridx += 1;
1396
-
1397
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1398
-
1399
- aConstraints.gridx += 1;
1400
-
1401
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1402
-
1403
- aConstraints.gridx = 0;
1404
- aConstraints.gridy += 1;
1405
- aConstraints.weighty = 0;
1406
- aConstraints.gridwidth = 1;
1476
+ editBar.preferredHeight = 15;
1477
+
1478
+ panel.add(editBar);
1479
+
14071480 /**/
14081481 //aConstraints.weighty = 0;
14091482 ////aConstraints.weightx = 1;
14101483 //aConstraints.weighty = 1;
14111484 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14121485 //aConstraints.gridx += 1;
1413
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1414
- aConstraints.weighty = 0;
1415
- aConstraints.gridx = 0;
1416
- aConstraints.gridy += 1;
1417
- aConstraints.gridwidth = 1;
1486
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14181487
1419
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1420
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1421
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1422
- aConstraints.gridx += 1;
1423
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1424
- //aConstraints.weightx = 0;
1425
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1426
- aConstraints.gridx = 0;
1427
- aConstraints.gridy += 1;
1428
- 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);
14291496
1430
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1431
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1432
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1433
- aConstraints.gridx += 1;
1434
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1435
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1436
- aConstraints.gridx = 0;
1437
- aConstraints.gridy += 1;
1438
- 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);
14391502
1440
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1441
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1442
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1443
- aConstraints.gridx += 1;
1444
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1445
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1446
- aConstraints.gridx = 0;
1447
- aConstraints.gridy += 1;
1448
- 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);
14491508
1450
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1451
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1452
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1453
- aConstraints.gridx += 1;
1454
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1455
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1456
- aConstraints.gridx = 0;
1457
- aConstraints.gridy += 1;
1458
- 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);
14591514
1460
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1461
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1462
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1463
- aConstraints.gridx += 1;
1464
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1465
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1466
- aConstraints.gridx = 0;
1467
- aConstraints.gridy += 1;
1468
- 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);
14691520
1470
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1471
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1472
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1473
- aConstraints.gridx += 1;
1474
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1475
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1476
- aConstraints.gridx = 0;
1477
- aConstraints.gridy += 1;
1478
- 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);
14791526
1480
- //aConstraints.weighty = 1;
1481
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1482
- //aConstraints.gridx += 1;
1483
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1484
- aConstraints.weighty = 0;
1485
- aConstraints.gridx = 0;
1486
- aConstraints.gridy += 1;
1487
- 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);
14881540
1489
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1490
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1491
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1492
- aConstraints.gridx += 1;
1493
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1494
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1495
- aConstraints.gridx = 0;
1496
- aConstraints.gridy += 1;
1497
- 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);
14981546
1499
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1500
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1501
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1502
- aConstraints.gridx += 1;
1503
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1504
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1505
- aConstraints.gridx = 0;
1506
- aConstraints.gridy += 1;
1507
- 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);
15081552
1509
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1510
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1511
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1512
- aConstraints.gridx += 1;
1513
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1514
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1515
- aConstraints.gridx = 0;
1516
- aConstraints.gridy += 1;
1517
- 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);
15181558
1519
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1520
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1521
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1522
- aConstraints.gridx += 1;
1523
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1524
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1525
- aConstraints.gridx = 0;
1526
- aConstraints.gridy += 1;
1527
- 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);
15281564
1529
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1530
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1531
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1532
- aConstraints.gridx += 1;
1533
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1534
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1535
- aConstraints.gridx = 0;
1536
- aConstraints.gridy += 1;
1537
- 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);
15381570
1539
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1540
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1541
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1542
- aConstraints.gridx += 1;
1543
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1544
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1545
- aConstraints.gridx = 0;
1546
- aConstraints.gridy += 1;
1547
- 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);
15481576
1549
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1550
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1551
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1552
- aConstraints.gridx += 1;
1553
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1554
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1555
- aConstraints.gridx = 0;
1556
- aConstraints.gridy += 1;
1557
- 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);
15581584
1559
- //aConstraints.weighty = 1;
1560
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1561
- //aConstraints.gridx += 1;
1562
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1563
- aConstraints.weighty = 0;
1564
- aConstraints.gridx = 0;
1565
- aConstraints.gridy += 1;
1566
- 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);
15671590
1568
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1569
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1570
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1571
- aConstraints.gridx += 1;
1572
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1573
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1574
- aConstraints.gridx = 0;
1575
- aConstraints.gridy += 1;
1576
- 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);
15771596
1578
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1579
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1580
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1581
- aConstraints.gridx += 1;
1582
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1583
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1584
- aConstraints.gridx = 0;
1585
- aConstraints.gridy += 1;
1586
- 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);
15871602
1588
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1589
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1590
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1591
- aConstraints.gridx += 1;
1592
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1593
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1594
- aConstraints.gridx = 0;
1595
- aConstraints.gridy += 1;
1596
- 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);
15971608
1598
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1599
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1600
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1601
- aConstraints.gridx += 1;
1602
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1603
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1604
- aConstraints.gridx = 0;
1605
- aConstraints.gridy += 1;
1606
- 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);
16071614
1608
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1609
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1610
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1611
- aConstraints.gridx += 1;
1612
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1613
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1614
- aConstraints.gridx = 0;
1615
- aConstraints.gridy += 1;
1616
- aConstraints.gridwidth = 1;
1617
-
1618
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1619
- Return();
1615
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1616
+ //Return();
16201617 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16211618 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16221619 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1627,130 +1624,93 @@
16271624 // aConstraints.gridy += 1;
16281625 // aConstraints.gridwidth = 1;
16291626
1630
- //aConstraints.weighty = 1;
1631
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1632
- //aConstraints.gridx += 1;
1633
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1634
- aConstraints.weighty = 0;
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
16381627
1639
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1640
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- 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);
16481635
1649
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1650
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1652
- aConstraints.gridx += 1;
1653
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1654
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1655
- aConstraints.gridx = 0;
1656
- aConstraints.gridy += 1;
1657
- 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);
16581641
1659
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1660
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1661
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1662
- aConstraints.gridx += 1;
1663
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1664
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1665
- aConstraints.gridx = 0;
1666
- aConstraints.gridy += 1;
1667
- 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);
16681647
1669
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1670
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1672
- aConstraints.gridx += 1;
1673
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1674
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1675
- aConstraints.gridx = 0;
1676
- aConstraints.gridy += 1;
1677
- aConstraints.gridwidth = 1;
1678
- 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);
16791653
1680
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1681
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- 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);
16891659
1690
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1691
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- 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);
16991667
1700
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1701
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- 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);
17091673
1710
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1711
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1712
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1713
- aConstraints.gridx += 1;
1714
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1715
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1716
- aConstraints.gridx = 0;
1717
- aConstraints.gridy += 1;
1718
- 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);
17191679
1720
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1721
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1722
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1723
- aConstraints.gridx += 1;
1724
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1725
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1726
- aConstraints.gridx = 0;
1727
- aConstraints.gridy += 1;
1728
- 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);
17291685
1730
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1731
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1732
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1733
- aConstraints.gridx += 1;
1734
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1735
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1736
- aConstraints.gridx = 0;
1737
- aConstraints.gridy += 1;
1738
- 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);
17391691
1740
- //aConstraints.weighty = 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1742
- //aConstraints.gridx += 1;
1743
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1744
- 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);
17451697
1746
- aConstraints.gridx = 0;
1747
- aConstraints.gridy = 0;
1748
- 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);
17491709
17501710 SetMaterial(copy); // .GetMaterial());
17511711
1752
- colorField.addChangeListener(this);
1753
- modulationField.addChangeListener(this);
1712
+ //colorField.addChangeListener(this);
1713
+// modulationField.addChangeListener(this);
17541714 metalnessField.addChangeListener(this);
17551715 diffuseField.addChangeListener(this);
17561716 specularField.addChangeListener(this);
....@@ -2562,6 +2522,7 @@
25622522 }
25632523 if (input == null)
25642524 {
2525
+ new Exception().printStackTrace();
25652526 System.exit(0);
25662527 }
25672528
....@@ -2958,20 +2919,37 @@
29582919 // june 2013 copy.HardTouch();
29592920 cameraView.repaint();
29602921 return;
2961
- } else if (event.getSource() == toggleFullItem)
2922
+ } else if (event.getSource() == toggleTimelineItem)
29622923 {
2963
- if (CameraPane.FULLSCREEN)
2924
+ timeline ^= true;
2925
+
2926
+ if (timeline)
29642927 {
2965
- frame.getContentPane().remove(/*"Center",*/bigThree);
2966
- framePanel.add(bigThree);
2967
- frame.getContentPane().add(/*"Center",*/framePanel);
2968
- } else
2969
- {
2970
- frame.getContentPane().remove(/*"Center",*/framePanel);
2971
- 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);
29722936 }
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
+
29732947 frame.validate();
2974
- cameraView.ToggleFullScreen();
2948
+ return;
2949
+ } else if (event.getSource() == toggleFullScreenItem)
2950
+ {
2951
+ ToggleFullScreen();
2952
+ frame.validate();
29752953
29762954 return;
29772955 } else if (event.getSource() == toggleRandomItem)
....@@ -3019,6 +2997,7 @@
30192997 if (event.getSource() == randomCB)
30202998 {
30212999 copy.random ^= true;
3000
+ objEditor.refreshContents();
30223001 return;
30233002 }
30243003 if (event.getSource() == speedupCB)
....@@ -3081,7 +3060,8 @@
30813060 objEditor.refreshContents();
30823061 } else if (event.getSource() == stepItem)
30833062 {
3084
- cameraView.ONESTEP = true;
3063
+ //cameraView.ONESTEP = true;
3064
+ Globals.ONESTEP = true;
30853065 cameraView.repaint();
30863066 return;
30873067 } else if (event.getSource() == stepButton)
....@@ -3220,9 +3200,9 @@
32203200 cameraView.RevertCamera();
32213201 cameraView.repaint();
32223202 return;
3223
- } else if (event.getSource() == textureButton)
3224
- {
3225
- return; // true;
3203
+// } else if (event.getSource() == textureButton)
3204
+// {
3205
+// return; // true;
32263206 } else // combos...
32273207 if (event.getSource() == texresMenu)
32283208 {
....@@ -3238,25 +3218,25 @@
32383218
32393219 void ToggleAnimation()
32403220 {
3241
- if (!CameraPane.ANIMATION)
3221
+ if (!Globals.ANIMATION)
32423222 {
32433223 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3244
- browser.show();
3224
+ browser.setVisible(true);
32453225 String filename = browser.getFile();
32463226 if (filename != null && filename.length() > 0)
32473227 {
3248
- CameraPane.filename = browser.getDirectory() + filename;
3228
+ Globals.filename = browser.getDirectory() + filename;
32493229 //CameraPane.framecount = 0;
3250
- CameraPane.imagecount = 0;
3230
+ Globals.imagecount = 0;
32513231
3252
- CameraPane.ANIMATION ^= true;
3232
+ Globals.ANIMATION ^= true;
32533233
32543234 GrafreeD.wav.cursor = 0;
32553235 GrafreeD.wav.loop = 0;
32563236 }
32573237 } else
32583238 {
3259
- CameraPane.ANIMATION ^= true;
3239
+ Globals.ANIMATION ^= true;
32603240 }
32613241 }
32623242
....@@ -3273,6 +3253,7 @@
32733253 callee.refreshContents();
32743254 } else
32753255 {
3256
+ new Exception().printStackTrace();
32763257 System.exit(0);
32773258 }
32783259 }
....@@ -3435,7 +3416,7 @@
34353416 current.fakedepth = (float) fakedepthField.getFloat();
34363417 current.shadowbias = (float) shadowbiasField.getFloat();
34373418
3438
- if (!NumberSlider.frozen)
3419
+ if (!cNumberSlider.frozen)
34393420 {
34403421 //System.out.println("Propagate = " + propagate);
34413422 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3483,6 +3464,7 @@
34833464 || e.getSource() == apertureField
34843465 || e.getSource() == shadowblurField)
34853466 {
3467
+ new Exception().printStackTrace();
34863468 System.exit(0);
34873469 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34883470 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3509,7 +3491,13 @@
35093491 //System.out.println("PARENT = " + parent);
35103492 //if (parent != null)
35113493 // parent.applySelf();
3512
- refreshContents();
3494
+ if (e.getSource() == normalpushField)
3495
+ {
3496
+ objEditor.refreshContents();
3497
+ //Refresh();
3498
+ }
3499
+ else
3500
+ refreshContents();
35133501 // ??? client.refreshEditWindow();
35143502 }
35153503 //else
....@@ -3521,7 +3509,7 @@
35213509 //group.name = nameField.getText();
35223510 //objEditor.applySelf();
35233511
3524
- assert (objEditor == this);
3512
+ // OCT2018: assert (objEditor == this);
35253513 if (copy.selection == null || copy.selection.size() == 0)
35263514 //super.applySelf()
35273515 ; else
....@@ -3545,12 +3533,18 @@
35453533 objEditor.copy = keep;
35463534 }
35473535 }
3536
+
3537
+ if (normalpushField != null)
3538
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
35483539 }
35493540
35503541 void SnapObject()
35513542 {
3552
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3553
- SnapObject(obj);
3543
+ if (copy.selection.size() > 0)
3544
+ {
3545
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3546
+ SnapObject(obj);
3547
+ }
35543548 }
35553549
35563550 void SnapObject(Object3D obj)
....@@ -3796,7 +3790,7 @@
37963790
37973791 radioPanel.revalidate();
37983792 radioPanel.repaint();
3799
- ctrlPanel.revalidate(); // ? new
3793
+ ctrlPanel.validate(); // ? new
38003794 ctrlPanel.repaint();
38013795 }
38023796 }
....@@ -4442,9 +4436,10 @@
44424436 //MenuItem normalLensItem;
44434437 MenuItem editCameraItem;
44444438 MenuItem revertCameraItem;
4445
- CheckboxMenuItem toggleLiveItem;
44464439 MenuItem stepItem;
4447
- CheckboxMenuItem toggleFullItem;
4440
+ CheckboxMenuItem toggleLiveItem;
4441
+ CheckboxMenuItem toggleFullScreenItem;
4442
+ CheckboxMenuItem toggleTimelineItem;
44484443 CheckboxMenuItem toggleRenderItem;
44494444 CheckboxMenuItem toggleDebugItem;
44504445 CheckboxMenuItem toggleFrustumItem;
....@@ -4459,23 +4454,26 @@
44594454 JSplitPane mainPanel;
44604455 JScrollPane scrollpane;
44614456 JPanel toolbarPanel;
4462
- JPanel treePanel;
4457
+ cGridBag treePanel;
44634458 JPanel radioPanel;
44644459 ButtonGroup buttonGroup;
4465
- JPanel ctrlPanel;
4466
- JPanel materialPanel;
4460
+ cGridBag ctrlPanel;
4461
+ cGridBag materialPanel;
44674462 JScrollPane infoPanel;
4468
- JPanel optionsPanel;
4463
+ cGridBag optionsPanel;
44694464 JTabbedPane objectPanel;
4470
- JPanel XYZPanel;
4465
+ cGridBag XYZPanel;
44714466 JSplitPane gridPanel;
44724467 JSplitPane bigPanel;
4473
- JPanel bigThree;
4474
- JTabbedPane jtp;
4475
- JPanel cameraPanel;
4468
+ cGridBag bigThree;
4469
+ cGridBag scenePanel;
4470
+ cGridBag centralPanel;
4471
+ JSplitPane cameraPanel;
4472
+ JPanel timelinePanel;
4473
+ JMenuBar timelineMenubar;
44764474 JSplitPane framePanel;
44774475 JTextArea/*Field*/ nameField;
4478
- cButton textureButton;
4476
+ //cButton textureButton;
44794477 cButton okButton;
44804478 cButton applyButton;
44814479 cButton cancelButton;
....@@ -4522,65 +4520,67 @@
45224520 // MATERIAL
45234521 JLabel materialLabel;
45244522 JLabel colorLabel;
4525
- NumberSlider colorField;
4523
+ cNumberSlider colorField;
45264524 JLabel modulationLabel;
4527
- NumberSlider modulationField;
4525
+ cNumberSlider modulationField;
45284526 JLabel metalnessLabel;
4529
- NumberSlider metalnessField;
4527
+ cNumberSlider metalnessField;
45304528 JLabel diffuseLabel;
4531
- NumberSlider diffuseField;
4529
+ cNumberSlider diffuseField;
45324530 JLabel specularLabel;
4533
- NumberSlider specularField;
4531
+ cNumberSlider specularField;
45344532 JLabel shininessLabel;
4535
- NumberSlider shininessField;
4533
+ cNumberSlider shininessField;
45364534 JLabel shiftLabel;
4537
- NumberSlider shiftField;
4535
+ cNumberSlider shiftField;
45384536 JLabel ambientLabel;
4539
- NumberSlider ambientField;
4537
+ cNumberSlider ambientField;
45404538 JLabel lightareaLabel;
4541
- NumberSlider lightareaField;
4539
+ cNumberSlider lightareaField;
45424540 JLabel diffusenessLabel;
4543
- NumberSlider diffusenessField;
4541
+ cNumberSlider diffusenessField;
45444542 JLabel velvetLabel;
4545
- NumberSlider velvetField;
4543
+ cNumberSlider velvetField;
45464544 JLabel sheenLabel;
4547
- NumberSlider sheenField;
4545
+ cNumberSlider sheenField;
45484546 JLabel subsurfaceLabel;
4549
- NumberSlider subsurfaceField;
4547
+ cNumberSlider subsurfaceField;
45504548 //JLabel bumpLabel;
45514549 //NumberSlider bumpField;
45524550 JLabel backlitLabel;
4553
- NumberSlider backlitField;
4551
+ cNumberSlider backlitField;
45544552 JLabel anisoLabel;
4555
- NumberSlider anisoField;
4553
+ cNumberSlider anisoField;
45564554 JLabel anisoVLabel;
4557
- NumberSlider anisoVField;
4555
+ cNumberSlider anisoVField;
45584556 JLabel cameraLabel;
4559
- NumberSlider cameraField;
4557
+ cNumberSlider cameraField;
45604558 JLabel selfshadowLabel;
4561
- NumberSlider selfshadowField;
4559
+ cNumberSlider selfshadowField;
45624560 JLabel shadowLabel;
4563
- NumberSlider shadowField;
4561
+ cNumberSlider shadowField;
45644562 JLabel textureLabel;
4565
- NumberSlider textureField;
4563
+ cNumberSlider textureField;
45664564 JLabel opacityLabel;
4567
- NumberSlider opacityField;
4565
+ cNumberSlider opacityField;
45684566 JLabel fakedepthLabel;
4569
- NumberSlider fakedepthField;
4567
+ cNumberSlider fakedepthField;
45704568 JLabel shadowbiasLabel;
4571
- NumberSlider shadowbiasField;
4569
+ cNumberSlider shadowbiasField;
45724570 JLabel bumpLabel;
4573
- NumberSlider bumpField;
4571
+ cNumberSlider bumpField;
45744572 JLabel noiseLabel;
4575
- NumberSlider noiseField;
4573
+ cNumberSlider noiseField;
45764574 JLabel powerLabel;
4577
- NumberSlider powerField;
4575
+ cNumberSlider powerField;
45784576 JLabel borderfadeLabel;
4579
- NumberSlider borderfadeField;
4577
+ cNumberSlider borderfadeField;
45804578 JLabel fogLabel;
4581
- NumberSlider fogField;
4579
+ cNumberSlider fogField;
45824580 JLabel opacityPowerLabel;
4583
- NumberSlider opacityPowerField;
4581
+ cNumberSlider opacityPowerField;
45844582 JTree jTree;
45854583 //ObjectUI parent;
4584
+
4585
+ cNumberSlider normalpushField;
45864586 }