Normand Briere
2019-05-01 a742f6cebf1d471217d836e07934e5c02c22b6db
ObjEditor.java
....@@ -138,34 +138,40 @@
138138 public void closeUI()
139139 {
140140 //new Exception().printStackTrace();
141
- System.out.println("this = " + this);
142
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
143143 //nameField.removeActionListener(this);
144
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
145145
146146 if (!GroupEditor.allparams)
147147 return;
148148
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);
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);
167167
168
- Remove(normalpushField);
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);
169175 }
170176
171177 public ObjEditor GetEditor()
....@@ -353,21 +359,23 @@
353359 objectPanel = new JTabbedPane();
354360 toolbarPanel = new JPanel();
355361 toolbarPanel.setName("Toolbar");
356
- treePanel = new JPanel();
362
+ treePanel = new cGridBag();
357363 treePanel.setName("Tree");
358
- ctrlPanel = new JPanel(); // new GridBagLayout());
364
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
359365 ctrlPanel.setName("Edit");
360
- materialPanel = new JPanel();
366
+ materialPanel = new cGridBag().setVertical(true);
361367 materialPanel.setName("Material");
362368 /*JTextPane*/
363369 infoarea = createTextPane();
370
+ doc = infoarea.getStyledDocument();
371
+
364372 infoarea.setEditable(true);
365373 SetText();
366374 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
367375 // infoarea.setOpaque(false);
368376 // //infoarea.setForeground(textcolor);
369
- infoarea.setLineWrap(true);
370
- infoarea.setWrapStyleWord(true);
377
+// TEXTAREA infoarea.setLineWrap(true);
378
+// TEXTAREA infoarea.setWrapStyleWord(true);
371379 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
372380 infoPanel.setPreferredSize(new Dimension(50, 200));
373381 infoPanel.setName("Info");
....@@ -378,16 +386,16 @@
378386 mainPanel.setName("Main");
379387 mainPanel.setContinuousLayout(true);
380388 mainPanel.setOneTouchExpandable(true);
381
- mainPanel.setDividerLocation(1.0);
382389 mainPanel.setDividerSize(9);
383
- mainPanel.setResizeWeight(0);
390
+ mainPanel.setDividerLocation(0.5); //1.0);
391
+ mainPanel.setResizeWeight(0.5);
384392
385393 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
386394 //mainPanel.setLayout(new GridBagLayout());
387395 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388
- treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
390
- materialPanel.setLayout(new GridBagLayout());
396
+// treePanel.setLayout(new GridBagLayout());
397
+ //ctrlPanel.setLayout(new GridBagLayout());
398
+ //materialPanel.setLayout(new GridBagLayout());
391399
392400 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
393401 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -426,7 +434,7 @@
426434 static String newline = "\n";
427435 protected static final String buttonString = "JButton";
428436 StyledDocument doc;
429
- JTextArea infoarea;
437
+ JTextPane infoarea;
430438
431439 void ClearInfo()
432440 {
....@@ -493,7 +501,10 @@
493501 }
494502
495503 if (full)
496
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
504
+ {
505
+ si.SendInfo(" BBox min: " + minima, "regular");
506
+ si.SendInfo(" BBox max: " + maxima, "regular");
507
+ }
497508
498509 if (sel.bRep != null)
499510 {
....@@ -591,6 +602,9 @@
591602 {
592603 CameraPane.pointflow = (PointFlow) sel;
593604 }
605
+
606
+ si.SendInfo("_____________________", "regular");
607
+ si.SendInfo("", "regular");
594608 }
595609 }
596610
....@@ -622,52 +636,52 @@
622636 cameraView.ToggleFullScreen();
623637 }
624638
625
- private JTextArea createTextPane()
639
+ private JTextPane createTextPane()
626640 {
627
- String[] initString =
628
- {
629
- "This is an editable JTextPane, ", //regular
630
- "another ", //italic
631
- "styled ", //bold
632
- "text ", //small
633
- "component, ", //large
634
- "which supports embedded components..." + newline,//regular
635
- " " + newline, //button
636
- "...and embedded icons..." + newline, //regular
637
- " ", //icon
638
- newline + "JTextPane is a subclass of JEditorPane that "
639
- + "uses a StyledEditorKit and StyledDocument, and provides "
640
- + "cover methods for interacting with those objects."
641
- };
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
+// }
642683
643
- String[] initStyles =
644
- {
645
- "regular", "italic", "bold", "small", "large",
646
- "regular", "button", "regular", "icon",
647
- "regular"
648
- };
649
-
650
- JTextPane textPane = new JTextPane();
651
- textPane.setEditable(true);
652
- /*StyledDocument*/ doc = textPane.getStyledDocument();
653
- addStylesToDocument(doc);
654
-
655
- try
656
- {
657
- for (int j = 0; j < 2; j++)
658
- {
659
- for (int i = 0; i < initString.length; i++)
660
- {
661
- doc.insertString(doc.getLength(), initString[i],
662
- doc.getStyle(initStyles[i]));
663
- }
664
- }
665
- } catch (BadLocationException ble)
666
- {
667
- System.err.println("Couldn't insert initial text into text pane.");
668
- }
669
-
670
- return new JTextArea(); // textPane;
684
+ return new JTextPane(); // textPane;
671685 }
672686
673687 protected void addStylesToDocument(StyledDocument doc)
....@@ -767,115 +781,83 @@
767781 JButton slowerButton;
768782 JButton fasterButton;
769783 JButton remarkButton;
784
+
785
+ cGridBag namePanel;
786
+ cGridBag setupPanel;
787
+ cGridBag commandsPanel;
788
+ cGridBag pushPanel;
789
+ cGridBag fillPanel;
770790
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
791
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
772792 {
773793 JCheckBox cb;
774794
775
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
776
- oe.aConstraints.gridwidth = 1; // 3;
777
-// oe.aConstraints.weightx = 1;
778
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
779
- 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);
780796 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
784797
785798 return cb;
786799 }
787800
788
- cButton AddButton(ObjEditor oe, String label)
801
+ cButton AddButton(cGridBag panel, String label)
789802 {
790803 cButton cb;
791804
792
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
793
- oe.aConstraints.gridwidth = 1;
794
-// oe.aConstraints.weightx = 1;
795
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
796
- 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);
797806 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
801807
802808 return cb;
803809 }
804810
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
811
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
806812 {
807813 JComboBox combo;
808814
809
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
810
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
811
- oe.aConstraints.gridx += 1;
815
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
812816 combo.addActionListener(this);
813817
814818 return combo;
815819 }
816820
817
- 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)
818822 {
819
- NumberSlider combo;
823
+ cGridBag control = new cGridBag();
824
+
825
+ cNumberSlider combo;
820826
821827 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824828 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
825
- aConstraints.gridwidth = 1;
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, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
- aConstraints.gridx += 1;
832
- aConstraints.gridwidth = 1;
833
-
829
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834831 combo.setFloat(current);
835
-
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
832
+
833
+ panel.add(control);
834
+
835
+ return control;
841836 }
842837
843
- 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)
844839 {
845
- NumberSlider combo;
840
+ cGridBag control = new cGridBag();
841
+
842
+ cNumberSlider combo;
846843
847844 JLabel jlabel = new JLabel(label);
848
-
849
- aConstraints.fill = GridBagConstraints.VERTICAL;
850845 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
851
- aConstraints.gridwidth = 2;
852
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
853
- aConstraints.gridx += 1;
854
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
855
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
856
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
857
- aConstraints.gridx += 1;
858
- aConstraints.gridwidth = 1;
859
-
846
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
847
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860848 combo.setInteger(current);
861849
862
- combo.label = jlabel;
863
-
864
- combo.addChangeListener(this);
865
-
866
- return combo;
850
+ panel.add(control);
851
+
852
+ return control;
867853 }
868854
869
- JTextArea AddText(JPanel ctrlPanel, String name)
855
+ JTextArea AddText(cGridBag ctrlPanel, String name)
870856 {
871857 JTextArea text;
872858
873
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
874
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
875
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
859
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
876860 text.addCaretListener(this);
877
- aConstraints.gridx += 1;
878
- aConstraints.gridwidth = 1;
879861
880862 return text;
881863 }
....@@ -905,9 +887,16 @@
905887 objEditor.ctrlPanel.remove(j);
906888 }
907889
890
+ void Remove(cNumberSlider j)
891
+ {
892
+ j.removeChangeListener(this);
893
+ //objEditor.ctrlPanel.remove(j.label);
894
+ objEditor.ctrlPanel.remove(j);
895
+ }
896
+
908897 /*
909898 */
910
- void Return() // ObjEditor oe)
899
+ void Return0() // ObjEditor oe)
911900 {
912901 aConstraints.gridy += 1;
913902 aConstraints.gridx = 0;
....@@ -962,37 +951,53 @@
962951
963952 void SetupUI2(ObjEditor oe)
964953 {
965
-// oe.aConstraints.weightx = 0;
966
-// oe.aConstraints.weighty = 0;
967
-// oe.aConstraints.gridx = 0;
968
-// oe.aConstraints.gridy = 0;
969
- 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();
970963
971964 if (!GroupEditor.allparams)
972965 return;
973966
974
- liveCB = AddCheckBox(oe, "Live", copy.live);
975
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
976
- 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);
977973 // Return();
978
- markCB = AddCheckBox(oe, "Mark", copy.marked);
979
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
980
- randomCB = AddCheckBox(oe, "Rand", copy.random);
981
- Return();
982
- resetButton = AddButton(oe, "Reset");
983
- 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");
984985 // resetAllButton = AddButton(oe, "Reset All");
985986 // stepAllButton = AddButton(oe, "Step All");
986
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
987
+ speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
987988 // Return();
988
- slowerButton = AddButton(oe, "Slow");
989
- fasterButton = AddButton(oe, "Fast");
990
- remarkButton = AddButton(oe, "Rem");
989
+ slowerButton = AddButton(commandsPanel, "Slow");
990
+ fasterButton = AddButton(commandsPanel, "Fast");
991
+ remarkButton = AddButton(commandsPanel, "Remark");
991992
992
- Return();
993
+ oe.ctrlPanel.add(commandsPanel);
994
+ oe.ctrlPanel.Return();
993995
994
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
995
- Return();
996
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
997
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
998
+ //Return();
999
+
1000
+ oe.ctrlPanel.Return();
9961001
9971002 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9981003 // ObjEditor.aConstraints.gridx += 1;
....@@ -1087,7 +1092,7 @@
10871092 oe.aConstraints.gridwidth = 1;
10881093 /**/
10891094 nameField = AddText(oe.ctrlPanel, copy.GetName());
1090
- Return();
1095
+ oe.ctrlPanel.Return();
10911096
10921097 //ctrlPanel.add(textureButton = new Button("Texture..."));
10931098 //textureButton.setEnabled(false);
....@@ -1189,7 +1194,8 @@
11891194 //JPanel worldPanel =
11901195 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11911196 //worldPanel.setName("World");
1192
- centralPanel = new JPanel(new BorderLayout());
1197
+ centralPanel = new cGridBag();
1198
+ centralPanel.preferredWidth = 20;
11931199 timelinePanel = new JPanel(new BorderLayout());
11941200 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11951201
....@@ -1222,6 +1228,7 @@
12221228 XYZPanel = new cGridBag().setVertical(true);
12231229 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12241230
1231
+ XYZPanel.preferredWidth = 5;
12251232 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
12261233 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
12271234 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
....@@ -1262,10 +1269,11 @@
12621269 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12631270 //tmp.setName("Edit");
12641271 objectPanel.add(materialPanel);
1265
- JPanel north = new JPanel(new BorderLayout());
1266
- north.setName("Edit");
1267
- north.add(ctrlPanel, BorderLayout.NORTH);
1268
- 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);
12691277 objectPanel.add(infoPanel);
12701278
12711279 /*
....@@ -1286,19 +1294,23 @@
12861294 scrollpane.setWheelScrollingEnabled(true);
12871295 scrollpane.addMouseWheelListener(this); // Default not fast enough
12881296
1289
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1290
- scenePanel.add(scrollpane);
1297
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1298
+ scenePanel.preferredWidth = 7;
1299
+
1300
+ JTabbedPane tabbedPane = new JTabbedPane();
1301
+ tabbedPane.add(scrollpane);
12911302
1292
- scenePanel.add(FSPane = new cFileSystemPane(this));
1303
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12931304
1294
- optionsPanel = new JPanel(new GridBagLayout());
1305
+ optionsPanel = new cGridBag().setVertical(true);
12951306
12961307 optionsPanel.setName("Options");
12971308
1298
- AddOptions(optionsPanel, aConstraints);
1309
+ AddOptions(optionsPanel); //, aConstraints);
12991310
1300
- scenePanel.add(optionsPanel);
1301
-
1311
+ tabbedPane.add(optionsPanel);
1312
+
1313
+ scenePanel.add(tabbedPane);
13021314
13031315 /*
13041316 cTree jTree = new cTree(null);
....@@ -1405,7 +1417,7 @@
14051417 });
14061418 }
14071419
1408
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1420
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
14091421 {
14101422 }
14111423
....@@ -1420,260 +1432,170 @@
14201432 ctrlPanel.removeAll();
14211433 }
14221434
1423
- void SetupMaterial(JPanel ctrlPanel)
1435
+ void SetupMaterial(cGridBag panel)
14241436 {
1425
- aConstraints.weighty = 0;
1426
- //aConstraints.weightx = 1;
1427
- /*
1437
+ /*
14281438 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14291439 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1430
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1431
- aConstraints.gridx += 1;
14321440 */
14331441
1434
- aConstraints.gridwidth = 1;
1435
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1436
- aConstraints.gridx += 1;
1437
- aConstraints.weighty = 0;
1438
- 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");
14391446
14401447 /*
14411448 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1442
- aConstraints.gridx += 1;
1443
- aConstraints.weighty = 0;
1444
- aConstraints.gridwidth = 1;
14451449 */
14461450
1447
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1448
- 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);
14491457
1450
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1451
-
1452
- aConstraints.gridx += 1;
1453
-
1454
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1455
-
1456
- aConstraints.gridx += 1;
1457
-
1458
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1459
-
1460
- aConstraints.gridx = 0;
1461
- aConstraints.gridy += 1;
1462
- aConstraints.weighty = 0;
1463
- aConstraints.gridwidth = 1;
1458
+ editBar.preferredHeight = 15;
1459
+
1460
+ panel.add(editBar);
1461
+
14641462 /**/
14651463 //aConstraints.weighty = 0;
14661464 ////aConstraints.weightx = 1;
14671465 //aConstraints.weighty = 1;
14681466 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14691467 //aConstraints.gridx += 1;
1470
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1471
- aConstraints.weighty = 0;
1472
- aConstraints.gridx = 0;
1473
- aConstraints.gridy += 1;
1474
- aConstraints.gridwidth = 1;
1468
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14751469
1476
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1477
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1479
- aConstraints.gridx += 1;
1480
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1481
- //aConstraints.weightx = 0;
1482
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1483
- aConstraints.gridx = 0;
1484
- aConstraints.gridy += 1;
1485
- 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);
14861478
1487
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1488
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1489
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1490
- aConstraints.gridx += 1;
1491
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1492
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1493
- aConstraints.gridx = 0;
1494
- aConstraints.gridy += 1;
1495
- 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);
14961484
1497
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1498
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1499
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1500
- aConstraints.gridx += 1;
1501
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1502
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1503
- aConstraints.gridx = 0;
1504
- aConstraints.gridy += 1;
1505
- 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);
15061490
1507
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1508
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1509
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1510
- aConstraints.gridx += 1;
1511
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1512
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1513
- aConstraints.gridx = 0;
1514
- aConstraints.gridy += 1;
1515
- 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);
15161496
1517
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1518
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1519
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1520
- aConstraints.gridx += 1;
1521
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1522
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1523
- aConstraints.gridx = 0;
1524
- aConstraints.gridy += 1;
1525
- 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);
15261502
1527
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1528
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1529
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1530
- aConstraints.gridx += 1;
1531
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1532
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1533
- aConstraints.gridx = 0;
1534
- aConstraints.gridy += 1;
1535
- 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);
15361508
1537
- //aConstraints.weighty = 1;
1538
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1539
- //aConstraints.gridx += 1;
1540
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1541
- aConstraints.weighty = 0;
1542
- aConstraints.gridx = 0;
1543
- aConstraints.gridy += 1;
1544
- 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);
15451522
1546
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1547
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1548
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1549
- aConstraints.gridx += 1;
1550
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1551
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1552
- aConstraints.gridx = 0;
1553
- aConstraints.gridy += 1;
1554
- 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);
15551528
1556
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1557
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1558
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1559
- aConstraints.gridx += 1;
1560
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1561
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1562
- aConstraints.gridx = 0;
1563
- aConstraints.gridy += 1;
1564
- 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);
15651534
1566
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1567
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1568
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1569
- aConstraints.gridx += 1;
1570
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1571
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1572
- aConstraints.gridx = 0;
1573
- aConstraints.gridy += 1;
1574
- 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);
15751540
1576
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1577
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1578
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1579
- aConstraints.gridx += 1;
1580
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1581
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1582
- aConstraints.gridx = 0;
1583
- aConstraints.gridy += 1;
1584
- 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);
15851546
1586
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1587
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1588
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1589
- aConstraints.gridx += 1;
1590
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1591
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1592
- aConstraints.gridx = 0;
1593
- aConstraints.gridy += 1;
1594
- 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);
15951552
1596
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1597
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1598
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1599
- aConstraints.gridx += 1;
1600
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1601
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1602
- aConstraints.gridx = 0;
1603
- aConstraints.gridy += 1;
1604
- 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);
16051558
1606
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1607
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1608
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1609
- aConstraints.gridx += 1;
1610
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1611
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1612
- aConstraints.gridx = 0;
1613
- aConstraints.gridy += 1;
1614
- 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);
16151566
1616
- //aConstraints.weighty = 1;
1617
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1618
- //aConstraints.gridx += 1;
1619
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1620
- aConstraints.weighty = 0;
1621
- aConstraints.gridx = 0;
1622
- aConstraints.gridy += 1;
1623
- 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);
16241572
1625
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1626
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1627
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1628
- aConstraints.gridx += 1;
1629
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1630
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1631
- aConstraints.gridx = 0;
1632
- aConstraints.gridy += 1;
1633
- 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);
16341578
1635
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1636
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1637
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1638
- aConstraints.gridx += 1;
1639
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1640
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1641
- aConstraints.gridx = 0;
1642
- aConstraints.gridy += 1;
1643
- 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);
16441584
1645
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1646
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1647
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1648
- aConstraints.gridx += 1;
1649
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1650
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1651
- aConstraints.gridx = 0;
1652
- aConstraints.gridy += 1;
1653
- 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);
16541590
1655
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1656
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1658
- aConstraints.gridx += 1;
1659
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1660
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1661
- aConstraints.gridx = 0;
1662
- aConstraints.gridy += 1;
1663
- 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);
16641596
1665
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1666
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1667
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1668
- aConstraints.gridx += 1;
1669
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1670
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1671
- aConstraints.gridx = 0;
1672
- aConstraints.gridy += 1;
1673
- aConstraints.gridwidth = 1;
1674
-
1675
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1676
- Return();
1597
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1598
+ //Return();
16771599 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16781600 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16791601 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1684,130 +1606,93 @@
16841606 // aConstraints.gridy += 1;
16851607 // aConstraints.gridwidth = 1;
16861608
1687
- //aConstraints.weighty = 1;
1688
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1689
- //aConstraints.gridx += 1;
1690
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1691
- aConstraints.weighty = 0;
1692
- aConstraints.gridx = 0;
1693
- aConstraints.gridy += 1;
1694
- aConstraints.gridwidth = 1;
16951609
1696
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1697
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1699
- aConstraints.gridx += 1;
1700
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1701
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1702
- aConstraints.gridx = 0;
1703
- aConstraints.gridy += 1;
1704
- 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);
17051617
1706
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1707
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1709
- aConstraints.gridx += 1;
1710
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1711
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1712
- aConstraints.gridx = 0;
1713
- aConstraints.gridy += 1;
1714
- 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);
17151623
1716
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1717
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1718
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1719
- aConstraints.gridx += 1;
1720
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1721
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1722
- aConstraints.gridx = 0;
1723
- aConstraints.gridy += 1;
1724
- 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);
17251629
1726
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1727
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1728
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1729
- aConstraints.gridx += 1;
1730
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1731
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1732
- aConstraints.gridx = 0;
1733
- aConstraints.gridy += 1;
1734
- aConstraints.gridwidth = 1;
1735
- 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);
17361635
1737
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1738
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1739
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1740
- aConstraints.gridx += 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1742
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1743
- aConstraints.gridx = 0;
1744
- aConstraints.gridy += 1;
1745
- 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);
17461641
1747
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1748
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1749
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1750
- aConstraints.gridx += 1;
1751
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1752
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1753
- aConstraints.gridx = 0;
1754
- aConstraints.gridy += 1;
1755
- 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);
17561649
1757
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1758
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1759
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1760
- aConstraints.gridx += 1;
1761
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1762
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1763
- aConstraints.gridx = 0;
1764
- aConstraints.gridy += 1;
1765
- 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);
17661655
1767
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1768
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1769
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1770
- aConstraints.gridx += 1;
1771
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1772
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1773
- aConstraints.gridx = 0;
1774
- aConstraints.gridy += 1;
1775
- 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);
17761661
1777
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1778
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1779
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1780
- aConstraints.gridx += 1;
1781
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1782
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1783
- aConstraints.gridx = 0;
1784
- aConstraints.gridy += 1;
1785
- 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);
17861667
1787
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1788
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1789
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1790
- aConstraints.gridx += 1;
1791
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1792
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1793
- aConstraints.gridx = 0;
1794
- aConstraints.gridy += 1;
1795
- 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);
17961673
1797
- //aConstraints.weighty = 1;
1798
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1799
- //aConstraints.gridx += 1;
1800
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1801
- 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);
18021679
1803
- aConstraints.gridx = 0;
1804
- aConstraints.gridy = 0;
1805
- 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);
18061691
18071692 SetMaterial(copy); // .GetMaterial());
18081693
1809
- colorField.addChangeListener(this);
1810
- modulationField.addChangeListener(this);
1694
+ //colorField.addChangeListener(this);
1695
+// modulationField.addChangeListener(this);
18111696 metalnessField.addChangeListener(this);
18121697 diffuseField.addChangeListener(this);
18131698 specularField.addChangeListener(this);
....@@ -2619,6 +2504,7 @@
26192504 }
26202505 if (input == null)
26212506 {
2507
+ new Exception().printStackTrace();
26222508 System.exit(0);
26232509 }
26242510
....@@ -3316,7 +3202,7 @@
33163202 if (!Globals.ANIMATION)
33173203 {
33183204 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3319
- browser.show();
3205
+ browser.setVisible(true);
33203206 String filename = browser.getFile();
33213207 if (filename != null && filename.length() > 0)
33223208 {
....@@ -3348,6 +3234,7 @@
33483234 callee.refreshContents();
33493235 } else
33503236 {
3237
+ new Exception().printStackTrace();
33513238 System.exit(0);
33523239 }
33533240 }
....@@ -3510,7 +3397,7 @@
35103397 current.fakedepth = (float) fakedepthField.getFloat();
35113398 current.shadowbias = (float) shadowbiasField.getFloat();
35123399
3513
- if (!NumberSlider.frozen)
3400
+ if (!cNumberSlider.frozen)
35143401 {
35153402 //System.out.println("Propagate = " + propagate);
35163403 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3558,6 +3445,7 @@
35583445 || e.getSource() == apertureField
35593446 || e.getSource() == shadowblurField)
35603447 {
3448
+ new Exception().printStackTrace();
35613449 System.exit(0);
35623450 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35633451 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3883,7 +3771,7 @@
38833771
38843772 radioPanel.revalidate();
38853773 radioPanel.repaint();
3886
- ctrlPanel.revalidate(); // ? new
3774
+ ctrlPanel.validate(); // ? new
38873775 ctrlPanel.repaint();
38883776 }
38893777 }
....@@ -4529,8 +4417,8 @@
45294417 //MenuItem normalLensItem;
45304418 MenuItem editCameraItem;
45314419 MenuItem revertCameraItem;
4532
- CheckboxMenuItem toggleLiveItem;
45334420 MenuItem stepItem;
4421
+ CheckboxMenuItem toggleLiveItem;
45344422 CheckboxMenuItem toggleFullScreenItem;
45354423 CheckboxMenuItem toggleTimelineItem;
45364424 CheckboxMenuItem toggleRenderItem;
....@@ -4547,20 +4435,20 @@
45474435 JSplitPane mainPanel;
45484436 JScrollPane scrollpane;
45494437 JPanel toolbarPanel;
4550
- JPanel treePanel;
4438
+ cGridBag treePanel;
45514439 JPanel radioPanel;
45524440 ButtonGroup buttonGroup;
4553
- JPanel ctrlPanel;
4554
- JPanel materialPanel;
4441
+ cGridBag ctrlPanel;
4442
+ cGridBag materialPanel;
45554443 JScrollPane infoPanel;
4556
- JPanel optionsPanel;
4444
+ cGridBag optionsPanel;
45574445 JTabbedPane objectPanel;
45584446 cGridBag XYZPanel;
45594447 JSplitPane gridPanel;
45604448 JSplitPane bigPanel;
45614449 cGridBag bigThree;
4562
- JTabbedPane scenePanel;
4563
- JPanel centralPanel;
4450
+ cGridBag scenePanel;
4451
+ cGridBag centralPanel;
45644452 JSplitPane cameraPanel;
45654453 JPanel timelinePanel;
45664454 JMenuBar timelineMenubar;
....@@ -4613,67 +4501,67 @@
46134501 // MATERIAL
46144502 JLabel materialLabel;
46154503 JLabel colorLabel;
4616
- NumberSlider colorField;
4504
+ cNumberSlider colorField;
46174505 JLabel modulationLabel;
4618
- NumberSlider modulationField;
4506
+ cNumberSlider modulationField;
46194507 JLabel metalnessLabel;
4620
- NumberSlider metalnessField;
4508
+ cNumberSlider metalnessField;
46214509 JLabel diffuseLabel;
4622
- NumberSlider diffuseField;
4510
+ cNumberSlider diffuseField;
46234511 JLabel specularLabel;
4624
- NumberSlider specularField;
4512
+ cNumberSlider specularField;
46254513 JLabel shininessLabel;
4626
- NumberSlider shininessField;
4514
+ cNumberSlider shininessField;
46274515 JLabel shiftLabel;
4628
- NumberSlider shiftField;
4516
+ cNumberSlider shiftField;
46294517 JLabel ambientLabel;
4630
- NumberSlider ambientField;
4518
+ cNumberSlider ambientField;
46314519 JLabel lightareaLabel;
4632
- NumberSlider lightareaField;
4520
+ cNumberSlider lightareaField;
46334521 JLabel diffusenessLabel;
4634
- NumberSlider diffusenessField;
4522
+ cNumberSlider diffusenessField;
46354523 JLabel velvetLabel;
4636
- NumberSlider velvetField;
4524
+ cNumberSlider velvetField;
46374525 JLabel sheenLabel;
4638
- NumberSlider sheenField;
4526
+ cNumberSlider sheenField;
46394527 JLabel subsurfaceLabel;
4640
- NumberSlider subsurfaceField;
4528
+ cNumberSlider subsurfaceField;
46414529 //JLabel bumpLabel;
46424530 //NumberSlider bumpField;
46434531 JLabel backlitLabel;
4644
- NumberSlider backlitField;
4532
+ cNumberSlider backlitField;
46454533 JLabel anisoLabel;
4646
- NumberSlider anisoField;
4534
+ cNumberSlider anisoField;
46474535 JLabel anisoVLabel;
4648
- NumberSlider anisoVField;
4536
+ cNumberSlider anisoVField;
46494537 JLabel cameraLabel;
4650
- NumberSlider cameraField;
4538
+ cNumberSlider cameraField;
46514539 JLabel selfshadowLabel;
4652
- NumberSlider selfshadowField;
4540
+ cNumberSlider selfshadowField;
46534541 JLabel shadowLabel;
4654
- NumberSlider shadowField;
4542
+ cNumberSlider shadowField;
46554543 JLabel textureLabel;
4656
- NumberSlider textureField;
4544
+ cNumberSlider textureField;
46574545 JLabel opacityLabel;
4658
- NumberSlider opacityField;
4546
+ cNumberSlider opacityField;
46594547 JLabel fakedepthLabel;
4660
- NumberSlider fakedepthField;
4548
+ cNumberSlider fakedepthField;
46614549 JLabel shadowbiasLabel;
4662
- NumberSlider shadowbiasField;
4550
+ cNumberSlider shadowbiasField;
46634551 JLabel bumpLabel;
4664
- NumberSlider bumpField;
4552
+ cNumberSlider bumpField;
46654553 JLabel noiseLabel;
4666
- NumberSlider noiseField;
4554
+ cNumberSlider noiseField;
46674555 JLabel powerLabel;
4668
- NumberSlider powerField;
4556
+ cNumberSlider powerField;
46694557 JLabel borderfadeLabel;
4670
- NumberSlider borderfadeField;
4558
+ cNumberSlider borderfadeField;
46714559 JLabel fogLabel;
4672
- NumberSlider fogField;
4560
+ cNumberSlider fogField;
46734561 JLabel opacityPowerLabel;
4674
- NumberSlider opacityPowerField;
4562
+ cNumberSlider opacityPowerField;
46754563 JTree jTree;
46764564 //ObjectUI parent;
46774565
4678
- NumberSlider normalpushField;
4566
+ cNumberSlider normalpushField;
46794567 }