Normand Briere
2019-05-01 20c1a07b76c39462594aedfedfe6e6adb17cd552
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,60 @@
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);
139145
140146 if (!GroupEditor.allparams)
141147 return;
142148
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);
149
+// objEditor.ctrlPanel.remove(liveCB);
150
+// objEditor.ctrlPanel.remove(hideCB);
151
+// objEditor.ctrlPanel.remove(markCB);
152
+//
153
+// objEditor.ctrlPanel.remove(randomCB);
154
+// objEditor.ctrlPanel.remove(speedupCB);
155
+// objEditor.ctrlPanel.remove(rewindCB);
156
+//
157
+// objEditor.ctrlPanel.remove(resetButton);
158
+// objEditor.ctrlPanel.remove(stepButton);
159
+//// objEditor.ctrlPanel.remove(stepAllButton);
160
+//// objEditor.ctrlPanel.remove(resetAllButton);
161
+// objEditor.ctrlPanel.remove(link2masterCB);
162
+// //objEditor.ctrlPanel.remove(flipVCB);
163
+// //objEditor.ctrlPanel.remove(texresMenu);
164
+// objEditor.ctrlPanel.remove(slowerButton);
165
+// objEditor.ctrlPanel.remove(fasterButton);
166
+// objEditor.ctrlPanel.remove(remarkButton);
167
+
168
+ objEditor.ctrlPanel.remove(namePanel);
169
+ objEditor.ctrlPanel.remove(setupPanel);
170
+ objEditor.ctrlPanel.remove(commandsPanel);
171
+ objEditor.ctrlPanel.remove(pushPanel);
172
+ //objEditor.ctrlPanel.remove(fillPanel);
173
+
174
+ //Remove(normalpushField);
161175 }
162176
163177 public ObjEditor GetEditor()
164178 {
165179 return objEditor; //.GetEditor();
166180 }
181
+
182
+ // Sometimes myself, sometimes my callee's.
167183 ObjEditor objEditor;
168184
169185 /*
....@@ -238,7 +254,7 @@
238254 //if (!isDisplayable())
239255 //setUndecorated(true);
240256
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
257
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242258 client = inClient;
243259 copy = localCopy;
244260 copy.editWindow = this;
....@@ -292,16 +308,18 @@
292308 //normalLensItem.addActionListener(this);
293309 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294310 revertCameraItem.addActionListener(this);
295
- cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullItem.addItemListener(this);
297
- toggleFullItem.setState(CameraPane.FULLSCREEN);
311
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
312
+ toggleTimelineItem.addItemListener(this);
313
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
314
+ toggleFullScreenItem.addItemListener(this);
315
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
298316 cameraMenu.add("-");
299317 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
300318 toggleTextureItem.addItemListener(this);
301319 toggleTextureItem.setState(CameraPane.textureon);
302320 cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
303321 toggleLiveItem.addItemListener(this);
304
- toggleLiveItem.setState(CameraPane.isLIVE());
322
+ toggleLiveItem.setState(Globals.isLIVE());
305323 cameraMenu.add(stepItem = new MenuItem("Step"));
306324 stepItem.addActionListener(this);
307325 // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
....@@ -341,21 +359,23 @@
341359 objectPanel = new JTabbedPane();
342360 toolbarPanel = new JPanel();
343361 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
362
+ treePanel = new cGridBag();
345363 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
364
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
347365 ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
366
+ materialPanel = new cGridBag().setVertical(true);
349367 materialPanel.setName("Material");
350368 /*JTextPane*/
351369 infoarea = createTextPane();
370
+ doc = infoarea.getStyledDocument();
371
+
352372 infoarea.setEditable(true);
353373 SetText();
354374 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355375 // infoarea.setOpaque(false);
356376 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
377
+// TEXTAREA infoarea.setLineWrap(true);
378
+// TEXTAREA infoarea.setWrapStyleWord(true);
359379 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
360380 infoPanel.setPreferredSize(new Dimension(50, 200));
361381 infoPanel.setName("Info");
....@@ -366,16 +386,16 @@
366386 mainPanel.setName("Main");
367387 mainPanel.setContinuousLayout(true);
368388 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370389 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
390
+ mainPanel.setDividerLocation(0.5); //1.0);
391
+ mainPanel.setResizeWeight(0.5);
372392
373393 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374394 //mainPanel.setLayout(new GridBagLayout());
375395 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
396
+// treePanel.setLayout(new GridBagLayout());
397
+ //ctrlPanel.setLayout(new GridBagLayout());
398
+ //materialPanel.setLayout(new GridBagLayout());
379399
380400 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381401 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +434,7 @@
414434 static String newline = "\n";
415435 protected static final String buttonString = "JButton";
416436 StyledDocument doc;
417
- JTextArea infoarea;
437
+ JTextPane infoarea;
418438
419439 void ClearInfo()
420440 {
....@@ -481,7 +501,10 @@
481501 }
482502
483503 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
504
+ {
505
+ si.SendInfo(" BBox min: " + minima, "regular");
506
+ si.SendInfo(" BBox max: " + maxima, "regular");
507
+ }
485508
486509 if (sel.bRep != null)
487510 {
....@@ -579,6 +602,9 @@
579602 {
580603 CameraPane.pointflow = (PointFlow) sel;
581604 }
605
+
606
+ si.SendInfo("_____________________", "regular");
607
+ si.SendInfo("", "regular");
582608 }
583609 }
584610
....@@ -594,52 +620,68 @@
594620 }
595621 }
596622
597
- private JTextArea createTextPane()
598
- {
599
- String[] initString =
623
+ void ToggleFullScreen()
600624 {
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++)
625
+ if (CameraPane.FULLSCREEN)
632626 {
633
- doc.insertString(doc.getLength(), initString[i],
634
- doc.getStyle(initStyles[i]));
627
+ frame.getContentPane().remove(/*"Center",*/bigThree);
628
+ framePanel.add(bigThree);
629
+ frame.getContentPane().add(/*"Center",*/framePanel);
630
+ } else
631
+ {
632
+ frame.getContentPane().remove(/*"Center",*/framePanel);
633
+ framePanel.remove(bigThree);
634
+ frame.getContentPane().add(/*"Center",*/bigThree);
635635 }
636
- }
637
- } catch (BadLocationException ble)
638
- {
639
- System.err.println("Couldn't insert initial text into text pane.");
636
+ cameraView.ToggleFullScreen();
640637 }
641638
642
- return new JTextArea(); // textPane;
639
+ private JTextPane createTextPane()
640
+ {
641
+// TEXTAREA String[] initString =
642
+// {
643
+// "This is an editable JTextPane, ", //regular
644
+// "another ", //italic
645
+// "styled ", //bold
646
+// "text ", //small
647
+// "component, ", //large
648
+// "which supports embedded components..." + newline,//regular
649
+// " " + newline, //button
650
+// "...and embedded icons..." + newline, //regular
651
+// " ", //icon
652
+// newline + "JTextPane is a subclass of JEditorPane that "
653
+// + "uses a StyledEditorKit and StyledDocument, and provides "
654
+// + "cover methods for interacting with those objects."
655
+// };
656
+//
657
+// String[] initStyles =
658
+// {
659
+// "regular", "italic", "bold", "small", "large",
660
+// "regular", "button", "regular", "icon",
661
+// "regular"
662
+// };
663
+//
664
+// JTextPane textPane = new JTextPane();
665
+// textPane.setEditable(true);
666
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
667
+// addStylesToDocument(doc);
668
+//
669
+// try
670
+// {
671
+// for (int j = 0; j < 2; j++)
672
+// {
673
+// for (int i = 0; i < initString.length; i++)
674
+// {
675
+// doc.insertString(doc.getLength(), initString[i],
676
+// doc.getStyle(initStyles[i]));
677
+// }
678
+// }
679
+// } catch (BadLocationException ble)
680
+// {
681
+// System.err.println("Couldn't insert initial text into text pane.");
682
+// }
683
+
684
+ return new JTextPane(); // textPane;
643685 }
644686
645687 protected void addStylesToDocument(StyledDocument doc)
....@@ -739,115 +781,83 @@
739781 JButton slowerButton;
740782 JButton fasterButton;
741783 JButton remarkButton;
784
+
785
+ cGridBag namePanel;
786
+ cGridBag setupPanel;
787
+ cGridBag commandsPanel;
788
+ cGridBag pushPanel;
789
+ cGridBag fillPanel;
742790
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
791
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
744792 {
745793 JCheckBox cb;
746794
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);
795
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
752796 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
756797
757798 return cb;
758799 }
759800
760
- cButton AddButton(ObjEditor oe, String label)
801
+ cButton AddButton(cGridBag panel, String label)
761802 {
762803 cButton cb;
763804
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);
805
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
769806 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
773807
774808 return cb;
775809 }
776810
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
811
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
778812 {
779813 JComboBox combo;
780814
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;
815
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
784816 combo.addActionListener(this);
785817
786818 return combo;
787819 }
788820
789
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
821
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
790822 {
791
- NumberSlider combo;
823
+ cGridBag control = new cGridBag();
824
+
825
+ cNumberSlider combo;
792826
793827 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
796828 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
-
829
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
806831 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
832
+
833
+ panel.add(control);
834
+
835
+ return control;
813836 }
814837
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
838
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
816839 {
817
- NumberSlider combo;
840
+ cGridBag control = new cGridBag();
841
+
842
+ cNumberSlider combo;
818843
819844 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822845 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
-
846
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
847
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832848 combo.setInteger(current);
833849
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
850
+ panel.add(control);
851
+
852
+ return control;
839853 }
840854
841
- JTextArea AddText(JPanel ctrlPanel, String name)
855
+ JTextArea AddText(cGridBag ctrlPanel, String name)
842856 {
843857 JTextArea text;
844858
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
859
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848860 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
851861
852862 return text;
853863 }
....@@ -877,9 +887,16 @@
877887 objEditor.ctrlPanel.remove(j);
878888 }
879889
890
+ void Remove(cNumberSlider j)
891
+ {
892
+ j.removeChangeListener(this);
893
+ //objEditor.ctrlPanel.remove(j.label);
894
+ objEditor.ctrlPanel.remove(j);
895
+ }
896
+
880897 /*
881898 */
882
- void Return() // ObjEditor oe)
899
+ void Return0() // ObjEditor oe)
883900 {
884901 aConstraints.gridy += 1;
885902 aConstraints.gridx = 0;
....@@ -938,31 +955,53 @@
938955 // oe.aConstraints.weighty = 0;
939956 // oe.aConstraints.gridx = 0;
940957 // oe.aConstraints.gridy = 0;
941
- SetupName(oe);
958
+ //SetupName(oe);
959
+
960
+ namePanel = new cGridBag();
961
+
962
+ nameField = AddText(namePanel, copy.GetName());
963
+ namePanel.add(nameField);
964
+ oe.ctrlPanel.add(namePanel);
965
+
966
+ oe.ctrlPanel.Return();
942967
943968 if (!GroupEditor.allparams)
944969 return;
945970
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
971
+ setupPanel = new cGridBag().setVertical(false);
972
+
973
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
974
+ link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
975
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
949976 // 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");
977
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
978
+ rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind);
979
+ randomCB = AddCheckBox(setupPanel, "Rand", copy.random);
980
+
981
+ oe.ctrlPanel.add(setupPanel);
982
+ oe.ctrlPanel.Return();
983
+
984
+ commandsPanel = new cGridBag().setVertical(false);
985
+
986
+ resetButton = AddButton(commandsPanel, "Reset");
987
+ stepButton = AddButton(commandsPanel, "Step");
956988 // resetAllButton = AddButton(oe, "Reset All");
957989 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
990
+ speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
959991 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- remarkButton = AddButton(oe, "Rem");
992
+ slowerButton = AddButton(commandsPanel, "Slow");
993
+ fasterButton = AddButton(commandsPanel, "Fast");
994
+ remarkButton = AddButton(commandsPanel, "Remark");
963995
964
- Return();
996
+ oe.ctrlPanel.add(commandsPanel);
997
+ oe.ctrlPanel.Return();
965998
999
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1000
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1001
+ //Return();
1002
+
1003
+ oe.ctrlPanel.Return();
1004
+
9661005 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671006 // ObjEditor.aConstraints.gridx += 1;
9681007
....@@ -1056,7 +1095,7 @@
10561095 oe.aConstraints.gridwidth = 1;
10571096 /**/
10581097 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1098
+ oe.ctrlPanel.Return();
10601099
10611100 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621101 //textureButton.setEnabled(false);
....@@ -1158,11 +1197,22 @@
11581197 //JPanel worldPanel =
11591198 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601199 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1164
- //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame);
1200
+ centralPanel = new cGridBag();
1201
+ centralPanel.preferredWidth = 20;
1202
+ timelinePanel = new JPanel(new BorderLayout());
1203
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11651204
1205
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1206
+ cameraPanel.setContinuousLayout(true);
1207
+ cameraPanel.setOneTouchExpandable(true);
1208
+// cameraPanel.setDividerLocation(0.9);
1209
+// cameraPanel.setDividerSize(9);
1210
+ cameraPanel.setResizeWeight(1.0);
1211
+
1212
+ centralPanel.add(cameraView);
1213
+ //frame.setJMenuBar(timelineMenubar);
1214
+ //centralPanel.add(timelinePanel);
1215
+
11661216 //topView.camera = ;
11671217 //frontView.camera = new Camera(2);
11681218 //sideView.camera = new Camera(3);
....@@ -1178,12 +1228,13 @@
11781228 //frontView.object = copy;
11791229 //sideView.object = copy;
11801230
1181
- XYZPanel = new JPanel();
1182
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1231
+ XYZPanel = new cGridBag().setVertical(true);
1232
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11831233
1184
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1186
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1234
+ XYZPanel.preferredWidth = 5;
1235
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1236
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1237
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
11871238
11881239 /*
11891240 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1192,7 +1243,7 @@
11921243 gridPanel.add(cameraView);
11931244 gridPanel.add(XYZPanel);
11941245 */
1195
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1246
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11961247 gridPanel.setContinuousLayout(true);
11971248 gridPanel.setOneTouchExpandable(true);
11981249 gridPanel.setDividerLocation(1.0);
....@@ -1221,10 +1272,11 @@
12211272 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12221273 //tmp.setName("Edit");
12231274 objectPanel.add(materialPanel);
1224
- JPanel north = new JPanel(new BorderLayout());
1225
- north.setName("Edit");
1226
- north.add(ctrlPanel, BorderLayout.NORTH);
1227
- objectPanel.add(north);
1275
+// JPanel north = new JPanel(new BorderLayout());
1276
+// north.setName("Edit");
1277
+// north.add(ctrlPanel, BorderLayout.NORTH);
1278
+// objectPanel.add(north);
1279
+ objectPanel.add(ctrlPanel);
12281280 objectPanel.add(infoPanel);
12291281
12301282 /*
....@@ -1245,16 +1297,23 @@
12451297 scrollpane.setWheelScrollingEnabled(true);
12461298 scrollpane.addMouseWheelListener(this); // Default not fast enough
12471299
1248
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1249
- scenePanel.add(scrollpane);
1300
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1301
+ scenePanel.preferredWidth = 7;
1302
+
1303
+ JTabbedPane tabbedPane = new JTabbedPane();
1304
+ tabbedPane.add(scrollpane);
12501305
1251
- scenePanel.add(FSPane = new cFileSystemPane(this));
1306
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12521307
1253
- optionsPanel = new JPanel(new GridBagLayout());
1308
+ optionsPanel = new cGridBag().setVertical(true);
12541309
12551310 optionsPanel.setName("Options");
1256
- scenePanel.add(optionsPanel);
1257
-
1311
+
1312
+ AddOptions(optionsPanel); //, aConstraints);
1313
+
1314
+ tabbedPane.add(optionsPanel);
1315
+
1316
+ scenePanel.add(tabbedPane);
12581317
12591318 /*
12601319 cTree jTree = new cTree(null);
....@@ -1288,6 +1347,7 @@
12881347 //bigPanel.setSize(new Dimension(10,10));
12891348 //bigPanel.add(ctrlPanel);
12901349 //bigPanel.add(gridPanel);
1350
+ /**
12911351 bigThree = new JPanel();
12921352 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12931353 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1304,14 +1364,20 @@
13041364 // aConstraints.gridheight = 3;
13051365 aWindowConstraints.gridx = 1;
13061366 aWindowConstraints.fill = GridBagConstraints.BOTH;
1307
- bigThree.add(cameraPanel, aWindowConstraints);
1367
+ bigThree.add(centralPanel, aWindowConstraints);
13081368 aWindowConstraints.weightx = 0;
13091369 aWindowConstraints.gridx = 4;
13101370 aWindowConstraints.gridwidth = 1;
13111371 // aConstraints.gridheight = 3;
13121372 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13131373 bigThree.add(XYZPanel, aWindowConstraints);
1374
+ /**/
13141375
1376
+ bigThree = new cGridBag();
1377
+ bigThree.addComponent(scenePanel);
1378
+ bigThree.addComponent(centralPanel);
1379
+ bigThree.addComponent(XYZPanel);
1380
+
13151381 // // SIDE EFFECT!!!
13161382 // aConstraints.gridx = 0;
13171383 // aConstraints.gridy = 0;
....@@ -1332,7 +1398,8 @@
13321398 //worldPane.add(bigPanel);
13331399 //worldPane.add(worldPanel);
13341400 /**/
1335
- frame.getContentPane().add(/*"Center",*/framePanel);
1401
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1402
+ frame.add(/*"Center",*/framePanel);
13361403 //frame.getContentPane().add(/*"Center",*/ worldPane);
13371404
13381405 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
....@@ -1353,6 +1420,10 @@
13531420 });
13541421 }
13551422
1423
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1424
+ {
1425
+ }
1426
+
13561427 JTree GetTree()
13571428 {
13581429 return objEditor.jTree;
....@@ -1364,260 +1435,170 @@
13641435 ctrlPanel.removeAll();
13651436 }
13661437
1367
- void SetupMaterial(JPanel ctrlPanel)
1438
+ void SetupMaterial(cGridBag panel)
13681439 {
1369
- aConstraints.weighty = 0;
1370
- //aConstraints.weightx = 1;
1371
- /*
1440
+ /*
13721441 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13731442 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1374
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1375
- aConstraints.gridx += 1;
13761443 */
13771444
1378
- aConstraints.gridwidth = 1;
1379
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1380
- aConstraints.gridx += 1;
1381
- aConstraints.weighty = 0;
1382
- aConstraints.gridwidth = 1;
1445
+ cGridBag editBar = new cGridBag().setVertical(false);
1446
+
1447
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1448
+ createMaterialButton.setToolTipText("Create material");
13831449
13841450 /*
13851451 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1386
- aConstraints.gridx += 1;
1387
- aConstraints.weighty = 0;
1388
- aConstraints.gridwidth = 1;
13891452 */
13901453
1391
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1392
- aConstraints.gridx += 1;
1454
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1455
+ clearMaterialButton.setToolTipText("Clear material");
1456
+
1457
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1458
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1459
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
13931460
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;
1461
+ editBar.preferredHeight = 15;
1462
+
1463
+ panel.add(editBar);
1464
+
14081465 /**/
14091466 //aConstraints.weighty = 0;
14101467 ////aConstraints.weightx = 1;
14111468 //aConstraints.weighty = 1;
14121469 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14131470 //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;
1471
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14191472
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;
1473
+ cGridBag colorSection = new cGridBag().setVertical(true);
1474
+
1475
+ cGridBag color = new cGridBag();
1476
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1477
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1479
+ //colorField.preferredWidth = 200;
1480
+ colorSection.add(color);
14301481
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;
1482
+ cGridBag modulation = new cGridBag();
1483
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1484
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1485
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1486
+ colorSection.add(modulation);
14401487
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;
1488
+ cGridBag texture = new cGridBag();
1489
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1490
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1491
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1492
+ colorSection.add(texture);
14501493
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;
1494
+ cGridBag anisoU = new cGridBag();
1495
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1496
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1497
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1498
+ colorSection.add(anisoU);
14601499
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;
1500
+ cGridBag anisoV = new cGridBag();
1501
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1502
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1503
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1504
+ colorSection.add(anisoV);
14701505
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;
1506
+ cGridBag shadowbias = new cGridBag();
1507
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1508
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1509
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1510
+ colorSection.add(shadowbias);
14801511
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;
1512
+ panel.add(new JSeparator());
1513
+
1514
+ panel.add(colorSection);
1515
+
1516
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1517
+
1518
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1519
+
1520
+ cGridBag diffuse = new cGridBag();
1521
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1522
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1523
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1524
+ diffuseSection.add(diffuse);
14891525
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;
1526
+ cGridBag diffuseness = new cGridBag();
1527
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1528
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1529
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1530
+ diffuseSection.add(diffuseness);
14991531
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;
1532
+ cGridBag selfshadow = new cGridBag();
1533
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1534
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1535
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1536
+ diffuseSection.add(selfshadow);
15091537
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;
1538
+ cGridBag sheen = new cGridBag();
1539
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1540
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1541
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1542
+ diffuseSection.add(sheen);
15191543
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;
1544
+ cGridBag subsurface = new cGridBag();
1545
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1546
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1547
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1548
+ diffuseSection.add(subsurface);
15291549
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;
1550
+ cGridBag shadow = new cGridBag();
1551
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1552
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1553
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1554
+ diffuseSection.add(shadow);
15391555
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;
1556
+ cGridBag fakedepth = new cGridBag();
1557
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1558
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1559
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1560
+ diffuseSection.add(fakedepth);
15491561
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;
1562
+ panel.add(new JSeparator());
1563
+
1564
+ panel.add(diffuseSection);
1565
+
1566
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1567
+
1568
+ cGridBag specularSection = new cGridBag().setVertical(true);
15591569
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;
1570
+ cGridBag specular = new cGridBag();
1571
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1572
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1573
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1574
+ specularSection.add(specular);
15681575
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;
1576
+ cGridBag lightarea = new cGridBag();
1577
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1578
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1579
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1580
+ specularSection.add(lightarea);
15781581
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;
1582
+ cGridBag shininess = new cGridBag();
1583
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1584
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1585
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1586
+ specularSection.add(shininess);
15881587
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;
1588
+ cGridBag metalness = new cGridBag();
1589
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1590
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1591
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1592
+ specularSection.add(metalness);
15981593
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;
1594
+ cGridBag velvet = new cGridBag();
1595
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1596
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1597
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1598
+ specularSection.add(velvet);
16081599
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();
1600
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1601
+ //Return();
16211602 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16221603 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16231604 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1628,130 +1609,93 @@
16281609 // aConstraints.gridy += 1;
16291610 // aConstraints.gridwidth = 1;
16301611
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;
16391612
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;
1613
+ panel.add(new JSeparator());
1614
+
1615
+ panel.add(specularSection);
1616
+
1617
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1618
+
1619
+ cGridBag globalSection = new cGridBag().setVertical(true);
16491620
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;
1621
+ cGridBag camera = new cGridBag();
1622
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1623
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1624
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1625
+ globalSection.add(camera);
16591626
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;
1627
+ cGridBag ambient = new cGridBag();
1628
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1629
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1630
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1631
+ globalSection.add(ambient);
16691632
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;
1633
+ cGridBag backlit = new cGridBag();
1634
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1635
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1636
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1637
+ globalSection.add(backlit);
16801638
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;
1639
+ cGridBag opacity = new cGridBag();
1640
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1641
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1642
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1643
+ globalSection.add(opacity);
16901644
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;
1645
+ panel.add(new JSeparator());
1646
+
1647
+ panel.add(globalSection);
1648
+
1649
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1650
+
1651
+ cGridBag textureSection = new cGridBag().setVertical(true);
17001652
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;
1653
+ cGridBag bump = new cGridBag();
1654
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1655
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1656
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1657
+ textureSection.add(bump);
17101658
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;
1659
+ cGridBag noise = new cGridBag();
1660
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1661
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1662
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1663
+ textureSection.add(noise);
17201664
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;
1665
+ cGridBag power = new cGridBag();
1666
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1667
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1668
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1669
+ textureSection.add(power);
17301670
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;
1671
+ cGridBag borderfade = new cGridBag();
1672
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1673
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1674
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1675
+ textureSection.add(borderfade);
17401676
1741
- //aConstraints.weighty = 1;
1742
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1743
- //aConstraints.gridx += 1;
1744
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1745
- aConstraints.weighty = 0;
1677
+ cGridBag fog = new cGridBag();
1678
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1679
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1680
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1681
+ textureSection.add(fog);
17461682
1747
- aConstraints.gridx = 0;
1748
- aConstraints.gridy = 0;
1749
- aConstraints.gridwidth = 1;
1683
+ cGridBag opacityPower = new cGridBag();
1684
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1685
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1686
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1687
+ textureSection.add(opacityPower);
1688
+
1689
+ panel.add(new JSeparator());
1690
+
1691
+ panel.add(textureSection);
1692
+
1693
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17501694
17511695 SetMaterial(copy); // .GetMaterial());
17521696
1753
- colorField.addChangeListener(this);
1754
- modulationField.addChangeListener(this);
1697
+ //colorField.addChangeListener(this);
1698
+// modulationField.addChangeListener(this);
17551699 metalnessField.addChangeListener(this);
17561700 diffuseField.addChangeListener(this);
17571701 specularField.addChangeListener(this);
....@@ -2563,6 +2507,7 @@
25632507 }
25642508 if (input == null)
25652509 {
2510
+ new Exception().printStackTrace();
25662511 System.exit(0);
25672512 }
25682513
....@@ -2959,20 +2904,37 @@
29592904 // june 2013 copy.HardTouch();
29602905 cameraView.repaint();
29612906 return;
2962
- } else if (event.getSource() == toggleFullItem)
2907
+ } else if (event.getSource() == toggleTimelineItem)
29632908 {
2964
- if (CameraPane.FULLSCREEN)
2909
+ timeline ^= true;
2910
+
2911
+ if (timeline)
29652912 {
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);
2913
+ centralPanel.remove(cameraView);
2914
+ cameraPanel.add(cameraView);
2915
+ centralPanel.add(cameraPanel);
2916
+ frame.setJMenuBar(timelineMenubar);
2917
+ wasFullScreen = CameraPane.FULLSCREEN;
2918
+ if (!CameraPane.FULLSCREEN)
2919
+ ToggleFullScreen();
2920
+ toggleFullScreenItem.setEnabled(false);
29732921 }
2922
+ else
2923
+ {
2924
+ centralPanel.remove(cameraPanel);
2925
+ centralPanel.add(cameraView);
2926
+ frame.setJMenuBar(null);
2927
+ if (!wasFullScreen)
2928
+ ToggleFullScreen();
2929
+ toggleFullScreenItem.setEnabled(true);
2930
+ }
2931
+
29742932 frame.validate();
2975
- cameraView.ToggleFullScreen();
2933
+ return;
2934
+ } else if (event.getSource() == toggleFullScreenItem)
2935
+ {
2936
+ ToggleFullScreen();
2937
+ frame.validate();
29762938
29772939 return;
29782940 } else if (event.getSource() == toggleRandomItem)
....@@ -3082,7 +3044,8 @@
30823044 objEditor.refreshContents();
30833045 } else if (event.getSource() == stepItem)
30843046 {
3085
- cameraView.ONESTEP = true;
3047
+ //cameraView.ONESTEP = true;
3048
+ Globals.ONESTEP = true;
30863049 cameraView.repaint();
30873050 return;
30883051 } else if (event.getSource() == stepButton)
....@@ -3221,9 +3184,9 @@
32213184 cameraView.RevertCamera();
32223185 cameraView.repaint();
32233186 return;
3224
- } else if (event.getSource() == textureButton)
3225
- {
3226
- return; // true;
3187
+// } else if (event.getSource() == textureButton)
3188
+// {
3189
+// return; // true;
32273190 } else // combos...
32283191 if (event.getSource() == texresMenu)
32293192 {
....@@ -3239,25 +3202,25 @@
32393202
32403203 void ToggleAnimation()
32413204 {
3242
- if (!CameraPane.ANIMATION)
3205
+ if (!Globals.ANIMATION)
32433206 {
32443207 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3245
- browser.show();
3208
+ browser.setVisible(true);
32463209 String filename = browser.getFile();
32473210 if (filename != null && filename.length() > 0)
32483211 {
3249
- CameraPane.filename = browser.getDirectory() + filename;
3212
+ Globals.filename = browser.getDirectory() + filename;
32503213 //CameraPane.framecount = 0;
3251
- CameraPane.imagecount = 0;
3214
+ Globals.imagecount = 0;
32523215
3253
- CameraPane.ANIMATION ^= true;
3216
+ Globals.ANIMATION ^= true;
32543217
32553218 GrafreeD.wav.cursor = 0;
32563219 GrafreeD.wav.loop = 0;
32573220 }
32583221 } else
32593222 {
3260
- CameraPane.ANIMATION ^= true;
3223
+ Globals.ANIMATION ^= true;
32613224 }
32623225 }
32633226
....@@ -3274,6 +3237,7 @@
32743237 callee.refreshContents();
32753238 } else
32763239 {
3240
+ new Exception().printStackTrace();
32773241 System.exit(0);
32783242 }
32793243 }
....@@ -3436,7 +3400,7 @@
34363400 current.fakedepth = (float) fakedepthField.getFloat();
34373401 current.shadowbias = (float) shadowbiasField.getFloat();
34383402
3439
- if (!NumberSlider.frozen)
3403
+ if (!cNumberSlider.frozen)
34403404 {
34413405 //System.out.println("Propagate = " + propagate);
34423406 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3484,6 +3448,7 @@
34843448 || e.getSource() == apertureField
34853449 || e.getSource() == shadowblurField)
34863450 {
3451
+ new Exception().printStackTrace();
34873452 System.exit(0);
34883453 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34893454 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3510,7 +3475,13 @@
35103475 //System.out.println("PARENT = " + parent);
35113476 //if (parent != null)
35123477 // parent.applySelf();
3513
- refreshContents();
3478
+ if (e.getSource() == normalpushField)
3479
+ {
3480
+ objEditor.refreshContents();
3481
+ //Refresh();
3482
+ }
3483
+ else
3484
+ refreshContents();
35143485 // ??? client.refreshEditWindow();
35153486 }
35163487 //else
....@@ -3522,7 +3493,7 @@
35223493 //group.name = nameField.getText();
35233494 //objEditor.applySelf();
35243495
3525
- assert (objEditor == this);
3496
+ // OCT2018: assert (objEditor == this);
35263497 if (copy.selection == null || copy.selection.size() == 0)
35273498 //super.applySelf()
35283499 ; else
....@@ -3546,12 +3517,18 @@
35463517 objEditor.copy = keep;
35473518 }
35483519 }
3520
+
3521
+ if (normalpushField != null)
3522
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
35493523 }
35503524
35513525 void SnapObject()
35523526 {
3553
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3554
- SnapObject(obj);
3527
+ if (copy.selection.size() > 0)
3528
+ {
3529
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3530
+ SnapObject(obj);
3531
+ }
35553532 }
35563533
35573534 void SnapObject(Object3D obj)
....@@ -3797,7 +3774,7 @@
37973774
37983775 radioPanel.revalidate();
37993776 radioPanel.repaint();
3800
- ctrlPanel.revalidate(); // ? new
3777
+ ctrlPanel.validate(); // ? new
38013778 ctrlPanel.repaint();
38023779 }
38033780 }
....@@ -4443,9 +4420,10 @@
44434420 //MenuItem normalLensItem;
44444421 MenuItem editCameraItem;
44454422 MenuItem revertCameraItem;
4446
- CheckboxMenuItem toggleLiveItem;
44474423 MenuItem stepItem;
4448
- CheckboxMenuItem toggleFullItem;
4424
+ CheckboxMenuItem toggleLiveItem;
4425
+ CheckboxMenuItem toggleFullScreenItem;
4426
+ CheckboxMenuItem toggleTimelineItem;
44494427 CheckboxMenuItem toggleRenderItem;
44504428 CheckboxMenuItem toggleDebugItem;
44514429 CheckboxMenuItem toggleFrustumItem;
....@@ -4460,23 +4438,26 @@
44604438 JSplitPane mainPanel;
44614439 JScrollPane scrollpane;
44624440 JPanel toolbarPanel;
4463
- JPanel treePanel;
4441
+ cGridBag treePanel;
44644442 JPanel radioPanel;
44654443 ButtonGroup buttonGroup;
4466
- JPanel ctrlPanel;
4467
- JPanel materialPanel;
4444
+ cGridBag ctrlPanel;
4445
+ cGridBag materialPanel;
44684446 JScrollPane infoPanel;
4469
- JPanel optionsPanel;
4447
+ cGridBag optionsPanel;
44704448 JTabbedPane objectPanel;
4471
- JPanel XYZPanel;
4449
+ cGridBag XYZPanel;
44724450 JSplitPane gridPanel;
44734451 JSplitPane bigPanel;
4474
- JPanel bigThree;
4475
- JTabbedPane scenePanel;
4476
- JPanel cameraPanel;
4452
+ cGridBag bigThree;
4453
+ cGridBag scenePanel;
4454
+ cGridBag centralPanel;
4455
+ JSplitPane cameraPanel;
4456
+ JPanel timelinePanel;
4457
+ JMenuBar timelineMenubar;
44774458 JSplitPane framePanel;
44784459 JTextArea/*Field*/ nameField;
4479
- cButton textureButton;
4460
+ //cButton textureButton;
44804461 cButton okButton;
44814462 cButton applyButton;
44824463 cButton cancelButton;
....@@ -4523,65 +4504,67 @@
45234504 // MATERIAL
45244505 JLabel materialLabel;
45254506 JLabel colorLabel;
4526
- NumberSlider colorField;
4507
+ cNumberSlider colorField;
45274508 JLabel modulationLabel;
4528
- NumberSlider modulationField;
4509
+ cNumberSlider modulationField;
45294510 JLabel metalnessLabel;
4530
- NumberSlider metalnessField;
4511
+ cNumberSlider metalnessField;
45314512 JLabel diffuseLabel;
4532
- NumberSlider diffuseField;
4513
+ cNumberSlider diffuseField;
45334514 JLabel specularLabel;
4534
- NumberSlider specularField;
4515
+ cNumberSlider specularField;
45354516 JLabel shininessLabel;
4536
- NumberSlider shininessField;
4517
+ cNumberSlider shininessField;
45374518 JLabel shiftLabel;
4538
- NumberSlider shiftField;
4519
+ cNumberSlider shiftField;
45394520 JLabel ambientLabel;
4540
- NumberSlider ambientField;
4521
+ cNumberSlider ambientField;
45414522 JLabel lightareaLabel;
4542
- NumberSlider lightareaField;
4523
+ cNumberSlider lightareaField;
45434524 JLabel diffusenessLabel;
4544
- NumberSlider diffusenessField;
4525
+ cNumberSlider diffusenessField;
45454526 JLabel velvetLabel;
4546
- NumberSlider velvetField;
4527
+ cNumberSlider velvetField;
45474528 JLabel sheenLabel;
4548
- NumberSlider sheenField;
4529
+ cNumberSlider sheenField;
45494530 JLabel subsurfaceLabel;
4550
- NumberSlider subsurfaceField;
4531
+ cNumberSlider subsurfaceField;
45514532 //JLabel bumpLabel;
45524533 //NumberSlider bumpField;
45534534 JLabel backlitLabel;
4554
- NumberSlider backlitField;
4535
+ cNumberSlider backlitField;
45554536 JLabel anisoLabel;
4556
- NumberSlider anisoField;
4537
+ cNumberSlider anisoField;
45574538 JLabel anisoVLabel;
4558
- NumberSlider anisoVField;
4539
+ cNumberSlider anisoVField;
45594540 JLabel cameraLabel;
4560
- NumberSlider cameraField;
4541
+ cNumberSlider cameraField;
45614542 JLabel selfshadowLabel;
4562
- NumberSlider selfshadowField;
4543
+ cNumberSlider selfshadowField;
45634544 JLabel shadowLabel;
4564
- NumberSlider shadowField;
4545
+ cNumberSlider shadowField;
45654546 JLabel textureLabel;
4566
- NumberSlider textureField;
4547
+ cNumberSlider textureField;
45674548 JLabel opacityLabel;
4568
- NumberSlider opacityField;
4549
+ cNumberSlider opacityField;
45694550 JLabel fakedepthLabel;
4570
- NumberSlider fakedepthField;
4551
+ cNumberSlider fakedepthField;
45714552 JLabel shadowbiasLabel;
4572
- NumberSlider shadowbiasField;
4553
+ cNumberSlider shadowbiasField;
45734554 JLabel bumpLabel;
4574
- NumberSlider bumpField;
4555
+ cNumberSlider bumpField;
45754556 JLabel noiseLabel;
4576
- NumberSlider noiseField;
4557
+ cNumberSlider noiseField;
45774558 JLabel powerLabel;
4578
- NumberSlider powerField;
4559
+ cNumberSlider powerField;
45794560 JLabel borderfadeLabel;
4580
- NumberSlider borderfadeField;
4561
+ cNumberSlider borderfadeField;
45814562 JLabel fogLabel;
4582
- NumberSlider fogField;
4563
+ cNumberSlider fogField;
45834564 JLabel opacityPowerLabel;
4584
- NumberSlider opacityPowerField;
4565
+ cNumberSlider opacityPowerField;
45854566 JTree jTree;
45864567 //ObjectUI parent;
4568
+
4569
+ cNumberSlider normalpushField;
45874570 }