Normand Briere
2019-05-01 a742f6cebf1d471217d836e07934e5c02c22b6db
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,60 @@
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);
139145
140146 if (!GroupEditor.allparams)
141147 return;
142148
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);
149
+// objEditor.ctrlPanel.remove(liveCB);
150
+// objEditor.ctrlPanel.remove(hideCB);
151
+// objEditor.ctrlPanel.remove(markCB);
152
+//
153
+// objEditor.ctrlPanel.remove(randomCB);
154
+// objEditor.ctrlPanel.remove(speedupCB);
155
+// objEditor.ctrlPanel.remove(rewindCB);
156
+//
157
+// objEditor.ctrlPanel.remove(resetButton);
158
+// objEditor.ctrlPanel.remove(stepButton);
159
+//// objEditor.ctrlPanel.remove(stepAllButton);
160
+//// objEditor.ctrlPanel.remove(resetAllButton);
161
+// objEditor.ctrlPanel.remove(link2masterCB);
162
+// //objEditor.ctrlPanel.remove(flipVCB);
163
+// //objEditor.ctrlPanel.remove(texresMenu);
164
+// objEditor.ctrlPanel.remove(slowerButton);
165
+// objEditor.ctrlPanel.remove(fasterButton);
166
+// objEditor.ctrlPanel.remove(remarkButton);
167
+
168
+ objEditor.ctrlPanel.remove(namePanel);
169
+ objEditor.ctrlPanel.remove(setupPanel);
170
+ objEditor.ctrlPanel.remove(commandsPanel);
171
+ objEditor.ctrlPanel.remove(pushPanel);
172
+ //objEditor.ctrlPanel.remove(fillPanel);
173
+
174
+ //Remove(normalpushField);
161175 }
162176
163177 public ObjEditor GetEditor()
164178 {
165179 return objEditor; //.GetEditor();
166180 }
181
+
182
+ // Sometimes myself, sometimes my callee's.
167183 ObjEditor objEditor;
168184
169185 /*
....@@ -238,7 +254,7 @@
238254 //if (!isDisplayable())
239255 //setUndecorated(true);
240256
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
257
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242258 client = inClient;
243259 copy = localCopy;
244260 copy.editWindow = this;
....@@ -292,16 +308,18 @@
292308 //normalLensItem.addActionListener(this);
293309 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294310 revertCameraItem.addActionListener(this);
295
- cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullItem.addItemListener(this);
297
- toggleFullItem.setState(CameraPane.FULLSCREEN);
311
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
312
+ toggleTimelineItem.addItemListener(this);
313
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
314
+ toggleFullScreenItem.addItemListener(this);
315
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
298316 cameraMenu.add("-");
299317 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
300318 toggleTextureItem.addItemListener(this);
301319 toggleTextureItem.setState(CameraPane.textureon);
302320 cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
303321 toggleLiveItem.addItemListener(this);
304
- toggleLiveItem.setState(CameraPane.isLIVE());
322
+ toggleLiveItem.setState(Globals.isLIVE());
305323 cameraMenu.add(stepItem = new MenuItem("Step"));
306324 stepItem.addActionListener(this);
307325 // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
....@@ -341,21 +359,23 @@
341359 objectPanel = new JTabbedPane();
342360 toolbarPanel = new JPanel();
343361 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
362
+ treePanel = new cGridBag();
345363 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
364
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
347365 ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
366
+ materialPanel = new cGridBag().setVertical(true);
349367 materialPanel.setName("Material");
350368 /*JTextPane*/
351369 infoarea = createTextPane();
370
+ doc = infoarea.getStyledDocument();
371
+
352372 infoarea.setEditable(true);
353373 SetText();
354374 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355375 // infoarea.setOpaque(false);
356376 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
377
+// TEXTAREA infoarea.setLineWrap(true);
378
+// TEXTAREA infoarea.setWrapStyleWord(true);
359379 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
360380 infoPanel.setPreferredSize(new Dimension(50, 200));
361381 infoPanel.setName("Info");
....@@ -366,16 +386,16 @@
366386 mainPanel.setName("Main");
367387 mainPanel.setContinuousLayout(true);
368388 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370389 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
390
+ mainPanel.setDividerLocation(0.5); //1.0);
391
+ mainPanel.setResizeWeight(0.5);
372392
373393 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374394 //mainPanel.setLayout(new GridBagLayout());
375395 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
396
+// treePanel.setLayout(new GridBagLayout());
397
+ //ctrlPanel.setLayout(new GridBagLayout());
398
+ //materialPanel.setLayout(new GridBagLayout());
379399
380400 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381401 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +434,7 @@
414434 static String newline = "\n";
415435 protected static final String buttonString = "JButton";
416436 StyledDocument doc;
417
- JTextArea infoarea;
437
+ JTextPane infoarea;
418438
419439 void ClearInfo()
420440 {
....@@ -481,7 +501,10 @@
481501 }
482502
483503 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
504
+ {
505
+ si.SendInfo(" BBox min: " + minima, "regular");
506
+ si.SendInfo(" BBox max: " + maxima, "regular");
507
+ }
485508
486509 if (sel.bRep != null)
487510 {
....@@ -522,18 +545,18 @@
522545 maxima.y = sel.toParent[3][1];
523546 maxima.z = sel.toParent[3][2];
524547 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");
530548 maxima.x = sel.toParent[0][0];
531549 maxima.y = sel.toParent[1][1];
532550 maxima.z = sel.toParent[2][2];
533551 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];
552
+ maxima.x = sel.globalTransform[3][0];
553
+ maxima.y = sel.globalTransform[3][1];
554
+ maxima.z = sel.globalTransform[3][2];
555
+ if (full)
556
+ si.SendInfo(" Global Orig: " + maxima, "regular");
557
+ maxima.x = sel.globalTransform[0][0];
558
+ maxima.y = sel.globalTransform[1][1];
559
+ maxima.z = sel.globalTransform[2][2];
537560 if (full)
538561 si.SendInfo(" Global Scale: " + maxima, "regular");
539562 }
....@@ -579,6 +602,9 @@
579602 {
580603 CameraPane.pointflow = (PointFlow) sel;
581604 }
605
+
606
+ si.SendInfo("_____________________", "regular");
607
+ si.SendInfo("", "regular");
582608 }
583609 }
584610
....@@ -594,52 +620,68 @@
594620 }
595621 }
596622
597
- private JTextArea createTextPane()
598
- {
599
- String[] initString =
623
+ void ToggleFullScreen()
600624 {
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++)
625
+ if (CameraPane.FULLSCREEN)
632626 {
633
- doc.insertString(doc.getLength(), initString[i],
634
- doc.getStyle(initStyles[i]));
627
+ frame.getContentPane().remove(/*"Center",*/bigThree);
628
+ framePanel.add(bigThree);
629
+ frame.getContentPane().add(/*"Center",*/framePanel);
630
+ } else
631
+ {
632
+ frame.getContentPane().remove(/*"Center",*/framePanel);
633
+ framePanel.remove(bigThree);
634
+ frame.getContentPane().add(/*"Center",*/bigThree);
635635 }
636
- }
637
- } catch (BadLocationException ble)
638
- {
639
- System.err.println("Couldn't insert initial text into text pane.");
636
+ cameraView.ToggleFullScreen();
640637 }
641638
642
- return new JTextArea(); // textPane;
639
+ private JTextPane createTextPane()
640
+ {
641
+// TEXTAREA String[] initString =
642
+// {
643
+// "This is an editable JTextPane, ", //regular
644
+// "another ", //italic
645
+// "styled ", //bold
646
+// "text ", //small
647
+// "component, ", //large
648
+// "which supports embedded components..." + newline,//regular
649
+// " " + newline, //button
650
+// "...and embedded icons..." + newline, //regular
651
+// " ", //icon
652
+// newline + "JTextPane is a subclass of JEditorPane that "
653
+// + "uses a StyledEditorKit and StyledDocument, and provides "
654
+// + "cover methods for interacting with those objects."
655
+// };
656
+//
657
+// String[] initStyles =
658
+// {
659
+// "regular", "italic", "bold", "small", "large",
660
+// "regular", "button", "regular", "icon",
661
+// "regular"
662
+// };
663
+//
664
+// JTextPane textPane = new JTextPane();
665
+// textPane.setEditable(true);
666
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
667
+// addStylesToDocument(doc);
668
+//
669
+// try
670
+// {
671
+// for (int j = 0; j < 2; j++)
672
+// {
673
+// for (int i = 0; i < initString.length; i++)
674
+// {
675
+// doc.insertString(doc.getLength(), initString[i],
676
+// doc.getStyle(initStyles[i]));
677
+// }
678
+// }
679
+// } catch (BadLocationException ble)
680
+// {
681
+// System.err.println("Couldn't insert initial text into text pane.");
682
+// }
683
+
684
+ return new JTextPane(); // textPane;
643685 }
644686
645687 protected void addStylesToDocument(StyledDocument doc)
....@@ -692,7 +734,7 @@
692734 protected static ImageIcon createImageIcon(String path,
693735 String description)
694736 {
695
- java.net.URL imgURL = GraphreeD.class.getResource(path);
737
+ java.net.URL imgURL = GrafreeD.class.getResource(path);
696738 if (imgURL != null)
697739 {
698740 return new ImageIcon(imgURL, description);
....@@ -739,115 +781,83 @@
739781 JButton slowerButton;
740782 JButton fasterButton;
741783 JButton remarkButton;
784
+
785
+ cGridBag namePanel;
786
+ cGridBag setupPanel;
787
+ cGridBag commandsPanel;
788
+ cGridBag pushPanel;
789
+ cGridBag fillPanel;
742790
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
791
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
744792 {
745793 JCheckBox cb;
746794
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);
795
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
752796 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
756797
757798 return cb;
758799 }
759800
760
- cButton AddButton(ObjEditor oe, String label)
801
+ cButton AddButton(cGridBag panel, String label)
761802 {
762803 cButton cb;
763804
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);
805
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
769806 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
773807
774808 return cb;
775809 }
776810
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
811
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
778812 {
779813 JComboBox combo;
780814
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;
815
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
784816 combo.addActionListener(this);
785817
786818 return combo;
787819 }
788820
789
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
821
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
790822 {
791
- NumberSlider combo;
823
+ cGridBag control = new cGridBag();
824
+
825
+ cNumberSlider combo;
792826
793827 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
796828 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
-
829
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
806831 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
832
+
833
+ panel.add(control);
834
+
835
+ return control;
813836 }
814837
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
838
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
816839 {
817
- NumberSlider combo;
840
+ cGridBag control = new cGridBag();
841
+
842
+ cNumberSlider combo;
818843
819844 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822845 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
-
846
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
847
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832848 combo.setInteger(current);
833849
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
850
+ panel.add(control);
851
+
852
+ return control;
839853 }
840854
841
- JTextArea AddText(JPanel ctrlPanel, String name)
855
+ JTextArea AddText(cGridBag ctrlPanel, String name)
842856 {
843857 JTextArea text;
844858
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
859
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848860 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
851861
852862 return text;
853863 }
....@@ -877,9 +887,16 @@
877887 objEditor.ctrlPanel.remove(j);
878888 }
879889
890
+ void Remove(cNumberSlider j)
891
+ {
892
+ j.removeChangeListener(this);
893
+ //objEditor.ctrlPanel.remove(j.label);
894
+ objEditor.ctrlPanel.remove(j);
895
+ }
896
+
880897 /*
881898 */
882
- void Return() // ObjEditor oe)
899
+ void Return0() // ObjEditor oe)
883900 {
884901 aConstraints.gridy += 1;
885902 aConstraints.gridx = 0;
....@@ -934,35 +951,54 @@
934951
935952 void SetupUI2(ObjEditor oe)
936953 {
937
-// oe.aConstraints.weightx = 0;
938
-// oe.aConstraints.weighty = 0;
939
-// oe.aConstraints.gridx = 0;
940
-// oe.aConstraints.gridy = 0;
941
- SetupName(oe);
954
+ //SetupName(oe);
955
+
956
+ namePanel = new cGridBag();
957
+
958
+ nameField = AddText(namePanel, copy.GetName());
959
+ namePanel.add(nameField);
960
+ oe.ctrlPanel.add(namePanel);
961
+
962
+ oe.ctrlPanel.Return();
942963
943964 if (!GroupEditor.allparams)
944965 return;
945966
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
967
+ setupPanel = new cGridBag().setVertical(false);
968
+
969
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
970
+ if (Globals.ADVANCED)
971
+ link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
972
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
949973 // 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");
974
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
975
+ rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind);
976
+ randomCB = AddCheckBox(setupPanel, "Rand", copy.random);
977
+
978
+ oe.ctrlPanel.add(setupPanel);
979
+ oe.ctrlPanel.Return();
980
+
981
+ commandsPanel = new cGridBag().setVertical(false);
982
+
983
+ resetButton = AddButton(commandsPanel, "Reset");
984
+ stepButton = AddButton(commandsPanel, "Step");
956985 // resetAllButton = AddButton(oe, "Reset All");
957986 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
987
+ speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
959988 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- remarkButton = AddButton(oe, "Rem");
989
+ slowerButton = AddButton(commandsPanel, "Slow");
990
+ fasterButton = AddButton(commandsPanel, "Fast");
991
+ remarkButton = AddButton(commandsPanel, "Remark");
963992
964
- Return();
993
+ oe.ctrlPanel.add(commandsPanel);
994
+ oe.ctrlPanel.Return();
965995
996
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
997
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
998
+ //Return();
999
+
1000
+ oe.ctrlPanel.Return();
1001
+
9661002 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671003 // ObjEditor.aConstraints.gridx += 1;
9681004
....@@ -1056,7 +1092,7 @@
10561092 oe.aConstraints.gridwidth = 1;
10571093 /**/
10581094 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1095
+ oe.ctrlPanel.Return();
10601096
10611097 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621098 //textureButton.setEnabled(false);
....@@ -1107,7 +1143,7 @@
11071143 //frontScroll.setLabel("------------------------------ XZ (front) ---------------------------------------------------");
11081144 //sideScroll.setLabel("------------------------------- YZ (side) ---------------------------------------------------");
11091145
1110
-// GridBagConstraints gbc = (GridBagConstraints) GraphreeD.clone(aConstraints);
1146
+// GridBagConstraints gbc = (GridBagConstraints) GrafreeD.clone(aConstraints);
11111147 Camera cam = GetCamera(copy, 0);
11121148
11131149 Composite cams = null;
....@@ -1158,10 +1194,22 @@
11581194 //JPanel worldPanel =
11591195 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601196 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1197
+ centralPanel = new cGridBag();
1198
+ centralPanel.preferredWidth = 20;
1199
+ timelinePanel = new JPanel(new BorderLayout());
1200
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11641201
1202
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1203
+ cameraPanel.setContinuousLayout(true);
1204
+ cameraPanel.setOneTouchExpandable(true);
1205
+// cameraPanel.setDividerLocation(0.9);
1206
+// cameraPanel.setDividerSize(9);
1207
+ cameraPanel.setResizeWeight(1.0);
1208
+
1209
+ centralPanel.add(cameraView);
1210
+ //frame.setJMenuBar(timelineMenubar);
1211
+ //centralPanel.add(timelinePanel);
1212
+
11651213 //topView.camera = ;
11661214 //frontView.camera = new Camera(2);
11671215 //sideView.camera = new Camera(3);
....@@ -1177,12 +1225,13 @@
11771225 //frontView.object = copy;
11781226 //sideView.object = copy;
11791227
1180
- XYZPanel = new JPanel();
1181
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1228
+ XYZPanel = new cGridBag().setVertical(true);
1229
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11821230
1183
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1184
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1231
+ XYZPanel.preferredWidth = 5;
1232
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1233
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1234
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
11861235
11871236 /*
11881237 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1191,7 +1240,7 @@
11911240 gridPanel.add(cameraView);
11921241 gridPanel.add(XYZPanel);
11931242 */
1194
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1243
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11951244 gridPanel.setContinuousLayout(true);
11961245 gridPanel.setOneTouchExpandable(true);
11971246 gridPanel.setDividerLocation(1.0);
....@@ -1220,10 +1269,11 @@
12201269 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12211270 //tmp.setName("Edit");
12221271 objectPanel.add(materialPanel);
1223
- JPanel north = new JPanel(new BorderLayout());
1224
- north.setName("Edit");
1225
- north.add(ctrlPanel, BorderLayout.NORTH);
1226
- objectPanel.add(north);
1272
+// JPanel north = new JPanel(new BorderLayout());
1273
+// north.setName("Edit");
1274
+// north.add(ctrlPanel, BorderLayout.NORTH);
1275
+// objectPanel.add(north);
1276
+ objectPanel.add(ctrlPanel);
12271277 objectPanel.add(infoPanel);
12281278
12291279 /*
....@@ -1244,16 +1294,23 @@
12441294 scrollpane.setWheelScrollingEnabled(true);
12451295 scrollpane.addMouseWheelListener(this); // Default not fast enough
12461296
1247
- /*JTabbedPane*/ jtp = new JTabbedPane();
1248
- jtp.add(scrollpane);
1297
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1298
+ scenePanel.preferredWidth = 7;
1299
+
1300
+ JTabbedPane tabbedPane = new JTabbedPane();
1301
+ tabbedPane.add(scrollpane);
12491302
1250
- jtp.add(FSPane = new cFileSystemPane(this));
1303
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12511304
1252
- optionsPanel = new JPanel(new GridBagLayout());
1305
+ optionsPanel = new cGridBag().setVertical(true);
12531306
12541307 optionsPanel.setName("Options");
1255
- jtp.add(optionsPanel);
1256
-
1308
+
1309
+ AddOptions(optionsPanel); //, aConstraints);
1310
+
1311
+ tabbedPane.add(optionsPanel);
1312
+
1313
+ scenePanel.add(tabbedPane);
12571314
12581315 /*
12591316 cTree jTree = new cTree(null);
....@@ -1275,7 +1332,7 @@
12751332 jtp.add(tree);
12761333 */
12771334
1278
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);
1335
+ bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
12791336 bigPanel.setContinuousLayout(true);
12801337 bigPanel.setOneTouchExpandable(true);
12811338 bigPanel.setDividerLocation(0.8);
....@@ -1287,6 +1344,7 @@
12871344 //bigPanel.setSize(new Dimension(10,10));
12881345 //bigPanel.add(ctrlPanel);
12891346 //bigPanel.add(gridPanel);
1347
+ /**
12901348 bigThree = new JPanel();
12911349 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12921350 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1297,20 +1355,26 @@
12971355 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
12981356 aWindowConstraints.weightx = 0;
12991357 aWindowConstraints.weighty = 1;
1300
- bigThree.add(jtp, aWindowConstraints);
1358
+ bigThree.add(scenePanel, aWindowConstraints);
13011359 aWindowConstraints.weightx = 1;
13021360 aWindowConstraints.gridwidth = 3;
13031361 // aConstraints.gridheight = 3;
13041362 aWindowConstraints.gridx = 1;
13051363 aWindowConstraints.fill = GridBagConstraints.BOTH;
1306
- bigThree.add(cameraPanel, aWindowConstraints);
1364
+ bigThree.add(centralPanel, aWindowConstraints);
13071365 aWindowConstraints.weightx = 0;
13081366 aWindowConstraints.gridx = 4;
13091367 aWindowConstraints.gridwidth = 1;
13101368 // aConstraints.gridheight = 3;
13111369 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13121370 bigThree.add(XYZPanel, aWindowConstraints);
1371
+ /**/
13131372
1373
+ bigThree = new cGridBag();
1374
+ bigThree.addComponent(scenePanel);
1375
+ bigThree.addComponent(centralPanel);
1376
+ bigThree.addComponent(XYZPanel);
1377
+
13141378 // // SIDE EFFECT!!!
13151379 // aConstraints.gridx = 0;
13161380 // aConstraints.gridy = 0;
....@@ -1331,10 +1395,11 @@
13311395 //worldPane.add(bigPanel);
13321396 //worldPane.add(worldPanel);
13331397 /**/
1334
- frame.getContentPane().add(/*"Center",*/framePanel);
1398
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1399
+ frame.add(/*"Center",*/framePanel);
13351400 //frame.getContentPane().add(/*"Center",*/ worldPane);
13361401
1337
-// aConstraints = gbc; // (GridBagConstraints) GraphreeD.clone(gbc);
1402
+// aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13381403
13391404 frame.setSize(1024, 768);
13401405 frame.show();
....@@ -1352,6 +1417,10 @@
13521417 });
13531418 }
13541419
1420
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1421
+ {
1422
+ }
1423
+
13551424 JTree GetTree()
13561425 {
13571426 return objEditor.jTree;
....@@ -1363,260 +1432,170 @@
13631432 ctrlPanel.removeAll();
13641433 }
13651434
1366
- void SetupMaterial(JPanel ctrlPanel)
1435
+ void SetupMaterial(cGridBag panel)
13671436 {
1368
- aConstraints.weighty = 0;
1369
- //aConstraints.weightx = 1;
1370
- /*
1437
+ /*
13711438 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13721439 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1373
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1374
- aConstraints.gridx += 1;
13751440 */
13761441
1377
- aConstraints.gridwidth = 1;
1378
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1379
- aConstraints.gridx += 1;
1380
- aConstraints.weighty = 0;
1381
- aConstraints.gridwidth = 1;
1442
+ cGridBag editBar = new cGridBag().setVertical(false);
1443
+
1444
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1445
+ createMaterialButton.setToolTipText("Create material");
13821446
13831447 /*
13841448 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
13881449 */
13891450
1390
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1391
- aConstraints.gridx += 1;
1451
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1452
+ clearMaterialButton.setToolTipText("Clear material");
1453
+
1454
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1455
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1456
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
13921457
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;
1458
+ editBar.preferredHeight = 15;
1459
+
1460
+ panel.add(editBar);
1461
+
14071462 /**/
14081463 //aConstraints.weighty = 0;
14091464 ////aConstraints.weightx = 1;
14101465 //aConstraints.weighty = 1;
14111466 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14121467 //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;
1468
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14181469
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;
1470
+ cGridBag colorSection = new cGridBag().setVertical(true);
1471
+
1472
+ cGridBag color = new cGridBag();
1473
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1474
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1475
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1476
+ //colorField.preferredWidth = 200;
1477
+ colorSection.add(color);
14291478
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;
1479
+ cGridBag modulation = new cGridBag();
1480
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1481
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1482
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1483
+ colorSection.add(modulation);
14391484
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;
1485
+ cGridBag texture = new cGridBag();
1486
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1487
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1488
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1489
+ colorSection.add(texture);
14491490
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;
1491
+ cGridBag anisoU = new cGridBag();
1492
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1493
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1494
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1495
+ colorSection.add(anisoU);
14591496
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;
1497
+ cGridBag anisoV = new cGridBag();
1498
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1499
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1500
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1501
+ colorSection.add(anisoV);
14691502
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;
1503
+ cGridBag shadowbias = new cGridBag();
1504
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1505
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1506
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1507
+ colorSection.add(shadowbias);
14791508
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;
1509
+ panel.add(new JSeparator());
1510
+
1511
+ panel.add(colorSection);
1512
+
1513
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1514
+
1515
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1516
+
1517
+ cGridBag diffuse = new cGridBag();
1518
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1519
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1520
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1521
+ diffuseSection.add(diffuse);
14881522
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;
1523
+ cGridBag diffuseness = new cGridBag();
1524
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1525
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1526
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1527
+ diffuseSection.add(diffuseness);
14981528
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;
1529
+ cGridBag selfshadow = new cGridBag();
1530
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1531
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1533
+ diffuseSection.add(selfshadow);
15081534
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;
1535
+ cGridBag sheen = new cGridBag();
1536
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1537
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1538
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1539
+ diffuseSection.add(sheen);
15181540
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;
1541
+ cGridBag subsurface = new cGridBag();
1542
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1543
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1544
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1545
+ diffuseSection.add(subsurface);
15281546
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;
1547
+ cGridBag shadow = new cGridBag();
1548
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1549
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1550
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1551
+ diffuseSection.add(shadow);
15381552
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;
1553
+ cGridBag fakedepth = new cGridBag();
1554
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1555
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1556
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1557
+ diffuseSection.add(fakedepth);
15481558
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;
1559
+ panel.add(new JSeparator());
1560
+
1561
+ panel.add(diffuseSection);
1562
+
1563
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1564
+
1565
+ cGridBag specularSection = new cGridBag().setVertical(true);
15581566
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;
1567
+ cGridBag specular = new cGridBag();
1568
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1569
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1570
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1571
+ specularSection.add(specular);
15671572
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;
1573
+ cGridBag lightarea = new cGridBag();
1574
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1575
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1576
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1577
+ specularSection.add(lightarea);
15771578
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;
1579
+ cGridBag shininess = new cGridBag();
1580
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1581
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1583
+ specularSection.add(shininess);
15871584
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;
1585
+ cGridBag metalness = new cGridBag();
1586
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1587
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1588
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1589
+ specularSection.add(metalness);
15971590
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;
1591
+ cGridBag velvet = new cGridBag();
1592
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1593
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1595
+ specularSection.add(velvet);
16071596
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();
1597
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1598
+ //Return();
16201599 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16211600 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16221601 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1627,130 +1606,93 @@
16271606 // aConstraints.gridy += 1;
16281607 // aConstraints.gridwidth = 1;
16291608
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;
16381609
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;
1610
+ panel.add(new JSeparator());
1611
+
1612
+ panel.add(specularSection);
1613
+
1614
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1615
+
1616
+ cGridBag globalSection = new cGridBag().setVertical(true);
16481617
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;
1618
+ cGridBag camera = new cGridBag();
1619
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1620
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1621
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1622
+ globalSection.add(camera);
16581623
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;
1624
+ cGridBag ambient = new cGridBag();
1625
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1626
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1627
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1628
+ globalSection.add(ambient);
16681629
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;
1630
+ cGridBag backlit = new cGridBag();
1631
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1632
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1633
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1634
+ globalSection.add(backlit);
16791635
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;
1636
+ cGridBag opacity = new cGridBag();
1637
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1638
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1639
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1640
+ globalSection.add(opacity);
16891641
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;
1642
+ panel.add(new JSeparator());
1643
+
1644
+ panel.add(globalSection);
1645
+
1646
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1647
+
1648
+ cGridBag textureSection = new cGridBag().setVertical(true);
16991649
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;
1650
+ cGridBag bump = new cGridBag();
1651
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1652
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1653
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1654
+ textureSection.add(bump);
17091655
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;
1656
+ cGridBag noise = new cGridBag();
1657
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1658
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1659
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1660
+ textureSection.add(noise);
17191661
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;
1662
+ cGridBag power = new cGridBag();
1663
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1664
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1665
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1666
+ textureSection.add(power);
17291667
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;
1668
+ cGridBag borderfade = new cGridBag();
1669
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1670
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1672
+ textureSection.add(borderfade);
17391673
1740
- //aConstraints.weighty = 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1742
- //aConstraints.gridx += 1;
1743
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1744
- aConstraints.weighty = 0;
1674
+ cGridBag fog = new cGridBag();
1675
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1676
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1678
+ textureSection.add(fog);
17451679
1746
- aConstraints.gridx = 0;
1747
- aConstraints.gridy = 0;
1748
- aConstraints.gridwidth = 1;
1680
+ cGridBag opacityPower = new cGridBag();
1681
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1682
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1683
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1684
+ textureSection.add(opacityPower);
1685
+
1686
+ panel.add(new JSeparator());
1687
+
1688
+ panel.add(textureSection);
1689
+
1690
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17491691
17501692 SetMaterial(copy); // .GetMaterial());
17511693
1752
- colorField.addChangeListener(this);
1753
- modulationField.addChangeListener(this);
1694
+ //colorField.addChangeListener(this);
1695
+// modulationField.addChangeListener(this);
17541696 metalnessField.addChangeListener(this);
17551697 diffuseField.addChangeListener(this);
17561698 specularField.addChangeListener(this);
....@@ -1859,19 +1801,21 @@
18591801 }
18601802
18611803 // 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")))
1804
+ if (filename.toLowerCase().endsWith(".jpg")
1805
+ || filename.toLowerCase().endsWith(".jpeg")
1806
+ || filename.toLowerCase().endsWith(".gif")
1807
+ || filename.toLowerCase().endsWith(".png")
1808
+ || filename.toLowerCase().endsWith(".tre")
1809
+ || filename.toLowerCase().endsWith(".bmp")
1810
+ || filename.toLowerCase().endsWith(".tga")
1811
+ || filename.toLowerCase().endsWith(".sgi")
1812
+ || filename.toLowerCase().endsWith(".tif")
1813
+ || filename.toLowerCase().endsWith(".tiff"))
18731814 {
1874
- DropTexture(filename);
1815
+ if (textures)
1816
+ DropTexture(filename);
1817
+ else
1818
+ CreateBillboard(filename);
18751819 continue;
18761820 }
18771821
....@@ -1880,6 +1824,60 @@
18801824 }
18811825
18821826 ResetModel();
1827
+ }
1828
+
1829
+ void CreateBillboard(String filename)
1830
+ {
1831
+ Object3D source = null;
1832
+ Object3D group = copy;
1833
+
1834
+ if (group.selection.size() > 0)
1835
+ {
1836
+ source = group.selection.get(0);
1837
+ }
1838
+
1839
+ Grid grid = new Grid(1,1);
1840
+ grid.material = null;
1841
+
1842
+ grid.toParent = LA.newMatrix();
1843
+ grid.fromParent = LA.newMatrix();
1844
+ LA.matYRotate(grid.toParent, Math.PI/2);
1845
+ LA.matXRotate(grid.toParent, -Math.PI/2);
1846
+ LA.matXRotate(grid.fromParent, Math.PI/2);
1847
+ LA.matYRotate(grid.fromParent, -Math.PI/2);
1848
+
1849
+ BillboardNode bb = new BillboardNode();
1850
+ bb.addChild(grid);
1851
+
1852
+ Object3D newgroup = new Object3D();
1853
+ newgroup.CreateMaterial();
1854
+
1855
+ File file = new File(filename);
1856
+ newgroup.name = file.getName();
1857
+ newgroup.addChild(bb);
1858
+
1859
+ Object3D main = newgroup;
1860
+
1861
+ main.SetPigmentTexture(filename);
1862
+
1863
+ if (source != null)
1864
+ {
1865
+ main.material = new cMaterial(source.material);
1866
+ if (main.projectedVertices.length < source.projectedVertices.length)
1867
+ {
1868
+ main.projectedVertices = new Object3D.cVector2[source.projectedVertices.length];
1869
+ }
1870
+
1871
+ for (int i=0; i<source.projectedVertices.length; i++)
1872
+ {
1873
+ main.projectedVertices[i].x = source.projectedVertices[i].x;
1874
+ main.projectedVertices[i].y = source.projectedVertices[i].y;
1875
+ }
1876
+
1877
+ main.texres = source.texres;
1878
+ }
1879
+
1880
+ makeSomething(newgroup, false);
18831881 }
18841882
18851883 Point location;
....@@ -2138,6 +2136,8 @@
21382136 {
21392137 Mocap sel = (Mocap) copy.selection.get(0);
21402138
2139
+ sel.SetCurrentBones(sel.frame);
2140
+
21412141 sel.fullname = fullname;
21422142
21432143 if (changename)
....@@ -2151,14 +2151,18 @@
21512151 sel.smoothed = false;
21522152
21532153 // if (!changename)
2154
- sel.SetPositionDelta(false, true, true, true/*?*/); // false
2154
+ //sel.SetPositionDelta(false, true, true, true/*?*/); // false
2155
+ sel.SetGlobalTransform();
2156
+ sel.LoadData();
2157
+ sel.Rewind();
2158
+ sel.Fade();
21552159 // sel.setPose(0);
21562160 refreshContents();
21572161 } else
21582162 {
21592163 mocap.Reset();
21602164 // new skeleton
2161
- makeSomething(mocap, false); // true);
2165
+ makeSomething(mocap, true); // true);
21622166 }
21632167 } catch (Exception e)
21642168 {
....@@ -2185,6 +2189,8 @@
21852189 {
21862190 Mocap sel = (Mocap) select;
21872191
2192
+ sel.SetCurrentBones(sel.frame);
2193
+
21882194 File file = new File(fullname);
21892195
21902196 // Mocap mocap = new Mocap("Mocap" + file.getName());
....@@ -2251,7 +2257,11 @@
22512257
22522258 if (!changename)
22532259 {
2254
- sel.SetPositionDelta(false, true, true, true/*?*/);
2260
+ //sel.SetPositionDelta(false, true, true, true/*?*/);
2261
+ sel.SetGlobalTransform();
2262
+ sel.LoadData();
2263
+ sel.Rewind();
2264
+ sel.Fade();
22552265 }
22562266
22572267 // sel.setPose(0);
....@@ -2345,7 +2355,7 @@
23452355
23462356 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23472357 {
2348
- if (GraphreeD.standAlone)
2358
+ if (GrafreeD.standAlone)
23492359 {
23502360 /**/
23512361 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
....@@ -2494,6 +2504,7 @@
24942504 }
24952505 if (input == null)
24962506 {
2507
+ new Exception().printStackTrace();
24972508 System.exit(0);
24982509 }
24992510
....@@ -2890,20 +2901,37 @@
28902901 // june 2013 copy.HardTouch();
28912902 cameraView.repaint();
28922903 return;
2893
- } else if (event.getSource() == toggleFullItem)
2904
+ } else if (event.getSource() == toggleTimelineItem)
28942905 {
2895
- if (CameraPane.FULLSCREEN)
2906
+ timeline ^= true;
2907
+
2908
+ if (timeline)
28962909 {
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);
2910
+ centralPanel.remove(cameraView);
2911
+ cameraPanel.add(cameraView);
2912
+ centralPanel.add(cameraPanel);
2913
+ frame.setJMenuBar(timelineMenubar);
2914
+ wasFullScreen = CameraPane.FULLSCREEN;
2915
+ if (!CameraPane.FULLSCREEN)
2916
+ ToggleFullScreen();
2917
+ toggleFullScreenItem.setEnabled(false);
29042918 }
2919
+ else
2920
+ {
2921
+ centralPanel.remove(cameraPanel);
2922
+ centralPanel.add(cameraView);
2923
+ frame.setJMenuBar(null);
2924
+ if (!wasFullScreen)
2925
+ ToggleFullScreen();
2926
+ toggleFullScreenItem.setEnabled(true);
2927
+ }
2928
+
29052929 frame.validate();
2906
- cameraView.ToggleFullScreen();
2930
+ return;
2931
+ } else if (event.getSource() == toggleFullScreenItem)
2932
+ {
2933
+ ToggleFullScreen();
2934
+ frame.validate();
29072935
29082936 return;
29092937 } else if (event.getSource() == toggleRandomItem)
....@@ -3013,7 +3041,8 @@
30133041 objEditor.refreshContents();
30143042 } else if (event.getSource() == stepItem)
30153043 {
3016
- cameraView.ONESTEP = true;
3044
+ //cameraView.ONESTEP = true;
3045
+ Globals.ONESTEP = true;
30173046 cameraView.repaint();
30183047 return;
30193048 } else if (event.getSource() == stepButton)
....@@ -3152,9 +3181,9 @@
31523181 cameraView.RevertCamera();
31533182 cameraView.repaint();
31543183 return;
3155
- } else if (event.getSource() == textureButton)
3156
- {
3157
- return; // true;
3184
+// } else if (event.getSource() == textureButton)
3185
+// {
3186
+// return; // true;
31583187 } else // combos...
31593188 if (event.getSource() == texresMenu)
31603189 {
....@@ -3170,25 +3199,25 @@
31703199
31713200 void ToggleAnimation()
31723201 {
3173
- if (!CameraPane.ANIMATION)
3202
+ if (!Globals.ANIMATION)
31743203 {
31753204 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3176
- browser.show();
3205
+ browser.setVisible(true);
31773206 String filename = browser.getFile();
31783207 if (filename != null && filename.length() > 0)
31793208 {
3180
- CameraPane.filename = browser.getDirectory() + filename;
3209
+ Globals.filename = browser.getDirectory() + filename;
31813210 //CameraPane.framecount = 0;
3182
- CameraPane.imagecount = 0;
3211
+ Globals.imagecount = 0;
31833212
3184
- CameraPane.ANIMATION ^= true;
3213
+ Globals.ANIMATION ^= true;
31853214
3186
- GraphreeD.wav.cursor = 0;
3187
- GraphreeD.wav.loop = 0;
3215
+ GrafreeD.wav.cursor = 0;
3216
+ GrafreeD.wav.loop = 0;
31883217 }
31893218 } else
31903219 {
3191
- CameraPane.ANIMATION ^= true;
3220
+ Globals.ANIMATION ^= true;
31923221 }
31933222 }
31943223
....@@ -3205,6 +3234,7 @@
32053234 callee.refreshContents();
32063235 } else
32073236 {
3237
+ new Exception().printStackTrace();
32083238 System.exit(0);
32093239 }
32103240 }
....@@ -3367,7 +3397,7 @@
33673397 current.fakedepth = (float) fakedepthField.getFloat();
33683398 current.shadowbias = (float) shadowbiasField.getFloat();
33693399
3370
- if (!NumberSlider.frozen)
3400
+ if (!cNumberSlider.frozen)
33713401 {
33723402 //System.out.println("Propagate = " + propagate);
33733403 copy.UpdateMaterial(anchor, current, propagate);
....@@ -3415,6 +3445,7 @@
34153445 || e.getSource() == apertureField
34163446 || e.getSource() == shadowblurField)
34173447 {
3448
+ new Exception().printStackTrace();
34183449 System.exit(0);
34193450 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34203451 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3441,7 +3472,13 @@
34413472 //System.out.println("PARENT = " + parent);
34423473 //if (parent != null)
34433474 // parent.applySelf();
3444
- refreshContents();
3475
+ if (e.getSource() == normalpushField)
3476
+ {
3477
+ objEditor.refreshContents();
3478
+ //Refresh();
3479
+ }
3480
+ else
3481
+ refreshContents();
34453482 // ??? client.refreshEditWindow();
34463483 }
34473484 //else
....@@ -3453,7 +3490,7 @@
34533490 //group.name = nameField.getText();
34543491 //objEditor.applySelf();
34553492
3456
- assert (objEditor == this);
3493
+ // OCT2018: assert (objEditor == this);
34573494 if (copy.selection == null || copy.selection.size() == 0)
34583495 //super.applySelf()
34593496 ; else
....@@ -3477,12 +3514,18 @@
34773514 objEditor.copy = keep;
34783515 }
34793516 }
3517
+
3518
+ if (normalpushField != null)
3519
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
34803520 }
34813521
34823522 void SnapObject()
34833523 {
3484
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3485
- SnapObject(obj);
3524
+ if (copy.selection.size() > 0)
3525
+ {
3526
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3527
+ SnapObject(obj);
3528
+ }
34863529 }
34873530
34883531 void SnapObject(Object3D obj)
....@@ -3596,7 +3639,7 @@
35963639
35973640 if (obj.parent != null)
35983641 {
3599
- obj.parent.TransformToWorld(interest);
3642
+// obj.parent.TransformToWorld(interest);
36003643 }
36013644
36023645 if (!CameraPane.TRACK)
....@@ -3728,7 +3771,7 @@
37283771
37293772 radioPanel.revalidate();
37303773 radioPanel.repaint();
3731
- ctrlPanel.revalidate(); // ? new
3774
+ ctrlPanel.validate(); // ? new
37323775 ctrlPanel.repaint();
37333776 }
37343777 }
....@@ -4085,7 +4128,7 @@
40854128
40864129 void load() // throws ClassNotFoundException
40874130 {
4088
- if (GraphreeD.standAlone)
4131
+ if (GrafreeD.standAlone)
40894132 {
40904133 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
40914134 browser.show();
....@@ -4190,7 +4233,7 @@
41904233
41914234 void saveAs()
41924235 {
4193
- if (GraphreeD.standAlone)
4236
+ if (GrafreeD.standAlone)
41944237 {
41954238 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
41964239 browser.setVisible(true);
....@@ -4213,10 +4256,20 @@
42134256
42144257 Object3D object = copy.selection.get(0);
42154258
4259
+ FileObject fileobj = null;
4260
+
4261
+ if (object instanceof FileObject)
4262
+ fileobj = (FileObject)object;
4263
+
42164264 if (object.fileparent != null)
42174265 {
4218
- FileObject fileobj = (FileObject) object.fileparent;
4266
+ assert(fileobj == null);
42194267
4268
+ fileobj = (FileObject) object.fileparent;
4269
+ }
4270
+
4271
+ if (fileobj != null)
4272
+ {
42204273 System.out.println("WriteObject " + object + " : " + fileobj.name);
42214274 WriteObject(object, fileobj.name);
42224275 }
....@@ -4259,7 +4312,7 @@
42594312 }
42604313 }
42614314 else
4262
- //if (GraphreeD.standAlone)
4315
+ //if (GrafreeD.standAlone)
42634316 {
42644317 FileDialog browser = new FileDialog(frame, "Export", FileDialog.SAVE);
42654318 browser.setVisible(true);
....@@ -4291,7 +4344,7 @@
42914344 Object3D objectparent = obj.parent;
42924345 obj.parent = null;
42934346
4294
- Object3D object = (Object3D) GraphreeD.clone(obj);
4347
+ Object3D object = (Object3D) GrafreeD.clone(obj);
42954348
42964349 obj.parent = objectparent;
42974350
....@@ -4325,7 +4378,7 @@
43254378 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43264379 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43274380 copy.generatePOV(buffer);
4328
- if (GraphreeD.standAlone)
4381
+ if (GrafreeD.standAlone)
43294382 {
43304383 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43314384 browser.show();
....@@ -4364,9 +4417,10 @@
43644417 //MenuItem normalLensItem;
43654418 MenuItem editCameraItem;
43664419 MenuItem revertCameraItem;
4367
- CheckboxMenuItem toggleLiveItem;
43684420 MenuItem stepItem;
4369
- CheckboxMenuItem toggleFullItem;
4421
+ CheckboxMenuItem toggleLiveItem;
4422
+ CheckboxMenuItem toggleFullScreenItem;
4423
+ CheckboxMenuItem toggleTimelineItem;
43704424 CheckboxMenuItem toggleRenderItem;
43714425 CheckboxMenuItem toggleDebugItem;
43724426 CheckboxMenuItem toggleFrustumItem;
....@@ -4381,23 +4435,26 @@
43814435 JSplitPane mainPanel;
43824436 JScrollPane scrollpane;
43834437 JPanel toolbarPanel;
4384
- JPanel treePanel;
4438
+ cGridBag treePanel;
43854439 JPanel radioPanel;
43864440 ButtonGroup buttonGroup;
4387
- JPanel ctrlPanel;
4388
- JPanel materialPanel;
4441
+ cGridBag ctrlPanel;
4442
+ cGridBag materialPanel;
43894443 JScrollPane infoPanel;
4390
- JPanel optionsPanel;
4444
+ cGridBag optionsPanel;
43914445 JTabbedPane objectPanel;
4392
- JPanel XYZPanel;
4446
+ cGridBag XYZPanel;
43934447 JSplitPane gridPanel;
43944448 JSplitPane bigPanel;
4395
- JPanel bigThree;
4396
- JTabbedPane jtp;
4397
- JPanel cameraPanel;
4449
+ cGridBag bigThree;
4450
+ cGridBag scenePanel;
4451
+ cGridBag centralPanel;
4452
+ JSplitPane cameraPanel;
4453
+ JPanel timelinePanel;
4454
+ JMenuBar timelineMenubar;
43984455 JSplitPane framePanel;
43994456 JTextArea/*Field*/ nameField;
4400
- cButton textureButton;
4457
+ //cButton textureButton;
44014458 cButton okButton;
44024459 cButton applyButton;
44034460 cButton cancelButton;
....@@ -4444,65 +4501,67 @@
44444501 // MATERIAL
44454502 JLabel materialLabel;
44464503 JLabel colorLabel;
4447
- NumberSlider colorField;
4504
+ cNumberSlider colorField;
44484505 JLabel modulationLabel;
4449
- NumberSlider modulationField;
4506
+ cNumberSlider modulationField;
44504507 JLabel metalnessLabel;
4451
- NumberSlider metalnessField;
4508
+ cNumberSlider metalnessField;
44524509 JLabel diffuseLabel;
4453
- NumberSlider diffuseField;
4510
+ cNumberSlider diffuseField;
44544511 JLabel specularLabel;
4455
- NumberSlider specularField;
4512
+ cNumberSlider specularField;
44564513 JLabel shininessLabel;
4457
- NumberSlider shininessField;
4514
+ cNumberSlider shininessField;
44584515 JLabel shiftLabel;
4459
- NumberSlider shiftField;
4516
+ cNumberSlider shiftField;
44604517 JLabel ambientLabel;
4461
- NumberSlider ambientField;
4518
+ cNumberSlider ambientField;
44624519 JLabel lightareaLabel;
4463
- NumberSlider lightareaField;
4520
+ cNumberSlider lightareaField;
44644521 JLabel diffusenessLabel;
4465
- NumberSlider diffusenessField;
4522
+ cNumberSlider diffusenessField;
44664523 JLabel velvetLabel;
4467
- NumberSlider velvetField;
4524
+ cNumberSlider velvetField;
44684525 JLabel sheenLabel;
4469
- NumberSlider sheenField;
4526
+ cNumberSlider sheenField;
44704527 JLabel subsurfaceLabel;
4471
- NumberSlider subsurfaceField;
4528
+ cNumberSlider subsurfaceField;
44724529 //JLabel bumpLabel;
44734530 //NumberSlider bumpField;
44744531 JLabel backlitLabel;
4475
- NumberSlider backlitField;
4532
+ cNumberSlider backlitField;
44764533 JLabel anisoLabel;
4477
- NumberSlider anisoField;
4534
+ cNumberSlider anisoField;
44784535 JLabel anisoVLabel;
4479
- NumberSlider anisoVField;
4536
+ cNumberSlider anisoVField;
44804537 JLabel cameraLabel;
4481
- NumberSlider cameraField;
4538
+ cNumberSlider cameraField;
44824539 JLabel selfshadowLabel;
4483
- NumberSlider selfshadowField;
4540
+ cNumberSlider selfshadowField;
44844541 JLabel shadowLabel;
4485
- NumberSlider shadowField;
4542
+ cNumberSlider shadowField;
44864543 JLabel textureLabel;
4487
- NumberSlider textureField;
4544
+ cNumberSlider textureField;
44884545 JLabel opacityLabel;
4489
- NumberSlider opacityField;
4546
+ cNumberSlider opacityField;
44904547 JLabel fakedepthLabel;
4491
- NumberSlider fakedepthField;
4548
+ cNumberSlider fakedepthField;
44924549 JLabel shadowbiasLabel;
4493
- NumberSlider shadowbiasField;
4550
+ cNumberSlider shadowbiasField;
44944551 JLabel bumpLabel;
4495
- NumberSlider bumpField;
4552
+ cNumberSlider bumpField;
44964553 JLabel noiseLabel;
4497
- NumberSlider noiseField;
4554
+ cNumberSlider noiseField;
44984555 JLabel powerLabel;
4499
- NumberSlider powerField;
4556
+ cNumberSlider powerField;
45004557 JLabel borderfadeLabel;
4501
- NumberSlider borderfadeField;
4558
+ cNumberSlider borderfadeField;
45024559 JLabel fogLabel;
4503
- NumberSlider fogField;
4560
+ cNumberSlider fogField;
45044561 JLabel opacityPowerLabel;
4505
- NumberSlider opacityPowerField;
4562
+ cNumberSlider opacityPowerField;
45064563 JTree jTree;
45074564 //ObjectUI parent;
4565
+
4566
+ cNumberSlider normalpushField;
45084567 }