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 cGridBag(); // new GridBagLayout());
365
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
359366 ctrlPanel.setName("Edit");
360367 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,15 +387,15 @@
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());
397
+// treePanel.setLayout(new GridBagLayout());
398
+ //ctrlPanel.setLayout(new GridBagLayout());
390399 //materialPanel.setLayout(new GridBagLayout());
391400
392401 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.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,54 +782,44 @@
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
- cNumberSlider AddSlider(cGridBag 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 {
819824 cGridBag control = new cGridBag();
820825
....@@ -826,12 +831,12 @@
826831 control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827832 combo.setFloat(current);
828833
829
- ctrlPanel.add(control);
834
+ panel.add(control);
830835
831
- return combo;
836
+ return control;
832837 }
833838
834
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, int min, int max, int current)
839
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
835840 {
836841 cGridBag control = new cGridBag();
837842
....@@ -839,25 +844,21 @@
839844
840845 JLabel jlabel = new JLabel(label);
841846 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
842
- ctrlPanel.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
843
- ctrlPanel.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
847
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
844849 combo.setInteger(current);
845850
846
- ctrlPanel.add(control);
851
+ panel.add(control);
847852
848
- return combo;
853
+ return control;
849854 }
850855
851856 JTextArea AddText(cGridBag ctrlPanel, String name)
852857 {
853858 JTextArea text;
854859
855
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
856
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
857860 ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
858861 text.addCaretListener(this);
859
- aConstraints.gridx += 1;
860
- aConstraints.gridwidth = 1;
861862
862863 return text;
863864 }
....@@ -896,7 +897,7 @@
896897
897898 /*
898899 */
899
- void Return() // ObjEditor oe)
900
+ void Return0() // ObjEditor oe)
900901 {
901902 aConstraints.gridy += 1;
902903 aConstraints.gridx = 0;
....@@ -951,37 +952,70 @@
951952
952953 void SetupUI2(ObjEditor oe)
953954 {
954
-// oe.aConstraints.weightx = 0;
955
-// oe.aConstraints.weighty = 0;
956
-// oe.aConstraints.gridx = 0;
957
-// oe.aConstraints.gridy = 0;
958
- 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();
959964
960965 if (!GroupEditor.allparams)
961966 return;
962967
963
- liveCB = AddCheckBox(oe, "Live", copy.live);
964
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
965
- 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");
966974 // Return();
967
- markCB = AddCheckBox(oe, "Mark", copy.marked);
968
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
969
- randomCB = AddCheckBox(oe, "Rand", copy.random);
970
- Return();
971
- resetButton = AddButton(oe, "Reset");
972
- 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");
9731001 // resetAllButton = AddButton(oe, "Reset All");
9741002 // stepAllButton = AddButton(oe, "Step All");
975
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9761003 // Return();
977
- slowerButton = AddButton(oe, "Slow");
978
- fasterButton = AddButton(oe, "Fast");
979
- 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");
9801010
981
- Return();
1011
+ oe.ctrlPanel.add(commandsPanel);
1012
+ oe.ctrlPanel.Return();
9821013
983
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
984
- Return();
1014
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1015
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1016
+ //Return();
1017
+
1018
+ oe.ctrlPanel.Return();
9851019
9861020 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871021 // ObjEditor.aConstraints.gridx += 1;
....@@ -1076,7 +1110,7 @@
10761110 oe.aConstraints.gridwidth = 1;
10771111 /**/
10781112 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1113
+ oe.ctrlPanel.Return();
10801114
10811115 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821116 //textureButton.setEnabled(false);
....@@ -1253,10 +1287,11 @@
12531287 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12541288 //tmp.setName("Edit");
12551289 objectPanel.add(materialPanel);
1256
- JPanel north = new JPanel(new BorderLayout());
1257
- north.setName("Edit");
1258
- north.add(ctrlPanel, BorderLayout.NORTH);
1259
- 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);
12601295 objectPanel.add(infoPanel);
12611296
12621297 /*
....@@ -1415,7 +1450,7 @@
14151450 ctrlPanel.removeAll();
14161451 }
14171452
1418
- void SetupMaterial(cGridBag ctrlPanel)
1453
+ void SetupMaterial(cGridBag panel)
14191454 {
14201455 /*
14211456 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
....@@ -1424,18 +1459,23 @@
14241459
14251460 cGridBag editBar = new cGridBag().setVertical(false);
14261461
1427
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
1462
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1463
+ createMaterialButton.setToolTipText("Create material");
14281464
14291465 /*
14301466 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14311467 */
14321468
1433
- editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints);
1434
- editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints);
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);
14351473 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
14361474 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
14371475
1438
- ctrlPanel.add(editBar);
1476
+ editBar.preferredHeight = 15;
1477
+
1478
+ panel.add(editBar);
14391479
14401480 /**/
14411481 //aConstraints.weighty = 0;
....@@ -1445,17 +1485,13 @@
14451485 //aConstraints.gridx += 1;
14461486 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14471487
1448
- JPanel colorPanel = new JPanel(new BorderLayout());
1449
- colorPanel.setBorder(BorderFactory.createLineBorder(Color.black));
1450
-
14511488 cGridBag colorSection = new cGridBag().setVertical(true);
1452
-
1453
- colorPanel.add(colorSection);
14541489
14551490 cGridBag color = new cGridBag();
14561491 color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
14571492 colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
14581493 color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1494
+ //colorField.preferredWidth = 200;
14591495 colorSection.add(color);
14601496
14611497 cGridBag modulation = new cGridBag();
....@@ -1488,16 +1524,13 @@
14881524 shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
14891525 colorSection.add(shadowbias);
14901526
1491
- ctrlPanel.add(colorPanel);
1527
+ panel.add(new JSeparator());
1528
+
1529
+ panel.add(colorSection);
14921530
14931531 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14941532
1495
- JPanel diffusePanel = new JPanel(new BorderLayout());
1496
- diffusePanel.setBorder(BorderFactory.createLineBorder(Color.black));
1497
-
14981533 cGridBag diffuseSection = new cGridBag().setVertical(true);
1499
-
1500
- diffusePanel.add(diffuseSection);
15011534
15021535 cGridBag diffuse = new cGridBag();
15031536 diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
....@@ -1541,16 +1574,13 @@
15411574 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15421575 diffuseSection.add(fakedepth);
15431576
1544
- ctrlPanel.add(diffusePanel);
1577
+ panel.add(new JSeparator());
1578
+
1579
+ panel.add(diffuseSection);
15451580
15461581 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15471582
1548
- JPanel specularPanel = new JPanel(new BorderLayout());
1549
- specularPanel.setBorder(BorderFactory.createLineBorder(Color.black));
1550
-
15511583 cGridBag specularSection = new cGridBag().setVertical(true);
1552
-
1553
- specularPanel.add(specularSection);
15541584
15551585 cGridBag specular = new cGridBag();
15561586 specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
....@@ -1582,7 +1612,7 @@
15821612 velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15831613 specularSection.add(velvet);
15841614
1585
- shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1);
1615
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
15861616 //Return();
15871617 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
15881618 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
....@@ -1595,16 +1625,13 @@
15951625 // aConstraints.gridwidth = 1;
15961626
15971627
1598
- ctrlPanel.add(specularPanel);
1628
+ panel.add(new JSeparator());
1629
+
1630
+ panel.add(specularSection);
15991631
16001632 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16011633
1602
- JPanel globalPanel = new JPanel(new BorderLayout());
1603
- globalPanel.setBorder(BorderFactory.createLineBorder(Color.black));
1604
-
16051634 cGridBag globalSection = new cGridBag().setVertical(true);
1606
-
1607
- globalPanel.add(globalSection);
16081635
16091636 cGridBag camera = new cGridBag();
16101637 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
....@@ -1630,16 +1657,13 @@
16301657 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16311658 globalSection.add(opacity);
16321659
1633
- ctrlPanel.add(globalPanel);
1660
+ panel.add(new JSeparator());
1661
+
1662
+ panel.add(globalSection);
16341663
16351664 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16361665
1637
- JPanel texturePanel = new JPanel(new BorderLayout());
1638
- texturePanel.setBorder(BorderFactory.createLineBorder(Color.black));
1639
-
16401666 cGridBag textureSection = new cGridBag().setVertical(true);
1641
-
1642
- texturePanel.add(textureSection);
16431667
16441668 cGridBag bump = new cGridBag();
16451669 bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
....@@ -1677,7 +1701,9 @@
16771701 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
16781702 textureSection.add(opacityPower);
16791703
1680
- ctrlPanel.add(texturePanel);
1704
+ panel.add(new JSeparator());
1705
+
1706
+ panel.add(textureSection);
16811707
16821708 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16831709
....@@ -2496,6 +2522,7 @@
24962522 }
24972523 if (input == null)
24982524 {
2525
+ new Exception().printStackTrace();
24992526 System.exit(0);
25002527 }
25012528
....@@ -2970,6 +2997,7 @@
29702997 if (event.getSource() == randomCB)
29712998 {
29722999 copy.random ^= true;
3000
+ objEditor.refreshContents();
29733001 return;
29743002 }
29753003 if (event.getSource() == speedupCB)
....@@ -3193,7 +3221,7 @@
31933221 if (!Globals.ANIMATION)
31943222 {
31953223 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3196
- browser.show();
3224
+ browser.setVisible(true);
31973225 String filename = browser.getFile();
31983226 if (filename != null && filename.length() > 0)
31993227 {
....@@ -3225,6 +3253,7 @@
32253253 callee.refreshContents();
32263254 } else
32273255 {
3256
+ new Exception().printStackTrace();
32283257 System.exit(0);
32293258 }
32303259 }
....@@ -3435,6 +3464,7 @@
34353464 || e.getSource() == apertureField
34363465 || e.getSource() == shadowblurField)
34373466 {
3467
+ new Exception().printStackTrace();
34383468 System.exit(0);
34393469 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34403470 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -4406,8 +4436,8 @@
44064436 //MenuItem normalLensItem;
44074437 MenuItem editCameraItem;
44084438 MenuItem revertCameraItem;
4409
- CheckboxMenuItem toggleLiveItem;
44104439 MenuItem stepItem;
4440
+ CheckboxMenuItem toggleLiveItem;
44114441 CheckboxMenuItem toggleFullScreenItem;
44124442 CheckboxMenuItem toggleTimelineItem;
44134443 CheckboxMenuItem toggleRenderItem;
....@@ -4424,7 +4454,7 @@
44244454 JSplitPane mainPanel;
44254455 JScrollPane scrollpane;
44264456 JPanel toolbarPanel;
4427
- JPanel treePanel;
4457
+ cGridBag treePanel;
44284458 JPanel radioPanel;
44294459 ButtonGroup buttonGroup;
44304460 cGridBag ctrlPanel;