Normand Briere
2019-05-01 504890a7b930ab6b853c49de825ae848e0535339
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()
....@@ -355,9 +361,9 @@
355361 toolbarPanel.setName("Toolbar");
356362 treePanel = new JPanel();
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();
....@@ -386,8 +392,8 @@
386392 //mainPanel.setLayout(new GridBagLayout());
387393 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388394 treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
390
- materialPanel.setLayout(new GridBagLayout());
395
+ //ctrlPanel.setLayout(new GridBagLayout());
396
+ //materialPanel.setLayout(new GridBagLayout());
391397
392398 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
393399 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -767,115 +773,83 @@
767773 JButton slowerButton;
768774 JButton fasterButton;
769775 JButton remarkButton;
776
+
777
+ cGridBag namePanel;
778
+ cGridBag setupPanel;
779
+ cGridBag commandsPanel;
780
+ cGridBag pushPanel;
781
+ cGridBag fillPanel;
770782
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
783
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
772784 {
773785 JCheckBox cb;
774786
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);
787
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
780788 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
784789
785790 return cb;
786791 }
787792
788
- cButton AddButton(ObjEditor oe, String label)
793
+ cButton AddButton(cGridBag panel, String label)
789794 {
790795 cButton cb;
791796
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);
797
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
797798 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
801799
802800 return cb;
803801 }
804802
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
803
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
806804 {
807805 JComboBox combo;
808806
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;
807
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
812808 combo.addActionListener(this);
813809
814810 return combo;
815811 }
816812
817
- 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)
818814 {
819
- NumberSlider combo;
815
+ cGridBag control = new cGridBag();
816
+
817
+ cNumberSlider combo;
820818
821819 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824820 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
-
821
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
822
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834823 combo.setFloat(current);
835
-
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
824
+
825
+ panel.add(control);
826
+
827
+ return control;
841828 }
842829
843
- 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)
844831 {
845
- NumberSlider combo;
832
+ cGridBag control = new cGridBag();
833
+
834
+ cNumberSlider combo;
846835
847836 JLabel jlabel = new JLabel(label);
848
-
849
- aConstraints.fill = GridBagConstraints.VERTICAL;
850837 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
-
838
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
839
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860840 combo.setInteger(current);
861841
862
- combo.label = jlabel;
863
-
864
- combo.addChangeListener(this);
865
-
866
- return combo;
842
+ panel.add(control);
843
+
844
+ return control;
867845 }
868846
869
- JTextArea AddText(JPanel ctrlPanel, String name)
847
+ JTextArea AddText(cGridBag ctrlPanel, String name)
870848 {
871849 JTextArea text;
872850
873
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
874
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
875
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
851
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
876852 text.addCaretListener(this);
877
- aConstraints.gridx += 1;
878
- aConstraints.gridwidth = 1;
879853
880854 return text;
881855 }
....@@ -905,9 +879,16 @@
905879 objEditor.ctrlPanel.remove(j);
906880 }
907881
882
+ void Remove(cNumberSlider j)
883
+ {
884
+ j.removeChangeListener(this);
885
+ //objEditor.ctrlPanel.remove(j.label);
886
+ objEditor.ctrlPanel.remove(j);
887
+ }
888
+
908889 /*
909890 */
910
- void Return() // ObjEditor oe)
891
+ void Return0() // ObjEditor oe)
911892 {
912893 aConstraints.gridy += 1;
913894 aConstraints.gridx = 0;
....@@ -966,33 +947,52 @@
966947 // oe.aConstraints.weighty = 0;
967948 // oe.aConstraints.gridx = 0;
968949 // oe.aConstraints.gridy = 0;
969
- 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();
970959
971960 if (!GroupEditor.allparams)
972961 return;
973962
974
- liveCB = AddCheckBox(oe, "Live", copy.live);
975
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
976
- 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);
977968 // 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");
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");
984980 // resetAllButton = AddButton(oe, "Reset All");
985981 // stepAllButton = AddButton(oe, "Step All");
986
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
982
+ speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
987983 // Return();
988
- slowerButton = AddButton(oe, "Slow");
989
- fasterButton = AddButton(oe, "Fast");
990
- remarkButton = AddButton(oe, "Rem");
984
+ slowerButton = AddButton(commandsPanel, "Slow");
985
+ fasterButton = AddButton(commandsPanel, "Fast");
986
+ remarkButton = AddButton(commandsPanel, "Remark");
991987
992
- Return();
988
+ oe.ctrlPanel.add(commandsPanel);
989
+ oe.ctrlPanel.Return();
993990
994
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
995
- Return();
991
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
992
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
993
+ //Return();
994
+
995
+ oe.ctrlPanel.Return();
996996
997997 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
998998 // ObjEditor.aConstraints.gridx += 1;
....@@ -1087,7 +1087,7 @@
10871087 oe.aConstraints.gridwidth = 1;
10881088 /**/
10891089 nameField = AddText(oe.ctrlPanel, copy.GetName());
1090
- Return();
1090
+ oe.ctrlPanel.Return();
10911091
10921092 //ctrlPanel.add(textureButton = new Button("Texture..."));
10931093 //textureButton.setEnabled(false);
....@@ -1264,10 +1264,11 @@
12641264 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12651265 //tmp.setName("Edit");
12661266 objectPanel.add(materialPanel);
1267
- JPanel north = new JPanel(new BorderLayout());
1268
- north.setName("Edit");
1269
- north.add(ctrlPanel, BorderLayout.NORTH);
1270
- 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);
12711272 objectPanel.add(infoPanel);
12721273
12731274 /*
....@@ -1296,11 +1297,11 @@
12961297
12971298 tabbedPane.add(FSPane = new cFileSystemPane(this));
12981299
1299
- optionsPanel = new JPanel(new GridBagLayout());
1300
+ optionsPanel = new cGridBag().setVertical(true);
13001301
13011302 optionsPanel.setName("Options");
13021303
1303
- AddOptions(optionsPanel, aConstraints);
1304
+ AddOptions(optionsPanel); //, aConstraints);
13041305
13051306 tabbedPane.add(optionsPanel);
13061307
....@@ -1411,7 +1412,7 @@
14111412 });
14121413 }
14131414
1414
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1415
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
14151416 {
14161417 }
14171418
....@@ -1426,260 +1427,165 @@
14261427 ctrlPanel.removeAll();
14271428 }
14281429
1429
- void SetupMaterial(JPanel ctrlPanel)
1430
+ void SetupMaterial(cGridBag panel)
14301431 {
1431
- aConstraints.weighty = 0;
1432
- //aConstraints.weightx = 1;
1433
- /*
1432
+ /*
14341433 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14351434 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1436
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1437
- aConstraints.gridx += 1;
14381435 */
14391436
1440
- aConstraints.gridwidth = 1;
1441
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1442
- aConstraints.gridx += 1;
1443
- aConstraints.weighty = 0;
1444
- aConstraints.gridwidth = 1;
1437
+ cGridBag editBar = new cGridBag().setVertical(false);
1438
+
1439
+ editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
14451440
14461441 /*
14471442 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1448
- aConstraints.gridx += 1;
1449
- aConstraints.weighty = 0;
1450
- aConstraints.gridwidth = 1;
14511443 */
14521444
1453
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1454
- 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);
14551449
1456
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1457
-
1458
- aConstraints.gridx += 1;
1459
-
1460
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1461
-
1462
- aConstraints.gridx += 1;
1463
-
1464
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1465
-
1466
- aConstraints.gridx = 0;
1467
- aConstraints.gridy += 1;
1468
- aConstraints.weighty = 0;
1469
- aConstraints.gridwidth = 1;
1450
+ panel.add(editBar);
1451
+
14701452 /**/
14711453 //aConstraints.weighty = 0;
14721454 ////aConstraints.weightx = 1;
14731455 //aConstraints.weighty = 1;
14741456 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14751457 //aConstraints.gridx += 1;
1476
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1477
- aConstraints.weighty = 0;
1478
- aConstraints.gridx = 0;
1479
- aConstraints.gridy += 1;
1480
- aConstraints.gridwidth = 1;
1458
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14811459
1482
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1483
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1484
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1485
- aConstraints.gridx += 1;
1486
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1487
- //aConstraints.weightx = 0;
1488
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1489
- aConstraints.gridx = 0;
1490
- aConstraints.gridy += 1;
1491
- 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);
14921468
1493
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1494
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1495
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1496
- aConstraints.gridx += 1;
1497
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1498
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1499
- aConstraints.gridx = 0;
1500
- aConstraints.gridy += 1;
1501
- 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);
15021474
1503
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1504
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1505
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1506
- aConstraints.gridx += 1;
1507
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1508
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1509
- aConstraints.gridx = 0;
1510
- aConstraints.gridy += 1;
1511
- 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);
15121480
1513
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1514
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1515
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1516
- aConstraints.gridx += 1;
1517
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1518
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1519
- aConstraints.gridx = 0;
1520
- aConstraints.gridy += 1;
1521
- 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);
15221486
1523
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1524
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1525
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1526
- aConstraints.gridx += 1;
1527
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1528
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1529
- aConstraints.gridx = 0;
1530
- aConstraints.gridy += 1;
1531
- 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);
15321492
1533
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1534
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1535
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1536
- aConstraints.gridx += 1;
1537
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1538
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1539
- aConstraints.gridx = 0;
1540
- aConstraints.gridy += 1;
1541
- 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);
15421498
1543
- //aConstraints.weighty = 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1545
- //aConstraints.gridx += 1;
1546
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1547
- aConstraints.weighty = 0;
1548
- aConstraints.gridx = 0;
1549
- aConstraints.gridy += 1;
1550
- 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);
15511512
1552
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1553
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1554
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1555
- aConstraints.gridx += 1;
1556
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1557
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1558
- aConstraints.gridx = 0;
1559
- aConstraints.gridy += 1;
1560
- 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);
15611518
1562
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1563
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1564
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1565
- aConstraints.gridx += 1;
1566
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1567
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1568
- aConstraints.gridx = 0;
1569
- aConstraints.gridy += 1;
1570
- 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);
15711524
1572
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1573
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1574
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1575
- aConstraints.gridx += 1;
1576
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1577
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1578
- aConstraints.gridx = 0;
1579
- aConstraints.gridy += 1;
1580
- 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);
15811530
1582
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1583
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1584
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1585
- aConstraints.gridx += 1;
1586
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1587
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1588
- aConstraints.gridx = 0;
1589
- aConstraints.gridy += 1;
1590
- 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);
15911536
1592
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1593
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1595
- aConstraints.gridx += 1;
1596
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1597
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1598
- aConstraints.gridx = 0;
1599
- aConstraints.gridy += 1;
1600
- 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);
16011542
1602
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1603
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1604
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1605
- aConstraints.gridx += 1;
1606
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1607
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1608
- aConstraints.gridx = 0;
1609
- aConstraints.gridy += 1;
1610
- 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);
16111548
1612
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1613
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1614
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1615
- aConstraints.gridx += 1;
1616
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1617
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1618
- aConstraints.gridx = 0;
1619
- aConstraints.gridy += 1;
1620
- 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);
16211556
1622
- //aConstraints.weighty = 1;
1623
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1624
- //aConstraints.gridx += 1;
1625
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1626
- aConstraints.weighty = 0;
1627
- aConstraints.gridx = 0;
1628
- aConstraints.gridy += 1;
1629
- 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);
16301562
1631
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1632
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1633
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1634
- aConstraints.gridx += 1;
1635
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1636
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1637
- aConstraints.gridx = 0;
1638
- aConstraints.gridy += 1;
1639
- 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);
16401568
1641
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1642
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1643
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1644
- aConstraints.gridx += 1;
1645
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1646
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1647
- aConstraints.gridx = 0;
1648
- aConstraints.gridy += 1;
1649
- 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);
16501574
1651
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1652
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1653
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1654
- aConstraints.gridx += 1;
1655
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1656
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1657
- aConstraints.gridx = 0;
1658
- aConstraints.gridy += 1;
1659
- 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);
16601580
1661
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1662
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1663
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1664
- aConstraints.gridx += 1;
1665
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1666
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1667
- aConstraints.gridx = 0;
1668
- aConstraints.gridy += 1;
1669
- 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);
16701586
1671
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1672
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1673
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1674
- aConstraints.gridx += 1;
1675
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1676
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1677
- aConstraints.gridx = 0;
1678
- aConstraints.gridy += 1;
1679
- aConstraints.gridwidth = 1;
1680
-
1681
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1682
- Return();
1587
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1588
+ //Return();
16831589 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16841590 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16851591 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1690,130 +1596,93 @@
16901596 // aConstraints.gridy += 1;
16911597 // aConstraints.gridwidth = 1;
16921598
1693
- //aConstraints.weighty = 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1695
- //aConstraints.gridx += 1;
1696
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1697
- aConstraints.weighty = 0;
1698
- aConstraints.gridx = 0;
1699
- aConstraints.gridy += 1;
1700
- aConstraints.gridwidth = 1;
17011599
1702
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1703
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1704
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1705
- aConstraints.gridx += 1;
1706
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1707
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1708
- aConstraints.gridx = 0;
1709
- aConstraints.gridy += 1;
1710
- 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);
17111607
1712
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1713
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1714
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1715
- aConstraints.gridx += 1;
1716
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1717
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1718
- aConstraints.gridx = 0;
1719
- aConstraints.gridy += 1;
1720
- 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);
17211613
1722
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1723
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1724
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1725
- aConstraints.gridx += 1;
1726
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1727
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1728
- aConstraints.gridx = 0;
1729
- aConstraints.gridy += 1;
1730
- 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);
17311619
1732
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1733
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1734
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1735
- aConstraints.gridx += 1;
1736
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1737
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1738
- aConstraints.gridx = 0;
1739
- aConstraints.gridy += 1;
1740
- aConstraints.gridwidth = 1;
1741
- 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);
17421625
1743
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1744
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1745
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1746
- aConstraints.gridx += 1;
1747
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1748
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1749
- aConstraints.gridx = 0;
1750
- aConstraints.gridy += 1;
1751
- 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);
17521631
1753
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1754
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1755
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1756
- aConstraints.gridx += 1;
1757
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1758
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1759
- aConstraints.gridx = 0;
1760
- aConstraints.gridy += 1;
1761
- 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);
17621639
1763
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1764
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1765
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1766
- aConstraints.gridx += 1;
1767
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1768
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1769
- aConstraints.gridx = 0;
1770
- aConstraints.gridy += 1;
1771
- 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);
17721645
1773
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1774
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1775
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1776
- aConstraints.gridx += 1;
1777
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1778
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1779
- aConstraints.gridx = 0;
1780
- aConstraints.gridy += 1;
1781
- 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);
17821651
1783
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1784
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1785
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1786
- aConstraints.gridx += 1;
1787
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1788
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1789
- aConstraints.gridx = 0;
1790
- aConstraints.gridy += 1;
1791
- 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);
17921657
1793
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1794
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1795
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1796
- aConstraints.gridx += 1;
1797
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1798
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1799
- aConstraints.gridx = 0;
1800
- aConstraints.gridy += 1;
1801
- 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);
18021663
1803
- //aConstraints.weighty = 1;
1804
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1805
- //aConstraints.gridx += 1;
1806
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1807
- 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);
18081669
1809
- aConstraints.gridx = 0;
1810
- aConstraints.gridy = 0;
1811
- 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);
18121681
18131682 SetMaterial(copy); // .GetMaterial());
18141683
1815
- colorField.addChangeListener(this);
1816
- modulationField.addChangeListener(this);
1684
+ //colorField.addChangeListener(this);
1685
+// modulationField.addChangeListener(this);
18171686 metalnessField.addChangeListener(this);
18181687 diffuseField.addChangeListener(this);
18191688 specularField.addChangeListener(this);
....@@ -2625,6 +2494,7 @@
26252494 }
26262495 if (input == null)
26272496 {
2497
+ new Exception().printStackTrace();
26282498 System.exit(0);
26292499 }
26302500
....@@ -3354,6 +3224,7 @@
33543224 callee.refreshContents();
33553225 } else
33563226 {
3227
+ new Exception().printStackTrace();
33573228 System.exit(0);
33583229 }
33593230 }
....@@ -3516,7 +3387,7 @@
35163387 current.fakedepth = (float) fakedepthField.getFloat();
35173388 current.shadowbias = (float) shadowbiasField.getFloat();
35183389
3519
- if (!NumberSlider.frozen)
3390
+ if (!cNumberSlider.frozen)
35203391 {
35213392 //System.out.println("Propagate = " + propagate);
35223393 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3564,6 +3435,7 @@
35643435 || e.getSource() == apertureField
35653436 || e.getSource() == shadowblurField)
35663437 {
3438
+ new Exception().printStackTrace();
35673439 System.exit(0);
35683440 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35693441 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3889,7 +3761,7 @@
38893761
38903762 radioPanel.revalidate();
38913763 radioPanel.repaint();
3892
- ctrlPanel.revalidate(); // ? new
3764
+ ctrlPanel.validate(); // ? new
38933765 ctrlPanel.repaint();
38943766 }
38953767 }
....@@ -4535,8 +4407,8 @@
45354407 //MenuItem normalLensItem;
45364408 MenuItem editCameraItem;
45374409 MenuItem revertCameraItem;
4538
- CheckboxMenuItem toggleLiveItem;
45394410 MenuItem stepItem;
4411
+ CheckboxMenuItem toggleLiveItem;
45404412 CheckboxMenuItem toggleFullScreenItem;
45414413 CheckboxMenuItem toggleTimelineItem;
45424414 CheckboxMenuItem toggleRenderItem;
....@@ -4556,10 +4428,10 @@
45564428 JPanel treePanel;
45574429 JPanel radioPanel;
45584430 ButtonGroup buttonGroup;
4559
- JPanel ctrlPanel;
4560
- JPanel materialPanel;
4431
+ cGridBag ctrlPanel;
4432
+ cGridBag materialPanel;
45614433 JScrollPane infoPanel;
4562
- JPanel optionsPanel;
4434
+ cGridBag optionsPanel;
45634435 JTabbedPane objectPanel;
45644436 cGridBag XYZPanel;
45654437 JSplitPane gridPanel;
....@@ -4619,67 +4491,67 @@
46194491 // MATERIAL
46204492 JLabel materialLabel;
46214493 JLabel colorLabel;
4622
- NumberSlider colorField;
4494
+ cNumberSlider colorField;
46234495 JLabel modulationLabel;
4624
- NumberSlider modulationField;
4496
+ cNumberSlider modulationField;
46254497 JLabel metalnessLabel;
4626
- NumberSlider metalnessField;
4498
+ cNumberSlider metalnessField;
46274499 JLabel diffuseLabel;
4628
- NumberSlider diffuseField;
4500
+ cNumberSlider diffuseField;
46294501 JLabel specularLabel;
4630
- NumberSlider specularField;
4502
+ cNumberSlider specularField;
46314503 JLabel shininessLabel;
4632
- NumberSlider shininessField;
4504
+ cNumberSlider shininessField;
46334505 JLabel shiftLabel;
4634
- NumberSlider shiftField;
4506
+ cNumberSlider shiftField;
46354507 JLabel ambientLabel;
4636
- NumberSlider ambientField;
4508
+ cNumberSlider ambientField;
46374509 JLabel lightareaLabel;
4638
- NumberSlider lightareaField;
4510
+ cNumberSlider lightareaField;
46394511 JLabel diffusenessLabel;
4640
- NumberSlider diffusenessField;
4512
+ cNumberSlider diffusenessField;
46414513 JLabel velvetLabel;
4642
- NumberSlider velvetField;
4514
+ cNumberSlider velvetField;
46434515 JLabel sheenLabel;
4644
- NumberSlider sheenField;
4516
+ cNumberSlider sheenField;
46454517 JLabel subsurfaceLabel;
4646
- NumberSlider subsurfaceField;
4518
+ cNumberSlider subsurfaceField;
46474519 //JLabel bumpLabel;
46484520 //NumberSlider bumpField;
46494521 JLabel backlitLabel;
4650
- NumberSlider backlitField;
4522
+ cNumberSlider backlitField;
46514523 JLabel anisoLabel;
4652
- NumberSlider anisoField;
4524
+ cNumberSlider anisoField;
46534525 JLabel anisoVLabel;
4654
- NumberSlider anisoVField;
4526
+ cNumberSlider anisoVField;
46554527 JLabel cameraLabel;
4656
- NumberSlider cameraField;
4528
+ cNumberSlider cameraField;
46574529 JLabel selfshadowLabel;
4658
- NumberSlider selfshadowField;
4530
+ cNumberSlider selfshadowField;
46594531 JLabel shadowLabel;
4660
- NumberSlider shadowField;
4532
+ cNumberSlider shadowField;
46614533 JLabel textureLabel;
4662
- NumberSlider textureField;
4534
+ cNumberSlider textureField;
46634535 JLabel opacityLabel;
4664
- NumberSlider opacityField;
4536
+ cNumberSlider opacityField;
46654537 JLabel fakedepthLabel;
4666
- NumberSlider fakedepthField;
4538
+ cNumberSlider fakedepthField;
46674539 JLabel shadowbiasLabel;
4668
- NumberSlider shadowbiasField;
4540
+ cNumberSlider shadowbiasField;
46694541 JLabel bumpLabel;
4670
- NumberSlider bumpField;
4542
+ cNumberSlider bumpField;
46714543 JLabel noiseLabel;
4672
- NumberSlider noiseField;
4544
+ cNumberSlider noiseField;
46734545 JLabel powerLabel;
4674
- NumberSlider powerField;
4546
+ cNumberSlider powerField;
46754547 JLabel borderfadeLabel;
4676
- NumberSlider borderfadeField;
4548
+ cNumberSlider borderfadeField;
46774549 JLabel fogLabel;
4678
- NumberSlider fogField;
4550
+ cNumberSlider fogField;
46794551 JLabel opacityPowerLabel;
4680
- NumberSlider opacityPowerField;
4552
+ cNumberSlider opacityPowerField;
46814553 JTree jTree;
46824554 //ObjectUI parent;
46834555
4684
- NumberSlider normalpushField;
4556
+ cNumberSlider normalpushField;
46854557 }