Normand Briere
2019-05-02 a76491b66a2e304d9ae27a162f407b98c70fbafa
ObjEditor.java
....@@ -138,34 +138,41 @@
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);
145
+
146
+ objEditor.ctrlPanel.remove(namePanel);
145147
146148 if (!GroupEditor.allparams)
147149 return;
148150
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);
151
+// objEditor.ctrlPanel.remove(liveCB);
152
+// objEditor.ctrlPanel.remove(hideCB);
153
+// objEditor.ctrlPanel.remove(markCB);
154
+//
155
+// objEditor.ctrlPanel.remove(randomCB);
156
+// objEditor.ctrlPanel.remove(speedupCB);
157
+// objEditor.ctrlPanel.remove(rewindCB);
158
+//
159
+// objEditor.ctrlPanel.remove(resetButton);
160
+// objEditor.ctrlPanel.remove(stepButton);
161
+//// objEditor.ctrlPanel.remove(stepAllButton);
162
+//// objEditor.ctrlPanel.remove(resetAllButton);
163
+// objEditor.ctrlPanel.remove(link2masterCB);
164
+// //objEditor.ctrlPanel.remove(flipVCB);
165
+// //objEditor.ctrlPanel.remove(texresMenu);
166
+// objEditor.ctrlPanel.remove(slowerButton);
167
+// objEditor.ctrlPanel.remove(fasterButton);
168
+// objEditor.ctrlPanel.remove(remarkButton);
167169
168
- Remove(normalpushField);
170
+ objEditor.ctrlPanel.remove(setupPanel);
171
+ objEditor.ctrlPanel.remove(commandsPanel);
172
+ objEditor.ctrlPanel.remove(pushPanel);
173
+ //objEditor.ctrlPanel.remove(fillPanel);
174
+
175
+ //Remove(normalpushField);
169176 }
170177
171178 public ObjEditor GetEditor()
....@@ -353,21 +360,23 @@
353360 objectPanel = new JTabbedPane();
354361 toolbarPanel = new JPanel();
355362 toolbarPanel.setName("Toolbar");
356
- treePanel = new JPanel();
363
+ treePanel = new cGridBag();
357364 treePanel.setName("Tree");
358
- ctrlPanel = new JPanel(); // new GridBagLayout());
365
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
359366 ctrlPanel.setName("Edit");
360
- materialPanel = new JPanel();
367
+ materialPanel = new cGridBag().setVertical(true);
361368 materialPanel.setName("Material");
362369 /*JTextPane*/
363370 infoarea = createTextPane();
371
+ doc = infoarea.getStyledDocument();
372
+
364373 infoarea.setEditable(true);
365374 SetText();
366375 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
367376 // infoarea.setOpaque(false);
368377 // //infoarea.setForeground(textcolor);
369
- infoarea.setLineWrap(true);
370
- infoarea.setWrapStyleWord(true);
378
+// TEXTAREA infoarea.setLineWrap(true);
379
+// TEXTAREA infoarea.setWrapStyleWord(true);
371380 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
372381 infoPanel.setPreferredSize(new Dimension(50, 200));
373382 infoPanel.setName("Info");
....@@ -378,16 +387,16 @@
378387 mainPanel.setName("Main");
379388 mainPanel.setContinuousLayout(true);
380389 mainPanel.setOneTouchExpandable(true);
381
- mainPanel.setDividerLocation(1.0);
382390 mainPanel.setDividerSize(9);
383
- mainPanel.setResizeWeight(0);
391
+ mainPanel.setDividerLocation(0.5); //1.0);
392
+ mainPanel.setResizeWeight(0.5);
384393
385394 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
386395 //mainPanel.setLayout(new GridBagLayout());
387396 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388
- treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
390
- materialPanel.setLayout(new GridBagLayout());
397
+// treePanel.setLayout(new GridBagLayout());
398
+ //ctrlPanel.setLayout(new GridBagLayout());
399
+ //materialPanel.setLayout(new GridBagLayout());
391400
392401 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
393402 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -426,7 +435,7 @@
426435 static String newline = "\n";
427436 protected static final String buttonString = "JButton";
428437 StyledDocument doc;
429
- JTextArea infoarea;
438
+ JTextPane infoarea;
430439
431440 void ClearInfo()
432441 {
....@@ -493,7 +502,10 @@
493502 }
494503
495504 if (full)
496
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
505
+ {
506
+ si.SendInfo(" BBox min: " + minima, "regular");
507
+ si.SendInfo(" BBox max: " + maxima, "regular");
508
+ }
497509
498510 if (sel.bRep != null)
499511 {
....@@ -591,6 +603,9 @@
591603 {
592604 CameraPane.pointflow = (PointFlow) sel;
593605 }
606
+
607
+ si.SendInfo("_____________________", "regular");
608
+ si.SendInfo("", "regular");
594609 }
595610 }
596611
....@@ -622,52 +637,52 @@
622637 cameraView.ToggleFullScreen();
623638 }
624639
625
- private JTextArea createTextPane()
640
+ private JTextPane createTextPane()
626641 {
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
- };
642
+// TEXTAREA String[] initString =
643
+// {
644
+// "This is an editable JTextPane, ", //regular
645
+// "another ", //italic
646
+// "styled ", //bold
647
+// "text ", //small
648
+// "component, ", //large
649
+// "which supports embedded components..." + newline,//regular
650
+// " " + newline, //button
651
+// "...and embedded icons..." + newline, //regular
652
+// " ", //icon
653
+// newline + "JTextPane is a subclass of JEditorPane that "
654
+// + "uses a StyledEditorKit and StyledDocument, and provides "
655
+// + "cover methods for interacting with those objects."
656
+// };
657
+//
658
+// String[] initStyles =
659
+// {
660
+// "regular", "italic", "bold", "small", "large",
661
+// "regular", "button", "regular", "icon",
662
+// "regular"
663
+// };
664
+//
665
+// JTextPane textPane = new JTextPane();
666
+// textPane.setEditable(true);
667
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
668
+// addStylesToDocument(doc);
669
+//
670
+// try
671
+// {
672
+// for (int j = 0; j < 2; j++)
673
+// {
674
+// for (int i = 0; i < initString.length; i++)
675
+// {
676
+// doc.insertString(doc.getLength(), initString[i],
677
+// doc.getStyle(initStyles[i]));
678
+// }
679
+// }
680
+// } catch (BadLocationException ble)
681
+// {
682
+// System.err.println("Couldn't insert initial text into text pane.");
683
+// }
642684
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;
685
+ return new JTextPane(); // textPane;
671686 }
672687
673688 protected void addStylesToDocument(StyledDocument doc)
....@@ -767,115 +782,83 @@
767782 JButton slowerButton;
768783 JButton fasterButton;
769784 JButton remarkButton;
785
+
786
+ cGridBag namePanel;
787
+ cGridBag setupPanel;
788
+ cGridBag commandsPanel;
789
+ cGridBag pushPanel;
790
+ cGridBag fillPanel;
770791
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
792
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
772793 {
773794 JCheckBox cb;
774795
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);
796
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
780797 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
784798
785799 return cb;
786800 }
787801
788
- cButton AddButton(ObjEditor oe, String label)
802
+ cButton AddButton(cGridBag panel, String label)
789803 {
790804 cButton cb;
791805
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);
806
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
797807 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
801808
802809 return cb;
803810 }
804811
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
812
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
806813 {
807814 JComboBox combo;
808815
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;
816
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
812817 combo.addActionListener(this);
813818
814819 return combo;
815820 }
816821
817
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
822
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
818823 {
819
- NumberSlider combo;
824
+ cGridBag control = new cGridBag();
825
+
826
+ cNumberSlider combo;
820827
821828 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824829 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
-
830
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834832 combo.setFloat(current);
835
-
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
833
+
834
+ panel.add(control);
835
+
836
+ return control;
841837 }
842838
843
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
839
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
844840 {
845
- NumberSlider combo;
841
+ cGridBag control = new cGridBag();
842
+
843
+ cNumberSlider combo;
846844
847845 JLabel jlabel = new JLabel(label);
848
-
849
- aConstraints.fill = GridBagConstraints.VERTICAL;
850846 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
-
847
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860849 combo.setInteger(current);
861850
862
- combo.label = jlabel;
863
-
864
- combo.addChangeListener(this);
865
-
866
- return combo;
851
+ panel.add(control);
852
+
853
+ return control;
867854 }
868855
869
- JTextArea AddText(JPanel ctrlPanel, String name)
856
+ JTextArea AddText(cGridBag ctrlPanel, String name)
870857 {
871858 JTextArea text;
872859
873
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
874
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
875
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
876861 text.addCaretListener(this);
877
- aConstraints.gridx += 1;
878
- aConstraints.gridwidth = 1;
879862
880863 return text;
881864 }
....@@ -905,9 +888,16 @@
905888 objEditor.ctrlPanel.remove(j);
906889 }
907890
891
+ void Remove(cNumberSlider j)
892
+ {
893
+ j.removeChangeListener(this);
894
+ //objEditor.ctrlPanel.remove(j.label);
895
+ objEditor.ctrlPanel.remove(j);
896
+ }
897
+
908898 /*
909899 */
910
- void Return() // ObjEditor oe)
900
+ void Return0() // ObjEditor oe)
911901 {
912902 aConstraints.gridy += 1;
913903 aConstraints.gridx = 0;
....@@ -962,37 +952,70 @@
962952
963953 void SetupUI2(ObjEditor oe)
964954 {
965
-// oe.aConstraints.weightx = 0;
966
-// oe.aConstraints.weighty = 0;
967
-// oe.aConstraints.gridx = 0;
968
-// oe.aConstraints.gridy = 0;
969
- SetupName(oe);
955
+ //SetupName(oe);
956
+
957
+ namePanel = new cGridBag();
958
+
959
+ nameField = AddText(namePanel, copy.GetName());
960
+ namePanel.add(nameField);
961
+ oe.ctrlPanel.add(namePanel);
962
+
963
+ oe.ctrlPanel.Return();
970964
971965 if (!GroupEditor.allparams)
972966 return;
973967
974
- liveCB = AddCheckBox(oe, "Live", copy.live);
975
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
976
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
968
+ setupPanel = new cGridBag().setVertical(false);
969
+
970
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
971
+ liveCB.setToolTipText("Animate object");
972
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
973
+ hideCB.setToolTipText("Hide object");
977974 // 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");
975
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
976
+ markCB.setToolTipText("Set the animation target transform");
977
+
978
+ rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
979
+ rewindCB.setToolTipText("Rewind animation");
980
+
981
+ randomCB = AddCheckBox(setupPanel, "Random", copy.random);
982
+ randomCB.setToolTipText("Option for switch node");
983
+
984
+ if (Globals.ADVANCED)
985
+ {
986
+ link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
987
+ link2masterCB.setToolTipText("Attach to support");
988
+ speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
989
+ speedupCB.setToolTipText("Option motion capture");
990
+ }
991
+
992
+ oe.ctrlPanel.add(setupPanel);
993
+ oe.ctrlPanel.Return();
994
+
995
+ commandsPanel = new cGridBag().setVertical(false);
996
+
997
+ resetButton = AddButton(commandsPanel, "Reset");
998
+ resetButton.setToolTipText("Jump to frame zero");
999
+ stepButton = AddButton(commandsPanel, "Step");
1000
+ stepButton.setToolTipText("Step one frame");
9841001 // resetAllButton = AddButton(oe, "Reset All");
9851002 // stepAllButton = AddButton(oe, "Step All");
986
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9871003 // Return();
988
- slowerButton = AddButton(oe, "Slow");
989
- fasterButton = AddButton(oe, "Fast");
990
- remarkButton = AddButton(oe, "Rem");
1004
+ slowerButton = AddButton(commandsPanel, "Slow");
1005
+ slowerButton.setToolTipText("Decrease animation speed");
1006
+ fasterButton = AddButton(commandsPanel, "Fast");
1007
+ fasterButton.setToolTipText("Increase animation speed");
1008
+ remarkButton = AddButton(commandsPanel, "Remark");
1009
+ remarkButton.setToolTipText("Set the current transform as the target");
9911010
992
- Return();
1011
+ oe.ctrlPanel.add(commandsPanel);
1012
+ oe.ctrlPanel.Return();
9931013
994
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
995
- Return();
1014
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1015
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1016
+ //Return();
1017
+
1018
+ oe.ctrlPanel.Return();
9961019
9971020 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9981021 // ObjEditor.aConstraints.gridx += 1;
....@@ -1087,7 +1110,7 @@
10871110 oe.aConstraints.gridwidth = 1;
10881111 /**/
10891112 nameField = AddText(oe.ctrlPanel, copy.GetName());
1090
- Return();
1113
+ oe.ctrlPanel.Return();
10911114
10921115 //ctrlPanel.add(textureButton = new Button("Texture..."));
10931116 //textureButton.setEnabled(false);
....@@ -1189,7 +1212,8 @@
11891212 //JPanel worldPanel =
11901213 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11911214 //worldPanel.setName("World");
1192
- centralPanel = new JPanel(new BorderLayout());
1215
+ centralPanel = new cGridBag();
1216
+ centralPanel.preferredWidth = 20;
11931217 timelinePanel = new JPanel(new BorderLayout());
11941218 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11951219
....@@ -1222,6 +1246,7 @@
12221246 XYZPanel = new cGridBag().setVertical(true);
12231247 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12241248
1249
+ XYZPanel.preferredWidth = 5;
12251250 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
12261251 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
12271252 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
....@@ -1262,10 +1287,11 @@
12621287 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12631288 //tmp.setName("Edit");
12641289 objectPanel.add(materialPanel);
1265
- JPanel north = new JPanel(new BorderLayout());
1266
- north.setName("Edit");
1267
- north.add(ctrlPanel, BorderLayout.NORTH);
1268
- objectPanel.add(north);
1290
+// JPanel north = new JPanel(new BorderLayout());
1291
+// north.setName("Edit");
1292
+// north.add(ctrlPanel, BorderLayout.NORTH);
1293
+// objectPanel.add(north);
1294
+ objectPanel.add(ctrlPanel);
12691295 objectPanel.add(infoPanel);
12701296
12711297 /*
....@@ -1286,19 +1312,23 @@
12861312 scrollpane.setWheelScrollingEnabled(true);
12871313 scrollpane.addMouseWheelListener(this); // Default not fast enough
12881314
1289
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1290
- scenePanel.add(scrollpane);
1315
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1316
+ scenePanel.preferredWidth = 7;
1317
+
1318
+ JTabbedPane tabbedPane = new JTabbedPane();
1319
+ tabbedPane.add(scrollpane);
12911320
1292
- scenePanel.add(FSPane = new cFileSystemPane(this));
1321
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12931322
1294
- optionsPanel = new JPanel(new GridBagLayout());
1323
+ optionsPanel = new cGridBag().setVertical(true);
12951324
12961325 optionsPanel.setName("Options");
12971326
1298
- AddOptions(optionsPanel, aConstraints);
1327
+ AddOptions(optionsPanel); //, aConstraints);
12991328
1300
- scenePanel.add(optionsPanel);
1301
-
1329
+ tabbedPane.add(optionsPanel);
1330
+
1331
+ scenePanel.add(tabbedPane);
13021332
13031333 /*
13041334 cTree jTree = new cTree(null);
....@@ -1405,7 +1435,7 @@
14051435 });
14061436 }
14071437
1408
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1438
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
14091439 {
14101440 }
14111441
....@@ -1420,260 +1450,170 @@
14201450 ctrlPanel.removeAll();
14211451 }
14221452
1423
- void SetupMaterial(JPanel ctrlPanel)
1453
+ void SetupMaterial(cGridBag panel)
14241454 {
1425
- aConstraints.weighty = 0;
1426
- //aConstraints.weightx = 1;
1427
- /*
1455
+ /*
14281456 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14291457 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1430
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1431
- aConstraints.gridx += 1;
14321458 */
14331459
1434
- aConstraints.gridwidth = 1;
1435
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1436
- aConstraints.gridx += 1;
1437
- aConstraints.weighty = 0;
1438
- aConstraints.gridwidth = 1;
1460
+ cGridBag editBar = new cGridBag().setVertical(false);
1461
+
1462
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1463
+ createMaterialButton.setToolTipText("Create material");
14391464
14401465 /*
14411466 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1442
- aConstraints.gridx += 1;
1443
- aConstraints.weighty = 0;
1444
- aConstraints.gridwidth = 1;
14451467 */
14461468
1447
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1448
- aConstraints.gridx += 1;
1469
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1470
+ clearMaterialButton.setToolTipText("Clear material");
1471
+
1472
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1473
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1474
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
14491475
1450
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1451
-
1452
- aConstraints.gridx += 1;
1453
-
1454
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1455
-
1456
- aConstraints.gridx += 1;
1457
-
1458
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1459
-
1460
- aConstraints.gridx = 0;
1461
- aConstraints.gridy += 1;
1462
- aConstraints.weighty = 0;
1463
- aConstraints.gridwidth = 1;
1476
+ editBar.preferredHeight = 15;
1477
+
1478
+ panel.add(editBar);
1479
+
14641480 /**/
14651481 //aConstraints.weighty = 0;
14661482 ////aConstraints.weightx = 1;
14671483 //aConstraints.weighty = 1;
14681484 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14691485 //aConstraints.gridx += 1;
1470
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1471
- aConstraints.weighty = 0;
1472
- aConstraints.gridx = 0;
1473
- aConstraints.gridy += 1;
1474
- aConstraints.gridwidth = 1;
1486
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14751487
1476
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1477
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1479
- aConstraints.gridx += 1;
1480
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1481
- //aConstraints.weightx = 0;
1482
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1483
- aConstraints.gridx = 0;
1484
- aConstraints.gridy += 1;
1485
- aConstraints.gridwidth = 1;
1488
+ cGridBag colorSection = new cGridBag().setVertical(true);
1489
+
1490
+ cGridBag color = new cGridBag();
1491
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1492
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1493
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1494
+ //colorField.preferredWidth = 200;
1495
+ colorSection.add(color);
14861496
1487
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1488
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1489
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1490
- aConstraints.gridx += 1;
1491
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1492
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1493
- aConstraints.gridx = 0;
1494
- aConstraints.gridy += 1;
1495
- aConstraints.gridwidth = 1;
1497
+ cGridBag modulation = new cGridBag();
1498
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1499
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1500
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1501
+ colorSection.add(modulation);
14961502
1497
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1498
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1499
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1500
- aConstraints.gridx += 1;
1501
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1502
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1503
- aConstraints.gridx = 0;
1504
- aConstraints.gridy += 1;
1505
- aConstraints.gridwidth = 1;
1503
+ cGridBag texture = new cGridBag();
1504
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1505
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1506
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1507
+ colorSection.add(texture);
15061508
1507
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1508
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1509
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1510
- aConstraints.gridx += 1;
1511
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1512
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1513
- aConstraints.gridx = 0;
1514
- aConstraints.gridy += 1;
1515
- aConstraints.gridwidth = 1;
1509
+ cGridBag anisoU = new cGridBag();
1510
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1511
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1512
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1513
+ colorSection.add(anisoU);
15161514
1517
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1518
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1519
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1520
- aConstraints.gridx += 1;
1521
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1522
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1523
- aConstraints.gridx = 0;
1524
- aConstraints.gridy += 1;
1525
- aConstraints.gridwidth = 1;
1515
+ cGridBag anisoV = new cGridBag();
1516
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1517
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1518
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1519
+ colorSection.add(anisoV);
15261520
1527
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1528
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1529
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1530
- aConstraints.gridx += 1;
1531
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1532
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1533
- aConstraints.gridx = 0;
1534
- aConstraints.gridy += 1;
1535
- aConstraints.gridwidth = 1;
1521
+ cGridBag shadowbias = new cGridBag();
1522
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1523
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1524
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1525
+ colorSection.add(shadowbias);
15361526
1537
- //aConstraints.weighty = 1;
1538
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1539
- //aConstraints.gridx += 1;
1540
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1541
- aConstraints.weighty = 0;
1542
- aConstraints.gridx = 0;
1543
- aConstraints.gridy += 1;
1544
- aConstraints.gridwidth = 1;
1527
+ panel.add(new JSeparator());
1528
+
1529
+ panel.add(colorSection);
1530
+
1531
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1532
+
1533
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1534
+
1535
+ cGridBag diffuse = new cGridBag();
1536
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1537
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1538
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1539
+ diffuseSection.add(diffuse);
15451540
1546
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1547
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1548
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1549
- aConstraints.gridx += 1;
1550
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1551
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1552
- aConstraints.gridx = 0;
1553
- aConstraints.gridy += 1;
1554
- aConstraints.gridwidth = 1;
1541
+ cGridBag diffuseness = new cGridBag();
1542
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1543
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1544
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1545
+ diffuseSection.add(diffuseness);
15551546
1556
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1557
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1558
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1559
- aConstraints.gridx += 1;
1560
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1561
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1562
- aConstraints.gridx = 0;
1563
- aConstraints.gridy += 1;
1564
- aConstraints.gridwidth = 1;
1547
+ cGridBag selfshadow = new cGridBag();
1548
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1549
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1550
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1551
+ diffuseSection.add(selfshadow);
15651552
1566
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1567
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1568
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1569
- aConstraints.gridx += 1;
1570
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1571
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1572
- aConstraints.gridx = 0;
1573
- aConstraints.gridy += 1;
1574
- aConstraints.gridwidth = 1;
1553
+ cGridBag sheen = new cGridBag();
1554
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1555
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1556
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1557
+ diffuseSection.add(sheen);
15751558
1576
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1577
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1578
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1579
- aConstraints.gridx += 1;
1580
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1581
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1582
- aConstraints.gridx = 0;
1583
- aConstraints.gridy += 1;
1584
- aConstraints.gridwidth = 1;
1559
+ cGridBag subsurface = new cGridBag();
1560
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1561
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1562
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1563
+ diffuseSection.add(subsurface);
15851564
1586
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1587
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1588
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1589
- aConstraints.gridx += 1;
1590
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1591
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1592
- aConstraints.gridx = 0;
1593
- aConstraints.gridy += 1;
1594
- aConstraints.gridwidth = 1;
1565
+ cGridBag shadow = new cGridBag();
1566
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1567
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1568
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1569
+ diffuseSection.add(shadow);
15951570
1596
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1597
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1598
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1599
- aConstraints.gridx += 1;
1600
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1601
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1602
- aConstraints.gridx = 0;
1603
- aConstraints.gridy += 1;
1604
- aConstraints.gridwidth = 1;
1571
+ cGridBag fakedepth = new cGridBag();
1572
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1573
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1574
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1575
+ diffuseSection.add(fakedepth);
16051576
1606
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1607
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1608
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1609
- aConstraints.gridx += 1;
1610
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1611
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1612
- aConstraints.gridx = 0;
1613
- aConstraints.gridy += 1;
1614
- aConstraints.gridwidth = 1;
1577
+ panel.add(new JSeparator());
1578
+
1579
+ panel.add(diffuseSection);
1580
+
1581
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1582
+
1583
+ cGridBag specularSection = new cGridBag().setVertical(true);
16151584
1616
- //aConstraints.weighty = 1;
1617
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1618
- //aConstraints.gridx += 1;
1619
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1620
- aConstraints.weighty = 0;
1621
- aConstraints.gridx = 0;
1622
- aConstraints.gridy += 1;
1623
- aConstraints.gridwidth = 1;
1585
+ cGridBag specular = new cGridBag();
1586
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1587
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1588
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1589
+ specularSection.add(specular);
16241590
1625
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1626
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1627
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1628
- aConstraints.gridx += 1;
1629
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1630
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1631
- aConstraints.gridx = 0;
1632
- aConstraints.gridy += 1;
1633
- aConstraints.gridwidth = 1;
1591
+ cGridBag lightarea = new cGridBag();
1592
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1593
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1595
+ specularSection.add(lightarea);
16341596
1635
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1636
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1637
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1638
- aConstraints.gridx += 1;
1639
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1640
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1641
- aConstraints.gridx = 0;
1642
- aConstraints.gridy += 1;
1643
- aConstraints.gridwidth = 1;
1597
+ cGridBag shininess = new cGridBag();
1598
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1599
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1600
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1601
+ specularSection.add(shininess);
16441602
1645
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1646
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1647
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1648
- aConstraints.gridx += 1;
1649
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1650
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1651
- aConstraints.gridx = 0;
1652
- aConstraints.gridy += 1;
1653
- aConstraints.gridwidth = 1;
1603
+ cGridBag metalness = new cGridBag();
1604
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1605
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1606
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1607
+ specularSection.add(metalness);
16541608
1655
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1656
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1658
- aConstraints.gridx += 1;
1659
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1660
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1661
- aConstraints.gridx = 0;
1662
- aConstraints.gridy += 1;
1663
- aConstraints.gridwidth = 1;
1609
+ cGridBag velvet = new cGridBag();
1610
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1611
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1612
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1613
+ specularSection.add(velvet);
16641614
1665
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1666
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1667
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1668
- aConstraints.gridx += 1;
1669
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1670
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1671
- aConstraints.gridx = 0;
1672
- aConstraints.gridy += 1;
1673
- aConstraints.gridwidth = 1;
1674
-
1675
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1676
- Return();
1615
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1616
+ //Return();
16771617 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16781618 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16791619 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1684,130 +1624,93 @@
16841624 // aConstraints.gridy += 1;
16851625 // aConstraints.gridwidth = 1;
16861626
1687
- //aConstraints.weighty = 1;
1688
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1689
- //aConstraints.gridx += 1;
1690
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1691
- aConstraints.weighty = 0;
1692
- aConstraints.gridx = 0;
1693
- aConstraints.gridy += 1;
1694
- aConstraints.gridwidth = 1;
16951627
1696
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1697
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1699
- aConstraints.gridx += 1;
1700
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1701
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1702
- aConstraints.gridx = 0;
1703
- aConstraints.gridy += 1;
1704
- aConstraints.gridwidth = 1;
1628
+ panel.add(new JSeparator());
1629
+
1630
+ panel.add(specularSection);
1631
+
1632
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1633
+
1634
+ cGridBag globalSection = new cGridBag().setVertical(true);
17051635
1706
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1707
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1709
- aConstraints.gridx += 1;
1710
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1711
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1712
- aConstraints.gridx = 0;
1713
- aConstraints.gridy += 1;
1714
- aConstraints.gridwidth = 1;
1636
+ cGridBag camera = new cGridBag();
1637
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1638
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1639
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1640
+ globalSection.add(camera);
17151641
1716
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1717
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1718
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1719
- aConstraints.gridx += 1;
1720
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1721
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1722
- aConstraints.gridx = 0;
1723
- aConstraints.gridy += 1;
1724
- aConstraints.gridwidth = 1;
1642
+ cGridBag ambient = new cGridBag();
1643
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1644
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1645
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1646
+ globalSection.add(ambient);
17251647
1726
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1727
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1728
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1729
- aConstraints.gridx += 1;
1730
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1731
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1732
- aConstraints.gridx = 0;
1733
- aConstraints.gridy += 1;
1734
- aConstraints.gridwidth = 1;
1735
- aConstraints.weighty = 0;
1648
+ cGridBag backlit = new cGridBag();
1649
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1650
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1652
+ globalSection.add(backlit);
17361653
1737
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1738
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1739
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1740
- aConstraints.gridx += 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1742
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1743
- aConstraints.gridx = 0;
1744
- aConstraints.gridy += 1;
1745
- aConstraints.gridwidth = 1;
1654
+ cGridBag opacity = new cGridBag();
1655
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1656
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1658
+ globalSection.add(opacity);
17461659
1747
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1748
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1749
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1750
- aConstraints.gridx += 1;
1751
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1752
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1753
- aConstraints.gridx = 0;
1754
- aConstraints.gridy += 1;
1755
- aConstraints.gridwidth = 1;
1660
+ panel.add(new JSeparator());
1661
+
1662
+ panel.add(globalSection);
1663
+
1664
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1665
+
1666
+ cGridBag textureSection = new cGridBag().setVertical(true);
17561667
1757
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1758
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1759
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1760
- aConstraints.gridx += 1;
1761
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1762
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1763
- aConstraints.gridx = 0;
1764
- aConstraints.gridy += 1;
1765
- aConstraints.gridwidth = 1;
1668
+ cGridBag bump = new cGridBag();
1669
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1670
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1672
+ textureSection.add(bump);
17661673
1767
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1768
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1769
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1770
- aConstraints.gridx += 1;
1771
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1772
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1773
- aConstraints.gridx = 0;
1774
- aConstraints.gridy += 1;
1775
- aConstraints.gridwidth = 1;
1674
+ cGridBag noise = new cGridBag();
1675
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1676
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1678
+ textureSection.add(noise);
17761679
1777
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1778
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1779
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1780
- aConstraints.gridx += 1;
1781
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1782
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1783
- aConstraints.gridx = 0;
1784
- aConstraints.gridy += 1;
1785
- aConstraints.gridwidth = 1;
1680
+ cGridBag power = new cGridBag();
1681
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1682
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1683
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1684
+ textureSection.add(power);
17861685
1787
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1788
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1789
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1790
- aConstraints.gridx += 1;
1791
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1792
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1793
- aConstraints.gridx = 0;
1794
- aConstraints.gridy += 1;
1795
- aConstraints.gridwidth = 1;
1686
+ cGridBag borderfade = new cGridBag();
1687
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1688
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1689
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1690
+ textureSection.add(borderfade);
17961691
1797
- //aConstraints.weighty = 1;
1798
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1799
- //aConstraints.gridx += 1;
1800
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1801
- aConstraints.weighty = 0;
1692
+ cGridBag fog = new cGridBag();
1693
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1694
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1695
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1696
+ textureSection.add(fog);
18021697
1803
- aConstraints.gridx = 0;
1804
- aConstraints.gridy = 0;
1805
- aConstraints.gridwidth = 1;
1698
+ cGridBag opacityPower = new cGridBag();
1699
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1700
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1701
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1702
+ textureSection.add(opacityPower);
1703
+
1704
+ panel.add(new JSeparator());
1705
+
1706
+ panel.add(textureSection);
1707
+
1708
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18061709
18071710 SetMaterial(copy); // .GetMaterial());
18081711
1809
- colorField.addChangeListener(this);
1810
- modulationField.addChangeListener(this);
1712
+ //colorField.addChangeListener(this);
1713
+// modulationField.addChangeListener(this);
18111714 metalnessField.addChangeListener(this);
18121715 diffuseField.addChangeListener(this);
18131716 specularField.addChangeListener(this);
....@@ -2619,6 +2522,7 @@
26192522 }
26202523 if (input == null)
26212524 {
2525
+ new Exception().printStackTrace();
26222526 System.exit(0);
26232527 }
26242528
....@@ -3093,6 +2997,7 @@
30932997 if (event.getSource() == randomCB)
30942998 {
30952999 copy.random ^= true;
3000
+ objEditor.refreshContents();
30963001 return;
30973002 }
30983003 if (event.getSource() == speedupCB)
....@@ -3316,7 +3221,7 @@
33163221 if (!Globals.ANIMATION)
33173222 {
33183223 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3319
- browser.show();
3224
+ browser.setVisible(true);
33203225 String filename = browser.getFile();
33213226 if (filename != null && filename.length() > 0)
33223227 {
....@@ -3348,6 +3253,7 @@
33483253 callee.refreshContents();
33493254 } else
33503255 {
3256
+ new Exception().printStackTrace();
33513257 System.exit(0);
33523258 }
33533259 }
....@@ -3510,7 +3416,7 @@
35103416 current.fakedepth = (float) fakedepthField.getFloat();
35113417 current.shadowbias = (float) shadowbiasField.getFloat();
35123418
3513
- if (!NumberSlider.frozen)
3419
+ if (!cNumberSlider.frozen)
35143420 {
35153421 //System.out.println("Propagate = " + propagate);
35163422 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3558,6 +3464,7 @@
35583464 || e.getSource() == apertureField
35593465 || e.getSource() == shadowblurField)
35603466 {
3467
+ new Exception().printStackTrace();
35613468 System.exit(0);
35623469 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35633470 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3883,7 +3790,7 @@
38833790
38843791 radioPanel.revalidate();
38853792 radioPanel.repaint();
3886
- ctrlPanel.revalidate(); // ? new
3793
+ ctrlPanel.validate(); // ? new
38873794 ctrlPanel.repaint();
38883795 }
38893796 }
....@@ -4529,8 +4436,8 @@
45294436 //MenuItem normalLensItem;
45304437 MenuItem editCameraItem;
45314438 MenuItem revertCameraItem;
4532
- CheckboxMenuItem toggleLiveItem;
45334439 MenuItem stepItem;
4440
+ CheckboxMenuItem toggleLiveItem;
45344441 CheckboxMenuItem toggleFullScreenItem;
45354442 CheckboxMenuItem toggleTimelineItem;
45364443 CheckboxMenuItem toggleRenderItem;
....@@ -4547,20 +4454,20 @@
45474454 JSplitPane mainPanel;
45484455 JScrollPane scrollpane;
45494456 JPanel toolbarPanel;
4550
- JPanel treePanel;
4457
+ cGridBag treePanel;
45514458 JPanel radioPanel;
45524459 ButtonGroup buttonGroup;
4553
- JPanel ctrlPanel;
4554
- JPanel materialPanel;
4460
+ cGridBag ctrlPanel;
4461
+ cGridBag materialPanel;
45554462 JScrollPane infoPanel;
4556
- JPanel optionsPanel;
4463
+ cGridBag optionsPanel;
45574464 JTabbedPane objectPanel;
45584465 cGridBag XYZPanel;
45594466 JSplitPane gridPanel;
45604467 JSplitPane bigPanel;
45614468 cGridBag bigThree;
4562
- JTabbedPane scenePanel;
4563
- JPanel centralPanel;
4469
+ cGridBag scenePanel;
4470
+ cGridBag centralPanel;
45644471 JSplitPane cameraPanel;
45654472 JPanel timelinePanel;
45664473 JMenuBar timelineMenubar;
....@@ -4613,67 +4520,67 @@
46134520 // MATERIAL
46144521 JLabel materialLabel;
46154522 JLabel colorLabel;
4616
- NumberSlider colorField;
4523
+ cNumberSlider colorField;
46174524 JLabel modulationLabel;
4618
- NumberSlider modulationField;
4525
+ cNumberSlider modulationField;
46194526 JLabel metalnessLabel;
4620
- NumberSlider metalnessField;
4527
+ cNumberSlider metalnessField;
46214528 JLabel diffuseLabel;
4622
- NumberSlider diffuseField;
4529
+ cNumberSlider diffuseField;
46234530 JLabel specularLabel;
4624
- NumberSlider specularField;
4531
+ cNumberSlider specularField;
46254532 JLabel shininessLabel;
4626
- NumberSlider shininessField;
4533
+ cNumberSlider shininessField;
46274534 JLabel shiftLabel;
4628
- NumberSlider shiftField;
4535
+ cNumberSlider shiftField;
46294536 JLabel ambientLabel;
4630
- NumberSlider ambientField;
4537
+ cNumberSlider ambientField;
46314538 JLabel lightareaLabel;
4632
- NumberSlider lightareaField;
4539
+ cNumberSlider lightareaField;
46334540 JLabel diffusenessLabel;
4634
- NumberSlider diffusenessField;
4541
+ cNumberSlider diffusenessField;
46354542 JLabel velvetLabel;
4636
- NumberSlider velvetField;
4543
+ cNumberSlider velvetField;
46374544 JLabel sheenLabel;
4638
- NumberSlider sheenField;
4545
+ cNumberSlider sheenField;
46394546 JLabel subsurfaceLabel;
4640
- NumberSlider subsurfaceField;
4547
+ cNumberSlider subsurfaceField;
46414548 //JLabel bumpLabel;
46424549 //NumberSlider bumpField;
46434550 JLabel backlitLabel;
4644
- NumberSlider backlitField;
4551
+ cNumberSlider backlitField;
46454552 JLabel anisoLabel;
4646
- NumberSlider anisoField;
4553
+ cNumberSlider anisoField;
46474554 JLabel anisoVLabel;
4648
- NumberSlider anisoVField;
4555
+ cNumberSlider anisoVField;
46494556 JLabel cameraLabel;
4650
- NumberSlider cameraField;
4557
+ cNumberSlider cameraField;
46514558 JLabel selfshadowLabel;
4652
- NumberSlider selfshadowField;
4559
+ cNumberSlider selfshadowField;
46534560 JLabel shadowLabel;
4654
- NumberSlider shadowField;
4561
+ cNumberSlider shadowField;
46554562 JLabel textureLabel;
4656
- NumberSlider textureField;
4563
+ cNumberSlider textureField;
46574564 JLabel opacityLabel;
4658
- NumberSlider opacityField;
4565
+ cNumberSlider opacityField;
46594566 JLabel fakedepthLabel;
4660
- NumberSlider fakedepthField;
4567
+ cNumberSlider fakedepthField;
46614568 JLabel shadowbiasLabel;
4662
- NumberSlider shadowbiasField;
4569
+ cNumberSlider shadowbiasField;
46634570 JLabel bumpLabel;
4664
- NumberSlider bumpField;
4571
+ cNumberSlider bumpField;
46654572 JLabel noiseLabel;
4666
- NumberSlider noiseField;
4573
+ cNumberSlider noiseField;
46674574 JLabel powerLabel;
4668
- NumberSlider powerField;
4575
+ cNumberSlider powerField;
46694576 JLabel borderfadeLabel;
4670
- NumberSlider borderfadeField;
4577
+ cNumberSlider borderfadeField;
46714578 JLabel fogLabel;
4672
- NumberSlider fogField;
4579
+ cNumberSlider fogField;
46734580 JLabel opacityPowerLabel;
4674
- NumberSlider opacityPowerField;
4581
+ cNumberSlider opacityPowerField;
46754582 JTree jTree;
46764583 //ObjectUI parent;
46774584
4678
- NumberSlider normalpushField;
4585
+ cNumberSlider normalpushField;
46794586 }