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,
....@@ -31,6 +33,9 @@
3133 boolean timeline;
3234 boolean wasFullScreen;
3335
36
+ GroupEditor callee;
37
+ JFrame frame;
38
+
3439 // SCRIPT
3540
3641 transient JFrame textpanel = null;
....@@ -121,51 +126,60 @@
121126 void keyPressed(int key, int modifiers)
122127 {
123128 System.out.println("KEY PRESSED");
124
- CameraPane.theRenderer.keyPressed(key, modifiers);
129
+ Globals.theRenderer.keyPressed(key, modifiers);
125130 }
126131 */
127132
128133 static GridBagConstraints aConstraints;
129134 static GridBagConstraints aWindowConstraints;
130
- GroupEditor callee;
131
- JFrame frame;
135
+
132136 static int GRIDWIDTH = 100; // 4;
133137
134138 public void closeUI()
135139 {
136140 //new Exception().printStackTrace();
137
- System.out.println("this = " + this);
138
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
139143 //nameField.removeActionListener(this);
140
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
141145
142146 if (!GroupEditor.allparams)
143147 return;
144148
145
- objEditor.ctrlPanel.remove(liveCB);
146
- objEditor.ctrlPanel.remove(hideCB);
147
- objEditor.ctrlPanel.remove(markCB);
148
-
149
- objEditor.ctrlPanel.remove(randomCB);
150
- objEditor.ctrlPanel.remove(speedupCB);
151
- objEditor.ctrlPanel.remove(rewindCB);
152
-
153
- objEditor.ctrlPanel.remove(resetButton);
154
- objEditor.ctrlPanel.remove(stepButton);
155
-// objEditor.ctrlPanel.remove(stepAllButton);
156
-// objEditor.ctrlPanel.remove(resetAllButton);
157
- objEditor.ctrlPanel.remove(link2masterCB);
158
- //objEditor.ctrlPanel.remove(flipVCB);
159
- //objEditor.ctrlPanel.remove(texresMenu);
160
- objEditor.ctrlPanel.remove(slowerButton);
161
- objEditor.ctrlPanel.remove(fasterButton);
162
- objEditor.ctrlPanel.remove(remarkButton);
149
+// objEditor.ctrlPanel.remove(liveCB);
150
+// objEditor.ctrlPanel.remove(hideCB);
151
+// objEditor.ctrlPanel.remove(markCB);
152
+//
153
+// objEditor.ctrlPanel.remove(randomCB);
154
+// objEditor.ctrlPanel.remove(speedupCB);
155
+// objEditor.ctrlPanel.remove(rewindCB);
156
+//
157
+// objEditor.ctrlPanel.remove(resetButton);
158
+// objEditor.ctrlPanel.remove(stepButton);
159
+//// objEditor.ctrlPanel.remove(stepAllButton);
160
+//// objEditor.ctrlPanel.remove(resetAllButton);
161
+// objEditor.ctrlPanel.remove(link2masterCB);
162
+// //objEditor.ctrlPanel.remove(flipVCB);
163
+// //objEditor.ctrlPanel.remove(texresMenu);
164
+// objEditor.ctrlPanel.remove(slowerButton);
165
+// objEditor.ctrlPanel.remove(fasterButton);
166
+// objEditor.ctrlPanel.remove(remarkButton);
167
+
168
+ objEditor.ctrlPanel.remove(namePanel);
169
+ objEditor.ctrlPanel.remove(setupPanel);
170
+ objEditor.ctrlPanel.remove(commandsPanel);
171
+ objEditor.ctrlPanel.remove(pushPanel);
172
+ //objEditor.ctrlPanel.remove(fillPanel);
173
+
174
+ //Remove(normalpushField);
163175 }
164176
165177 public ObjEditor GetEditor()
166178 {
167179 return objEditor; //.GetEditor();
168180 }
181
+
182
+ // Sometimes myself, sometimes my callee's.
169183 ObjEditor objEditor;
170184
171185 /*
....@@ -305,7 +319,7 @@
305319 toggleTextureItem.setState(CameraPane.textureon);
306320 cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
307321 toggleLiveItem.addItemListener(this);
308
- toggleLiveItem.setState(CameraPane.isLIVE());
322
+ toggleLiveItem.setState(Globals.isLIVE());
309323 cameraMenu.add(stepItem = new MenuItem("Step"));
310324 stepItem.addActionListener(this);
311325 // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
....@@ -347,9 +361,9 @@
347361 toolbarPanel.setName("Toolbar");
348362 treePanel = new JPanel();
349363 treePanel.setName("Tree");
350
- ctrlPanel = new JPanel(); // new GridBagLayout());
364
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
351365 ctrlPanel.setName("Edit");
352
- materialPanel = new JPanel();
366
+ materialPanel = new cGridBag().setVertical(true);
353367 materialPanel.setName("Material");
354368 /*JTextPane*/
355369 infoarea = createTextPane();
....@@ -378,8 +392,8 @@
378392 //mainPanel.setLayout(new GridBagLayout());
379393 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
380394 treePanel.setLayout(new GridBagLayout());
381
- ctrlPanel.setLayout(new GridBagLayout());
382
- materialPanel.setLayout(new GridBagLayout());
395
+ //ctrlPanel.setLayout(new GridBagLayout());
396
+ //materialPanel.setLayout(new GridBagLayout());
383397
384398 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
385399 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -759,115 +773,83 @@
759773 JButton slowerButton;
760774 JButton fasterButton;
761775 JButton remarkButton;
776
+
777
+ cGridBag namePanel;
778
+ cGridBag setupPanel;
779
+ cGridBag commandsPanel;
780
+ cGridBag pushPanel;
781
+ cGridBag fillPanel;
762782
763
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
783
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
764784 {
765785 JCheckBox cb;
766786
767
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
768
- oe.aConstraints.gridwidth = 1; // 3;
769
-// oe.aConstraints.weightx = 1;
770
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
771
- 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);
772788 cb.addItemListener(this);
773
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
774
- oe.aConstraints.gridwidth = 1;
775
- oe.aConstraints.gridx += 1;
776789
777790 return cb;
778791 }
779792
780
- cButton AddButton(ObjEditor oe, String label)
793
+ cButton AddButton(cGridBag panel, String label)
781794 {
782795 cButton cb;
783796
784
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
785
- oe.aConstraints.gridwidth = 1;
786
-// oe.aConstraints.weightx = 1;
787
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
788
- 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);
789798 cb.addActionListener(this);
790
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
791
- oe.aConstraints.gridwidth = 1;
792
- oe.aConstraints.gridx += 1;
793799
794800 return cb;
795801 }
796802
797
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
803
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
798804 {
799805 JComboBox combo;
800806
801
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
802
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
803
- oe.aConstraints.gridx += 1;
807
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
804808 combo.addActionListener(this);
805809
806810 return combo;
807811 }
808812
809
- 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)
810814 {
811
- NumberSlider combo;
815
+ cGridBag control = new cGridBag();
816
+
817
+ cNumberSlider combo;
812818
813819 JLabel jlabel = new JLabel(label);
814
-
815
- aConstraints.fill = GridBagConstraints.VERTICAL;
816820 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
817
- aConstraints.gridwidth = 2;
818
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
819
- aConstraints.gridx += 1;
820
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
821
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
822
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
823
- aConstraints.gridx += 1;
824
- aConstraints.gridwidth = 1;
825
-
821
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
822
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
826823 combo.setFloat(current);
827
-
828
- combo.label = jlabel;
829
-
830
- combo.addChangeListener(this);
831
-
832
- return combo;
824
+
825
+ panel.add(control);
826
+
827
+ return control;
833828 }
834829
835
- 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)
836831 {
837
- NumberSlider combo;
832
+ cGridBag control = new cGridBag();
833
+
834
+ cNumberSlider combo;
838835
839836 JLabel jlabel = new JLabel(label);
840
-
841
- aConstraints.fill = GridBagConstraints.VERTICAL;
842837 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
843
- aConstraints.gridwidth = 2;
844
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
845
- aConstraints.gridx += 1;
846
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
847
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
848
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
851
-
838
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
839
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
852840 combo.setInteger(current);
853841
854
- combo.label = jlabel;
855
-
856
- combo.addChangeListener(this);
857
-
858
- return combo;
842
+ panel.add(control);
843
+
844
+ return control;
859845 }
860846
861
- JTextArea AddText(JPanel ctrlPanel, String name)
847
+ JTextArea AddText(cGridBag ctrlPanel, String name)
862848 {
863849 JTextArea text;
864850
865
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
866
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
867
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
851
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
868852 text.addCaretListener(this);
869
- aConstraints.gridx += 1;
870
- aConstraints.gridwidth = 1;
871853
872854 return text;
873855 }
....@@ -897,9 +879,16 @@
897879 objEditor.ctrlPanel.remove(j);
898880 }
899881
882
+ void Remove(cNumberSlider j)
883
+ {
884
+ j.removeChangeListener(this);
885
+ //objEditor.ctrlPanel.remove(j.label);
886
+ objEditor.ctrlPanel.remove(j);
887
+ }
888
+
900889 /*
901890 */
902
- void Return() // ObjEditor oe)
891
+ void Return0() // ObjEditor oe)
903892 {
904893 aConstraints.gridy += 1;
905894 aConstraints.gridx = 0;
....@@ -958,31 +947,53 @@
958947 // oe.aConstraints.weighty = 0;
959948 // oe.aConstraints.gridx = 0;
960949 // oe.aConstraints.gridy = 0;
961
- 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();
962959
963960 if (!GroupEditor.allparams)
964961 return;
965962
966
- liveCB = AddCheckBox(oe, "Live", copy.live);
967
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
968
- 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);
969968 // Return();
970
- markCB = AddCheckBox(oe, "Mark", copy.marked);
971
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
972
- randomCB = AddCheckBox(oe, "Rand", copy.random);
973
- Return();
974
- resetButton = AddButton(oe, "Reset");
975
- 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");
976980 // resetAllButton = AddButton(oe, "Reset All");
977981 // stepAllButton = AddButton(oe, "Step All");
978
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
982
+ speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
979983 // Return();
980
- slowerButton = AddButton(oe, "Slow");
981
- fasterButton = AddButton(oe, "Fast");
982
- remarkButton = AddButton(oe, "Rem");
984
+ slowerButton = AddButton(commandsPanel, "Slow");
985
+ fasterButton = AddButton(commandsPanel, "Fast");
986
+ remarkButton = AddButton(commandsPanel, "Remark");
983987
984
- Return();
988
+ oe.ctrlPanel.add(commandsPanel);
989
+ oe.ctrlPanel.Return();
985990
991
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
992
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
993
+ //Return();
994
+
995
+ oe.ctrlPanel.Return();
996
+
986997 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
987998 // ObjEditor.aConstraints.gridx += 1;
988999
....@@ -1076,7 +1087,7 @@
10761087 oe.aConstraints.gridwidth = 1;
10771088 /**/
10781089 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1090
+ oe.ctrlPanel.Return();
10801091
10811092 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821093 //textureButton.setEnabled(false);
....@@ -1178,10 +1189,18 @@
11781189 //JPanel worldPanel =
11791190 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11801191 //worldPanel.setName("World");
1181
- centralPanel = new JPanel(new BorderLayout());
1192
+ centralPanel = new cGridBag();
1193
+ centralPanel.preferredWidth = 20;
11821194 timelinePanel = new JPanel(new BorderLayout());
11831195 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11841196
1197
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1198
+ cameraPanel.setContinuousLayout(true);
1199
+ cameraPanel.setOneTouchExpandable(true);
1200
+// cameraPanel.setDividerLocation(0.9);
1201
+// cameraPanel.setDividerSize(9);
1202
+ cameraPanel.setResizeWeight(1.0);
1203
+
11851204 centralPanel.add(cameraView);
11861205 //frame.setJMenuBar(timelineMenubar);
11871206 //centralPanel.add(timelinePanel);
....@@ -1201,12 +1220,13 @@
12011220 //frontView.object = copy;
12021221 //sideView.object = copy;
12031222
1204
- XYZPanel = new JPanel();
1205
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1223
+ XYZPanel = new cGridBag().setVertical(true);
1224
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12061225
1207
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1208
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1209
- 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);
12101230
12111231 /*
12121232 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1244,10 +1264,11 @@
12441264 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12451265 //tmp.setName("Edit");
12461266 objectPanel.add(materialPanel);
1247
- JPanel north = new JPanel(new BorderLayout());
1248
- north.setName("Edit");
1249
- north.add(ctrlPanel, BorderLayout.NORTH);
1250
- 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);
12511272 objectPanel.add(infoPanel);
12521273
12531274 /*
....@@ -1268,16 +1289,23 @@
12681289 scrollpane.setWheelScrollingEnabled(true);
12691290 scrollpane.addMouseWheelListener(this); // Default not fast enough
12701291
1271
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1272
- scenePanel.add(scrollpane);
1292
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1293
+ scenePanel.preferredWidth = 7;
1294
+
1295
+ JTabbedPane tabbedPane = new JTabbedPane();
1296
+ tabbedPane.add(scrollpane);
12731297
1274
- scenePanel.add(FSPane = new cFileSystemPane(this));
1298
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12751299
1276
- optionsPanel = new JPanel(new GridBagLayout());
1300
+ optionsPanel = new cGridBag().setVertical(true);
12771301
12781302 optionsPanel.setName("Options");
1279
- scenePanel.add(optionsPanel);
1280
-
1303
+
1304
+ AddOptions(optionsPanel); //, aConstraints);
1305
+
1306
+ tabbedPane.add(optionsPanel);
1307
+
1308
+ scenePanel.add(tabbedPane);
12811309
12821310 /*
12831311 cTree jTree = new cTree(null);
....@@ -1311,6 +1339,7 @@
13111339 //bigPanel.setSize(new Dimension(10,10));
13121340 //bigPanel.add(ctrlPanel);
13131341 //bigPanel.add(gridPanel);
1342
+ /**
13141343 bigThree = new JPanel();
13151344 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13161345 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1334,7 +1363,13 @@
13341363 // aConstraints.gridheight = 3;
13351364 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13361365 bigThree.add(XYZPanel, aWindowConstraints);
1366
+ /**/
13371367
1368
+ bigThree = new cGridBag();
1369
+ bigThree.addComponent(scenePanel);
1370
+ bigThree.addComponent(centralPanel);
1371
+ bigThree.addComponent(XYZPanel);
1372
+
13381373 // // SIDE EFFECT!!!
13391374 // aConstraints.gridx = 0;
13401375 // aConstraints.gridy = 0;
....@@ -1355,7 +1390,8 @@
13551390 //worldPane.add(bigPanel);
13561391 //worldPane.add(worldPanel);
13571392 /**/
1358
- frame.getContentPane().add(/*"Center",*/framePanel);
1393
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1394
+ frame.add(/*"Center",*/framePanel);
13591395 //frame.getContentPane().add(/*"Center",*/ worldPane);
13601396
13611397 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
....@@ -1376,6 +1412,10 @@
13761412 });
13771413 }
13781414
1415
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1416
+ {
1417
+ }
1418
+
13791419 JTree GetTree()
13801420 {
13811421 return objEditor.jTree;
....@@ -1387,260 +1427,165 @@
13871427 ctrlPanel.removeAll();
13881428 }
13891429
1390
- void SetupMaterial(JPanel ctrlPanel)
1430
+ void SetupMaterial(cGridBag panel)
13911431 {
1392
- aConstraints.weighty = 0;
1393
- //aConstraints.weightx = 1;
1394
- /*
1432
+ /*
13951433 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13961434 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1397
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1398
- aConstraints.gridx += 1;
13991435 */
14001436
1401
- aConstraints.gridwidth = 1;
1402
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1403
- aConstraints.gridx += 1;
1404
- aConstraints.weighty = 0;
1405
- aConstraints.gridwidth = 1;
1437
+ cGridBag editBar = new cGridBag().setVertical(false);
1438
+
1439
+ editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
14061440
14071441 /*
14081442 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1409
- aConstraints.gridx += 1;
1410
- aConstraints.weighty = 0;
1411
- aConstraints.gridwidth = 1;
14121443 */
14131444
1414
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1415
- 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);
14161449
1417
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1418
-
1419
- aConstraints.gridx += 1;
1420
-
1421
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1422
-
1423
- aConstraints.gridx += 1;
1424
-
1425
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1426
-
1427
- aConstraints.gridx = 0;
1428
- aConstraints.gridy += 1;
1429
- aConstraints.weighty = 0;
1430
- aConstraints.gridwidth = 1;
1450
+ panel.add(editBar);
1451
+
14311452 /**/
14321453 //aConstraints.weighty = 0;
14331454 ////aConstraints.weightx = 1;
14341455 //aConstraints.weighty = 1;
14351456 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14361457 //aConstraints.gridx += 1;
1437
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1438
- aConstraints.weighty = 0;
1439
- aConstraints.gridx = 0;
1440
- aConstraints.gridy += 1;
1441
- aConstraints.gridwidth = 1;
1458
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14421459
1443
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1444
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1445
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1446
- aConstraints.gridx += 1;
1447
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1448
- //aConstraints.weightx = 0;
1449
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1450
- aConstraints.gridx = 0;
1451
- aConstraints.gridy += 1;
1452
- 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);
14531468
1454
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1455
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1456
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1457
- aConstraints.gridx += 1;
1458
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1459
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1460
- aConstraints.gridx = 0;
1461
- aConstraints.gridy += 1;
1462
- 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);
14631474
1464
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1465
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1466
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1467
- aConstraints.gridx += 1;
1468
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1469
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1470
- aConstraints.gridx = 0;
1471
- aConstraints.gridy += 1;
1472
- 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);
14731480
1474
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1475
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1476
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1477
- aConstraints.gridx += 1;
1478
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1479
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1480
- aConstraints.gridx = 0;
1481
- aConstraints.gridy += 1;
1482
- 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);
14831486
1484
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1485
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1486
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1487
- aConstraints.gridx += 1;
1488
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1489
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1490
- aConstraints.gridx = 0;
1491
- aConstraints.gridy += 1;
1492
- 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);
14931492
1494
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1495
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1496
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1497
- aConstraints.gridx += 1;
1498
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1499
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1500
- aConstraints.gridx = 0;
1501
- aConstraints.gridy += 1;
1502
- 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);
15031498
1504
- //aConstraints.weighty = 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1506
- //aConstraints.gridx += 1;
1507
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1508
- aConstraints.weighty = 0;
1509
- aConstraints.gridx = 0;
1510
- aConstraints.gridy += 1;
1511
- 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);
15121512
1513
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1514
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1515
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1516
- aConstraints.gridx += 1;
1517
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1518
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1519
- aConstraints.gridx = 0;
1520
- aConstraints.gridy += 1;
1521
- 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);
15221518
1523
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1524
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1525
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1526
- aConstraints.gridx += 1;
1527
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1528
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1529
- aConstraints.gridx = 0;
1530
- aConstraints.gridy += 1;
1531
- 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);
15321524
1533
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1534
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1535
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1536
- aConstraints.gridx += 1;
1537
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1538
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1539
- aConstraints.gridx = 0;
1540
- aConstraints.gridy += 1;
1541
- 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);
15421530
1543
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1544
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1545
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1546
- aConstraints.gridx += 1;
1547
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1548
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1549
- aConstraints.gridx = 0;
1550
- aConstraints.gridy += 1;
1551
- 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);
15521536
1553
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1554
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1555
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1556
- aConstraints.gridx += 1;
1557
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1558
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1559
- aConstraints.gridx = 0;
1560
- aConstraints.gridy += 1;
1561
- 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);
15621542
1563
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1564
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1565
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1566
- aConstraints.gridx += 1;
1567
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1568
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1569
- aConstraints.gridx = 0;
1570
- aConstraints.gridy += 1;
1571
- 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);
15721548
1573
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1574
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1575
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1576
- aConstraints.gridx += 1;
1577
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1578
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1579
- aConstraints.gridx = 0;
1580
- aConstraints.gridy += 1;
1581
- 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);
15821556
1583
- //aConstraints.weighty = 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1585
- //aConstraints.gridx += 1;
1586
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1587
- aConstraints.weighty = 0;
1588
- aConstraints.gridx = 0;
1589
- aConstraints.gridy += 1;
1590
- 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);
15911562
1592
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1593
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1595
- aConstraints.gridx += 1;
1596
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1597
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1598
- aConstraints.gridx = 0;
1599
- aConstraints.gridy += 1;
1600
- 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);
16011568
1602
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1603
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1604
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1605
- aConstraints.gridx += 1;
1606
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1607
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1608
- aConstraints.gridx = 0;
1609
- aConstraints.gridy += 1;
1610
- 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);
16111574
1612
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1613
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1614
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1615
- aConstraints.gridx += 1;
1616
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1617
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1618
- aConstraints.gridx = 0;
1619
- aConstraints.gridy += 1;
1620
- 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);
16211580
1622
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1623
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1624
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1625
- aConstraints.gridx += 1;
1626
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1627
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1628
- aConstraints.gridx = 0;
1629
- aConstraints.gridy += 1;
1630
- 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);
16311586
1632
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1633
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1634
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1635
- aConstraints.gridx += 1;
1636
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1637
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1638
- aConstraints.gridx = 0;
1639
- aConstraints.gridy += 1;
1640
- aConstraints.gridwidth = 1;
1641
-
1642
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1643
- Return();
1587
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1588
+ //Return();
16441589 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16451590 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16461591 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1651,130 +1596,93 @@
16511596 // aConstraints.gridy += 1;
16521597 // aConstraints.gridwidth = 1;
16531598
1654
- //aConstraints.weighty = 1;
1655
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1656
- //aConstraints.gridx += 1;
1657
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1658
- aConstraints.weighty = 0;
1659
- aConstraints.gridx = 0;
1660
- aConstraints.gridy += 1;
1661
- aConstraints.gridwidth = 1;
16621599
1663
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1664
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1665
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1666
- aConstraints.gridx += 1;
1667
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1668
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1669
- aConstraints.gridx = 0;
1670
- aConstraints.gridy += 1;
1671
- 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);
16721607
1673
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1674
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1675
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1676
- aConstraints.gridx += 1;
1677
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1678
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1679
- aConstraints.gridx = 0;
1680
- aConstraints.gridy += 1;
1681
- 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);
16821613
1683
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1684
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1685
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1686
- aConstraints.gridx += 1;
1687
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1688
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1689
- aConstraints.gridx = 0;
1690
- aConstraints.gridy += 1;
1691
- 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);
16921619
1693
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1694
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1695
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1696
- aConstraints.gridx += 1;
1697
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1698
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1699
- aConstraints.gridx = 0;
1700
- aConstraints.gridy += 1;
1701
- aConstraints.gridwidth = 1;
1702
- 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);
17031625
1704
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1705
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1706
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1707
- aConstraints.gridx += 1;
1708
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1709
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1710
- aConstraints.gridx = 0;
1711
- aConstraints.gridy += 1;
1712
- 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);
17131631
1714
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1715
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1716
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1717
- aConstraints.gridx += 1;
1718
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1719
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1720
- aConstraints.gridx = 0;
1721
- aConstraints.gridy += 1;
1722
- 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);
17231639
1724
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1725
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1726
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1727
- aConstraints.gridx += 1;
1728
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1729
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1730
- aConstraints.gridx = 0;
1731
- aConstraints.gridy += 1;
1732
- 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);
17331645
1734
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1735
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1736
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1737
- aConstraints.gridx += 1;
1738
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1739
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1740
- aConstraints.gridx = 0;
1741
- aConstraints.gridy += 1;
1742
- 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);
17431651
1744
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1745
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1746
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1747
- aConstraints.gridx += 1;
1748
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1749
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1750
- aConstraints.gridx = 0;
1751
- aConstraints.gridy += 1;
1752
- 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);
17531657
1754
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1755
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1756
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1757
- aConstraints.gridx += 1;
1758
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1759
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1760
- aConstraints.gridx = 0;
1761
- aConstraints.gridy += 1;
1762
- 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);
17631663
1764
- //aConstraints.weighty = 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1766
- //aConstraints.gridx += 1;
1767
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1768
- 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);
17691669
1770
- aConstraints.gridx = 0;
1771
- aConstraints.gridy = 0;
1772
- 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);
17731681
17741682 SetMaterial(copy); // .GetMaterial());
17751683
1776
- colorField.addChangeListener(this);
1777
- modulationField.addChangeListener(this);
1684
+ //colorField.addChangeListener(this);
1685
+// modulationField.addChangeListener(this);
17781686 metalnessField.addChangeListener(this);
17791687 diffuseField.addChangeListener(this);
17801688 specularField.addChangeListener(this);
....@@ -2586,6 +2494,7 @@
25862494 }
25872495 if (input == null)
25882496 {
2497
+ new Exception().printStackTrace();
25892498 System.exit(0);
25902499 }
25912500
....@@ -2989,7 +2898,8 @@
29892898 if (timeline)
29902899 {
29912900 centralPanel.remove(cameraView);
2992
- centralPanel.add(timelinePanel);
2901
+ cameraPanel.add(cameraView);
2902
+ centralPanel.add(cameraPanel);
29932903 frame.setJMenuBar(timelineMenubar);
29942904 wasFullScreen = CameraPane.FULLSCREEN;
29952905 if (!CameraPane.FULLSCREEN)
....@@ -2998,7 +2908,7 @@
29982908 }
29992909 else
30002910 {
3001
- centralPanel.remove(timelinePanel);
2911
+ centralPanel.remove(cameraPanel);
30022912 centralPanel.add(cameraView);
30032913 frame.setJMenuBar(null);
30042914 if (!wasFullScreen)
....@@ -3121,7 +3031,8 @@
31213031 objEditor.refreshContents();
31223032 } else if (event.getSource() == stepItem)
31233033 {
3124
- cameraView.ONESTEP = true;
3034
+ //cameraView.ONESTEP = true;
3035
+ Globals.ONESTEP = true;
31253036 cameraView.repaint();
31263037 return;
31273038 } else if (event.getSource() == stepButton)
....@@ -3278,25 +3189,25 @@
32783189
32793190 void ToggleAnimation()
32803191 {
3281
- if (!CameraPane.ANIMATION)
3192
+ if (!Globals.ANIMATION)
32823193 {
32833194 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
32843195 browser.show();
32853196 String filename = browser.getFile();
32863197 if (filename != null && filename.length() > 0)
32873198 {
3288
- CameraPane.filename = browser.getDirectory() + filename;
3199
+ Globals.filename = browser.getDirectory() + filename;
32893200 //CameraPane.framecount = 0;
3290
- CameraPane.imagecount = 0;
3201
+ Globals.imagecount = 0;
32913202
3292
- CameraPane.ANIMATION ^= true;
3203
+ Globals.ANIMATION ^= true;
32933204
32943205 GrafreeD.wav.cursor = 0;
32953206 GrafreeD.wav.loop = 0;
32963207 }
32973208 } else
32983209 {
3299
- CameraPane.ANIMATION ^= true;
3210
+ Globals.ANIMATION ^= true;
33003211 }
33013212 }
33023213
....@@ -3313,6 +3224,7 @@
33133224 callee.refreshContents();
33143225 } else
33153226 {
3227
+ new Exception().printStackTrace();
33163228 System.exit(0);
33173229 }
33183230 }
....@@ -3475,7 +3387,7 @@
34753387 current.fakedepth = (float) fakedepthField.getFloat();
34763388 current.shadowbias = (float) shadowbiasField.getFloat();
34773389
3478
- if (!NumberSlider.frozen)
3390
+ if (!cNumberSlider.frozen)
34793391 {
34803392 //System.out.println("Propagate = " + propagate);
34813393 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3523,6 +3435,7 @@
35233435 || e.getSource() == apertureField
35243436 || e.getSource() == shadowblurField)
35253437 {
3438
+ new Exception().printStackTrace();
35263439 System.exit(0);
35273440 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35283441 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3549,7 +3462,13 @@
35493462 //System.out.println("PARENT = " + parent);
35503463 //if (parent != null)
35513464 // parent.applySelf();
3552
- refreshContents();
3465
+ if (e.getSource() == normalpushField)
3466
+ {
3467
+ objEditor.refreshContents();
3468
+ //Refresh();
3469
+ }
3470
+ else
3471
+ refreshContents();
35533472 // ??? client.refreshEditWindow();
35543473 }
35553474 //else
....@@ -3561,7 +3480,7 @@
35613480 //group.name = nameField.getText();
35623481 //objEditor.applySelf();
35633482
3564
- assert (objEditor == this);
3483
+ // OCT2018: assert (objEditor == this);
35653484 if (copy.selection == null || copy.selection.size() == 0)
35663485 //super.applySelf()
35673486 ; else
....@@ -3585,6 +3504,9 @@
35853504 objEditor.copy = keep;
35863505 }
35873506 }
3507
+
3508
+ if (normalpushField != null)
3509
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
35883510 }
35893511
35903512 void SnapObject()
....@@ -3839,7 +3761,7 @@
38393761
38403762 radioPanel.revalidate();
38413763 radioPanel.repaint();
3842
- ctrlPanel.revalidate(); // ? new
3764
+ ctrlPanel.validate(); // ? new
38433765 ctrlPanel.repaint();
38443766 }
38453767 }
....@@ -4485,8 +4407,8 @@
44854407 //MenuItem normalLensItem;
44864408 MenuItem editCameraItem;
44874409 MenuItem revertCameraItem;
4488
- CheckboxMenuItem toggleLiveItem;
44894410 MenuItem stepItem;
4411
+ CheckboxMenuItem toggleLiveItem;
44904412 CheckboxMenuItem toggleFullScreenItem;
44914413 CheckboxMenuItem toggleTimelineItem;
44924414 CheckboxMenuItem toggleRenderItem;
....@@ -4506,17 +4428,18 @@
45064428 JPanel treePanel;
45074429 JPanel radioPanel;
45084430 ButtonGroup buttonGroup;
4509
- JPanel ctrlPanel;
4510
- JPanel materialPanel;
4431
+ cGridBag ctrlPanel;
4432
+ cGridBag materialPanel;
45114433 JScrollPane infoPanel;
4512
- JPanel optionsPanel;
4434
+ cGridBag optionsPanel;
45134435 JTabbedPane objectPanel;
4514
- JPanel XYZPanel;
4436
+ cGridBag XYZPanel;
45154437 JSplitPane gridPanel;
45164438 JSplitPane bigPanel;
4517
- JPanel bigThree;
4518
- JTabbedPane scenePanel;
4519
- JPanel centralPanel;
4439
+ cGridBag bigThree;
4440
+ cGridBag scenePanel;
4441
+ cGridBag centralPanel;
4442
+ JSplitPane cameraPanel;
45204443 JPanel timelinePanel;
45214444 JMenuBar timelineMenubar;
45224445 JSplitPane framePanel;
....@@ -4568,65 +4491,67 @@
45684491 // MATERIAL
45694492 JLabel materialLabel;
45704493 JLabel colorLabel;
4571
- NumberSlider colorField;
4494
+ cNumberSlider colorField;
45724495 JLabel modulationLabel;
4573
- NumberSlider modulationField;
4496
+ cNumberSlider modulationField;
45744497 JLabel metalnessLabel;
4575
- NumberSlider metalnessField;
4498
+ cNumberSlider metalnessField;
45764499 JLabel diffuseLabel;
4577
- NumberSlider diffuseField;
4500
+ cNumberSlider diffuseField;
45784501 JLabel specularLabel;
4579
- NumberSlider specularField;
4502
+ cNumberSlider specularField;
45804503 JLabel shininessLabel;
4581
- NumberSlider shininessField;
4504
+ cNumberSlider shininessField;
45824505 JLabel shiftLabel;
4583
- NumberSlider shiftField;
4506
+ cNumberSlider shiftField;
45844507 JLabel ambientLabel;
4585
- NumberSlider ambientField;
4508
+ cNumberSlider ambientField;
45864509 JLabel lightareaLabel;
4587
- NumberSlider lightareaField;
4510
+ cNumberSlider lightareaField;
45884511 JLabel diffusenessLabel;
4589
- NumberSlider diffusenessField;
4512
+ cNumberSlider diffusenessField;
45904513 JLabel velvetLabel;
4591
- NumberSlider velvetField;
4514
+ cNumberSlider velvetField;
45924515 JLabel sheenLabel;
4593
- NumberSlider sheenField;
4516
+ cNumberSlider sheenField;
45944517 JLabel subsurfaceLabel;
4595
- NumberSlider subsurfaceField;
4518
+ cNumberSlider subsurfaceField;
45964519 //JLabel bumpLabel;
45974520 //NumberSlider bumpField;
45984521 JLabel backlitLabel;
4599
- NumberSlider backlitField;
4522
+ cNumberSlider backlitField;
46004523 JLabel anisoLabel;
4601
- NumberSlider anisoField;
4524
+ cNumberSlider anisoField;
46024525 JLabel anisoVLabel;
4603
- NumberSlider anisoVField;
4526
+ cNumberSlider anisoVField;
46044527 JLabel cameraLabel;
4605
- NumberSlider cameraField;
4528
+ cNumberSlider cameraField;
46064529 JLabel selfshadowLabel;
4607
- NumberSlider selfshadowField;
4530
+ cNumberSlider selfshadowField;
46084531 JLabel shadowLabel;
4609
- NumberSlider shadowField;
4532
+ cNumberSlider shadowField;
46104533 JLabel textureLabel;
4611
- NumberSlider textureField;
4534
+ cNumberSlider textureField;
46124535 JLabel opacityLabel;
4613
- NumberSlider opacityField;
4536
+ cNumberSlider opacityField;
46144537 JLabel fakedepthLabel;
4615
- NumberSlider fakedepthField;
4538
+ cNumberSlider fakedepthField;
46164539 JLabel shadowbiasLabel;
4617
- NumberSlider shadowbiasField;
4540
+ cNumberSlider shadowbiasField;
46184541 JLabel bumpLabel;
4619
- NumberSlider bumpField;
4542
+ cNumberSlider bumpField;
46204543 JLabel noiseLabel;
4621
- NumberSlider noiseField;
4544
+ cNumberSlider noiseField;
46224545 JLabel powerLabel;
4623
- NumberSlider powerField;
4546
+ cNumberSlider powerField;
46244547 JLabel borderfadeLabel;
4625
- NumberSlider borderfadeField;
4548
+ cNumberSlider borderfadeField;
46264549 JLabel fogLabel;
4627
- NumberSlider fogField;
4550
+ cNumberSlider fogField;
46284551 JLabel opacityPowerLabel;
4629
- NumberSlider opacityPowerField;
4552
+ cNumberSlider opacityPowerField;
46304553 JTree jTree;
46314554 //ObjectUI parent;
4555
+
4556
+ cNumberSlider normalpushField;
46324557 }