Normand Briere
2019-05-02 a76491b66a2e304d9ae27a162f407b98c70fbafa
ObjEditor.java
....@@ -19,6 +19,8 @@
1919 import //weka.core.
2020 matrix.Matrix;
2121
22
+import grafeme.ui.*;
23
+
2224 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2325 ActionListener, ChangeListener,
2426 InputMethodListener,
....@@ -28,7 +30,12 @@
2830 iSendInfo
2931 //KeyListener
3032 {
33
+ boolean timeline;
34
+ boolean wasFullScreen;
3135
36
+ GroupEditor callee;
37
+ JFrame frame;
38
+
3239 // SCRIPT
3340
3441 transient JFrame textpanel = null;
....@@ -119,51 +126,61 @@
119126 void keyPressed(int key, int modifiers)
120127 {
121128 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
129
+ Globals.theRenderer.keyPressed(key, modifiers);
123130 }
124131 */
125132
126133 static GridBagConstraints aConstraints;
127134 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
135
+
130136 static int GRIDWIDTH = 100; // 4;
131137
132138 public void closeUI()
133139 {
134140 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
141
+// System.out.println("this = " + this);
142
+// System.out.println("objEditor = " + objEditor);
137143 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
144
+// objEditor.ctrlPanel.remove(nameField);
145
+
146
+ objEditor.ctrlPanel.remove(namePanel);
139147
140148 if (!GroupEditor.allparams)
141149 return;
142150
143
- objEditor.ctrlPanel.remove(liveCB);
144
- objEditor.ctrlPanel.remove(hideCB);
145
- objEditor.ctrlPanel.remove(markCB);
146
-
147
- objEditor.ctrlPanel.remove(randomCB);
148
- objEditor.ctrlPanel.remove(speedupCB);
149
- objEditor.ctrlPanel.remove(rewindCB);
150
-
151
- objEditor.ctrlPanel.remove(resetButton);
152
- objEditor.ctrlPanel.remove(stepButton);
153
-// objEditor.ctrlPanel.remove(stepAllButton);
154
-// objEditor.ctrlPanel.remove(resetAllButton);
155
- objEditor.ctrlPanel.remove(link2masterCB);
156
- //objEditor.ctrlPanel.remove(flipVCB);
157
- //objEditor.ctrlPanel.remove(texresMenu);
158
- objEditor.ctrlPanel.remove(slowerButton);
159
- objEditor.ctrlPanel.remove(fasterButton);
160
- 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);
169
+
170
+ objEditor.ctrlPanel.remove(setupPanel);
171
+ objEditor.ctrlPanel.remove(commandsPanel);
172
+ objEditor.ctrlPanel.remove(pushPanel);
173
+ //objEditor.ctrlPanel.remove(fillPanel);
174
+
175
+ //Remove(normalpushField);
161176 }
162177
163178 public ObjEditor GetEditor()
164179 {
165180 return objEditor; //.GetEditor();
166181 }
182
+
183
+ // Sometimes myself, sometimes my callee's.
167184 ObjEditor objEditor;
168185
169186 /*
....@@ -238,7 +255,7 @@
238255 //if (!isDisplayable())
239256 //setUndecorated(true);
240257
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
258
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242259 client = inClient;
243260 copy = localCopy;
244261 copy.editWindow = this;
....@@ -292,16 +309,18 @@
292309 //normalLensItem.addActionListener(this);
293310 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294311 revertCameraItem.addActionListener(this);
295
- cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullItem.addItemListener(this);
297
- toggleFullItem.setState(CameraPane.FULLSCREEN);
312
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
313
+ toggleTimelineItem.addItemListener(this);
314
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
315
+ toggleFullScreenItem.addItemListener(this);
316
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
298317 cameraMenu.add("-");
299318 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
300319 toggleTextureItem.addItemListener(this);
301320 toggleTextureItem.setState(CameraPane.textureon);
302321 cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
303322 toggleLiveItem.addItemListener(this);
304
- toggleLiveItem.setState(CameraPane.isLIVE());
323
+ toggleLiveItem.setState(Globals.isLIVE());
305324 cameraMenu.add(stepItem = new MenuItem("Step"));
306325 stepItem.addActionListener(this);
307326 // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
....@@ -341,21 +360,23 @@
341360 objectPanel = new JTabbedPane();
342361 toolbarPanel = new JPanel();
343362 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
363
+ treePanel = new cGridBag();
345364 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
365
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
347366 ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
367
+ materialPanel = new cGridBag().setVertical(true);
349368 materialPanel.setName("Material");
350369 /*JTextPane*/
351370 infoarea = createTextPane();
371
+ doc = infoarea.getStyledDocument();
372
+
352373 infoarea.setEditable(true);
353374 SetText();
354375 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355376 // infoarea.setOpaque(false);
356377 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
378
+// TEXTAREA infoarea.setLineWrap(true);
379
+// TEXTAREA infoarea.setWrapStyleWord(true);
359380 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
360381 infoPanel.setPreferredSize(new Dimension(50, 200));
361382 infoPanel.setName("Info");
....@@ -366,16 +387,16 @@
366387 mainPanel.setName("Main");
367388 mainPanel.setContinuousLayout(true);
368389 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370390 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
391
+ mainPanel.setDividerLocation(0.5); //1.0);
392
+ mainPanel.setResizeWeight(0.5);
372393
373394 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374395 //mainPanel.setLayout(new GridBagLayout());
375396 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
397
+// treePanel.setLayout(new GridBagLayout());
398
+ //ctrlPanel.setLayout(new GridBagLayout());
399
+ //materialPanel.setLayout(new GridBagLayout());
379400
380401 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381402 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +435,7 @@
414435 static String newline = "\n";
415436 protected static final String buttonString = "JButton";
416437 StyledDocument doc;
417
- JTextArea infoarea;
438
+ JTextPane infoarea;
418439
419440 void ClearInfo()
420441 {
....@@ -481,7 +502,10 @@
481502 }
482503
483504 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
505
+ {
506
+ si.SendInfo(" BBox min: " + minima, "regular");
507
+ si.SendInfo(" BBox max: " + maxima, "regular");
508
+ }
485509
486510 if (sel.bRep != null)
487511 {
....@@ -522,18 +546,18 @@
522546 maxima.y = sel.toParent[3][1];
523547 maxima.z = sel.toParent[3][2];
524548 si.SendInfo(" Orig: " + maxima, "regular");
525
- maxima.x = sel.globalTransform[3][0];
526
- maxima.y = sel.globalTransform[3][1];
527
- maxima.z = sel.globalTransform[3][2];
528
- if (full)
529
- si.SendInfo(" Global Orig: " + maxima, "regular");
530549 maxima.x = sel.toParent[0][0];
531550 maxima.y = sel.toParent[1][1];
532551 maxima.z = sel.toParent[2][2];
533552 si.SendInfo(" Scale: " + maxima, "regular");
534
- maxima.x = sel.globalTransform[0][0];
535
- maxima.y = sel.globalTransform[1][1];
536
- maxima.z = sel.globalTransform[2][2];
553
+ maxima.x = sel.globalTransform[3][0];
554
+ maxima.y = sel.globalTransform[3][1];
555
+ maxima.z = sel.globalTransform[3][2];
556
+ if (full)
557
+ si.SendInfo(" Global Orig: " + maxima, "regular");
558
+ maxima.x = sel.globalTransform[0][0];
559
+ maxima.y = sel.globalTransform[1][1];
560
+ maxima.z = sel.globalTransform[2][2];
537561 if (full)
538562 si.SendInfo(" Global Scale: " + maxima, "regular");
539563 }
....@@ -579,6 +603,9 @@
579603 {
580604 CameraPane.pointflow = (PointFlow) sel;
581605 }
606
+
607
+ si.SendInfo("_____________________", "regular");
608
+ si.SendInfo("", "regular");
582609 }
583610 }
584611
....@@ -594,52 +621,68 @@
594621 }
595622 }
596623
597
- private JTextArea createTextPane()
598
- {
599
- String[] initString =
624
+ void ToggleFullScreen()
600625 {
601
- "This is an editable JTextPane, ", //regular
602
- "another ", //italic
603
- "styled ", //bold
604
- "text ", //small
605
- "component, ", //large
606
- "which supports embedded components..." + newline,//regular
607
- " " + newline, //button
608
- "...and embedded icons..." + newline, //regular
609
- " ", //icon
610
- newline + "JTextPane is a subclass of JEditorPane that "
611
- + "uses a StyledEditorKit and StyledDocument, and provides "
612
- + "cover methods for interacting with those objects."
613
- };
614
-
615
- String[] initStyles =
616
- {
617
- "regular", "italic", "bold", "small", "large",
618
- "regular", "button", "regular", "icon",
619
- "regular"
620
- };
621
-
622
- JTextPane textPane = new JTextPane();
623
- textPane.setEditable(true);
624
- /*StyledDocument*/ doc = textPane.getStyledDocument();
625
- addStylesToDocument(doc);
626
-
627
- try
628
- {
629
- for (int j = 0; j < 2; j++)
630
- {
631
- for (int i = 0; i < initString.length; i++)
626
+ if (CameraPane.FULLSCREEN)
632627 {
633
- doc.insertString(doc.getLength(), initString[i],
634
- doc.getStyle(initStyles[i]));
628
+ frame.getContentPane().remove(/*"Center",*/bigThree);
629
+ framePanel.add(bigThree);
630
+ frame.getContentPane().add(/*"Center",*/framePanel);
631
+ } else
632
+ {
633
+ frame.getContentPane().remove(/*"Center",*/framePanel);
634
+ framePanel.remove(bigThree);
635
+ frame.getContentPane().add(/*"Center",*/bigThree);
635636 }
636
- }
637
- } catch (BadLocationException ble)
638
- {
639
- System.err.println("Couldn't insert initial text into text pane.");
637
+ cameraView.ToggleFullScreen();
640638 }
641639
642
- return new JTextArea(); // textPane;
640
+ private JTextPane createTextPane()
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
+// }
684
+
685
+ return new JTextPane(); // textPane;
643686 }
644687
645688 protected void addStylesToDocument(StyledDocument doc)
....@@ -692,7 +735,7 @@
692735 protected static ImageIcon createImageIcon(String path,
693736 String description)
694737 {
695
- java.net.URL imgURL = GraphreeD.class.getResource(path);
738
+ java.net.URL imgURL = GrafreeD.class.getResource(path);
696739 if (imgURL != null)
697740 {
698741 return new ImageIcon(imgURL, description);
....@@ -739,115 +782,83 @@
739782 JButton slowerButton;
740783 JButton fasterButton;
741784 JButton remarkButton;
785
+
786
+ cGridBag namePanel;
787
+ cGridBag setupPanel;
788
+ cGridBag commandsPanel;
789
+ cGridBag pushPanel;
790
+ cGridBag fillPanel;
742791
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
792
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
744793 {
745794 JCheckBox cb;
746795
747
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
748
- oe.aConstraints.gridwidth = 1; // 3;
749
-// oe.aConstraints.weightx = 1;
750
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
751
- 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);
752797 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
756798
757799 return cb;
758800 }
759801
760
- cButton AddButton(ObjEditor oe, String label)
802
+ cButton AddButton(cGridBag panel, String label)
761803 {
762804 cButton cb;
763805
764
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
765
- oe.aConstraints.gridwidth = 1;
766
-// oe.aConstraints.weightx = 1;
767
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
768
- 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);
769807 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
773808
774809 return cb;
775810 }
776811
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
812
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
778813 {
779814 JComboBox combo;
780815
781
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
782
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
783
- oe.aConstraints.gridx += 1;
816
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
784817 combo.addActionListener(this);
785818
786819 return combo;
787820 }
788821
789
- 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)
790823 {
791
- NumberSlider combo;
824
+ cGridBag control = new cGridBag();
825
+
826
+ cNumberSlider combo;
792827
793828 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
796829 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
797
- aConstraints.gridwidth = 2;
798
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
799
- aConstraints.gridx += 1;
800
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
801
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
802
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
803
- aConstraints.gridx += 1;
804
- aConstraints.gridwidth = 1;
805
-
830
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
806832 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
833
+
834
+ panel.add(control);
835
+
836
+ return control;
813837 }
814838
815
- 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)
816840 {
817
- NumberSlider combo;
841
+ cGridBag control = new cGridBag();
842
+
843
+ cNumberSlider combo;
818844
819845 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822846 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
823
- aConstraints.gridwidth = 2;
824
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
825
- aConstraints.gridx += 1;
826
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
827
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
828
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
829
- aConstraints.gridx += 1;
830
- aConstraints.gridwidth = 1;
831
-
847
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832849 combo.setInteger(current);
833850
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
851
+ panel.add(control);
852
+
853
+ return control;
839854 }
840855
841
- JTextArea AddText(JPanel ctrlPanel, String name)
856
+ JTextArea AddText(cGridBag ctrlPanel, String name)
842857 {
843858 JTextArea text;
844859
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
860
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848861 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
851862
852863 return text;
853864 }
....@@ -877,9 +888,16 @@
877888 objEditor.ctrlPanel.remove(j);
878889 }
879890
891
+ void Remove(cNumberSlider j)
892
+ {
893
+ j.removeChangeListener(this);
894
+ //objEditor.ctrlPanel.remove(j.label);
895
+ objEditor.ctrlPanel.remove(j);
896
+ }
897
+
880898 /*
881899 */
882
- void Return() // ObjEditor oe)
900
+ void Return0() // ObjEditor oe)
883901 {
884902 aConstraints.gridy += 1;
885903 aConstraints.gridx = 0;
....@@ -934,35 +952,71 @@
934952
935953 void SetupUI2(ObjEditor oe)
936954 {
937
-// oe.aConstraints.weightx = 0;
938
-// oe.aConstraints.weighty = 0;
939
-// oe.aConstraints.gridx = 0;
940
-// oe.aConstraints.gridy = 0;
941
- 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();
942964
943965 if (!GroupEditor.allparams)
944966 return;
945967
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- 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");
949974 // Return();
950
- markCB = AddCheckBox(oe, "Mark", copy.marked);
951
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
952
- randomCB = AddCheckBox(oe, "Rand", copy.random);
953
- Return();
954
- resetButton = AddButton(oe, "Reset");
955
- 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");
9561001 // resetAllButton = AddButton(oe, "Reset All");
9571002 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9591003 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- 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");
9631010
964
- Return();
1011
+ oe.ctrlPanel.add(commandsPanel);
1012
+ oe.ctrlPanel.Return();
9651013
1014
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1015
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1016
+ //Return();
1017
+
1018
+ oe.ctrlPanel.Return();
1019
+
9661020 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671021 // ObjEditor.aConstraints.gridx += 1;
9681022
....@@ -1056,7 +1110,7 @@
10561110 oe.aConstraints.gridwidth = 1;
10571111 /**/
10581112 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1113
+ oe.ctrlPanel.Return();
10601114
10611115 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621116 //textureButton.setEnabled(false);
....@@ -1107,7 +1161,7 @@
11071161 //frontScroll.setLabel("------------------------------ XZ (front) ---------------------------------------------------");
11081162 //sideScroll.setLabel("------------------------------- YZ (side) ---------------------------------------------------");
11091163
1110
-// GridBagConstraints gbc = (GridBagConstraints) GraphreeD.clone(aConstraints);
1164
+// GridBagConstraints gbc = (GridBagConstraints) GrafreeD.clone(aConstraints);
11111165 Camera cam = GetCamera(copy, 0);
11121166
11131167 Composite cams = null;
....@@ -1158,10 +1212,22 @@
11581212 //JPanel worldPanel =
11591213 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601214 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1215
+ centralPanel = new cGridBag();
1216
+ centralPanel.preferredWidth = 20;
1217
+ timelinePanel = new JPanel(new BorderLayout());
1218
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11641219
1220
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1221
+ cameraPanel.setContinuousLayout(true);
1222
+ cameraPanel.setOneTouchExpandable(true);
1223
+// cameraPanel.setDividerLocation(0.9);
1224
+// cameraPanel.setDividerSize(9);
1225
+ cameraPanel.setResizeWeight(1.0);
1226
+
1227
+ centralPanel.add(cameraView);
1228
+ //frame.setJMenuBar(timelineMenubar);
1229
+ //centralPanel.add(timelinePanel);
1230
+
11651231 //topView.camera = ;
11661232 //frontView.camera = new Camera(2);
11671233 //sideView.camera = new Camera(3);
....@@ -1177,12 +1243,13 @@
11771243 //frontView.object = copy;
11781244 //sideView.object = copy;
11791245
1180
- XYZPanel = new JPanel();
1181
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1246
+ XYZPanel = new cGridBag().setVertical(true);
1247
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11821248
1183
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1184
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1249
+ XYZPanel.preferredWidth = 5;
1250
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1251
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1252
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
11861253
11871254 /*
11881255 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1191,7 +1258,7 @@
11911258 gridPanel.add(cameraView);
11921259 gridPanel.add(XYZPanel);
11931260 */
1194
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1261
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11951262 gridPanel.setContinuousLayout(true);
11961263 gridPanel.setOneTouchExpandable(true);
11971264 gridPanel.setDividerLocation(1.0);
....@@ -1220,10 +1287,11 @@
12201287 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12211288 //tmp.setName("Edit");
12221289 objectPanel.add(materialPanel);
1223
- JPanel north = new JPanel(new BorderLayout());
1224
- north.setName("Edit");
1225
- north.add(ctrlPanel, BorderLayout.NORTH);
1226
- 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);
12271295 objectPanel.add(infoPanel);
12281296
12291297 /*
....@@ -1244,16 +1312,23 @@
12441312 scrollpane.setWheelScrollingEnabled(true);
12451313 scrollpane.addMouseWheelListener(this); // Default not fast enough
12461314
1247
- /*JTabbedPane*/ jtp = new JTabbedPane();
1248
- jtp.add(scrollpane);
1315
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1316
+ scenePanel.preferredWidth = 7;
1317
+
1318
+ JTabbedPane tabbedPane = new JTabbedPane();
1319
+ tabbedPane.add(scrollpane);
12491320
1250
- jtp.add(FSPane = new cFileSystemPane(this));
1321
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12511322
1252
- optionsPanel = new JPanel(new GridBagLayout());
1323
+ optionsPanel = new cGridBag().setVertical(true);
12531324
12541325 optionsPanel.setName("Options");
1255
- jtp.add(optionsPanel);
1256
-
1326
+
1327
+ AddOptions(optionsPanel); //, aConstraints);
1328
+
1329
+ tabbedPane.add(optionsPanel);
1330
+
1331
+ scenePanel.add(tabbedPane);
12571332
12581333 /*
12591334 cTree jTree = new cTree(null);
....@@ -1275,7 +1350,7 @@
12751350 jtp.add(tree);
12761351 */
12771352
1278
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);
1353
+ bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
12791354 bigPanel.setContinuousLayout(true);
12801355 bigPanel.setOneTouchExpandable(true);
12811356 bigPanel.setDividerLocation(0.8);
....@@ -1287,6 +1362,7 @@
12871362 //bigPanel.setSize(new Dimension(10,10));
12881363 //bigPanel.add(ctrlPanel);
12891364 //bigPanel.add(gridPanel);
1365
+ /**
12901366 bigThree = new JPanel();
12911367 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12921368 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1297,20 +1373,26 @@
12971373 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
12981374 aWindowConstraints.weightx = 0;
12991375 aWindowConstraints.weighty = 1;
1300
- bigThree.add(jtp, aWindowConstraints);
1376
+ bigThree.add(scenePanel, aWindowConstraints);
13011377 aWindowConstraints.weightx = 1;
13021378 aWindowConstraints.gridwidth = 3;
13031379 // aConstraints.gridheight = 3;
13041380 aWindowConstraints.gridx = 1;
13051381 aWindowConstraints.fill = GridBagConstraints.BOTH;
1306
- bigThree.add(cameraPanel, aWindowConstraints);
1382
+ bigThree.add(centralPanel, aWindowConstraints);
13071383 aWindowConstraints.weightx = 0;
13081384 aWindowConstraints.gridx = 4;
13091385 aWindowConstraints.gridwidth = 1;
13101386 // aConstraints.gridheight = 3;
13111387 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13121388 bigThree.add(XYZPanel, aWindowConstraints);
1389
+ /**/
13131390
1391
+ bigThree = new cGridBag();
1392
+ bigThree.addComponent(scenePanel);
1393
+ bigThree.addComponent(centralPanel);
1394
+ bigThree.addComponent(XYZPanel);
1395
+
13141396 // // SIDE EFFECT!!!
13151397 // aConstraints.gridx = 0;
13161398 // aConstraints.gridy = 0;
....@@ -1331,12 +1413,13 @@
13311413 //worldPane.add(bigPanel);
13321414 //worldPane.add(worldPanel);
13331415 /**/
1334
- frame.getContentPane().add(/*"Center",*/framePanel);
1416
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1417
+ frame.add(/*"Center",*/framePanel);
13351418 //frame.getContentPane().add(/*"Center",*/ worldPane);
13361419
1337
-// aConstraints = gbc; // (GridBagConstraints) GraphreeD.clone(gbc);
1420
+// aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13381421
1339
- frame.setSize(800, 600);
1422
+ frame.setSize(1024, 768);
13401423 frame.show();
13411424
13421425 gridPanel.setDividerLocation(1.0);
....@@ -1352,6 +1435,10 @@
13521435 });
13531436 }
13541437
1438
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1439
+ {
1440
+ }
1441
+
13551442 JTree GetTree()
13561443 {
13571444 return objEditor.jTree;
....@@ -1363,260 +1450,170 @@
13631450 ctrlPanel.removeAll();
13641451 }
13651452
1366
- void SetupMaterial(JPanel ctrlPanel)
1453
+ void SetupMaterial(cGridBag panel)
13671454 {
1368
- aConstraints.weighty = 0;
1369
- //aConstraints.weightx = 1;
1370
- /*
1455
+ /*
13711456 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13721457 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1373
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1374
- aConstraints.gridx += 1;
13751458 */
13761459
1377
- aConstraints.gridwidth = 1;
1378
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1379
- aConstraints.gridx += 1;
1380
- aConstraints.weighty = 0;
1381
- 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");
13821464
13831465 /*
13841466 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
13881467 */
13891468
1390
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1391
- 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);
13921475
1393
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1394
-
1395
- aConstraints.gridx += 1;
1396
-
1397
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1398
-
1399
- aConstraints.gridx += 1;
1400
-
1401
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1402
-
1403
- aConstraints.gridx = 0;
1404
- aConstraints.gridy += 1;
1405
- aConstraints.weighty = 0;
1406
- aConstraints.gridwidth = 1;
1476
+ editBar.preferredHeight = 15;
1477
+
1478
+ panel.add(editBar);
1479
+
14071480 /**/
14081481 //aConstraints.weighty = 0;
14091482 ////aConstraints.weightx = 1;
14101483 //aConstraints.weighty = 1;
14111484 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14121485 //aConstraints.gridx += 1;
1413
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1414
- aConstraints.weighty = 0;
1415
- aConstraints.gridx = 0;
1416
- aConstraints.gridy += 1;
1417
- aConstraints.gridwidth = 1;
1486
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14181487
1419
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1420
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1421
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1422
- aConstraints.gridx += 1;
1423
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1424
- //aConstraints.weightx = 0;
1425
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1426
- aConstraints.gridx = 0;
1427
- aConstraints.gridy += 1;
1428
- 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);
14291496
1430
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1431
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1432
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1433
- aConstraints.gridx += 1;
1434
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1435
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1436
- aConstraints.gridx = 0;
1437
- aConstraints.gridy += 1;
1438
- 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);
14391502
1440
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1441
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1442
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1443
- aConstraints.gridx += 1;
1444
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1445
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1446
- aConstraints.gridx = 0;
1447
- aConstraints.gridy += 1;
1448
- 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);
14491508
1450
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1451
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1452
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1453
- aConstraints.gridx += 1;
1454
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1455
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1456
- aConstraints.gridx = 0;
1457
- aConstraints.gridy += 1;
1458
- 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);
14591514
1460
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1461
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1462
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1463
- aConstraints.gridx += 1;
1464
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1465
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1466
- aConstraints.gridx = 0;
1467
- aConstraints.gridy += 1;
1468
- 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);
14691520
1470
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1471
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1472
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1473
- aConstraints.gridx += 1;
1474
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1475
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1476
- aConstraints.gridx = 0;
1477
- aConstraints.gridy += 1;
1478
- 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);
14791526
1480
- //aConstraints.weighty = 1;
1481
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1482
- //aConstraints.gridx += 1;
1483
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1484
- aConstraints.weighty = 0;
1485
- aConstraints.gridx = 0;
1486
- aConstraints.gridy += 1;
1487
- 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);
14881540
1489
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1490
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1491
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1492
- aConstraints.gridx += 1;
1493
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1494
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1495
- aConstraints.gridx = 0;
1496
- aConstraints.gridy += 1;
1497
- 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);
14981546
1499
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1500
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1501
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1502
- aConstraints.gridx += 1;
1503
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1504
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1505
- aConstraints.gridx = 0;
1506
- aConstraints.gridy += 1;
1507
- 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);
15081552
1509
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1510
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1511
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1512
- aConstraints.gridx += 1;
1513
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1514
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1515
- aConstraints.gridx = 0;
1516
- aConstraints.gridy += 1;
1517
- 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);
15181558
1519
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1520
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1521
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1522
- aConstraints.gridx += 1;
1523
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1524
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1525
- aConstraints.gridx = 0;
1526
- aConstraints.gridy += 1;
1527
- 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);
15281564
1529
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1530
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1531
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1532
- aConstraints.gridx += 1;
1533
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1534
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1535
- aConstraints.gridx = 0;
1536
- aConstraints.gridy += 1;
1537
- 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);
15381570
1539
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1540
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1541
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1542
- aConstraints.gridx += 1;
1543
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1544
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1545
- aConstraints.gridx = 0;
1546
- aConstraints.gridy += 1;
1547
- 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);
15481576
1549
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1550
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1551
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1552
- aConstraints.gridx += 1;
1553
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1554
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1555
- aConstraints.gridx = 0;
1556
- aConstraints.gridy += 1;
1557
- 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);
15581584
1559
- //aConstraints.weighty = 1;
1560
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1561
- //aConstraints.gridx += 1;
1562
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1563
- aConstraints.weighty = 0;
1564
- aConstraints.gridx = 0;
1565
- aConstraints.gridy += 1;
1566
- 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);
15671590
1568
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1569
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1570
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1571
- aConstraints.gridx += 1;
1572
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1573
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1574
- aConstraints.gridx = 0;
1575
- aConstraints.gridy += 1;
1576
- 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);
15771596
1578
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1579
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1580
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1581
- aConstraints.gridx += 1;
1582
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1583
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1584
- aConstraints.gridx = 0;
1585
- aConstraints.gridy += 1;
1586
- 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);
15871602
1588
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1589
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1590
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1591
- aConstraints.gridx += 1;
1592
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1593
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1594
- aConstraints.gridx = 0;
1595
- aConstraints.gridy += 1;
1596
- 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);
15971608
1598
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1599
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1600
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1601
- aConstraints.gridx += 1;
1602
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1603
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1604
- aConstraints.gridx = 0;
1605
- aConstraints.gridy += 1;
1606
- 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);
16071614
1608
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1609
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1610
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1611
- aConstraints.gridx += 1;
1612
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1613
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1614
- aConstraints.gridx = 0;
1615
- aConstraints.gridy += 1;
1616
- aConstraints.gridwidth = 1;
1617
-
1618
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1619
- Return();
1615
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1616
+ //Return();
16201617 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16211618 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16221619 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1627,130 +1624,93 @@
16271624 // aConstraints.gridy += 1;
16281625 // aConstraints.gridwidth = 1;
16291626
1630
- //aConstraints.weighty = 1;
1631
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1632
- //aConstraints.gridx += 1;
1633
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1634
- aConstraints.weighty = 0;
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
16381627
1639
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1640
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- 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);
16481635
1649
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1650
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1652
- aConstraints.gridx += 1;
1653
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1654
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1655
- aConstraints.gridx = 0;
1656
- aConstraints.gridy += 1;
1657
- 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);
16581641
1659
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1660
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1661
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1662
- aConstraints.gridx += 1;
1663
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1664
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1665
- aConstraints.gridx = 0;
1666
- aConstraints.gridy += 1;
1667
- 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);
16681647
1669
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1670
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1672
- aConstraints.gridx += 1;
1673
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1674
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1675
- aConstraints.gridx = 0;
1676
- aConstraints.gridy += 1;
1677
- aConstraints.gridwidth = 1;
1678
- 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);
16791653
1680
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1681
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- 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);
16891659
1690
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1691
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- 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);
16991667
1700
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1701
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- 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);
17091673
1710
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1711
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1712
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1713
- aConstraints.gridx += 1;
1714
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1715
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1716
- aConstraints.gridx = 0;
1717
- aConstraints.gridy += 1;
1718
- 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);
17191679
1720
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1721
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1722
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1723
- aConstraints.gridx += 1;
1724
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1725
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1726
- aConstraints.gridx = 0;
1727
- aConstraints.gridy += 1;
1728
- 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);
17291685
1730
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1731
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1732
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1733
- aConstraints.gridx += 1;
1734
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1735
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1736
- aConstraints.gridx = 0;
1737
- aConstraints.gridy += 1;
1738
- 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);
17391691
1740
- //aConstraints.weighty = 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1742
- //aConstraints.gridx += 1;
1743
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1744
- 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);
17451697
1746
- aConstraints.gridx = 0;
1747
- aConstraints.gridy = 0;
1748
- 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);
17491709
17501710 SetMaterial(copy); // .GetMaterial());
17511711
1752
- colorField.addChangeListener(this);
1753
- modulationField.addChangeListener(this);
1712
+ //colorField.addChangeListener(this);
1713
+// modulationField.addChangeListener(this);
17541714 metalnessField.addChangeListener(this);
17551715 diffuseField.addChangeListener(this);
17561716 specularField.addChangeListener(this);
....@@ -1859,19 +1819,21 @@
18591819 }
18601820
18611821 // Images/textures
1862
- if (textures
1863
- && (filename.toLowerCase().endsWith(".jpg")
1864
- || filename.toLowerCase().endsWith(".jpeg")
1865
- || filename.toLowerCase().endsWith(".gif")
1866
- || filename.toLowerCase().endsWith(".png")
1867
- || filename.toLowerCase().endsWith(".tre")
1868
- || filename.toLowerCase().endsWith(".bmp")
1869
- || filename.toLowerCase().endsWith(".tga")
1870
- || filename.toLowerCase().endsWith(".sgi")
1871
- || filename.toLowerCase().endsWith(".tif")
1872
- || filename.toLowerCase().endsWith(".tiff")))
1822
+ if (filename.toLowerCase().endsWith(".jpg")
1823
+ || filename.toLowerCase().endsWith(".jpeg")
1824
+ || filename.toLowerCase().endsWith(".gif")
1825
+ || filename.toLowerCase().endsWith(".png")
1826
+ || filename.toLowerCase().endsWith(".tre")
1827
+ || filename.toLowerCase().endsWith(".bmp")
1828
+ || filename.toLowerCase().endsWith(".tga")
1829
+ || filename.toLowerCase().endsWith(".sgi")
1830
+ || filename.toLowerCase().endsWith(".tif")
1831
+ || filename.toLowerCase().endsWith(".tiff"))
18731832 {
1874
- DropTexture(filename);
1833
+ if (textures)
1834
+ DropTexture(filename);
1835
+ else
1836
+ CreateBillboard(filename);
18751837 continue;
18761838 }
18771839
....@@ -1880,6 +1842,60 @@
18801842 }
18811843
18821844 ResetModel();
1845
+ }
1846
+
1847
+ void CreateBillboard(String filename)
1848
+ {
1849
+ Object3D source = null;
1850
+ Object3D group = copy;
1851
+
1852
+ if (group.selection.size() > 0)
1853
+ {
1854
+ source = group.selection.get(0);
1855
+ }
1856
+
1857
+ Grid grid = new Grid(1,1);
1858
+ grid.material = null;
1859
+
1860
+ grid.toParent = LA.newMatrix();
1861
+ grid.fromParent = LA.newMatrix();
1862
+ LA.matYRotate(grid.toParent, Math.PI/2);
1863
+ LA.matXRotate(grid.toParent, -Math.PI/2);
1864
+ LA.matXRotate(grid.fromParent, Math.PI/2);
1865
+ LA.matYRotate(grid.fromParent, -Math.PI/2);
1866
+
1867
+ BillboardNode bb = new BillboardNode();
1868
+ bb.addChild(grid);
1869
+
1870
+ Object3D newgroup = new Object3D();
1871
+ newgroup.CreateMaterial();
1872
+
1873
+ File file = new File(filename);
1874
+ newgroup.name = file.getName();
1875
+ newgroup.addChild(bb);
1876
+
1877
+ Object3D main = newgroup;
1878
+
1879
+ main.SetPigmentTexture(filename);
1880
+
1881
+ if (source != null)
1882
+ {
1883
+ main.material = new cMaterial(source.material);
1884
+ if (main.projectedVertices.length < source.projectedVertices.length)
1885
+ {
1886
+ main.projectedVertices = new Object3D.cVector2[source.projectedVertices.length];
1887
+ }
1888
+
1889
+ for (int i=0; i<source.projectedVertices.length; i++)
1890
+ {
1891
+ main.projectedVertices[i].x = source.projectedVertices[i].x;
1892
+ main.projectedVertices[i].y = source.projectedVertices[i].y;
1893
+ }
1894
+
1895
+ main.texres = source.texres;
1896
+ }
1897
+
1898
+ makeSomething(newgroup, false);
18831899 }
18841900
18851901 Point location;
....@@ -2138,6 +2154,8 @@
21382154 {
21392155 Mocap sel = (Mocap) copy.selection.get(0);
21402156
2157
+ sel.SetCurrentBones(sel.frame);
2158
+
21412159 sel.fullname = fullname;
21422160
21432161 if (changename)
....@@ -2151,14 +2169,18 @@
21512169 sel.smoothed = false;
21522170
21532171 // if (!changename)
2154
- sel.SetPositionDelta(false, true, true, true/*?*/); // false
2172
+ //sel.SetPositionDelta(false, true, true, true/*?*/); // false
2173
+ sel.SetGlobalTransform();
2174
+ sel.LoadData();
2175
+ sel.Rewind();
2176
+ sel.Fade();
21552177 // sel.setPose(0);
21562178 refreshContents();
21572179 } else
21582180 {
21592181 mocap.Reset();
21602182 // new skeleton
2161
- makeSomething(mocap, false); // true);
2183
+ makeSomething(mocap, true); // true);
21622184 }
21632185 } catch (Exception e)
21642186 {
....@@ -2185,6 +2207,8 @@
21852207 {
21862208 Mocap sel = (Mocap) select;
21872209
2210
+ sel.SetCurrentBones(sel.frame);
2211
+
21882212 File file = new File(fullname);
21892213
21902214 // Mocap mocap = new Mocap("Mocap" + file.getName());
....@@ -2251,7 +2275,11 @@
22512275
22522276 if (!changename)
22532277 {
2254
- sel.SetPositionDelta(false, true, true, true/*?*/);
2278
+ //sel.SetPositionDelta(false, true, true, true/*?*/);
2279
+ sel.SetGlobalTransform();
2280
+ sel.LoadData();
2281
+ sel.Rewind();
2282
+ sel.Fade();
22552283 }
22562284
22572285 // sel.setPose(0);
....@@ -2345,7 +2373,7 @@
23452373
23462374 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23472375 {
2348
- if (GraphreeD.standAlone)
2376
+ if (GrafreeD.standAlone)
23492377 {
23502378 /**/
23512379 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
....@@ -2494,6 +2522,7 @@
24942522 }
24952523 if (input == null)
24962524 {
2525
+ new Exception().printStackTrace();
24972526 System.exit(0);
24982527 }
24992528
....@@ -2890,20 +2919,37 @@
28902919 // june 2013 copy.HardTouch();
28912920 cameraView.repaint();
28922921 return;
2893
- } else if (event.getSource() == toggleFullItem)
2922
+ } else if (event.getSource() == toggleTimelineItem)
28942923 {
2895
- if (CameraPane.FULLSCREEN)
2924
+ timeline ^= true;
2925
+
2926
+ if (timeline)
28962927 {
2897
- frame.getContentPane().remove(/*"Center",*/bigThree);
2898
- framePanel.add(bigThree);
2899
- frame.getContentPane().add(/*"Center",*/framePanel);
2900
- } else
2901
- {
2902
- frame.getContentPane().remove(/*"Center",*/framePanel);
2903
- frame.getContentPane().add(/*"Center",*/bigThree);
2928
+ centralPanel.remove(cameraView);
2929
+ cameraPanel.add(cameraView);
2930
+ centralPanel.add(cameraPanel);
2931
+ frame.setJMenuBar(timelineMenubar);
2932
+ wasFullScreen = CameraPane.FULLSCREEN;
2933
+ if (!CameraPane.FULLSCREEN)
2934
+ ToggleFullScreen();
2935
+ toggleFullScreenItem.setEnabled(false);
29042936 }
2937
+ else
2938
+ {
2939
+ centralPanel.remove(cameraPanel);
2940
+ centralPanel.add(cameraView);
2941
+ frame.setJMenuBar(null);
2942
+ if (!wasFullScreen)
2943
+ ToggleFullScreen();
2944
+ toggleFullScreenItem.setEnabled(true);
2945
+ }
2946
+
29052947 frame.validate();
2906
- cameraView.ToggleFullScreen();
2948
+ return;
2949
+ } else if (event.getSource() == toggleFullScreenItem)
2950
+ {
2951
+ ToggleFullScreen();
2952
+ frame.validate();
29072953
29082954 return;
29092955 } else if (event.getSource() == toggleRandomItem)
....@@ -2951,6 +2997,7 @@
29512997 if (event.getSource() == randomCB)
29522998 {
29532999 copy.random ^= true;
3000
+ objEditor.refreshContents();
29543001 return;
29553002 }
29563003 if (event.getSource() == speedupCB)
....@@ -3013,7 +3060,8 @@
30133060 objEditor.refreshContents();
30143061 } else if (event.getSource() == stepItem)
30153062 {
3016
- cameraView.ONESTEP = true;
3063
+ //cameraView.ONESTEP = true;
3064
+ Globals.ONESTEP = true;
30173065 cameraView.repaint();
30183066 return;
30193067 } else if (event.getSource() == stepButton)
....@@ -3152,9 +3200,9 @@
31523200 cameraView.RevertCamera();
31533201 cameraView.repaint();
31543202 return;
3155
- } else if (event.getSource() == textureButton)
3156
- {
3157
- return; // true;
3203
+// } else if (event.getSource() == textureButton)
3204
+// {
3205
+// return; // true;
31583206 } else // combos...
31593207 if (event.getSource() == texresMenu)
31603208 {
....@@ -3170,25 +3218,25 @@
31703218
31713219 void ToggleAnimation()
31723220 {
3173
- if (!CameraPane.ANIMATION)
3221
+ if (!Globals.ANIMATION)
31743222 {
31753223 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3176
- browser.show();
3224
+ browser.setVisible(true);
31773225 String filename = browser.getFile();
31783226 if (filename != null && filename.length() > 0)
31793227 {
3180
- CameraPane.filename = browser.getDirectory() + filename;
3228
+ Globals.filename = browser.getDirectory() + filename;
31813229 //CameraPane.framecount = 0;
3182
- CameraPane.imagecount = 0;
3230
+ Globals.imagecount = 0;
31833231
3184
- CameraPane.ANIMATION ^= true;
3232
+ Globals.ANIMATION ^= true;
31853233
3186
- GraphreeD.wav.cursor = 0;
3187
- GraphreeD.wav.loop = 0;
3234
+ GrafreeD.wav.cursor = 0;
3235
+ GrafreeD.wav.loop = 0;
31883236 }
31893237 } else
31903238 {
3191
- CameraPane.ANIMATION ^= true;
3239
+ Globals.ANIMATION ^= true;
31923240 }
31933241 }
31943242
....@@ -3205,6 +3253,7 @@
32053253 callee.refreshContents();
32063254 } else
32073255 {
3256
+ new Exception().printStackTrace();
32083257 System.exit(0);
32093258 }
32103259 }
....@@ -3367,7 +3416,7 @@
33673416 current.fakedepth = (float) fakedepthField.getFloat();
33683417 current.shadowbias = (float) shadowbiasField.getFloat();
33693418
3370
- if (!NumberSlider.frozen)
3419
+ if (!cNumberSlider.frozen)
33713420 {
33723421 //System.out.println("Propagate = " + propagate);
33733422 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3415,6 +3464,7 @@
34153464 || e.getSource() == apertureField
34163465 || e.getSource() == shadowblurField)
34173466 {
3467
+ new Exception().printStackTrace();
34183468 System.exit(0);
34193469 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34203470 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3441,7 +3491,13 @@
34413491 //System.out.println("PARENT = " + parent);
34423492 //if (parent != null)
34433493 // parent.applySelf();
3444
- refreshContents();
3494
+ if (e.getSource() == normalpushField)
3495
+ {
3496
+ objEditor.refreshContents();
3497
+ //Refresh();
3498
+ }
3499
+ else
3500
+ refreshContents();
34453501 // ??? client.refreshEditWindow();
34463502 }
34473503 //else
....@@ -3453,7 +3509,7 @@
34533509 //group.name = nameField.getText();
34543510 //objEditor.applySelf();
34553511
3456
- assert (objEditor == this);
3512
+ // OCT2018: assert (objEditor == this);
34573513 if (copy.selection == null || copy.selection.size() == 0)
34583514 //super.applySelf()
34593515 ; else
....@@ -3477,12 +3533,18 @@
34773533 objEditor.copy = keep;
34783534 }
34793535 }
3536
+
3537
+ if (normalpushField != null)
3538
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
34803539 }
34813540
34823541 void SnapObject()
34833542 {
3484
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3485
- SnapObject(obj);
3543
+ if (copy.selection.size() > 0)
3544
+ {
3545
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3546
+ SnapObject(obj);
3547
+ }
34863548 }
34873549
34883550 void SnapObject(Object3D obj)
....@@ -3596,7 +3658,7 @@
35963658
35973659 if (obj.parent != null)
35983660 {
3599
- obj.parent.TransformToWorld(interest);
3661
+// obj.parent.TransformToWorld(interest);
36003662 }
36013663
36023664 if (!CameraPane.TRACK)
....@@ -3728,7 +3790,7 @@
37283790
37293791 radioPanel.revalidate();
37303792 radioPanel.repaint();
3731
- ctrlPanel.revalidate(); // ? new
3793
+ ctrlPanel.validate(); // ? new
37323794 ctrlPanel.repaint();
37333795 }
37343796 }
....@@ -4085,7 +4147,7 @@
40854147
40864148 void load() // throws ClassNotFoundException
40874149 {
4088
- if (GraphreeD.standAlone)
4150
+ if (GrafreeD.standAlone)
40894151 {
40904152 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
40914153 browser.show();
....@@ -4190,7 +4252,7 @@
41904252
41914253 void saveAs()
41924254 {
4193
- if (GraphreeD.standAlone)
4255
+ if (GrafreeD.standAlone)
41944256 {
41954257 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
41964258 browser.setVisible(true);
....@@ -4213,10 +4275,20 @@
42134275
42144276 Object3D object = copy.selection.get(0);
42154277
4278
+ FileObject fileobj = null;
4279
+
4280
+ if (object instanceof FileObject)
4281
+ fileobj = (FileObject)object;
4282
+
42164283 if (object.fileparent != null)
42174284 {
4218
- FileObject fileobj = (FileObject) object.fileparent;
4285
+ assert(fileobj == null);
42194286
4287
+ fileobj = (FileObject) object.fileparent;
4288
+ }
4289
+
4290
+ if (fileobj != null)
4291
+ {
42204292 System.out.println("WriteObject " + object + " : " + fileobj.name);
42214293 WriteObject(object, fileobj.name);
42224294 }
....@@ -4259,7 +4331,7 @@
42594331 }
42604332 }
42614333 else
4262
- //if (GraphreeD.standAlone)
4334
+ //if (GrafreeD.standAlone)
42634335 {
42644336 FileDialog browser = new FileDialog(frame, "Export", FileDialog.SAVE);
42654337 browser.setVisible(true);
....@@ -4291,7 +4363,7 @@
42914363 Object3D objectparent = obj.parent;
42924364 obj.parent = null;
42934365
4294
- Object3D object = (Object3D) GraphreeD.clone(obj);
4366
+ Object3D object = (Object3D) GrafreeD.clone(obj);
42954367
42964368 obj.parent = objectparent;
42974369
....@@ -4325,7 +4397,7 @@
43254397 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43264398 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43274399 copy.generatePOV(buffer);
4328
- if (GraphreeD.standAlone)
4400
+ if (GrafreeD.standAlone)
43294401 {
43304402 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43314403 browser.show();
....@@ -4364,9 +4436,10 @@
43644436 //MenuItem normalLensItem;
43654437 MenuItem editCameraItem;
43664438 MenuItem revertCameraItem;
4367
- CheckboxMenuItem toggleLiveItem;
43684439 MenuItem stepItem;
4369
- CheckboxMenuItem toggleFullItem;
4440
+ CheckboxMenuItem toggleLiveItem;
4441
+ CheckboxMenuItem toggleFullScreenItem;
4442
+ CheckboxMenuItem toggleTimelineItem;
43704443 CheckboxMenuItem toggleRenderItem;
43714444 CheckboxMenuItem toggleDebugItem;
43724445 CheckboxMenuItem toggleFrustumItem;
....@@ -4381,23 +4454,26 @@
43814454 JSplitPane mainPanel;
43824455 JScrollPane scrollpane;
43834456 JPanel toolbarPanel;
4384
- JPanel treePanel;
4457
+ cGridBag treePanel;
43854458 JPanel radioPanel;
43864459 ButtonGroup buttonGroup;
4387
- JPanel ctrlPanel;
4388
- JPanel materialPanel;
4460
+ cGridBag ctrlPanel;
4461
+ cGridBag materialPanel;
43894462 JScrollPane infoPanel;
4390
- JPanel optionsPanel;
4463
+ cGridBag optionsPanel;
43914464 JTabbedPane objectPanel;
4392
- JPanel XYZPanel;
4465
+ cGridBag XYZPanel;
43934466 JSplitPane gridPanel;
43944467 JSplitPane bigPanel;
4395
- JPanel bigThree;
4396
- JTabbedPane jtp;
4397
- JPanel cameraPanel;
4468
+ cGridBag bigThree;
4469
+ cGridBag scenePanel;
4470
+ cGridBag centralPanel;
4471
+ JSplitPane cameraPanel;
4472
+ JPanel timelinePanel;
4473
+ JMenuBar timelineMenubar;
43984474 JSplitPane framePanel;
43994475 JTextArea/*Field*/ nameField;
4400
- cButton textureButton;
4476
+ //cButton textureButton;
44014477 cButton okButton;
44024478 cButton applyButton;
44034479 cButton cancelButton;
....@@ -4444,65 +4520,67 @@
44444520 // MATERIAL
44454521 JLabel materialLabel;
44464522 JLabel colorLabel;
4447
- NumberSlider colorField;
4523
+ cNumberSlider colorField;
44484524 JLabel modulationLabel;
4449
- NumberSlider modulationField;
4525
+ cNumberSlider modulationField;
44504526 JLabel metalnessLabel;
4451
- NumberSlider metalnessField;
4527
+ cNumberSlider metalnessField;
44524528 JLabel diffuseLabel;
4453
- NumberSlider diffuseField;
4529
+ cNumberSlider diffuseField;
44544530 JLabel specularLabel;
4455
- NumberSlider specularField;
4531
+ cNumberSlider specularField;
44564532 JLabel shininessLabel;
4457
- NumberSlider shininessField;
4533
+ cNumberSlider shininessField;
44584534 JLabel shiftLabel;
4459
- NumberSlider shiftField;
4535
+ cNumberSlider shiftField;
44604536 JLabel ambientLabel;
4461
- NumberSlider ambientField;
4537
+ cNumberSlider ambientField;
44624538 JLabel lightareaLabel;
4463
- NumberSlider lightareaField;
4539
+ cNumberSlider lightareaField;
44644540 JLabel diffusenessLabel;
4465
- NumberSlider diffusenessField;
4541
+ cNumberSlider diffusenessField;
44664542 JLabel velvetLabel;
4467
- NumberSlider velvetField;
4543
+ cNumberSlider velvetField;
44684544 JLabel sheenLabel;
4469
- NumberSlider sheenField;
4545
+ cNumberSlider sheenField;
44704546 JLabel subsurfaceLabel;
4471
- NumberSlider subsurfaceField;
4547
+ cNumberSlider subsurfaceField;
44724548 //JLabel bumpLabel;
44734549 //NumberSlider bumpField;
44744550 JLabel backlitLabel;
4475
- NumberSlider backlitField;
4551
+ cNumberSlider backlitField;
44764552 JLabel anisoLabel;
4477
- NumberSlider anisoField;
4553
+ cNumberSlider anisoField;
44784554 JLabel anisoVLabel;
4479
- NumberSlider anisoVField;
4555
+ cNumberSlider anisoVField;
44804556 JLabel cameraLabel;
4481
- NumberSlider cameraField;
4557
+ cNumberSlider cameraField;
44824558 JLabel selfshadowLabel;
4483
- NumberSlider selfshadowField;
4559
+ cNumberSlider selfshadowField;
44844560 JLabel shadowLabel;
4485
- NumberSlider shadowField;
4561
+ cNumberSlider shadowField;
44864562 JLabel textureLabel;
4487
- NumberSlider textureField;
4563
+ cNumberSlider textureField;
44884564 JLabel opacityLabel;
4489
- NumberSlider opacityField;
4565
+ cNumberSlider opacityField;
44904566 JLabel fakedepthLabel;
4491
- NumberSlider fakedepthField;
4567
+ cNumberSlider fakedepthField;
44924568 JLabel shadowbiasLabel;
4493
- NumberSlider shadowbiasField;
4569
+ cNumberSlider shadowbiasField;
44944570 JLabel bumpLabel;
4495
- NumberSlider bumpField;
4571
+ cNumberSlider bumpField;
44964572 JLabel noiseLabel;
4497
- NumberSlider noiseField;
4573
+ cNumberSlider noiseField;
44984574 JLabel powerLabel;
4499
- NumberSlider powerField;
4575
+ cNumberSlider powerField;
45004576 JLabel borderfadeLabel;
4501
- NumberSlider borderfadeField;
4577
+ cNumberSlider borderfadeField;
45024578 JLabel fogLabel;
4503
- NumberSlider fogField;
4579
+ cNumberSlider fogField;
45044580 JLabel opacityPowerLabel;
4505
- NumberSlider opacityPowerField;
4581
+ cNumberSlider opacityPowerField;
45064582 JTree jTree;
45074583 //ObjectUI parent;
4584
+
4585
+ cNumberSlider normalpushField;
45084586 }