Normand Briere
2019-05-01 504890a7b930ab6b853c49de825ae848e0535339
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,
....@@ -124,7 +126,7 @@
124126 void keyPressed(int key, int modifiers)
125127 {
126128 System.out.println("KEY PRESSED");
127
- CameraPane.theRenderer.keyPressed(key, modifiers);
129
+ Globals.theRenderer.keyPressed(key, modifiers);
128130 }
129131 */
130132
....@@ -136,34 +138,40 @@
136138 public void closeUI()
137139 {
138140 //new Exception().printStackTrace();
139
- System.out.println("this = " + this);
140
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
141143 //nameField.removeActionListener(this);
142
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
143145
144146 if (!GroupEditor.allparams)
145147 return;
146148
147
- objEditor.ctrlPanel.remove(liveCB);
148
- objEditor.ctrlPanel.remove(hideCB);
149
- objEditor.ctrlPanel.remove(markCB);
150
-
151
- objEditor.ctrlPanel.remove(randomCB);
152
- objEditor.ctrlPanel.remove(speedupCB);
153
- objEditor.ctrlPanel.remove(rewindCB);
154
-
155
- objEditor.ctrlPanel.remove(resetButton);
156
- objEditor.ctrlPanel.remove(stepButton);
157
-// objEditor.ctrlPanel.remove(stepAllButton);
158
-// objEditor.ctrlPanel.remove(resetAllButton);
159
- objEditor.ctrlPanel.remove(link2masterCB);
160
- //objEditor.ctrlPanel.remove(flipVCB);
161
- //objEditor.ctrlPanel.remove(texresMenu);
162
- objEditor.ctrlPanel.remove(slowerButton);
163
- objEditor.ctrlPanel.remove(fasterButton);
164
- 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);
165167
166
- 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);
167175 }
168176
169177 public ObjEditor GetEditor()
....@@ -353,9 +361,9 @@
353361 toolbarPanel.setName("Toolbar");
354362 treePanel = new JPanel();
355363 treePanel.setName("Tree");
356
- ctrlPanel = new JPanel(); // new GridBagLayout());
364
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
357365 ctrlPanel.setName("Edit");
358
- materialPanel = new JPanel();
366
+ materialPanel = new cGridBag().setVertical(true);
359367 materialPanel.setName("Material");
360368 /*JTextPane*/
361369 infoarea = createTextPane();
....@@ -384,8 +392,8 @@
384392 //mainPanel.setLayout(new GridBagLayout());
385393 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
386394 treePanel.setLayout(new GridBagLayout());
387
- ctrlPanel.setLayout(new GridBagLayout());
388
- materialPanel.setLayout(new GridBagLayout());
395
+ //ctrlPanel.setLayout(new GridBagLayout());
396
+ //materialPanel.setLayout(new GridBagLayout());
389397
390398 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
391399 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -765,115 +773,83 @@
765773 JButton slowerButton;
766774 JButton fasterButton;
767775 JButton remarkButton;
776
+
777
+ cGridBag namePanel;
778
+ cGridBag setupPanel;
779
+ cGridBag commandsPanel;
780
+ cGridBag pushPanel;
781
+ cGridBag fillPanel;
768782
769
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
783
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
770784 {
771785 JCheckBox cb;
772786
773
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
774
- oe.aConstraints.gridwidth = 1; // 3;
775
-// oe.aConstraints.weightx = 1;
776
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
777
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
787
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
778788 cb.addItemListener(this);
779
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
780
- oe.aConstraints.gridwidth = 1;
781
- oe.aConstraints.gridx += 1;
782789
783790 return cb;
784791 }
785792
786
- cButton AddButton(ObjEditor oe, String label)
793
+ cButton AddButton(cGridBag panel, String label)
787794 {
788795 cButton cb;
789796
790
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
791
- oe.aConstraints.gridwidth = 1;
792
-// oe.aConstraints.weightx = 1;
793
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
794
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
797
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
795798 cb.addActionListener(this);
796
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
797
- oe.aConstraints.gridwidth = 1;
798
- oe.aConstraints.gridx += 1;
799799
800800 return cb;
801801 }
802802
803
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
803
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
804804 {
805805 JComboBox combo;
806806
807
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
808
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
809
- oe.aConstraints.gridx += 1;
807
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
810808 combo.addActionListener(this);
811809
812810 return combo;
813811 }
814812
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
813
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
816814 {
817
- NumberSlider combo;
815
+ cGridBag control = new cGridBag();
816
+
817
+ cNumberSlider combo;
818818
819819 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822820 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
823
- aConstraints.gridwidth = 1;
824
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
825
- aConstraints.gridx += 1;
826
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
827
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
828
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
829
- aConstraints.gridx += 1;
830
- aConstraints.gridwidth = 1;
831
-
821
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
822
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832823 combo.setFloat(current);
833
-
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
824
+
825
+ panel.add(control);
826
+
827
+ return control;
839828 }
840829
841
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
830
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
842831 {
843
- NumberSlider combo;
832
+ cGridBag control = new cGridBag();
833
+
834
+ cNumberSlider combo;
844835
845836 JLabel jlabel = new JLabel(label);
846
-
847
- aConstraints.fill = GridBagConstraints.VERTICAL;
848837 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
849
- aConstraints.gridwidth = 2;
850
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
851
- aConstraints.gridx += 1;
852
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
853
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
854
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
855
- aConstraints.gridx += 1;
856
- aConstraints.gridwidth = 1;
857
-
838
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
839
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
858840 combo.setInteger(current);
859841
860
- combo.label = jlabel;
861
-
862
- combo.addChangeListener(this);
863
-
864
- return combo;
842
+ panel.add(control);
843
+
844
+ return control;
865845 }
866846
867
- JTextArea AddText(JPanel ctrlPanel, String name)
847
+ JTextArea AddText(cGridBag ctrlPanel, String name)
868848 {
869849 JTextArea text;
870850
871
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
872
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
873
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
851
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
874852 text.addCaretListener(this);
875
- aConstraints.gridx += 1;
876
- aConstraints.gridwidth = 1;
877853
878854 return text;
879855 }
....@@ -903,9 +879,16 @@
903879 objEditor.ctrlPanel.remove(j);
904880 }
905881
882
+ void Remove(cNumberSlider j)
883
+ {
884
+ j.removeChangeListener(this);
885
+ //objEditor.ctrlPanel.remove(j.label);
886
+ objEditor.ctrlPanel.remove(j);
887
+ }
888
+
906889 /*
907890 */
908
- void Return() // ObjEditor oe)
891
+ void Return0() // ObjEditor oe)
909892 {
910893 aConstraints.gridy += 1;
911894 aConstraints.gridx = 0;
....@@ -964,33 +947,52 @@
964947 // oe.aConstraints.weighty = 0;
965948 // oe.aConstraints.gridx = 0;
966949 // oe.aConstraints.gridy = 0;
967
- SetupName(oe);
950
+ //SetupName(oe);
951
+
952
+ namePanel = new cGridBag();
953
+
954
+ nameField = AddText(namePanel, copy.GetName());
955
+ namePanel.add(nameField);
956
+ oe.ctrlPanel.add(namePanel);
957
+
958
+ oe.ctrlPanel.Return();
968959
969960 if (!GroupEditor.allparams)
970961 return;
971962
972
- liveCB = AddCheckBox(oe, "Live", copy.live);
973
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
974
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
963
+ setupPanel = new cGridBag().setVertical(false);
964
+
965
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
966
+ link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
967
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
975968 // Return();
976
- markCB = AddCheckBox(oe, "Mark", copy.marked);
977
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
978
- randomCB = AddCheckBox(oe, "Rand", copy.random);
979
- Return();
980
- resetButton = AddButton(oe, "Reset");
981
- stepButton = AddButton(oe, "Step");
969
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
970
+ rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind);
971
+ randomCB = AddCheckBox(setupPanel, "Rand", copy.random);
972
+
973
+ oe.ctrlPanel.add(setupPanel);
974
+ oe.ctrlPanel.Return();
975
+
976
+ commandsPanel = new cGridBag().setVertical(false);
977
+
978
+ resetButton = AddButton(commandsPanel, "Reset");
979
+ stepButton = AddButton(commandsPanel, "Step");
982980 // resetAllButton = AddButton(oe, "Reset All");
983981 // stepAllButton = AddButton(oe, "Step All");
984
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
982
+ speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
985983 // Return();
986
- slowerButton = AddButton(oe, "Slow");
987
- fasterButton = AddButton(oe, "Fast");
988
- remarkButton = AddButton(oe, "Rem");
984
+ slowerButton = AddButton(commandsPanel, "Slow");
985
+ fasterButton = AddButton(commandsPanel, "Fast");
986
+ remarkButton = AddButton(commandsPanel, "Remark");
989987
990
- Return();
988
+ oe.ctrlPanel.add(commandsPanel);
989
+ oe.ctrlPanel.Return();
991990
992
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
993
- Return();
991
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
992
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
993
+ //Return();
994
+
995
+ oe.ctrlPanel.Return();
994996
995997 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
996998 // ObjEditor.aConstraints.gridx += 1;
....@@ -1085,7 +1087,7 @@
10851087 oe.aConstraints.gridwidth = 1;
10861088 /**/
10871089 nameField = AddText(oe.ctrlPanel, copy.GetName());
1088
- Return();
1090
+ oe.ctrlPanel.Return();
10891091
10901092 //ctrlPanel.add(textureButton = new Button("Texture..."));
10911093 //textureButton.setEnabled(false);
....@@ -1187,7 +1189,8 @@
11871189 //JPanel worldPanel =
11881190 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11891191 //worldPanel.setName("World");
1190
- centralPanel = new JPanel(new BorderLayout());
1192
+ centralPanel = new cGridBag();
1193
+ centralPanel.preferredWidth = 20;
11911194 timelinePanel = new JPanel(new BorderLayout());
11921195 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11931196
....@@ -1217,12 +1220,13 @@
12171220 //frontView.object = copy;
12181221 //sideView.object = copy;
12191222
1220
- XYZPanel = new JPanel();
1221
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1223
+ XYZPanel = new cGridBag().setVertical(true);
1224
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12221225
1223
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1224
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1225
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1226
+ XYZPanel.preferredWidth = 5;
1227
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1228
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1229
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12261230
12271231 /*
12281232 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1260,10 +1264,11 @@
12601264 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12611265 //tmp.setName("Edit");
12621266 objectPanel.add(materialPanel);
1263
- JPanel north = new JPanel(new BorderLayout());
1264
- north.setName("Edit");
1265
- north.add(ctrlPanel, BorderLayout.NORTH);
1266
- objectPanel.add(north);
1267
+// JPanel north = new JPanel(new BorderLayout());
1268
+// north.setName("Edit");
1269
+// north.add(ctrlPanel, BorderLayout.NORTH);
1270
+// objectPanel.add(north);
1271
+ objectPanel.add(ctrlPanel);
12671272 objectPanel.add(infoPanel);
12681273
12691274 /*
....@@ -1284,16 +1289,23 @@
12841289 scrollpane.setWheelScrollingEnabled(true);
12851290 scrollpane.addMouseWheelListener(this); // Default not fast enough
12861291
1287
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1288
- scenePanel.add(scrollpane);
1292
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1293
+ scenePanel.preferredWidth = 7;
1294
+
1295
+ JTabbedPane tabbedPane = new JTabbedPane();
1296
+ tabbedPane.add(scrollpane);
12891297
1290
- scenePanel.add(FSPane = new cFileSystemPane(this));
1298
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12911299
1292
- optionsPanel = new JPanel(new GridBagLayout());
1300
+ optionsPanel = new cGridBag().setVertical(true);
12931301
12941302 optionsPanel.setName("Options");
1295
- scenePanel.add(optionsPanel);
1296
-
1303
+
1304
+ AddOptions(optionsPanel); //, aConstraints);
1305
+
1306
+ tabbedPane.add(optionsPanel);
1307
+
1308
+ scenePanel.add(tabbedPane);
12971309
12981310 /*
12991311 cTree jTree = new cTree(null);
....@@ -1327,6 +1339,7 @@
13271339 //bigPanel.setSize(new Dimension(10,10));
13281340 //bigPanel.add(ctrlPanel);
13291341 //bigPanel.add(gridPanel);
1342
+ /**
13301343 bigThree = new JPanel();
13311344 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13321345 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1350,7 +1363,13 @@
13501363 // aConstraints.gridheight = 3;
13511364 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13521365 bigThree.add(XYZPanel, aWindowConstraints);
1366
+ /**/
13531367
1368
+ bigThree = new cGridBag();
1369
+ bigThree.addComponent(scenePanel);
1370
+ bigThree.addComponent(centralPanel);
1371
+ bigThree.addComponent(XYZPanel);
1372
+
13541373 // // SIDE EFFECT!!!
13551374 // aConstraints.gridx = 0;
13561375 // aConstraints.gridy = 0;
....@@ -1393,6 +1412,10 @@
13931412 });
13941413 }
13951414
1415
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1416
+ {
1417
+ }
1418
+
13961419 JTree GetTree()
13971420 {
13981421 return objEditor.jTree;
....@@ -1404,260 +1427,165 @@
14041427 ctrlPanel.removeAll();
14051428 }
14061429
1407
- void SetupMaterial(JPanel ctrlPanel)
1430
+ void SetupMaterial(cGridBag panel)
14081431 {
1409
- aConstraints.weighty = 0;
1410
- //aConstraints.weightx = 1;
1411
- /*
1432
+ /*
14121433 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14131434 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1414
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1415
- aConstraints.gridx += 1;
14161435 */
14171436
1418
- aConstraints.gridwidth = 1;
1419
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1420
- aConstraints.gridx += 1;
1421
- aConstraints.weighty = 0;
1422
- aConstraints.gridwidth = 1;
1437
+ cGridBag editBar = new cGridBag().setVertical(false);
1438
+
1439
+ editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
14231440
14241441 /*
14251442 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1426
- aConstraints.gridx += 1;
1427
- aConstraints.weighty = 0;
1428
- aConstraints.gridwidth = 1;
14291443 */
14301444
1431
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1432
- aConstraints.gridx += 1;
1445
+ editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints);
1446
+ editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints);
1447
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1448
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
14331449
1434
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1435
-
1436
- aConstraints.gridx += 1;
1437
-
1438
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1439
-
1440
- aConstraints.gridx += 1;
1441
-
1442
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1443
-
1444
- aConstraints.gridx = 0;
1445
- aConstraints.gridy += 1;
1446
- aConstraints.weighty = 0;
1447
- aConstraints.gridwidth = 1;
1450
+ panel.add(editBar);
1451
+
14481452 /**/
14491453 //aConstraints.weighty = 0;
14501454 ////aConstraints.weightx = 1;
14511455 //aConstraints.weighty = 1;
14521456 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14531457 //aConstraints.gridx += 1;
1454
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1455
- aConstraints.weighty = 0;
1456
- aConstraints.gridx = 0;
1457
- aConstraints.gridy += 1;
1458
- aConstraints.gridwidth = 1;
1458
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14591459
1460
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1461
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1462
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1463
- aConstraints.gridx += 1;
1464
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1465
- //aConstraints.weightx = 0;
1466
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1467
- aConstraints.gridx = 0;
1468
- aConstraints.gridy += 1;
1469
- aConstraints.gridwidth = 1;
1460
+ cGridBag colorSection = new cGridBag().setVertical(true);
1461
+
1462
+ cGridBag color = new cGridBag();
1463
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1464
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1465
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1466
+ //colorField.preferredWidth = 200;
1467
+ colorSection.add(color);
14701468
1471
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1472
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1473
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1474
- aConstraints.gridx += 1;
1475
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1476
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1477
- aConstraints.gridx = 0;
1478
- aConstraints.gridy += 1;
1479
- aConstraints.gridwidth = 1;
1469
+ cGridBag modulation = new cGridBag();
1470
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1471
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1472
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1473
+ colorSection.add(modulation);
14801474
1481
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1482
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1483
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1484
- aConstraints.gridx += 1;
1485
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1486
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1487
- aConstraints.gridx = 0;
1488
- aConstraints.gridy += 1;
1489
- aConstraints.gridwidth = 1;
1475
+ cGridBag texture = new cGridBag();
1476
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1477
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1479
+ colorSection.add(texture);
14901480
1491
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1492
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1493
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1494
- aConstraints.gridx += 1;
1495
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1496
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1497
- aConstraints.gridx = 0;
1498
- aConstraints.gridy += 1;
1499
- aConstraints.gridwidth = 1;
1481
+ cGridBag anisoU = new cGridBag();
1482
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1483
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1484
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1485
+ colorSection.add(anisoU);
15001486
1501
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1502
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1503
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1504
- aConstraints.gridx += 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1506
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1507
- aConstraints.gridx = 0;
1508
- aConstraints.gridy += 1;
1509
- aConstraints.gridwidth = 1;
1487
+ cGridBag anisoV = new cGridBag();
1488
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1489
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1490
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1491
+ colorSection.add(anisoV);
15101492
1511
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1512
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1513
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1514
- aConstraints.gridx += 1;
1515
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1516
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1517
- aConstraints.gridx = 0;
1518
- aConstraints.gridy += 1;
1519
- aConstraints.gridwidth = 1;
1493
+ cGridBag shadowbias = new cGridBag();
1494
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1495
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1496
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1497
+ colorSection.add(shadowbias);
15201498
1521
- //aConstraints.weighty = 1;
1522
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1523
- //aConstraints.gridx += 1;
1524
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1525
- aConstraints.weighty = 0;
1526
- aConstraints.gridx = 0;
1527
- aConstraints.gridy += 1;
1528
- aConstraints.gridwidth = 1;
1499
+ panel.add(new JSeparator());
1500
+
1501
+ panel.add(colorSection);
1502
+
1503
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1504
+
1505
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1506
+
1507
+ cGridBag diffuse = new cGridBag();
1508
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1509
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1510
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1511
+ diffuseSection.add(diffuse);
15291512
1530
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1531
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1533
- aConstraints.gridx += 1;
1534
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1535
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1536
- aConstraints.gridx = 0;
1537
- aConstraints.gridy += 1;
1538
- aConstraints.gridwidth = 1;
1513
+ cGridBag diffuseness = new cGridBag();
1514
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1515
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1516
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1517
+ diffuseSection.add(diffuseness);
15391518
1540
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1541
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1542
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1543
- aConstraints.gridx += 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1545
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1546
- aConstraints.gridx = 0;
1547
- aConstraints.gridy += 1;
1548
- aConstraints.gridwidth = 1;
1519
+ cGridBag selfshadow = new cGridBag();
1520
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1521
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1522
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1523
+ diffuseSection.add(selfshadow);
15491524
1550
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1551
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1552
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1553
- aConstraints.gridx += 1;
1554
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1555
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1556
- aConstraints.gridx = 0;
1557
- aConstraints.gridy += 1;
1558
- aConstraints.gridwidth = 1;
1525
+ cGridBag sheen = new cGridBag();
1526
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1527
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1528
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1529
+ diffuseSection.add(sheen);
15591530
1560
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1561
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1562
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1563
- aConstraints.gridx += 1;
1564
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1565
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1566
- aConstraints.gridx = 0;
1567
- aConstraints.gridy += 1;
1568
- aConstraints.gridwidth = 1;
1531
+ cGridBag subsurface = new cGridBag();
1532
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1533
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1534
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1535
+ diffuseSection.add(subsurface);
15691536
1570
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1571
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1572
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1573
- aConstraints.gridx += 1;
1574
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1575
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1576
- aConstraints.gridx = 0;
1577
- aConstraints.gridy += 1;
1578
- aConstraints.gridwidth = 1;
1537
+ cGridBag shadow = new cGridBag();
1538
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1539
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1540
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1541
+ diffuseSection.add(shadow);
15791542
1580
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1581
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1583
- aConstraints.gridx += 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1585
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1586
- aConstraints.gridx = 0;
1587
- aConstraints.gridy += 1;
1588
- aConstraints.gridwidth = 1;
1543
+ cGridBag fakedepth = new cGridBag();
1544
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1545
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1546
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1547
+ diffuseSection.add(fakedepth);
15891548
1590
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1591
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1592
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1593
- aConstraints.gridx += 1;
1594
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1595
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1596
- aConstraints.gridx = 0;
1597
- aConstraints.gridy += 1;
1598
- aConstraints.gridwidth = 1;
1549
+ panel.add(new JSeparator());
1550
+
1551
+ panel.add(diffuseSection);
1552
+
1553
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1554
+
1555
+ cGridBag specularSection = new cGridBag().setVertical(true);
15991556
1600
- //aConstraints.weighty = 1;
1601
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1602
- //aConstraints.gridx += 1;
1603
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1604
- aConstraints.weighty = 0;
1605
- aConstraints.gridx = 0;
1606
- aConstraints.gridy += 1;
1607
- aConstraints.gridwidth = 1;
1557
+ cGridBag specular = new cGridBag();
1558
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1559
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1560
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1561
+ specularSection.add(specular);
16081562
1609
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1610
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1612
- aConstraints.gridx += 1;
1613
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1614
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1615
- aConstraints.gridx = 0;
1616
- aConstraints.gridy += 1;
1617
- aConstraints.gridwidth = 1;
1563
+ cGridBag lightarea = new cGridBag();
1564
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1565
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1566
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1567
+ specularSection.add(lightarea);
16181568
1619
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1620
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1621
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1622
- aConstraints.gridx += 1;
1623
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1624
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1625
- aConstraints.gridx = 0;
1626
- aConstraints.gridy += 1;
1627
- aConstraints.gridwidth = 1;
1569
+ cGridBag shininess = new cGridBag();
1570
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1571
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1572
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1573
+ specularSection.add(shininess);
16281574
1629
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1630
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1632
- aConstraints.gridx += 1;
1633
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1634
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
1575
+ cGridBag metalness = new cGridBag();
1576
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1577
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1578
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1579
+ specularSection.add(metalness);
16381580
1639
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1640
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- aConstraints.gridwidth = 1;
1581
+ cGridBag velvet = new cGridBag();
1582
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1583
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1584
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1585
+ specularSection.add(velvet);
16481586
1649
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1650
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1652
- aConstraints.gridx += 1;
1653
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1654
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1655
- aConstraints.gridx = 0;
1656
- aConstraints.gridy += 1;
1657
- aConstraints.gridwidth = 1;
1658
-
1659
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1660
- Return();
1587
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1588
+ //Return();
16611589 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16621590 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16631591 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1668,130 +1596,93 @@
16681596 // aConstraints.gridy += 1;
16691597 // aConstraints.gridwidth = 1;
16701598
1671
- //aConstraints.weighty = 1;
1672
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1673
- //aConstraints.gridx += 1;
1674
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1675
- aConstraints.weighty = 0;
1676
- aConstraints.gridx = 0;
1677
- aConstraints.gridy += 1;
1678
- aConstraints.gridwidth = 1;
16791599
1680
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1681
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- aConstraints.gridwidth = 1;
1600
+ panel.add(new JSeparator());
1601
+
1602
+ panel.add(specularSection);
1603
+
1604
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1605
+
1606
+ cGridBag globalSection = new cGridBag().setVertical(true);
16891607
1690
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1691
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- aConstraints.gridwidth = 1;
1608
+ cGridBag camera = new cGridBag();
1609
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1610
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1612
+ globalSection.add(camera);
16991613
1700
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1701
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- aConstraints.gridwidth = 1;
1614
+ cGridBag ambient = new cGridBag();
1615
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1616
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1617
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1618
+ globalSection.add(ambient);
17091619
1710
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1711
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1712
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1713
- aConstraints.gridx += 1;
1714
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1715
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1716
- aConstraints.gridx = 0;
1717
- aConstraints.gridy += 1;
1718
- aConstraints.gridwidth = 1;
1719
- aConstraints.weighty = 0;
1620
+ cGridBag backlit = new cGridBag();
1621
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1622
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1623
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1624
+ globalSection.add(backlit);
17201625
1721
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1722
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1723
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1724
- aConstraints.gridx += 1;
1725
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1726
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1727
- aConstraints.gridx = 0;
1728
- aConstraints.gridy += 1;
1729
- aConstraints.gridwidth = 1;
1626
+ cGridBag opacity = new cGridBag();
1627
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1628
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1629
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1630
+ globalSection.add(opacity);
17301631
1731
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1732
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1733
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1734
- aConstraints.gridx += 1;
1735
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1736
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1737
- aConstraints.gridx = 0;
1738
- aConstraints.gridy += 1;
1739
- aConstraints.gridwidth = 1;
1632
+ panel.add(new JSeparator());
1633
+
1634
+ panel.add(globalSection);
1635
+
1636
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1637
+
1638
+ cGridBag textureSection = new cGridBag().setVertical(true);
17401639
1741
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1742
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1743
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1744
- aConstraints.gridx += 1;
1745
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1746
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1747
- aConstraints.gridx = 0;
1748
- aConstraints.gridy += 1;
1749
- aConstraints.gridwidth = 1;
1640
+ cGridBag bump = new cGridBag();
1641
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1642
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1643
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1644
+ textureSection.add(bump);
17501645
1751
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1752
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1753
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1754
- aConstraints.gridx += 1;
1755
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1756
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1757
- aConstraints.gridx = 0;
1758
- aConstraints.gridy += 1;
1759
- aConstraints.gridwidth = 1;
1646
+ cGridBag noise = new cGridBag();
1647
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1648
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1649
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1650
+ textureSection.add(noise);
17601651
1761
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1762
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1763
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1764
- aConstraints.gridx += 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1766
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1767
- aConstraints.gridx = 0;
1768
- aConstraints.gridy += 1;
1769
- aConstraints.gridwidth = 1;
1652
+ cGridBag power = new cGridBag();
1653
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1654
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1655
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1656
+ textureSection.add(power);
17701657
1771
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1772
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1773
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1774
- aConstraints.gridx += 1;
1775
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1776
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1777
- aConstraints.gridx = 0;
1778
- aConstraints.gridy += 1;
1779
- aConstraints.gridwidth = 1;
1658
+ cGridBag borderfade = new cGridBag();
1659
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1660
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1661
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1662
+ textureSection.add(borderfade);
17801663
1781
- //aConstraints.weighty = 1;
1782
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1783
- //aConstraints.gridx += 1;
1784
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1785
- aConstraints.weighty = 0;
1664
+ cGridBag fog = new cGridBag();
1665
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1666
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1667
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1668
+ textureSection.add(fog);
17861669
1787
- aConstraints.gridx = 0;
1788
- aConstraints.gridy = 0;
1789
- aConstraints.gridwidth = 1;
1670
+ cGridBag opacityPower = new cGridBag();
1671
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1672
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1673
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1674
+ textureSection.add(opacityPower);
1675
+
1676
+ panel.add(new JSeparator());
1677
+
1678
+ panel.add(textureSection);
1679
+
1680
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17901681
17911682 SetMaterial(copy); // .GetMaterial());
17921683
1793
- colorField.addChangeListener(this);
1794
- modulationField.addChangeListener(this);
1684
+ //colorField.addChangeListener(this);
1685
+// modulationField.addChangeListener(this);
17951686 metalnessField.addChangeListener(this);
17961687 diffuseField.addChangeListener(this);
17971688 specularField.addChangeListener(this);
....@@ -2603,6 +2494,7 @@
26032494 }
26042495 if (input == null)
26052496 {
2497
+ new Exception().printStackTrace();
26062498 System.exit(0);
26072499 }
26082500
....@@ -3332,6 +3224,7 @@
33323224 callee.refreshContents();
33333225 } else
33343226 {
3227
+ new Exception().printStackTrace();
33353228 System.exit(0);
33363229 }
33373230 }
....@@ -3494,7 +3387,7 @@
34943387 current.fakedepth = (float) fakedepthField.getFloat();
34953388 current.shadowbias = (float) shadowbiasField.getFloat();
34963389
3497
- if (!NumberSlider.frozen)
3390
+ if (!cNumberSlider.frozen)
34983391 {
34993392 //System.out.println("Propagate = " + propagate);
35003393 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3542,6 +3435,7 @@
35423435 || e.getSource() == apertureField
35433436 || e.getSource() == shadowblurField)
35443437 {
3438
+ new Exception().printStackTrace();
35453439 System.exit(0);
35463440 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35473441 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3867,7 +3761,7 @@
38673761
38683762 radioPanel.revalidate();
38693763 radioPanel.repaint();
3870
- ctrlPanel.revalidate(); // ? new
3764
+ ctrlPanel.validate(); // ? new
38713765 ctrlPanel.repaint();
38723766 }
38733767 }
....@@ -4513,8 +4407,8 @@
45134407 //MenuItem normalLensItem;
45144408 MenuItem editCameraItem;
45154409 MenuItem revertCameraItem;
4516
- CheckboxMenuItem toggleLiveItem;
45174410 MenuItem stepItem;
4411
+ CheckboxMenuItem toggleLiveItem;
45184412 CheckboxMenuItem toggleFullScreenItem;
45194413 CheckboxMenuItem toggleTimelineItem;
45204414 CheckboxMenuItem toggleRenderItem;
....@@ -4534,17 +4428,17 @@
45344428 JPanel treePanel;
45354429 JPanel radioPanel;
45364430 ButtonGroup buttonGroup;
4537
- JPanel ctrlPanel;
4538
- JPanel materialPanel;
4431
+ cGridBag ctrlPanel;
4432
+ cGridBag materialPanel;
45394433 JScrollPane infoPanel;
4540
- JPanel optionsPanel;
4434
+ cGridBag optionsPanel;
45414435 JTabbedPane objectPanel;
4542
- JPanel XYZPanel;
4436
+ cGridBag XYZPanel;
45434437 JSplitPane gridPanel;
45444438 JSplitPane bigPanel;
4545
- JPanel bigThree;
4546
- JTabbedPane scenePanel;
4547
- JPanel centralPanel;
4439
+ cGridBag bigThree;
4440
+ cGridBag scenePanel;
4441
+ cGridBag centralPanel;
45484442 JSplitPane cameraPanel;
45494443 JPanel timelinePanel;
45504444 JMenuBar timelineMenubar;
....@@ -4597,67 +4491,67 @@
45974491 // MATERIAL
45984492 JLabel materialLabel;
45994493 JLabel colorLabel;
4600
- NumberSlider colorField;
4494
+ cNumberSlider colorField;
46014495 JLabel modulationLabel;
4602
- NumberSlider modulationField;
4496
+ cNumberSlider modulationField;
46034497 JLabel metalnessLabel;
4604
- NumberSlider metalnessField;
4498
+ cNumberSlider metalnessField;
46054499 JLabel diffuseLabel;
4606
- NumberSlider diffuseField;
4500
+ cNumberSlider diffuseField;
46074501 JLabel specularLabel;
4608
- NumberSlider specularField;
4502
+ cNumberSlider specularField;
46094503 JLabel shininessLabel;
4610
- NumberSlider shininessField;
4504
+ cNumberSlider shininessField;
46114505 JLabel shiftLabel;
4612
- NumberSlider shiftField;
4506
+ cNumberSlider shiftField;
46134507 JLabel ambientLabel;
4614
- NumberSlider ambientField;
4508
+ cNumberSlider ambientField;
46154509 JLabel lightareaLabel;
4616
- NumberSlider lightareaField;
4510
+ cNumberSlider lightareaField;
46174511 JLabel diffusenessLabel;
4618
- NumberSlider diffusenessField;
4512
+ cNumberSlider diffusenessField;
46194513 JLabel velvetLabel;
4620
- NumberSlider velvetField;
4514
+ cNumberSlider velvetField;
46214515 JLabel sheenLabel;
4622
- NumberSlider sheenField;
4516
+ cNumberSlider sheenField;
46234517 JLabel subsurfaceLabel;
4624
- NumberSlider subsurfaceField;
4518
+ cNumberSlider subsurfaceField;
46254519 //JLabel bumpLabel;
46264520 //NumberSlider bumpField;
46274521 JLabel backlitLabel;
4628
- NumberSlider backlitField;
4522
+ cNumberSlider backlitField;
46294523 JLabel anisoLabel;
4630
- NumberSlider anisoField;
4524
+ cNumberSlider anisoField;
46314525 JLabel anisoVLabel;
4632
- NumberSlider anisoVField;
4526
+ cNumberSlider anisoVField;
46334527 JLabel cameraLabel;
4634
- NumberSlider cameraField;
4528
+ cNumberSlider cameraField;
46354529 JLabel selfshadowLabel;
4636
- NumberSlider selfshadowField;
4530
+ cNumberSlider selfshadowField;
46374531 JLabel shadowLabel;
4638
- NumberSlider shadowField;
4532
+ cNumberSlider shadowField;
46394533 JLabel textureLabel;
4640
- NumberSlider textureField;
4534
+ cNumberSlider textureField;
46414535 JLabel opacityLabel;
4642
- NumberSlider opacityField;
4536
+ cNumberSlider opacityField;
46434537 JLabel fakedepthLabel;
4644
- NumberSlider fakedepthField;
4538
+ cNumberSlider fakedepthField;
46454539 JLabel shadowbiasLabel;
4646
- NumberSlider shadowbiasField;
4540
+ cNumberSlider shadowbiasField;
46474541 JLabel bumpLabel;
4648
- NumberSlider bumpField;
4542
+ cNumberSlider bumpField;
46494543 JLabel noiseLabel;
4650
- NumberSlider noiseField;
4544
+ cNumberSlider noiseField;
46514545 JLabel powerLabel;
4652
- NumberSlider powerField;
4546
+ cNumberSlider powerField;
46534547 JLabel borderfadeLabel;
4654
- NumberSlider borderfadeField;
4548
+ cNumberSlider borderfadeField;
46554549 JLabel fogLabel;
4656
- NumberSlider fogField;
4550
+ cNumberSlider fogField;
46574551 JLabel opacityPowerLabel;
4658
- NumberSlider opacityPowerField;
4552
+ cNumberSlider opacityPowerField;
46594553 JTree jTree;
46604554 //ObjectUI parent;
46614555
4662
- NumberSlider normalpushField;
4556
+ cNumberSlider normalpushField;
46634557 }