Normand Briere
2019-05-01 a742f6cebf1d471217d836e07934e5c02c22b6db
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,18 +308,18 @@
292308 //normalLensItem.addActionListener(this);
293309 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294310 revertCameraItem.addActionListener(this);
311
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
312
+ toggleTimelineItem.addItemListener(this);
295313 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
296314 toggleFullScreenItem.addItemListener(this);
297315 toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
298
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
299
- toggleTimelineItem.addItemListener(this);
300316 cameraMenu.add("-");
301317 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
302318 toggleTextureItem.addItemListener(this);
303319 toggleTextureItem.setState(CameraPane.textureon);
304320 cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
305321 toggleLiveItem.addItemListener(this);
306
- toggleLiveItem.setState(CameraPane.isLIVE());
322
+ toggleLiveItem.setState(Globals.isLIVE());
307323 cameraMenu.add(stepItem = new MenuItem("Step"));
308324 stepItem.addActionListener(this);
309325 // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
....@@ -343,21 +359,23 @@
343359 objectPanel = new JTabbedPane();
344360 toolbarPanel = new JPanel();
345361 toolbarPanel.setName("Toolbar");
346
- treePanel = new JPanel();
362
+ treePanel = new cGridBag();
347363 treePanel.setName("Tree");
348
- ctrlPanel = new JPanel(); // new GridBagLayout());
364
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
349365 ctrlPanel.setName("Edit");
350
- materialPanel = new JPanel();
366
+ materialPanel = new cGridBag().setVertical(true);
351367 materialPanel.setName("Material");
352368 /*JTextPane*/
353369 infoarea = createTextPane();
370
+ doc = infoarea.getStyledDocument();
371
+
354372 infoarea.setEditable(true);
355373 SetText();
356374 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
357375 // infoarea.setOpaque(false);
358376 // //infoarea.setForeground(textcolor);
359
- infoarea.setLineWrap(true);
360
- infoarea.setWrapStyleWord(true);
377
+// TEXTAREA infoarea.setLineWrap(true);
378
+// TEXTAREA infoarea.setWrapStyleWord(true);
361379 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
362380 infoPanel.setPreferredSize(new Dimension(50, 200));
363381 infoPanel.setName("Info");
....@@ -368,16 +386,16 @@
368386 mainPanel.setName("Main");
369387 mainPanel.setContinuousLayout(true);
370388 mainPanel.setOneTouchExpandable(true);
371
- mainPanel.setDividerLocation(1.0);
372389 mainPanel.setDividerSize(9);
373
- mainPanel.setResizeWeight(0);
390
+ mainPanel.setDividerLocation(0.5); //1.0);
391
+ mainPanel.setResizeWeight(0.5);
374392
375393 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
376394 //mainPanel.setLayout(new GridBagLayout());
377395 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
378
- treePanel.setLayout(new GridBagLayout());
379
- ctrlPanel.setLayout(new GridBagLayout());
380
- materialPanel.setLayout(new GridBagLayout());
396
+// treePanel.setLayout(new GridBagLayout());
397
+ //ctrlPanel.setLayout(new GridBagLayout());
398
+ //materialPanel.setLayout(new GridBagLayout());
381399
382400 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
383401 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -416,7 +434,7 @@
416434 static String newline = "\n";
417435 protected static final String buttonString = "JButton";
418436 StyledDocument doc;
419
- JTextArea infoarea;
437
+ JTextPane infoarea;
420438
421439 void ClearInfo()
422440 {
....@@ -483,7 +501,10 @@
483501 }
484502
485503 if (full)
486
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
504
+ {
505
+ si.SendInfo(" BBox min: " + minima, "regular");
506
+ si.SendInfo(" BBox max: " + maxima, "regular");
507
+ }
487508
488509 if (sel.bRep != null)
489510 {
....@@ -581,6 +602,9 @@
581602 {
582603 CameraPane.pointflow = (PointFlow) sel;
583604 }
605
+
606
+ si.SendInfo("_____________________", "regular");
607
+ si.SendInfo("", "regular");
584608 }
585609 }
586610
....@@ -596,52 +620,68 @@
596620 }
597621 }
598622
599
- private JTextArea createTextPane()
600
- {
601
- String[] initString =
623
+ void ToggleFullScreen()
602624 {
603
- "This is an editable JTextPane, ", //regular
604
- "another ", //italic
605
- "styled ", //bold
606
- "text ", //small
607
- "component, ", //large
608
- "which supports embedded components..." + newline,//regular
609
- " " + newline, //button
610
- "...and embedded icons..." + newline, //regular
611
- " ", //icon
612
- newline + "JTextPane is a subclass of JEditorPane that "
613
- + "uses a StyledEditorKit and StyledDocument, and provides "
614
- + "cover methods for interacting with those objects."
615
- };
616
-
617
- String[] initStyles =
618
- {
619
- "regular", "italic", "bold", "small", "large",
620
- "regular", "button", "regular", "icon",
621
- "regular"
622
- };
623
-
624
- JTextPane textPane = new JTextPane();
625
- textPane.setEditable(true);
626
- /*StyledDocument*/ doc = textPane.getStyledDocument();
627
- addStylesToDocument(doc);
628
-
629
- try
630
- {
631
- for (int j = 0; j < 2; j++)
632
- {
633
- for (int i = 0; i < initString.length; i++)
625
+ if (CameraPane.FULLSCREEN)
634626 {
635
- doc.insertString(doc.getLength(), initString[i],
636
- 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);
637635 }
638
- }
639
- } catch (BadLocationException ble)
640
- {
641
- System.err.println("Couldn't insert initial text into text pane.");
636
+ cameraView.ToggleFullScreen();
642637 }
643638
644
- 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;
645685 }
646686
647687 protected void addStylesToDocument(StyledDocument doc)
....@@ -741,115 +781,83 @@
741781 JButton slowerButton;
742782 JButton fasterButton;
743783 JButton remarkButton;
784
+
785
+ cGridBag namePanel;
786
+ cGridBag setupPanel;
787
+ cGridBag commandsPanel;
788
+ cGridBag pushPanel;
789
+ cGridBag fillPanel;
744790
745
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
791
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
746792 {
747793 JCheckBox cb;
748794
749
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
750
- oe.aConstraints.gridwidth = 1; // 3;
751
-// oe.aConstraints.weightx = 1;
752
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
753
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
795
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
754796 cb.addItemListener(this);
755
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
756
- oe.aConstraints.gridwidth = 1;
757
- oe.aConstraints.gridx += 1;
758797
759798 return cb;
760799 }
761800
762
- cButton AddButton(ObjEditor oe, String label)
801
+ cButton AddButton(cGridBag panel, String label)
763802 {
764803 cButton cb;
765804
766
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
767
- oe.aConstraints.gridwidth = 1;
768
-// oe.aConstraints.weightx = 1;
769
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
770
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
805
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
771806 cb.addActionListener(this);
772
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
773
- oe.aConstraints.gridwidth = 1;
774
- oe.aConstraints.gridx += 1;
775807
776808 return cb;
777809 }
778810
779
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
811
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
780812 {
781813 JComboBox combo;
782814
783
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
784
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
785
- oe.aConstraints.gridx += 1;
815
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
786816 combo.addActionListener(this);
787817
788818 return combo;
789819 }
790820
791
- 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)
792822 {
793
- NumberSlider combo;
823
+ cGridBag control = new cGridBag();
824
+
825
+ cNumberSlider combo;
794826
795827 JLabel jlabel = new JLabel(label);
796
-
797
- aConstraints.fill = GridBagConstraints.VERTICAL;
798828 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
799
- aConstraints.gridwidth = 2;
800
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
801
- aConstraints.gridx += 1;
802
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
803
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
804
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
805
- aConstraints.gridx += 1;
806
- aConstraints.gridwidth = 1;
807
-
829
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808831 combo.setFloat(current);
809
-
810
- combo.label = jlabel;
811
-
812
- combo.addChangeListener(this);
813
-
814
- return combo;
832
+
833
+ panel.add(control);
834
+
835
+ return control;
815836 }
816837
817
- 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)
818839 {
819
- NumberSlider combo;
840
+ cGridBag control = new cGridBag();
841
+
842
+ cNumberSlider combo;
820843
821844 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824845 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
825
- aConstraints.gridwidth = 2;
826
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
829
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
830
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
- aConstraints.gridx += 1;
832
- aConstraints.gridwidth = 1;
833
-
846
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
847
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834848 combo.setInteger(current);
835849
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
850
+ panel.add(control);
851
+
852
+ return control;
841853 }
842854
843
- JTextArea AddText(JPanel ctrlPanel, String name)
855
+ JTextArea AddText(cGridBag ctrlPanel, String name)
844856 {
845857 JTextArea text;
846858
847
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
848
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
849
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
859
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
850860 text.addCaretListener(this);
851
- aConstraints.gridx += 1;
852
- aConstraints.gridwidth = 1;
853861
854862 return text;
855863 }
....@@ -879,9 +887,16 @@
879887 objEditor.ctrlPanel.remove(j);
880888 }
881889
890
+ void Remove(cNumberSlider j)
891
+ {
892
+ j.removeChangeListener(this);
893
+ //objEditor.ctrlPanel.remove(j.label);
894
+ objEditor.ctrlPanel.remove(j);
895
+ }
896
+
882897 /*
883898 */
884
- void Return() // ObjEditor oe)
899
+ void Return0() // ObjEditor oe)
885900 {
886901 aConstraints.gridy += 1;
887902 aConstraints.gridx = 0;
....@@ -936,35 +951,54 @@
936951
937952 void SetupUI2(ObjEditor oe)
938953 {
939
-// oe.aConstraints.weightx = 0;
940
-// oe.aConstraints.weighty = 0;
941
-// oe.aConstraints.gridx = 0;
942
-// oe.aConstraints.gridy = 0;
943
- SetupName(oe);
954
+ //SetupName(oe);
955
+
956
+ namePanel = new cGridBag();
957
+
958
+ nameField = AddText(namePanel, copy.GetName());
959
+ namePanel.add(nameField);
960
+ oe.ctrlPanel.add(namePanel);
961
+
962
+ oe.ctrlPanel.Return();
944963
945964 if (!GroupEditor.allparams)
946965 return;
947966
948
- liveCB = AddCheckBox(oe, "Live", copy.live);
949
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
950
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
967
+ setupPanel = new cGridBag().setVertical(false);
968
+
969
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
970
+ if (Globals.ADVANCED)
971
+ link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
972
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
951973 // Return();
952
- markCB = AddCheckBox(oe, "Mark", copy.marked);
953
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
954
- randomCB = AddCheckBox(oe, "Rand", copy.random);
955
- Return();
956
- resetButton = AddButton(oe, "Reset");
957
- stepButton = AddButton(oe, "Step");
974
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
975
+ rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind);
976
+ randomCB = AddCheckBox(setupPanel, "Rand", copy.random);
977
+
978
+ oe.ctrlPanel.add(setupPanel);
979
+ oe.ctrlPanel.Return();
980
+
981
+ commandsPanel = new cGridBag().setVertical(false);
982
+
983
+ resetButton = AddButton(commandsPanel, "Reset");
984
+ stepButton = AddButton(commandsPanel, "Step");
958985 // resetAllButton = AddButton(oe, "Reset All");
959986 // stepAllButton = AddButton(oe, "Step All");
960
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
987
+ speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
961988 // Return();
962
- slowerButton = AddButton(oe, "Slow");
963
- fasterButton = AddButton(oe, "Fast");
964
- remarkButton = AddButton(oe, "Rem");
989
+ slowerButton = AddButton(commandsPanel, "Slow");
990
+ fasterButton = AddButton(commandsPanel, "Fast");
991
+ remarkButton = AddButton(commandsPanel, "Remark");
965992
966
- Return();
993
+ oe.ctrlPanel.add(commandsPanel);
994
+ oe.ctrlPanel.Return();
967995
996
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
997
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
998
+ //Return();
999
+
1000
+ oe.ctrlPanel.Return();
1001
+
9681002 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9691003 // ObjEditor.aConstraints.gridx += 1;
9701004
....@@ -1058,7 +1092,7 @@
10581092 oe.aConstraints.gridwidth = 1;
10591093 /**/
10601094 nameField = AddText(oe.ctrlPanel, copy.GetName());
1061
- Return();
1095
+ oe.ctrlPanel.Return();
10621096
10631097 //ctrlPanel.add(textureButton = new Button("Texture..."));
10641098 //textureButton.setEnabled(false);
....@@ -1160,10 +1194,18 @@
11601194 //JPanel worldPanel =
11611195 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11621196 //worldPanel.setName("World");
1163
- centralPanel = new JPanel(new BorderLayout());
1197
+ centralPanel = new cGridBag();
1198
+ centralPanel.preferredWidth = 20;
11641199 timelinePanel = new JPanel(new BorderLayout());
11651200 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11661201
1202
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1203
+ cameraPanel.setContinuousLayout(true);
1204
+ cameraPanel.setOneTouchExpandable(true);
1205
+// cameraPanel.setDividerLocation(0.9);
1206
+// cameraPanel.setDividerSize(9);
1207
+ cameraPanel.setResizeWeight(1.0);
1208
+
11671209 centralPanel.add(cameraView);
11681210 //frame.setJMenuBar(timelineMenubar);
11691211 //centralPanel.add(timelinePanel);
....@@ -1183,12 +1225,13 @@
11831225 //frontView.object = copy;
11841226 //sideView.object = copy;
11851227
1186
- XYZPanel = new JPanel();
1187
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1228
+ XYZPanel = new cGridBag().setVertical(true);
1229
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11881230
1189
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1190
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1191
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1231
+ XYZPanel.preferredWidth = 5;
1232
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1233
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1234
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
11921235
11931236 /*
11941237 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1226,10 +1269,11 @@
12261269 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12271270 //tmp.setName("Edit");
12281271 objectPanel.add(materialPanel);
1229
- JPanel north = new JPanel(new BorderLayout());
1230
- north.setName("Edit");
1231
- north.add(ctrlPanel, BorderLayout.NORTH);
1232
- objectPanel.add(north);
1272
+// JPanel north = new JPanel(new BorderLayout());
1273
+// north.setName("Edit");
1274
+// north.add(ctrlPanel, BorderLayout.NORTH);
1275
+// objectPanel.add(north);
1276
+ objectPanel.add(ctrlPanel);
12331277 objectPanel.add(infoPanel);
12341278
12351279 /*
....@@ -1250,16 +1294,23 @@
12501294 scrollpane.setWheelScrollingEnabled(true);
12511295 scrollpane.addMouseWheelListener(this); // Default not fast enough
12521296
1253
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1254
- scenePanel.add(scrollpane);
1297
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1298
+ scenePanel.preferredWidth = 7;
1299
+
1300
+ JTabbedPane tabbedPane = new JTabbedPane();
1301
+ tabbedPane.add(scrollpane);
12551302
1256
- scenePanel.add(FSPane = new cFileSystemPane(this));
1303
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12571304
1258
- optionsPanel = new JPanel(new GridBagLayout());
1305
+ optionsPanel = new cGridBag().setVertical(true);
12591306
12601307 optionsPanel.setName("Options");
1261
- scenePanel.add(optionsPanel);
1262
-
1308
+
1309
+ AddOptions(optionsPanel); //, aConstraints);
1310
+
1311
+ tabbedPane.add(optionsPanel);
1312
+
1313
+ scenePanel.add(tabbedPane);
12631314
12641315 /*
12651316 cTree jTree = new cTree(null);
....@@ -1293,6 +1344,7 @@
12931344 //bigPanel.setSize(new Dimension(10,10));
12941345 //bigPanel.add(ctrlPanel);
12951346 //bigPanel.add(gridPanel);
1347
+ /**
12961348 bigThree = new JPanel();
12971349 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12981350 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1316,7 +1368,13 @@
13161368 // aConstraints.gridheight = 3;
13171369 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13181370 bigThree.add(XYZPanel, aWindowConstraints);
1371
+ /**/
13191372
1373
+ bigThree = new cGridBag();
1374
+ bigThree.addComponent(scenePanel);
1375
+ bigThree.addComponent(centralPanel);
1376
+ bigThree.addComponent(XYZPanel);
1377
+
13201378 // // SIDE EFFECT!!!
13211379 // aConstraints.gridx = 0;
13221380 // aConstraints.gridy = 0;
....@@ -1337,7 +1395,8 @@
13371395 //worldPane.add(bigPanel);
13381396 //worldPane.add(worldPanel);
13391397 /**/
1340
- frame.getContentPane().add(/*"Center",*/framePanel);
1398
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1399
+ frame.add(/*"Center",*/framePanel);
13411400 //frame.getContentPane().add(/*"Center",*/ worldPane);
13421401
13431402 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
....@@ -1358,6 +1417,10 @@
13581417 });
13591418 }
13601419
1420
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1421
+ {
1422
+ }
1423
+
13611424 JTree GetTree()
13621425 {
13631426 return objEditor.jTree;
....@@ -1369,260 +1432,170 @@
13691432 ctrlPanel.removeAll();
13701433 }
13711434
1372
- void SetupMaterial(JPanel ctrlPanel)
1435
+ void SetupMaterial(cGridBag panel)
13731436 {
1374
- aConstraints.weighty = 0;
1375
- //aConstraints.weightx = 1;
1376
- /*
1437
+ /*
13771438 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13781439 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1379
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1380
- aConstraints.gridx += 1;
13811440 */
13821441
1383
- aConstraints.gridwidth = 1;
1384
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
1442
+ cGridBag editBar = new cGridBag().setVertical(false);
1443
+
1444
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1445
+ createMaterialButton.setToolTipText("Create material");
13881446
13891447 /*
13901448 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1391
- aConstraints.gridx += 1;
1392
- aConstraints.weighty = 0;
1393
- aConstraints.gridwidth = 1;
13941449 */
13951450
1396
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1397
- aConstraints.gridx += 1;
1451
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1452
+ clearMaterialButton.setToolTipText("Clear material");
1453
+
1454
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1455
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1456
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
13981457
1399
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1400
-
1401
- aConstraints.gridx += 1;
1402
-
1403
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1404
-
1405
- aConstraints.gridx += 1;
1406
-
1407
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1408
-
1409
- aConstraints.gridx = 0;
1410
- aConstraints.gridy += 1;
1411
- aConstraints.weighty = 0;
1412
- aConstraints.gridwidth = 1;
1458
+ editBar.preferredHeight = 15;
1459
+
1460
+ panel.add(editBar);
1461
+
14131462 /**/
14141463 //aConstraints.weighty = 0;
14151464 ////aConstraints.weightx = 1;
14161465 //aConstraints.weighty = 1;
14171466 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14181467 //aConstraints.gridx += 1;
1419
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1420
- aConstraints.weighty = 0;
1421
- aConstraints.gridx = 0;
1422
- aConstraints.gridy += 1;
1423
- aConstraints.gridwidth = 1;
1468
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14241469
1425
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1426
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1427
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1428
- aConstraints.gridx += 1;
1429
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1430
- //aConstraints.weightx = 0;
1431
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1432
- aConstraints.gridx = 0;
1433
- aConstraints.gridy += 1;
1434
- aConstraints.gridwidth = 1;
1470
+ cGridBag colorSection = new cGridBag().setVertical(true);
1471
+
1472
+ cGridBag color = new cGridBag();
1473
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1474
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1475
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1476
+ //colorField.preferredWidth = 200;
1477
+ colorSection.add(color);
14351478
1436
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1437
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1438
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1439
- aConstraints.gridx += 1;
1440
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1441
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1442
- aConstraints.gridx = 0;
1443
- aConstraints.gridy += 1;
1444
- aConstraints.gridwidth = 1;
1479
+ cGridBag modulation = new cGridBag();
1480
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1481
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1482
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1483
+ colorSection.add(modulation);
14451484
1446
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1447
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1448
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1449
- aConstraints.gridx += 1;
1450
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1451
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1452
- aConstraints.gridx = 0;
1453
- aConstraints.gridy += 1;
1454
- aConstraints.gridwidth = 1;
1485
+ cGridBag texture = new cGridBag();
1486
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1487
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1488
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1489
+ colorSection.add(texture);
14551490
1456
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1457
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1458
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1459
- aConstraints.gridx += 1;
1460
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1461
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1462
- aConstraints.gridx = 0;
1463
- aConstraints.gridy += 1;
1464
- aConstraints.gridwidth = 1;
1491
+ cGridBag anisoU = new cGridBag();
1492
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1493
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1494
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1495
+ colorSection.add(anisoU);
14651496
1466
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1467
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1468
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1469
- aConstraints.gridx += 1;
1470
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1471
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1472
- aConstraints.gridx = 0;
1473
- aConstraints.gridy += 1;
1474
- aConstraints.gridwidth = 1;
1497
+ cGridBag anisoV = new cGridBag();
1498
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1499
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1500
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1501
+ colorSection.add(anisoV);
14751502
1476
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1477
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1479
- aConstraints.gridx += 1;
1480
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1481
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1482
- aConstraints.gridx = 0;
1483
- aConstraints.gridy += 1;
1484
- aConstraints.gridwidth = 1;
1503
+ cGridBag shadowbias = new cGridBag();
1504
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1505
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1506
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1507
+ colorSection.add(shadowbias);
14851508
1486
- //aConstraints.weighty = 1;
1487
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1488
- //aConstraints.gridx += 1;
1489
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1490
- aConstraints.weighty = 0;
1491
- aConstraints.gridx = 0;
1492
- aConstraints.gridy += 1;
1493
- aConstraints.gridwidth = 1;
1509
+ panel.add(new JSeparator());
1510
+
1511
+ panel.add(colorSection);
1512
+
1513
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1514
+
1515
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1516
+
1517
+ cGridBag diffuse = new cGridBag();
1518
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1519
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1520
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1521
+ diffuseSection.add(diffuse);
14941522
1495
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1496
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1497
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1498
- aConstraints.gridx += 1;
1499
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1500
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1501
- aConstraints.gridx = 0;
1502
- aConstraints.gridy += 1;
1503
- aConstraints.gridwidth = 1;
1523
+ cGridBag diffuseness = new cGridBag();
1524
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1525
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1526
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1527
+ diffuseSection.add(diffuseness);
15041528
1505
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1506
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1507
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1508
- aConstraints.gridx += 1;
1509
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1510
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1511
- aConstraints.gridx = 0;
1512
- aConstraints.gridy += 1;
1513
- aConstraints.gridwidth = 1;
1529
+ cGridBag selfshadow = new cGridBag();
1530
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1531
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1533
+ diffuseSection.add(selfshadow);
15141534
1515
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1516
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1517
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1518
- aConstraints.gridx += 1;
1519
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1520
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1521
- aConstraints.gridx = 0;
1522
- aConstraints.gridy += 1;
1523
- aConstraints.gridwidth = 1;
1535
+ cGridBag sheen = new cGridBag();
1536
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1537
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1538
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1539
+ diffuseSection.add(sheen);
15241540
1525
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1526
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1527
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1528
- aConstraints.gridx += 1;
1529
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1530
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1531
- aConstraints.gridx = 0;
1532
- aConstraints.gridy += 1;
1533
- aConstraints.gridwidth = 1;
1541
+ cGridBag subsurface = new cGridBag();
1542
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1543
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1544
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1545
+ diffuseSection.add(subsurface);
15341546
1535
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1536
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1537
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1538
- aConstraints.gridx += 1;
1539
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1540
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1541
- aConstraints.gridx = 0;
1542
- aConstraints.gridy += 1;
1543
- aConstraints.gridwidth = 1;
1547
+ cGridBag shadow = new cGridBag();
1548
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1549
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1550
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1551
+ diffuseSection.add(shadow);
15441552
1545
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1546
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1547
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1548
- aConstraints.gridx += 1;
1549
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1550
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1551
- aConstraints.gridx = 0;
1552
- aConstraints.gridy += 1;
1553
- aConstraints.gridwidth = 1;
1553
+ cGridBag fakedepth = new cGridBag();
1554
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1555
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1556
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1557
+ diffuseSection.add(fakedepth);
15541558
1555
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1556
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1557
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1558
- aConstraints.gridx += 1;
1559
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1560
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1561
- aConstraints.gridx = 0;
1562
- aConstraints.gridy += 1;
1563
- aConstraints.gridwidth = 1;
1559
+ panel.add(new JSeparator());
1560
+
1561
+ panel.add(diffuseSection);
1562
+
1563
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1564
+
1565
+ cGridBag specularSection = new cGridBag().setVertical(true);
15641566
1565
- //aConstraints.weighty = 1;
1566
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1567
- //aConstraints.gridx += 1;
1568
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1569
- aConstraints.weighty = 0;
1570
- aConstraints.gridx = 0;
1571
- aConstraints.gridy += 1;
1572
- aConstraints.gridwidth = 1;
1567
+ cGridBag specular = new cGridBag();
1568
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1569
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1570
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1571
+ specularSection.add(specular);
15731572
1574
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1575
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1576
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1577
- aConstraints.gridx += 1;
1578
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1579
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1580
- aConstraints.gridx = 0;
1581
- aConstraints.gridy += 1;
1582
- aConstraints.gridwidth = 1;
1573
+ cGridBag lightarea = new cGridBag();
1574
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1575
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1576
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1577
+ specularSection.add(lightarea);
15831578
1584
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1585
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1586
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1587
- aConstraints.gridx += 1;
1588
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1589
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1590
- aConstraints.gridx = 0;
1591
- aConstraints.gridy += 1;
1592
- aConstraints.gridwidth = 1;
1579
+ cGridBag shininess = new cGridBag();
1580
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1581
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1583
+ specularSection.add(shininess);
15931584
1594
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1595
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1596
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1597
- aConstraints.gridx += 1;
1598
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1599
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1600
- aConstraints.gridx = 0;
1601
- aConstraints.gridy += 1;
1602
- aConstraints.gridwidth = 1;
1585
+ cGridBag metalness = new cGridBag();
1586
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1587
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1588
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1589
+ specularSection.add(metalness);
16031590
1604
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1605
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1606
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1607
- aConstraints.gridx += 1;
1608
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1609
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1610
- aConstraints.gridx = 0;
1611
- aConstraints.gridy += 1;
1612
- aConstraints.gridwidth = 1;
1591
+ cGridBag velvet = new cGridBag();
1592
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1593
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1595
+ specularSection.add(velvet);
16131596
1614
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1615
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1616
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1617
- aConstraints.gridx += 1;
1618
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1619
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1620
- aConstraints.gridx = 0;
1621
- aConstraints.gridy += 1;
1622
- aConstraints.gridwidth = 1;
1623
-
1624
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1625
- Return();
1597
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1598
+ //Return();
16261599 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16271600 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16281601 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1633,130 +1606,93 @@
16331606 // aConstraints.gridy += 1;
16341607 // aConstraints.gridwidth = 1;
16351608
1636
- //aConstraints.weighty = 1;
1637
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1638
- //aConstraints.gridx += 1;
1639
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1640
- aConstraints.weighty = 0;
1641
- aConstraints.gridx = 0;
1642
- aConstraints.gridy += 1;
1643
- aConstraints.gridwidth = 1;
16441609
1645
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1646
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1647
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1648
- aConstraints.gridx += 1;
1649
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1650
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1651
- aConstraints.gridx = 0;
1652
- aConstraints.gridy += 1;
1653
- aConstraints.gridwidth = 1;
1610
+ panel.add(new JSeparator());
1611
+
1612
+ panel.add(specularSection);
1613
+
1614
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1615
+
1616
+ cGridBag globalSection = new cGridBag().setVertical(true);
16541617
1655
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1656
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1658
- aConstraints.gridx += 1;
1659
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1660
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1661
- aConstraints.gridx = 0;
1662
- aConstraints.gridy += 1;
1663
- aConstraints.gridwidth = 1;
1618
+ cGridBag camera = new cGridBag();
1619
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1620
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1621
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1622
+ globalSection.add(camera);
16641623
1665
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1666
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1667
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1668
- aConstraints.gridx += 1;
1669
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1670
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1671
- aConstraints.gridx = 0;
1672
- aConstraints.gridy += 1;
1673
- aConstraints.gridwidth = 1;
1624
+ cGridBag ambient = new cGridBag();
1625
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1626
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1627
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1628
+ globalSection.add(ambient);
16741629
1675
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1676
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1678
- aConstraints.gridx += 1;
1679
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1680
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1681
- aConstraints.gridx = 0;
1682
- aConstraints.gridy += 1;
1683
- aConstraints.gridwidth = 1;
1684
- aConstraints.weighty = 0;
1630
+ cGridBag backlit = new cGridBag();
1631
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1632
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1633
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1634
+ globalSection.add(backlit);
16851635
1686
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1687
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1689
- aConstraints.gridx += 1;
1690
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1691
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1692
- aConstraints.gridx = 0;
1693
- aConstraints.gridy += 1;
1694
- aConstraints.gridwidth = 1;
1636
+ cGridBag opacity = new cGridBag();
1637
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1638
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1639
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1640
+ globalSection.add(opacity);
16951641
1696
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1697
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1699
- aConstraints.gridx += 1;
1700
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1701
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1702
- aConstraints.gridx = 0;
1703
- aConstraints.gridy += 1;
1704
- aConstraints.gridwidth = 1;
1642
+ panel.add(new JSeparator());
1643
+
1644
+ panel.add(globalSection);
1645
+
1646
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1647
+
1648
+ cGridBag textureSection = new cGridBag().setVertical(true);
17051649
1706
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1707
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1709
- aConstraints.gridx += 1;
1710
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1711
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1712
- aConstraints.gridx = 0;
1713
- aConstraints.gridy += 1;
1714
- aConstraints.gridwidth = 1;
1650
+ cGridBag bump = new cGridBag();
1651
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1652
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1653
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1654
+ textureSection.add(bump);
17151655
1716
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1717
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1718
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1719
- aConstraints.gridx += 1;
1720
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1721
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1722
- aConstraints.gridx = 0;
1723
- aConstraints.gridy += 1;
1724
- aConstraints.gridwidth = 1;
1656
+ cGridBag noise = new cGridBag();
1657
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1658
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1659
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1660
+ textureSection.add(noise);
17251661
1726
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1727
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1728
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1729
- aConstraints.gridx += 1;
1730
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1731
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1732
- aConstraints.gridx = 0;
1733
- aConstraints.gridy += 1;
1734
- aConstraints.gridwidth = 1;
1662
+ cGridBag power = new cGridBag();
1663
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1664
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1665
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1666
+ textureSection.add(power);
17351667
1736
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1737
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1738
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1739
- aConstraints.gridx += 1;
1740
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1741
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1742
- aConstraints.gridx = 0;
1743
- aConstraints.gridy += 1;
1744
- aConstraints.gridwidth = 1;
1668
+ cGridBag borderfade = new cGridBag();
1669
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1670
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1672
+ textureSection.add(borderfade);
17451673
1746
- //aConstraints.weighty = 1;
1747
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1748
- //aConstraints.gridx += 1;
1749
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1750
- aConstraints.weighty = 0;
1674
+ cGridBag fog = new cGridBag();
1675
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1676
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1678
+ textureSection.add(fog);
17511679
1752
- aConstraints.gridx = 0;
1753
- aConstraints.gridy = 0;
1754
- aConstraints.gridwidth = 1;
1680
+ cGridBag opacityPower = new cGridBag();
1681
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1682
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1683
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1684
+ textureSection.add(opacityPower);
1685
+
1686
+ panel.add(new JSeparator());
1687
+
1688
+ panel.add(textureSection);
1689
+
1690
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17551691
17561692 SetMaterial(copy); // .GetMaterial());
17571693
1758
- colorField.addChangeListener(this);
1759
- modulationField.addChangeListener(this);
1694
+ //colorField.addChangeListener(this);
1695
+// modulationField.addChangeListener(this);
17601696 metalnessField.addChangeListener(this);
17611697 diffuseField.addChangeListener(this);
17621698 specularField.addChangeListener(this);
....@@ -2568,6 +2504,7 @@
25682504 }
25692505 if (input == null)
25702506 {
2507
+ new Exception().printStackTrace();
25712508 System.exit(0);
25722509 }
25732510
....@@ -2966,37 +2903,35 @@
29662903 return;
29672904 } else if (event.getSource() == toggleTimelineItem)
29682905 {
2969
- copy.timeline ^= true;
2906
+ timeline ^= true;
29702907
2971
- if (copy.timeline)
2908
+ if (timeline)
29722909 {
29732910 centralPanel.remove(cameraView);
2974
- centralPanel.add(timelinePanel);
2911
+ cameraPanel.add(cameraView);
2912
+ centralPanel.add(cameraPanel);
29752913 frame.setJMenuBar(timelineMenubar);
2914
+ wasFullScreen = CameraPane.FULLSCREEN;
2915
+ if (!CameraPane.FULLSCREEN)
2916
+ ToggleFullScreen();
2917
+ toggleFullScreenItem.setEnabled(false);
29762918 }
29772919 else
29782920 {
2979
- centralPanel.remove(timelinePanel);
2921
+ centralPanel.remove(cameraPanel);
29802922 centralPanel.add(cameraView);
29812923 frame.setJMenuBar(null);
2924
+ if (!wasFullScreen)
2925
+ ToggleFullScreen();
2926
+ toggleFullScreenItem.setEnabled(true);
29822927 }
29832928
29842929 frame.validate();
29852930 return;
29862931 } else if (event.getSource() == toggleFullScreenItem)
29872932 {
2988
- if (CameraPane.FULLSCREEN)
2989
- {
2990
- frame.getContentPane().remove(/*"Center",*/bigThree);
2991
- framePanel.add(bigThree);
2992
- frame.getContentPane().add(/*"Center",*/framePanel);
2993
- } else
2994
- {
2995
- frame.getContentPane().remove(/*"Center",*/framePanel);
2996
- frame.getContentPane().add(/*"Center",*/bigThree);
2997
- }
2933
+ ToggleFullScreen();
29982934 frame.validate();
2999
- cameraView.ToggleFullScreen();
30002935
30012936 return;
30022937 } else if (event.getSource() == toggleRandomItem)
....@@ -3106,7 +3041,8 @@
31063041 objEditor.refreshContents();
31073042 } else if (event.getSource() == stepItem)
31083043 {
3109
- cameraView.ONESTEP = true;
3044
+ //cameraView.ONESTEP = true;
3045
+ Globals.ONESTEP = true;
31103046 cameraView.repaint();
31113047 return;
31123048 } else if (event.getSource() == stepButton)
....@@ -3263,25 +3199,25 @@
32633199
32643200 void ToggleAnimation()
32653201 {
3266
- if (!CameraPane.ANIMATION)
3202
+ if (!Globals.ANIMATION)
32673203 {
32683204 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3269
- browser.show();
3205
+ browser.setVisible(true);
32703206 String filename = browser.getFile();
32713207 if (filename != null && filename.length() > 0)
32723208 {
3273
- CameraPane.filename = browser.getDirectory() + filename;
3209
+ Globals.filename = browser.getDirectory() + filename;
32743210 //CameraPane.framecount = 0;
3275
- CameraPane.imagecount = 0;
3211
+ Globals.imagecount = 0;
32763212
3277
- CameraPane.ANIMATION ^= true;
3213
+ Globals.ANIMATION ^= true;
32783214
32793215 GrafreeD.wav.cursor = 0;
32803216 GrafreeD.wav.loop = 0;
32813217 }
32823218 } else
32833219 {
3284
- CameraPane.ANIMATION ^= true;
3220
+ Globals.ANIMATION ^= true;
32853221 }
32863222 }
32873223
....@@ -3298,6 +3234,7 @@
32983234 callee.refreshContents();
32993235 } else
33003236 {
3237
+ new Exception().printStackTrace();
33013238 System.exit(0);
33023239 }
33033240 }
....@@ -3460,7 +3397,7 @@
34603397 current.fakedepth = (float) fakedepthField.getFloat();
34613398 current.shadowbias = (float) shadowbiasField.getFloat();
34623399
3463
- if (!NumberSlider.frozen)
3400
+ if (!cNumberSlider.frozen)
34643401 {
34653402 //System.out.println("Propagate = " + propagate);
34663403 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3508,6 +3445,7 @@
35083445 || e.getSource() == apertureField
35093446 || e.getSource() == shadowblurField)
35103447 {
3448
+ new Exception().printStackTrace();
35113449 System.exit(0);
35123450 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35133451 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3534,7 +3472,13 @@
35343472 //System.out.println("PARENT = " + parent);
35353473 //if (parent != null)
35363474 // parent.applySelf();
3537
- refreshContents();
3475
+ if (e.getSource() == normalpushField)
3476
+ {
3477
+ objEditor.refreshContents();
3478
+ //Refresh();
3479
+ }
3480
+ else
3481
+ refreshContents();
35383482 // ??? client.refreshEditWindow();
35393483 }
35403484 //else
....@@ -3546,7 +3490,7 @@
35463490 //group.name = nameField.getText();
35473491 //objEditor.applySelf();
35483492
3549
- assert (objEditor == this);
3493
+ // OCT2018: assert (objEditor == this);
35503494 if (copy.selection == null || copy.selection.size() == 0)
35513495 //super.applySelf()
35523496 ; else
....@@ -3570,12 +3514,18 @@
35703514 objEditor.copy = keep;
35713515 }
35723516 }
3517
+
3518
+ if (normalpushField != null)
3519
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
35733520 }
35743521
35753522 void SnapObject()
35763523 {
3577
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3578
- SnapObject(obj);
3524
+ if (copy.selection.size() > 0)
3525
+ {
3526
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3527
+ SnapObject(obj);
3528
+ }
35793529 }
35803530
35813531 void SnapObject(Object3D obj)
....@@ -3821,7 +3771,7 @@
38213771
38223772 radioPanel.revalidate();
38233773 radioPanel.repaint();
3824
- ctrlPanel.revalidate(); // ? new
3774
+ ctrlPanel.validate(); // ? new
38253775 ctrlPanel.repaint();
38263776 }
38273777 }
....@@ -4467,8 +4417,8 @@
44674417 //MenuItem normalLensItem;
44684418 MenuItem editCameraItem;
44694419 MenuItem revertCameraItem;
4470
- CheckboxMenuItem toggleLiveItem;
44714420 MenuItem stepItem;
4421
+ CheckboxMenuItem toggleLiveItem;
44724422 CheckboxMenuItem toggleFullScreenItem;
44734423 CheckboxMenuItem toggleTimelineItem;
44744424 CheckboxMenuItem toggleRenderItem;
....@@ -4485,20 +4435,21 @@
44854435 JSplitPane mainPanel;
44864436 JScrollPane scrollpane;
44874437 JPanel toolbarPanel;
4488
- JPanel treePanel;
4438
+ cGridBag treePanel;
44894439 JPanel radioPanel;
44904440 ButtonGroup buttonGroup;
4491
- JPanel ctrlPanel;
4492
- JPanel materialPanel;
4441
+ cGridBag ctrlPanel;
4442
+ cGridBag materialPanel;
44934443 JScrollPane infoPanel;
4494
- JPanel optionsPanel;
4444
+ cGridBag optionsPanel;
44954445 JTabbedPane objectPanel;
4496
- JPanel XYZPanel;
4446
+ cGridBag XYZPanel;
44974447 JSplitPane gridPanel;
44984448 JSplitPane bigPanel;
4499
- JPanel bigThree;
4500
- JTabbedPane scenePanel;
4501
- JPanel centralPanel;
4449
+ cGridBag bigThree;
4450
+ cGridBag scenePanel;
4451
+ cGridBag centralPanel;
4452
+ JSplitPane cameraPanel;
45024453 JPanel timelinePanel;
45034454 JMenuBar timelineMenubar;
45044455 JSplitPane framePanel;
....@@ -4550,65 +4501,67 @@
45504501 // MATERIAL
45514502 JLabel materialLabel;
45524503 JLabel colorLabel;
4553
- NumberSlider colorField;
4504
+ cNumberSlider colorField;
45544505 JLabel modulationLabel;
4555
- NumberSlider modulationField;
4506
+ cNumberSlider modulationField;
45564507 JLabel metalnessLabel;
4557
- NumberSlider metalnessField;
4508
+ cNumberSlider metalnessField;
45584509 JLabel diffuseLabel;
4559
- NumberSlider diffuseField;
4510
+ cNumberSlider diffuseField;
45604511 JLabel specularLabel;
4561
- NumberSlider specularField;
4512
+ cNumberSlider specularField;
45624513 JLabel shininessLabel;
4563
- NumberSlider shininessField;
4514
+ cNumberSlider shininessField;
45644515 JLabel shiftLabel;
4565
- NumberSlider shiftField;
4516
+ cNumberSlider shiftField;
45664517 JLabel ambientLabel;
4567
- NumberSlider ambientField;
4518
+ cNumberSlider ambientField;
45684519 JLabel lightareaLabel;
4569
- NumberSlider lightareaField;
4520
+ cNumberSlider lightareaField;
45704521 JLabel diffusenessLabel;
4571
- NumberSlider diffusenessField;
4522
+ cNumberSlider diffusenessField;
45724523 JLabel velvetLabel;
4573
- NumberSlider velvetField;
4524
+ cNumberSlider velvetField;
45744525 JLabel sheenLabel;
4575
- NumberSlider sheenField;
4526
+ cNumberSlider sheenField;
45764527 JLabel subsurfaceLabel;
4577
- NumberSlider subsurfaceField;
4528
+ cNumberSlider subsurfaceField;
45784529 //JLabel bumpLabel;
45794530 //NumberSlider bumpField;
45804531 JLabel backlitLabel;
4581
- NumberSlider backlitField;
4532
+ cNumberSlider backlitField;
45824533 JLabel anisoLabel;
4583
- NumberSlider anisoField;
4534
+ cNumberSlider anisoField;
45844535 JLabel anisoVLabel;
4585
- NumberSlider anisoVField;
4536
+ cNumberSlider anisoVField;
45864537 JLabel cameraLabel;
4587
- NumberSlider cameraField;
4538
+ cNumberSlider cameraField;
45884539 JLabel selfshadowLabel;
4589
- NumberSlider selfshadowField;
4540
+ cNumberSlider selfshadowField;
45904541 JLabel shadowLabel;
4591
- NumberSlider shadowField;
4542
+ cNumberSlider shadowField;
45924543 JLabel textureLabel;
4593
- NumberSlider textureField;
4544
+ cNumberSlider textureField;
45944545 JLabel opacityLabel;
4595
- NumberSlider opacityField;
4546
+ cNumberSlider opacityField;
45964547 JLabel fakedepthLabel;
4597
- NumberSlider fakedepthField;
4548
+ cNumberSlider fakedepthField;
45984549 JLabel shadowbiasLabel;
4599
- NumberSlider shadowbiasField;
4550
+ cNumberSlider shadowbiasField;
46004551 JLabel bumpLabel;
4601
- NumberSlider bumpField;
4552
+ cNumberSlider bumpField;
46024553 JLabel noiseLabel;
4603
- NumberSlider noiseField;
4554
+ cNumberSlider noiseField;
46044555 JLabel powerLabel;
4605
- NumberSlider powerField;
4556
+ cNumberSlider powerField;
46064557 JLabel borderfadeLabel;
4607
- NumberSlider borderfadeField;
4558
+ cNumberSlider borderfadeField;
46084559 JLabel fogLabel;
4609
- NumberSlider fogField;
4560
+ cNumberSlider fogField;
46104561 JLabel opacityPowerLabel;
4611
- NumberSlider opacityPowerField;
4562
+ cNumberSlider opacityPowerField;
46124563 JTree jTree;
46134564 //ObjectUI parent;
4565
+
4566
+ cNumberSlider normalpushField;
46144567 }