Normand Briere
2019-05-01 b1585b5b2b60c4165be400636c787fae24428c6a
ObjEditor.java
....@@ -138,34 +138,40 @@
138138 public void closeUI()
139139 {
140140 //new Exception().printStackTrace();
141
- System.out.println("this = " + this);
142
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
143143 //nameField.removeActionListener(this);
144
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
145145
146146 if (!GroupEditor.allparams)
147147 return;
148148
149
- objEditor.ctrlPanel.remove(liveCB);
150
- objEditor.ctrlPanel.remove(hideCB);
151
- objEditor.ctrlPanel.remove(markCB);
152
-
153
- objEditor.ctrlPanel.remove(randomCB);
154
- objEditor.ctrlPanel.remove(speedupCB);
155
- objEditor.ctrlPanel.remove(rewindCB);
156
-
157
- objEditor.ctrlPanel.remove(resetButton);
158
- objEditor.ctrlPanel.remove(stepButton);
159
-// objEditor.ctrlPanel.remove(stepAllButton);
160
-// objEditor.ctrlPanel.remove(resetAllButton);
161
- objEditor.ctrlPanel.remove(link2masterCB);
162
- //objEditor.ctrlPanel.remove(flipVCB);
163
- //objEditor.ctrlPanel.remove(texresMenu);
164
- objEditor.ctrlPanel.remove(slowerButton);
165
- objEditor.ctrlPanel.remove(fasterButton);
166
- objEditor.ctrlPanel.remove(remarkButton);
149
+// objEditor.ctrlPanel.remove(liveCB);
150
+// objEditor.ctrlPanel.remove(hideCB);
151
+// objEditor.ctrlPanel.remove(markCB);
152
+//
153
+// objEditor.ctrlPanel.remove(randomCB);
154
+// objEditor.ctrlPanel.remove(speedupCB);
155
+// objEditor.ctrlPanel.remove(rewindCB);
156
+//
157
+// objEditor.ctrlPanel.remove(resetButton);
158
+// objEditor.ctrlPanel.remove(stepButton);
159
+//// objEditor.ctrlPanel.remove(stepAllButton);
160
+//// objEditor.ctrlPanel.remove(resetAllButton);
161
+// objEditor.ctrlPanel.remove(link2masterCB);
162
+// //objEditor.ctrlPanel.remove(flipVCB);
163
+// //objEditor.ctrlPanel.remove(texresMenu);
164
+// objEditor.ctrlPanel.remove(slowerButton);
165
+// objEditor.ctrlPanel.remove(fasterButton);
166
+// objEditor.ctrlPanel.remove(remarkButton);
167167
168
- Remove(normalpushField);
168
+ objEditor.ctrlPanel.remove(namePanel);
169
+ objEditor.ctrlPanel.remove(setupPanel);
170
+ objEditor.ctrlPanel.remove(commandsPanel);
171
+ objEditor.ctrlPanel.remove(pushPanel);
172
+ //objEditor.ctrlPanel.remove(fillPanel);
173
+
174
+ //Remove(normalpushField);
169175 }
170176
171177 public ObjEditor GetEditor()
....@@ -353,21 +359,23 @@
353359 objectPanel = new JTabbedPane();
354360 toolbarPanel = new JPanel();
355361 toolbarPanel.setName("Toolbar");
356
- treePanel = new JPanel();
362
+ treePanel = new cGridBag();
357363 treePanel.setName("Tree");
358
- ctrlPanel = new JPanel(); // new GridBagLayout());
364
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
359365 ctrlPanel.setName("Edit");
360
- materialPanel = new JPanel();
366
+ materialPanel = new cGridBag().setVertical(true);
361367 materialPanel.setName("Material");
362368 /*JTextPane*/
363369 infoarea = createTextPane();
370
+ doc = infoarea.getStyledDocument();
371
+
364372 infoarea.setEditable(true);
365373 SetText();
366374 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
367375 // infoarea.setOpaque(false);
368376 // //infoarea.setForeground(textcolor);
369
- infoarea.setLineWrap(true);
370
- infoarea.setWrapStyleWord(true);
377
+// TEXTAREA infoarea.setLineWrap(true);
378
+// TEXTAREA infoarea.setWrapStyleWord(true);
371379 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
372380 infoPanel.setPreferredSize(new Dimension(50, 200));
373381 infoPanel.setName("Info");
....@@ -378,16 +386,16 @@
378386 mainPanel.setName("Main");
379387 mainPanel.setContinuousLayout(true);
380388 mainPanel.setOneTouchExpandable(true);
381
- mainPanel.setDividerLocation(1.0);
382389 mainPanel.setDividerSize(9);
383
- mainPanel.setResizeWeight(0);
390
+ mainPanel.setDividerLocation(0.5); //1.0);
391
+ mainPanel.setResizeWeight(0.5);
384392
385393 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
386394 //mainPanel.setLayout(new GridBagLayout());
387395 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388
- treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
390
- materialPanel.setLayout(new GridBagLayout());
396
+// treePanel.setLayout(new GridBagLayout());
397
+ //ctrlPanel.setLayout(new GridBagLayout());
398
+ //materialPanel.setLayout(new GridBagLayout());
391399
392400 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
393401 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -426,7 +434,7 @@
426434 static String newline = "\n";
427435 protected static final String buttonString = "JButton";
428436 StyledDocument doc;
429
- JTextArea infoarea;
437
+ JTextPane infoarea;
430438
431439 void ClearInfo()
432440 {
....@@ -493,7 +501,10 @@
493501 }
494502
495503 if (full)
496
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
504
+ {
505
+ si.SendInfo(" BBox min: " + minima, "regular");
506
+ si.SendInfo(" BBox max: " + maxima, "regular");
507
+ }
497508
498509 if (sel.bRep != null)
499510 {
....@@ -591,6 +602,9 @@
591602 {
592603 CameraPane.pointflow = (PointFlow) sel;
593604 }
605
+
606
+ si.SendInfo("_____________________", "regular");
607
+ si.SendInfo("", "regular");
594608 }
595609 }
596610
....@@ -622,52 +636,52 @@
622636 cameraView.ToggleFullScreen();
623637 }
624638
625
- private JTextArea createTextPane()
639
+ private JTextPane createTextPane()
626640 {
627
- String[] initString =
628
- {
629
- "This is an editable JTextPane, ", //regular
630
- "another ", //italic
631
- "styled ", //bold
632
- "text ", //small
633
- "component, ", //large
634
- "which supports embedded components..." + newline,//regular
635
- " " + newline, //button
636
- "...and embedded icons..." + newline, //regular
637
- " ", //icon
638
- newline + "JTextPane is a subclass of JEditorPane that "
639
- + "uses a StyledEditorKit and StyledDocument, and provides "
640
- + "cover methods for interacting with those objects."
641
- };
641
+// TEXTAREA String[] initString =
642
+// {
643
+// "This is an editable JTextPane, ", //regular
644
+// "another ", //italic
645
+// "styled ", //bold
646
+// "text ", //small
647
+// "component, ", //large
648
+// "which supports embedded components..." + newline,//regular
649
+// " " + newline, //button
650
+// "...and embedded icons..." + newline, //regular
651
+// " ", //icon
652
+// newline + "JTextPane is a subclass of JEditorPane that "
653
+// + "uses a StyledEditorKit and StyledDocument, and provides "
654
+// + "cover methods for interacting with those objects."
655
+// };
656
+//
657
+// String[] initStyles =
658
+// {
659
+// "regular", "italic", "bold", "small", "large",
660
+// "regular", "button", "regular", "icon",
661
+// "regular"
662
+// };
663
+//
664
+// JTextPane textPane = new JTextPane();
665
+// textPane.setEditable(true);
666
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
667
+// addStylesToDocument(doc);
668
+//
669
+// try
670
+// {
671
+// for (int j = 0; j < 2; j++)
672
+// {
673
+// for (int i = 0; i < initString.length; i++)
674
+// {
675
+// doc.insertString(doc.getLength(), initString[i],
676
+// doc.getStyle(initStyles[i]));
677
+// }
678
+// }
679
+// } catch (BadLocationException ble)
680
+// {
681
+// System.err.println("Couldn't insert initial text into text pane.");
682
+// }
642683
643
- String[] initStyles =
644
- {
645
- "regular", "italic", "bold", "small", "large",
646
- "regular", "button", "regular", "icon",
647
- "regular"
648
- };
649
-
650
- JTextPane textPane = new JTextPane();
651
- textPane.setEditable(true);
652
- /*StyledDocument*/ doc = textPane.getStyledDocument();
653
- addStylesToDocument(doc);
654
-
655
- try
656
- {
657
- for (int j = 0; j < 2; j++)
658
- {
659
- for (int i = 0; i < initString.length; i++)
660
- {
661
- doc.insertString(doc.getLength(), initString[i],
662
- doc.getStyle(initStyles[i]));
663
- }
664
- }
665
- } catch (BadLocationException ble)
666
- {
667
- System.err.println("Couldn't insert initial text into text pane.");
668
- }
669
-
670
- return new JTextArea(); // textPane;
684
+ return new JTextPane(); // textPane;
671685 }
672686
673687 protected void addStylesToDocument(StyledDocument doc)
....@@ -767,115 +781,83 @@
767781 JButton slowerButton;
768782 JButton fasterButton;
769783 JButton remarkButton;
784
+
785
+ cGridBag namePanel;
786
+ cGridBag setupPanel;
787
+ cGridBag commandsPanel;
788
+ cGridBag pushPanel;
789
+ cGridBag fillPanel;
770790
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
791
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
772792 {
773793 JCheckBox cb;
774794
775
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
776
- oe.aConstraints.gridwidth = 1; // 3;
777
-// oe.aConstraints.weightx = 1;
778
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
779
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
795
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
780796 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
784797
785798 return cb;
786799 }
787800
788
- cButton AddButton(ObjEditor oe, String label)
801
+ cButton AddButton(cGridBag panel, String label)
789802 {
790803 cButton cb;
791804
792
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
793
- oe.aConstraints.gridwidth = 1;
794
-// oe.aConstraints.weightx = 1;
795
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
796
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
805
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
797806 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
801807
802808 return cb;
803809 }
804810
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
811
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
806812 {
807813 JComboBox combo;
808814
809
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
810
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
811
- oe.aConstraints.gridx += 1;
815
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
812816 combo.addActionListener(this);
813817
814818 return combo;
815819 }
816820
817
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
821
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
818822 {
819
- NumberSlider combo;
823
+ cGridBag control = new cGridBag();
824
+
825
+ cNumberSlider combo;
820826
821827 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824828 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
825
- aConstraints.gridwidth = 1;
826
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
829
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
830
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
- aConstraints.gridx += 1;
832
- aConstraints.gridwidth = 1;
833
-
829
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834831 combo.setFloat(current);
835
-
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
832
+
833
+ panel.add(control);
834
+
835
+ return control;
841836 }
842837
843
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
838
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
844839 {
845
- NumberSlider combo;
840
+ cGridBag control = new cGridBag();
841
+
842
+ cNumberSlider combo;
846843
847844 JLabel jlabel = new JLabel(label);
848
-
849
- aConstraints.fill = GridBagConstraints.VERTICAL;
850845 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
851
- aConstraints.gridwidth = 2;
852
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
853
- aConstraints.gridx += 1;
854
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
855
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
856
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
857
- aConstraints.gridx += 1;
858
- aConstraints.gridwidth = 1;
859
-
846
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
847
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860848 combo.setInteger(current);
861849
862
- combo.label = jlabel;
863
-
864
- combo.addChangeListener(this);
865
-
866
- return combo;
850
+ panel.add(control);
851
+
852
+ return control;
867853 }
868854
869
- JTextArea AddText(JPanel ctrlPanel, String name)
855
+ JTextArea AddText(cGridBag ctrlPanel, String name)
870856 {
871857 JTextArea text;
872858
873
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
874
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
875
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
859
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
876860 text.addCaretListener(this);
877
- aConstraints.gridx += 1;
878
- aConstraints.gridwidth = 1;
879861
880862 return text;
881863 }
....@@ -905,9 +887,16 @@
905887 objEditor.ctrlPanel.remove(j);
906888 }
907889
890
+ void Remove(cNumberSlider j)
891
+ {
892
+ j.removeChangeListener(this);
893
+ //objEditor.ctrlPanel.remove(j.label);
894
+ objEditor.ctrlPanel.remove(j);
895
+ }
896
+
908897 /*
909898 */
910
- void Return() // ObjEditor oe)
899
+ void Return0() // ObjEditor oe)
911900 {
912901 aConstraints.gridy += 1;
913902 aConstraints.gridx = 0;
....@@ -966,33 +955,52 @@
966955 // oe.aConstraints.weighty = 0;
967956 // oe.aConstraints.gridx = 0;
968957 // oe.aConstraints.gridy = 0;
969
- SetupName(oe);
958
+ //SetupName(oe);
959
+
960
+ namePanel = new cGridBag();
961
+
962
+ nameField = AddText(namePanel, copy.GetName());
963
+ namePanel.add(nameField);
964
+ oe.ctrlPanel.add(namePanel);
965
+
966
+ oe.ctrlPanel.Return();
970967
971968 if (!GroupEditor.allparams)
972969 return;
973970
974
- liveCB = AddCheckBox(oe, "Live", copy.live);
975
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
976
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
971
+ setupPanel = new cGridBag().setVertical(false);
972
+
973
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
974
+ link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
975
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
977976 // 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");
977
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
978
+ rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind);
979
+ randomCB = AddCheckBox(setupPanel, "Rand", copy.random);
980
+
981
+ oe.ctrlPanel.add(setupPanel);
982
+ oe.ctrlPanel.Return();
983
+
984
+ commandsPanel = new cGridBag().setVertical(false);
985
+
986
+ resetButton = AddButton(commandsPanel, "Reset");
987
+ stepButton = AddButton(commandsPanel, "Step");
984988 // resetAllButton = AddButton(oe, "Reset All");
985989 // stepAllButton = AddButton(oe, "Step All");
986
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
990
+ speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
987991 // Return();
988
- slowerButton = AddButton(oe, "Slow");
989
- fasterButton = AddButton(oe, "Fast");
990
- remarkButton = AddButton(oe, "Rem");
992
+ slowerButton = AddButton(commandsPanel, "Slow");
993
+ fasterButton = AddButton(commandsPanel, "Fast");
994
+ remarkButton = AddButton(commandsPanel, "Remark");
991995
992
- Return();
996
+ oe.ctrlPanel.add(commandsPanel);
997
+ oe.ctrlPanel.Return();
993998
994
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
995
- Return();
999
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1000
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1001
+ //Return();
1002
+
1003
+ oe.ctrlPanel.Return();
9961004
9971005 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9981006 // ObjEditor.aConstraints.gridx += 1;
....@@ -1087,7 +1095,7 @@
10871095 oe.aConstraints.gridwidth = 1;
10881096 /**/
10891097 nameField = AddText(oe.ctrlPanel, copy.GetName());
1090
- Return();
1098
+ oe.ctrlPanel.Return();
10911099
10921100 //ctrlPanel.add(textureButton = new Button("Texture..."));
10931101 //textureButton.setEnabled(false);
....@@ -1264,10 +1272,11 @@
12641272 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12651273 //tmp.setName("Edit");
12661274 objectPanel.add(materialPanel);
1267
- JPanel north = new JPanel(new BorderLayout());
1268
- north.setName("Edit");
1269
- north.add(ctrlPanel, BorderLayout.NORTH);
1270
- objectPanel.add(north);
1275
+// JPanel north = new JPanel(new BorderLayout());
1276
+// north.setName("Edit");
1277
+// north.add(ctrlPanel, BorderLayout.NORTH);
1278
+// objectPanel.add(north);
1279
+ objectPanel.add(ctrlPanel);
12711280 objectPanel.add(infoPanel);
12721281
12731282 /*
....@@ -1296,11 +1305,11 @@
12961305
12971306 tabbedPane.add(FSPane = new cFileSystemPane(this));
12981307
1299
- optionsPanel = new JPanel(new GridBagLayout());
1308
+ optionsPanel = new cGridBag().setVertical(true);
13001309
13011310 optionsPanel.setName("Options");
13021311
1303
- AddOptions(optionsPanel, aConstraints);
1312
+ AddOptions(optionsPanel); //, aConstraints);
13041313
13051314 tabbedPane.add(optionsPanel);
13061315
....@@ -1411,7 +1420,7 @@
14111420 });
14121421 }
14131422
1414
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1423
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
14151424 {
14161425 }
14171426
....@@ -1426,260 +1435,170 @@
14261435 ctrlPanel.removeAll();
14271436 }
14281437
1429
- void SetupMaterial(JPanel ctrlPanel)
1438
+ void SetupMaterial(cGridBag panel)
14301439 {
1431
- aConstraints.weighty = 0;
1432
- //aConstraints.weightx = 1;
1433
- /*
1440
+ /*
14341441 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14351442 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1436
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1437
- aConstraints.gridx += 1;
14381443 */
14391444
1440
- aConstraints.gridwidth = 1;
1441
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1442
- aConstraints.gridx += 1;
1443
- aConstraints.weighty = 0;
1444
- aConstraints.gridwidth = 1;
1445
+ cGridBag editBar = new cGridBag().setVertical(false);
1446
+
1447
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1448
+ createMaterialButton.setToolTipText("Create material");
14451449
14461450 /*
14471451 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1448
- aConstraints.gridx += 1;
1449
- aConstraints.weighty = 0;
1450
- aConstraints.gridwidth = 1;
14511452 */
14521453
1453
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1454
- aConstraints.gridx += 1;
1454
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1455
+ clearMaterialButton.setToolTipText("Clear material");
1456
+
1457
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1458
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1459
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
14551460
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;
1461
+ editBar.preferredHeight = 15;
1462
+
1463
+ panel.add(editBar);
1464
+
14701465 /**/
14711466 //aConstraints.weighty = 0;
14721467 ////aConstraints.weightx = 1;
14731468 //aConstraints.weighty = 1;
14741469 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14751470 //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;
1471
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14811472
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;
1473
+ cGridBag colorSection = new cGridBag().setVertical(true);
1474
+
1475
+ cGridBag color = new cGridBag();
1476
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1477
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1479
+ //colorField.preferredWidth = 200;
1480
+ colorSection.add(color);
14921481
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;
1482
+ cGridBag modulation = new cGridBag();
1483
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1484
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1485
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1486
+ colorSection.add(modulation);
15021487
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;
1488
+ cGridBag texture = new cGridBag();
1489
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1490
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1491
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1492
+ colorSection.add(texture);
15121493
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;
1494
+ cGridBag anisoU = new cGridBag();
1495
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1496
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1497
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1498
+ colorSection.add(anisoU);
15221499
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;
1500
+ cGridBag anisoV = new cGridBag();
1501
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1502
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1503
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1504
+ colorSection.add(anisoV);
15321505
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;
1506
+ cGridBag shadowbias = new cGridBag();
1507
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1508
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1509
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1510
+ colorSection.add(shadowbias);
15421511
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;
1512
+ panel.add(new JSeparator());
1513
+
1514
+ panel.add(colorSection);
1515
+
1516
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1517
+
1518
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1519
+
1520
+ cGridBag diffuse = new cGridBag();
1521
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1522
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1523
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1524
+ diffuseSection.add(diffuse);
15511525
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;
1526
+ cGridBag diffuseness = new cGridBag();
1527
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1528
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1529
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1530
+ diffuseSection.add(diffuseness);
15611531
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;
1532
+ cGridBag selfshadow = new cGridBag();
1533
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1534
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1535
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1536
+ diffuseSection.add(selfshadow);
15711537
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;
1538
+ cGridBag sheen = new cGridBag();
1539
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1540
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1541
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1542
+ diffuseSection.add(sheen);
15811543
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;
1544
+ cGridBag subsurface = new cGridBag();
1545
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1546
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1547
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1548
+ diffuseSection.add(subsurface);
15911549
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;
1550
+ cGridBag shadow = new cGridBag();
1551
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1552
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1553
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1554
+ diffuseSection.add(shadow);
16011555
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;
1556
+ cGridBag fakedepth = new cGridBag();
1557
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1558
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1559
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1560
+ diffuseSection.add(fakedepth);
16111561
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;
1562
+ panel.add(new JSeparator());
1563
+
1564
+ panel.add(diffuseSection);
1565
+
1566
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1567
+
1568
+ cGridBag specularSection = new cGridBag().setVertical(true);
16211569
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;
1570
+ cGridBag specular = new cGridBag();
1571
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1572
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1573
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1574
+ specularSection.add(specular);
16301575
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;
1576
+ cGridBag lightarea = new cGridBag();
1577
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1578
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1579
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1580
+ specularSection.add(lightarea);
16401581
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;
1582
+ cGridBag shininess = new cGridBag();
1583
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1584
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1585
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1586
+ specularSection.add(shininess);
16501587
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;
1588
+ cGridBag metalness = new cGridBag();
1589
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1590
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1591
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1592
+ specularSection.add(metalness);
16601593
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;
1594
+ cGridBag velvet = new cGridBag();
1595
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1596
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1597
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1598
+ specularSection.add(velvet);
16701599
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();
1600
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1601
+ //Return();
16831602 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16841603 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16851604 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1690,130 +1609,93 @@
16901609 // aConstraints.gridy += 1;
16911610 // aConstraints.gridwidth = 1;
16921611
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;
17011612
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;
1613
+ panel.add(new JSeparator());
1614
+
1615
+ panel.add(specularSection);
1616
+
1617
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1618
+
1619
+ cGridBag globalSection = new cGridBag().setVertical(true);
17111620
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;
1621
+ cGridBag camera = new cGridBag();
1622
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1623
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1624
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1625
+ globalSection.add(camera);
17211626
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;
1627
+ cGridBag ambient = new cGridBag();
1628
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1629
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1630
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1631
+ globalSection.add(ambient);
17311632
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;
1633
+ cGridBag backlit = new cGridBag();
1634
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1635
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1636
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1637
+ globalSection.add(backlit);
17421638
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;
1639
+ cGridBag opacity = new cGridBag();
1640
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1641
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1642
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1643
+ globalSection.add(opacity);
17521644
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;
1645
+ panel.add(new JSeparator());
1646
+
1647
+ panel.add(globalSection);
1648
+
1649
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1650
+
1651
+ cGridBag textureSection = new cGridBag().setVertical(true);
17621652
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;
1653
+ cGridBag bump = new cGridBag();
1654
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1655
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1656
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1657
+ textureSection.add(bump);
17721658
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;
1659
+ cGridBag noise = new cGridBag();
1660
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1661
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1662
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1663
+ textureSection.add(noise);
17821664
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;
1665
+ cGridBag power = new cGridBag();
1666
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1667
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1668
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1669
+ textureSection.add(power);
17921670
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;
1671
+ cGridBag borderfade = new cGridBag();
1672
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1673
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1674
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1675
+ textureSection.add(borderfade);
18021676
1803
- //aConstraints.weighty = 1;
1804
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1805
- //aConstraints.gridx += 1;
1806
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1807
- aConstraints.weighty = 0;
1677
+ cGridBag fog = new cGridBag();
1678
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1679
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1680
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1681
+ textureSection.add(fog);
18081682
1809
- aConstraints.gridx = 0;
1810
- aConstraints.gridy = 0;
1811
- aConstraints.gridwidth = 1;
1683
+ cGridBag opacityPower = new cGridBag();
1684
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1685
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1686
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1687
+ textureSection.add(opacityPower);
1688
+
1689
+ panel.add(new JSeparator());
1690
+
1691
+ panel.add(textureSection);
1692
+
1693
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18121694
18131695 SetMaterial(copy); // .GetMaterial());
18141696
1815
- colorField.addChangeListener(this);
1816
- modulationField.addChangeListener(this);
1697
+ //colorField.addChangeListener(this);
1698
+// modulationField.addChangeListener(this);
18171699 metalnessField.addChangeListener(this);
18181700 diffuseField.addChangeListener(this);
18191701 specularField.addChangeListener(this);
....@@ -2625,6 +2507,7 @@
26252507 }
26262508 if (input == null)
26272509 {
2510
+ new Exception().printStackTrace();
26282511 System.exit(0);
26292512 }
26302513
....@@ -3354,6 +3237,7 @@
33543237 callee.refreshContents();
33553238 } else
33563239 {
3240
+ new Exception().printStackTrace();
33573241 System.exit(0);
33583242 }
33593243 }
....@@ -3516,7 +3400,7 @@
35163400 current.fakedepth = (float) fakedepthField.getFloat();
35173401 current.shadowbias = (float) shadowbiasField.getFloat();
35183402
3519
- if (!NumberSlider.frozen)
3403
+ if (!cNumberSlider.frozen)
35203404 {
35213405 //System.out.println("Propagate = " + propagate);
35223406 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3564,6 +3448,7 @@
35643448 || e.getSource() == apertureField
35653449 || e.getSource() == shadowblurField)
35663450 {
3451
+ new Exception().printStackTrace();
35673452 System.exit(0);
35683453 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35693454 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3889,7 +3774,7 @@
38893774
38903775 radioPanel.revalidate();
38913776 radioPanel.repaint();
3892
- ctrlPanel.revalidate(); // ? new
3777
+ ctrlPanel.validate(); // ? new
38933778 ctrlPanel.repaint();
38943779 }
38953780 }
....@@ -4535,8 +4420,8 @@
45354420 //MenuItem normalLensItem;
45364421 MenuItem editCameraItem;
45374422 MenuItem revertCameraItem;
4538
- CheckboxMenuItem toggleLiveItem;
45394423 MenuItem stepItem;
4424
+ CheckboxMenuItem toggleLiveItem;
45404425 CheckboxMenuItem toggleFullScreenItem;
45414426 CheckboxMenuItem toggleTimelineItem;
45424427 CheckboxMenuItem toggleRenderItem;
....@@ -4553,13 +4438,13 @@
45534438 JSplitPane mainPanel;
45544439 JScrollPane scrollpane;
45554440 JPanel toolbarPanel;
4556
- JPanel treePanel;
4441
+ cGridBag treePanel;
45574442 JPanel radioPanel;
45584443 ButtonGroup buttonGroup;
4559
- JPanel ctrlPanel;
4560
- JPanel materialPanel;
4444
+ cGridBag ctrlPanel;
4445
+ cGridBag materialPanel;
45614446 JScrollPane infoPanel;
4562
- JPanel optionsPanel;
4447
+ cGridBag optionsPanel;
45634448 JTabbedPane objectPanel;
45644449 cGridBag XYZPanel;
45654450 JSplitPane gridPanel;
....@@ -4619,67 +4504,67 @@
46194504 // MATERIAL
46204505 JLabel materialLabel;
46214506 JLabel colorLabel;
4622
- NumberSlider colorField;
4507
+ cNumberSlider colorField;
46234508 JLabel modulationLabel;
4624
- NumberSlider modulationField;
4509
+ cNumberSlider modulationField;
46254510 JLabel metalnessLabel;
4626
- NumberSlider metalnessField;
4511
+ cNumberSlider metalnessField;
46274512 JLabel diffuseLabel;
4628
- NumberSlider diffuseField;
4513
+ cNumberSlider diffuseField;
46294514 JLabel specularLabel;
4630
- NumberSlider specularField;
4515
+ cNumberSlider specularField;
46314516 JLabel shininessLabel;
4632
- NumberSlider shininessField;
4517
+ cNumberSlider shininessField;
46334518 JLabel shiftLabel;
4634
- NumberSlider shiftField;
4519
+ cNumberSlider shiftField;
46354520 JLabel ambientLabel;
4636
- NumberSlider ambientField;
4521
+ cNumberSlider ambientField;
46374522 JLabel lightareaLabel;
4638
- NumberSlider lightareaField;
4523
+ cNumberSlider lightareaField;
46394524 JLabel diffusenessLabel;
4640
- NumberSlider diffusenessField;
4525
+ cNumberSlider diffusenessField;
46414526 JLabel velvetLabel;
4642
- NumberSlider velvetField;
4527
+ cNumberSlider velvetField;
46434528 JLabel sheenLabel;
4644
- NumberSlider sheenField;
4529
+ cNumberSlider sheenField;
46454530 JLabel subsurfaceLabel;
4646
- NumberSlider subsurfaceField;
4531
+ cNumberSlider subsurfaceField;
46474532 //JLabel bumpLabel;
46484533 //NumberSlider bumpField;
46494534 JLabel backlitLabel;
4650
- NumberSlider backlitField;
4535
+ cNumberSlider backlitField;
46514536 JLabel anisoLabel;
4652
- NumberSlider anisoField;
4537
+ cNumberSlider anisoField;
46534538 JLabel anisoVLabel;
4654
- NumberSlider anisoVField;
4539
+ cNumberSlider anisoVField;
46554540 JLabel cameraLabel;
4656
- NumberSlider cameraField;
4541
+ cNumberSlider cameraField;
46574542 JLabel selfshadowLabel;
4658
- NumberSlider selfshadowField;
4543
+ cNumberSlider selfshadowField;
46594544 JLabel shadowLabel;
4660
- NumberSlider shadowField;
4545
+ cNumberSlider shadowField;
46614546 JLabel textureLabel;
4662
- NumberSlider textureField;
4547
+ cNumberSlider textureField;
46634548 JLabel opacityLabel;
4664
- NumberSlider opacityField;
4549
+ cNumberSlider opacityField;
46654550 JLabel fakedepthLabel;
4666
- NumberSlider fakedepthField;
4551
+ cNumberSlider fakedepthField;
46674552 JLabel shadowbiasLabel;
4668
- NumberSlider shadowbiasField;
4553
+ cNumberSlider shadowbiasField;
46694554 JLabel bumpLabel;
4670
- NumberSlider bumpField;
4555
+ cNumberSlider bumpField;
46714556 JLabel noiseLabel;
4672
- NumberSlider noiseField;
4557
+ cNumberSlider noiseField;
46734558 JLabel powerLabel;
4674
- NumberSlider powerField;
4559
+ cNumberSlider powerField;
46754560 JLabel borderfadeLabel;
4676
- NumberSlider borderfadeField;
4561
+ cNumberSlider borderfadeField;
46774562 JLabel fogLabel;
4678
- NumberSlider fogField;
4563
+ cNumberSlider fogField;
46794564 JLabel opacityPowerLabel;
4680
- NumberSlider opacityPowerField;
4565
+ cNumberSlider opacityPowerField;
46814566 JTree jTree;
46824567 //ObjectUI parent;
46834568
4684
- NumberSlider normalpushField;
4569
+ cNumberSlider normalpushField;
46854570 }