Normand Briere
2019-06-24 47cd0f0a3870d843cb758535316060d30f15c811
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -19,6 +20,8 @@
1920 import //weka.core.
2021 matrix.Matrix;
2122
23
+import grafeme.ui.*;
24
+
2225 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2326 ActionListener, ChangeListener,
2427 InputMethodListener,
....@@ -28,7 +31,73 @@
2831 iSendInfo
2932 //KeyListener
3033 {
34
+ boolean timeline;
35
+ boolean wasFullScreen;
3136
37
+ GroupEditor callee;
38
+ JFrame frame;
39
+
40
+ static ObjEditor theFrame;
41
+
42
+ cButton GetButton(String name, boolean border)
43
+ {
44
+ try
45
+ {
46
+ ImageIcon icon = GetIcon(name);
47
+ return new cButton(icon, border);
48
+ }
49
+ catch (Exception e)
50
+ {
51
+ return new cButton(name, border);
52
+ }
53
+ }
54
+
55
+ cToggleButton GetToggleButton(String name, boolean border)
56
+ {
57
+ try
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cToggleButton(icon, border);
61
+ }
62
+ catch (Exception e)
63
+ {
64
+ return new cToggleButton(name, border);
65
+ }
66
+ }
67
+
68
+ cCheckBox GetCheckBox(String name, boolean border)
69
+ {
70
+ try
71
+ {
72
+ ImageIcon icon = GetIcon(name);
73
+ return new cCheckBox(icon, border);
74
+ }
75
+ catch (Exception e)
76
+ {
77
+ return new cCheckBox(name, border);
78
+ }
79
+ }
80
+
81
+ private ImageIcon GetIcon(String name) throws IOException
82
+ {
83
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
84
+
85
+ if (image.getWidth() != 24 && image.getHeight() != 24)
86
+ {
87
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
88
+ Graphics2D g = resized.createGraphics();
89
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
90
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
91
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
92
+ g.dispose();
93
+
94
+ image = resized;
95
+ }
96
+
97
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
98
+ return icon;
99
+ }
100
+
32101 // SCRIPT
33102
34103 transient JFrame textpanel = null;
....@@ -119,51 +188,62 @@
119188 void keyPressed(int key, int modifiers)
120189 {
121190 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
191
+ Globals.theRenderer.keyPressed(key, modifiers);
123192 }
124193 */
125194
126195 static GridBagConstraints aConstraints;
127196 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
197
+
130198 static int GRIDWIDTH = 100; // 4;
131199
132200 public void closeUI()
133201 {
134202 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
203
+// System.out.println("this = " + this);
204
+// System.out.println("objEditor = " + objEditor);
137205 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
206
+// objEditor.ctrlPanel.remove(nameField);
207
+
208
+ objEditor.ctrlPanel.remove(namePanel);
139209
140210 if (!GroupEditor.allparams)
141211 return;
142212
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);
213
+// objEditor.ctrlPanel.remove(liveCB);
214
+// objEditor.ctrlPanel.remove(hideCB);
215
+// objEditor.ctrlPanel.remove(markCB);
216
+//
217
+// objEditor.ctrlPanel.remove(randomCB);
218
+// objEditor.ctrlPanel.remove(speedupCB);
219
+// objEditor.ctrlPanel.remove(rewindCB);
220
+//
221
+// objEditor.ctrlPanel.remove(resetButton);
222
+// objEditor.ctrlPanel.remove(stepButton);
223
+//// objEditor.ctrlPanel.remove(stepAllButton);
224
+//// objEditor.ctrlPanel.remove(resetAllButton);
225
+// objEditor.ctrlPanel.remove(link2masterCB);
226
+// //objEditor.ctrlPanel.remove(flipVCB);
227
+// //objEditor.ctrlPanel.remove(texresMenu);
228
+// objEditor.ctrlPanel.remove(slowerButton);
229
+// objEditor.ctrlPanel.remove(fasterButton);
230
+// objEditor.ctrlPanel.remove(remarkButton);
231
+
232
+ objEditor.ctrlPanel.remove(setupPanel);
233
+ objEditor.ctrlPanel.remove(setupPanel2);
234
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
235
+ objEditor.ctrlPanel.remove(pushPanel);
236
+ //objEditor.ctrlPanel.remove(fillPanel);
237
+
238
+ //Remove(normalpushField);
161239 }
162240
163241 public ObjEditor GetEditor()
164242 {
165243 return objEditor; //.GetEditor();
166244 }
245
+
246
+ // Sometimes myself, sometimes my callee's.
167247 ObjEditor objEditor;
168248
169249 /*
....@@ -226,6 +306,7 @@
226306 //localCopy.parent = null;
227307
228308 frame = new JFrame();
309
+ frame.setUndecorated(true);
229310 objEditor = this;
230311 this.callee = callee;
231312
....@@ -238,7 +319,7 @@
238319 //if (!isDisplayable())
239320 //setUndecorated(true);
240321
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
322
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242323 client = inClient;
243324 copy = localCopy;
244325 copy.editWindow = this;
....@@ -259,24 +340,40 @@
259340 void SetupMenu()
260341 {
261342 frame.setMenuBar(menuBar = new MenuBar());
262
- menuBar.add(windowMenu = new Menu("File"));
263
- windowMenu.add(loadItem = new MenuItem("Load..."));
264
- windowMenu.add("-");
265
- windowMenu.add(saveItem = new MenuItem("Save"));
266
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
343
+ menuBar.add(fileMenu = new Menu("File"));
344
+ fileMenu.add(newItem = new MenuItem("New"));
345
+ fileMenu.add(loadItem = new MenuItem("Open..."));
346
+
347
+ //oe.menuBar.add(menu = new Menu("Include"));
348
+ Menu menu = new Menu("Import");
349
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
350
+ importOBJItem.addActionListener(this);
351
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
352
+ import3DSItem.addActionListener(this);
353
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
354
+ importVRMLX3DItem.addActionListener(this);
355
+ menu.add("-");
356
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
357
+ importGFDItem.addActionListener(this);
358
+ fileMenu.add(menu);
359
+ fileMenu.add("-");
360
+
361
+ fileMenu.add(saveItem = new MenuItem("Save"));
362
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
267363 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
268
- windowMenu.add("-");
269
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
270
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
271
- windowMenu.add("-");
364
+ fileMenu.add("-");
365
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
366
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
367
+ fileMenu.add("-");
272368 if (client.parent != null)
273369 {
274
- windowMenu.add(closeItem = new MenuItem("Close"));
370
+ fileMenu.add(closeItem = new MenuItem("Close"));
275371 } else
276372 {
277
- windowMenu.add(closeItem = new MenuItem("Exit"));
373
+ fileMenu.add(closeItem = new MenuItem("Exit"));
278374 }
279375
376
+ newItem.addActionListener(this);
280377 loadItem.addActionListener(this);
281378 saveItem.addActionListener(this);
282379 saveAsItem.addActionListener(this);
....@@ -285,77 +382,38 @@
285382 //povItem.addActionListener(this);
286383 closeItem.addActionListener(this);
287384
288
- menuBar.add(cameraMenu = new Menu("View"));
289
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
290
- //zBufferItem.addActionListener(this);
291
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
292
- //normalLensItem.addActionListener(this);
293
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294
- revertCameraItem.addActionListener(this);
295
- cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullItem.addItemListener(this);
297
- toggleFullItem.setState(CameraPane.FULLSCREEN);
298
- cameraMenu.add("-");
299
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
300
- toggleTextureItem.addItemListener(this);
301
- toggleTextureItem.setState(CameraPane.textureon);
302
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
303
- toggleLiveItem.addItemListener(this);
304
- toggleLiveItem.setState(CameraPane.isLIVE());
305
- cameraMenu.add(stepItem = new MenuItem("Step"));
306
- stepItem.addActionListener(this);
307
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
308
-// toggleDLItem.addItemListener(this);
309
-// toggleDLItem.setState(false);
310
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
311
- toggleRenderItem.addItemListener(this);
312
- toggleRenderItem.setState(!CameraPane.frozen);
313
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
314
- toggleDebugItem.addItemListener(this);
315
- toggleDebugItem.setState(CameraPane.DEBUG);
316
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
317
- toggleFrustumItem.addItemListener(this);
318
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
319
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
320
- toggleFootContactItem.addItemListener(this);
321
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
322
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
323
- toggleRandomItem.addItemListener(this);
324
- toggleRandomItem.setState(CameraPane.RANDOM);
325
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
326
- toggleHandleItem.addItemListener(this);
327
- toggleHandleItem.setState(CameraPane.HANDLES);
328
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
329
- togglePaintItem.addItemListener(this);
330
- togglePaintItem.setState(CameraPane.PAINTMODE);
331
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
332
-// toggleRootItem.addItemListener(this);
333
-// toggleRootItem.setState(false);
334
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
335
-// animationItem.addItemListener(this);
336
-// animationItem.setState(CameraPane.ANIMATION);
337
- cameraMenu.add("-");
338
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
339
- editCameraItem.addActionListener(this);
340
-
341385 objectPanel = new JTabbedPane();
342386 toolbarPanel = new JPanel();
343387 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
388
+ treePanel = new cGridBag();
345389 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
347
- ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
390
+
391
+ editPanel = new cGridBag().setVertical(true);
392
+ editPanel.setName("Edit");
393
+
394
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
395
+
396
+ editCommandsPanel = new cGridBag();
397
+ editPanel.add(editCommandsPanel);
398
+ editPanel.add(ctrlPanel);
399
+
400
+ toolboxPanel = new cGridBag().setVertical(false);
401
+ toolboxPanel.setName("Toolbox");
402
+
403
+ materialPanel = new cGridBag().setVertical(true);
349404 materialPanel.setName("Material");
405
+
350406 /*JTextPane*/
351407 infoarea = createTextPane();
408
+ doc = infoarea.getStyledDocument();
409
+
352410 infoarea.setEditable(true);
353411 SetText();
354412 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355413 // infoarea.setOpaque(false);
356414 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
415
+// TEXTAREA infoarea.setLineWrap(true);
416
+// TEXTAREA infoarea.setWrapStyleWord(true);
359417 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
360418 infoPanel.setPreferredSize(new Dimension(50, 200));
361419 infoPanel.setName("Info");
....@@ -366,16 +424,16 @@
366424 mainPanel.setName("Main");
367425 mainPanel.setContinuousLayout(true);
368426 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370427 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
428
+ mainPanel.setDividerLocation(0.5); //1.0);
429
+ mainPanel.setResizeWeight(0.5);
372430
373431 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374432 //mainPanel.setLayout(new GridBagLayout());
375433 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
434
+// treePanel.setLayout(new GridBagLayout());
435
+ //ctrlPanel.setLayout(new GridBagLayout());
436
+ //materialPanel.setLayout(new GridBagLayout());
379437
380438 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381439 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +472,7 @@
414472 static String newline = "\n";
415473 protected static final String buttonString = "JButton";
416474 StyledDocument doc;
417
- JTextArea infoarea;
475
+ JTextPane infoarea;
418476
419477 void ClearInfo()
420478 {
....@@ -437,10 +495,10 @@
437495 e.printStackTrace();
438496 }
439497
440
- String selection = infoarea.getText();
441
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
442
- java.awt.datatransfer.Clipboard clipboard =
443
- Toolkit.getDefaultToolkit().getSystemClipboard();
498
+// String selection = infoarea.getText();
499
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
500
+// java.awt.datatransfer.Clipboard clipboard =
501
+// Toolkit.getDefaultToolkit().getSystemClipboard();
444502 //clipboard.setContents(data, data);
445503 }
446504
....@@ -463,13 +521,13 @@
463521 //SendInfo("Name:", "bold");
464522 if (sel.GetTextures() != null || debug)
465523 {
466
- si.SendInfo(sel.toString(), "bold");
524
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
467525 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
468526 if (sel.Size() > 0)
469527 {
470528 si.SendInfo("#children = " + sel.Size(), "regular");
471529 }
472
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
530
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
473531 if (debug)
474532 {
475533 try
....@@ -481,7 +539,10 @@
481539 }
482540
483541 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
542
+ {
543
+ si.SendInfo(" BBox min: " + minima, "regular");
544
+ si.SendInfo(" BBox max: " + maxima, "regular");
545
+ }
485546
486547 if (sel.bRep != null)
487548 {
....@@ -508,7 +569,7 @@
508569 }
509570 if (sel.support != null)
510571 {
511
- si.SendInfo(" support: " + sel.support, "regular");
572
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
512573 }
513574 if (sel.scriptnode != null)
514575 {
....@@ -579,6 +640,9 @@
579640 {
580641 CameraPane.pointflow = (PointFlow) sel;
581642 }
643
+
644
+ si.SendInfo("_____________________", "regular");
645
+ si.SendInfo("", "regular");
582646 }
583647 }
584648
....@@ -594,52 +658,140 @@
594658 }
595659 }
596660
597
- private JTextArea createTextPane()
598
- {
599
- String[] initString =
600
- {
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
- };
661
+static GraphicsDevice device = GraphicsEnvironment
662
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
614663
615
- String[] initStyles =
616
- {
617
- "regular", "italic", "bold", "small", "large",
618
- "regular", "button", "regular", "icon",
619
- "regular"
620
- };
664
+ Rectangle keeprect;
665
+ cRadio radio;
666
+
667
+cButton keepButton;
668
+ cButton twoButton; // Full 3D
669
+ cButton sixButton;
670
+ cButton threeButton;
671
+ cButton sevenButton;
672
+ cButton fourButton; // full panel
673
+ cButton oneButton; // full XYZ
674
+ //cButton currentLayout;
675
+
676
+ boolean maximized;
677
+
678
+ cButton fullscreenLayout;
621679
622
- JTextPane textPane = new JTextPane();
623
- textPane.setEditable(true);
624
- /*StyledDocument*/ doc = textPane.getStyledDocument();
625
- addStylesToDocument(doc);
626
-
627
- try
680
+ void Minimize()
628681 {
629
- for (int j = 0; j < 2; j++)
682
+ frame.setState(Frame.ICONIFIED);
683
+ }
684
+
685
+ void Maximize()
686
+ {
687
+ if (maximized)
630688 {
631
- for (int i = 0; i < initString.length; i++)
632
- {
633
- doc.insertString(doc.getLength(), initString[i],
634
- doc.getStyle(initStyles[i]));
635
- }
689
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
636690 }
637
- } catch (BadLocationException ble)
691
+ else
692
+ {
693
+ keeprect = frame.getBounds();
694
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
695
+ Dimension rect2 = frame.getToolkit().getScreenSize();
696
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
697
+// frame.setState(Frame.MAXIMIZED_BOTH);
698
+ }
699
+
700
+ maximized ^= true;
701
+ }
702
+
703
+ void ToggleFullScreen()
638704 {
639
- System.err.println("Couldn't insert initial text into text pane.");
705
+ if (CameraPane.FULLSCREEN)
706
+ {
707
+ device.setFullScreenWindow(null);
708
+ //frame.setVisible(false);
709
+// frame.removeNotify();
710
+// frame.setUndecorated(false);
711
+// frame.addNotify();
712
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
713
+
714
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
715
+// X framePanel.add(bigThree);
716
+// X frame.getContentPane().add(/*"Center",*/framePanel);
717
+ framePanel.setDividerLocation(1);
718
+
719
+ //frame.setVisible(true);
720
+ radio.layout = keepButton;
721
+ //theFrame = null;
722
+ keepButton = null;
723
+ radio.layout.doClick();
724
+
725
+ } else
726
+ {
727
+ keepButton = radio.layout;
728
+ //keeprect = frame.getBounds();
729
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
730
+// frame.getToolkit().getScreenSize().height);
731
+ //frame.setVisible(false);
732
+ device.setFullScreenWindow(frame);
733
+// frame.removeNotify();
734
+// frame.setUndecorated(true);
735
+// frame.addNotify();
736
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
737
+// X framePanel.remove(bigThree);
738
+// X frame.getContentPane().add(/*"Center",*/bigThree);
739
+ framePanel.setDividerLocation(0);
740
+
741
+ radio.layout = fullscreenLayout;
742
+ radio.layout.doClick();
743
+ //frame.setVisible(true);
744
+ }
745
+
746
+ cameraView.ToggleFullScreen();
640747 }
641748
642
- return new JTextArea(); // textPane;
749
+ private JTextPane createTextPane()
750
+ {
751
+// TEXTAREA String[] initString =
752
+// {
753
+// "This is an editable JTextPane, ", //regular
754
+// "another ", //italic
755
+// "styled ", //bold
756
+// "text ", //small
757
+// "component, ", //large
758
+// "which supports embedded components..." + newline,//regular
759
+// " " + newline, //button
760
+// "...and embedded icons..." + newline, //regular
761
+// " ", //icon
762
+// newline + "JTextPane is a subclass of JEditorPane that "
763
+// + "uses a StyledEditorKit and StyledDocument, and provides "
764
+// + "cover methods for interacting with those objects."
765
+// };
766
+//
767
+// String[] initStyles =
768
+// {
769
+// "regular", "italic", "bold", "small", "large",
770
+// "regular", "button", "regular", "icon",
771
+// "regular"
772
+// };
773
+//
774
+// JTextPane textPane = new JTextPane();
775
+// textPane.setEditable(true);
776
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
777
+// addStylesToDocument(doc);
778
+//
779
+// try
780
+// {
781
+// for (int j = 0; j < 2; j++)
782
+// {
783
+// for (int i = 0; i < initString.length; i++)
784
+// {
785
+// doc.insertString(doc.getLength(), initString[i],
786
+// doc.getStyle(initStyles[i]));
787
+// }
788
+// }
789
+// } catch (BadLocationException ble)
790
+// {
791
+// System.err.println("Couldn't insert initial text into text pane.");
792
+// }
793
+
794
+ return new JTextPane(); // textPane;
643795 }
644796
645797 protected void addStylesToDocument(StyledDocument doc)
....@@ -692,7 +844,7 @@
692844 protected static ImageIcon createImageIcon(String path,
693845 String description)
694846 {
695
- java.net.URL imgURL = GrafreeD.class.getResource(path);
847
+ java.net.URL imgURL = Grafreed.class.getResource(path);
696848 if (imgURL != null)
697849 {
698850 return new ImageIcon(imgURL, description);
....@@ -724,6 +876,7 @@
724876 // NumberSlider vDivsField;
725877 // JCheckBox endcaps;
726878 JCheckBox liveCB;
879
+ JCheckBox selectCB;
727880 JCheckBox hideCB;
728881 JCheckBox link2masterCB;
729882 JCheckBox markCB;
....@@ -739,115 +892,87 @@
739892 JButton slowerButton;
740893 JButton fasterButton;
741894 JButton remarkButton;
895
+
896
+ cGridBag editPanel;
897
+ cGridBag editCommandsPanel;
898
+
899
+ cGridBag namePanel;
900
+ cGridBag setupPanel;
901
+ cGridBag setupPanel2;
902
+ cGridBag objectCommandsPanel;
903
+ cGridBag pushPanel;
904
+ cGridBag fillPanel;
742905
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
906
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
744907 {
745908 JCheckBox cb;
746909
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);
910
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
752911 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
756912
757913 return cb;
758914 }
759915
760
- cButton AddButton(ObjEditor oe, String label)
916
+ cButton AddButton(cGridBag panel, String label)
761917 {
762918 cButton cb;
763919
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);
920
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
769921 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
773922
774923 return cb;
775924 }
776925
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
926
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
778927 {
779928 JComboBox combo;
780929
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;
930
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
784931 combo.addActionListener(this);
785932
786933 return combo;
787934 }
788935
789
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
936
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
790937 {
791
- NumberSlider combo;
938
+ cGridBag control = new cGridBag();
939
+
940
+ cNumberSlider combo;
792941
793942 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
796943 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
-
944
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
945
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
806946 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
947
+
948
+ panel.add(control);
949
+
950
+ return control;
813951 }
814952
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
953
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
816954 {
817
- NumberSlider combo;
955
+ cGridBag control = new cGridBag();
956
+
957
+ cNumberSlider combo;
818958
819959 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822960 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
-
961
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
962
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832963 combo.setInteger(current);
833964
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
965
+ panel.add(control);
966
+
967
+ return control;
839968 }
840969
841
- JTextArea AddText(JPanel ctrlPanel, String name)
970
+ JTextArea AddText(cGridBag ctrlPanel, String name)
842971 {
843972 JTextArea text;
844973
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
974
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
848975 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
851976
852977 return text;
853978 }
....@@ -877,9 +1002,16 @@
8771002 objEditor.ctrlPanel.remove(j);
8781003 }
8791004
1005
+ void Remove(cNumberSlider j)
1006
+ {
1007
+ j.removeChangeListener(this);
1008
+ //objEditor.ctrlPanel.remove(j.label);
1009
+ objEditor.ctrlPanel.remove(j);
1010
+ }
1011
+
8801012 /*
8811013 */
882
- void Return() // ObjEditor oe)
1014
+ void Return0() // ObjEditor oe)
8831015 {
8841016 aConstraints.gridy += 1;
8851017 aConstraints.gridx = 0;
....@@ -934,35 +1066,77 @@
9341066
9351067 void SetupUI2(ObjEditor oe)
9361068 {
937
-// oe.aConstraints.weightx = 0;
938
-// oe.aConstraints.weighty = 0;
939
-// oe.aConstraints.gridx = 0;
940
-// oe.aConstraints.gridy = 0;
941
- SetupName(oe);
1069
+ //SetupName(oe);
1070
+
1071
+ namePanel = new cGridBag();
1072
+
1073
+ nameField = AddText(namePanel, copy.GetName());
1074
+ namePanel.add(nameField);
1075
+ oe.ctrlPanel.add(namePanel);
1076
+
1077
+ oe.ctrlPanel.Return();
9421078
9431079 if (!GroupEditor.allparams)
9441080 return;
9451081
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1082
+ setupPanel = new cGridBag().setVertical(false);
1083
+
1084
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1085
+ liveCB.setToolTipText("Animate object");
1086
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1087
+ selectCB.setToolTipText("Make object selectable");
9491088 // 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");
1089
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1090
+ hideCB.setToolTipText("Hide object");
1091
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1092
+ markCB.setToolTipText("Set the animation target transform");
1093
+
1094
+ setupPanel2 = new cGridBag().setVertical(false);
1095
+
1096
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1097
+ rewindCB.setToolTipText("Rewind animation");
1098
+
1099
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1100
+ randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1101
+
1102
+ if (Globals.ADVANCED)
1103
+ {
1104
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1105
+ link2masterCB.setToolTipText("Attach to support");
1106
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1107
+ speedupCB.setToolTipText("Option motion capture");
1108
+ }
1109
+
1110
+ oe.ctrlPanel.add(setupPanel);
1111
+ oe.ctrlPanel.Return();
1112
+ oe.ctrlPanel.add(setupPanel2);
1113
+ oe.ctrlPanel.Return();
1114
+
1115
+ objectCommandsPanel = new cGridBag().setVertical(false);
1116
+
1117
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1118
+ resetButton.setToolTipText("Jump to frame zero");
1119
+ stepButton = AddButton(objectCommandsPanel, "Step");
1120
+ stepButton.setToolTipText("Step one frame");
9561121 // resetAllButton = AddButton(oe, "Reset All");
9571122 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9591123 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- remarkButton = AddButton(oe, "Rem");
1124
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1125
+ slowerButton.setToolTipText("Decrease animation speed");
1126
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1127
+ fasterButton.setToolTipText("Increase animation speed");
1128
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1129
+ remarkButton.setToolTipText("Set the current transform as the target");
9631130
964
- Return();
1131
+ oe.ctrlPanel.add(objectCommandsPanel);
1132
+ oe.ctrlPanel.Return();
9651133
1134
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1135
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1136
+ //Return();
1137
+
1138
+ oe.ctrlPanel.Return();
1139
+
9661140 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671141 // ObjEditor.aConstraints.gridx += 1;
9681142
....@@ -1056,7 +1230,7 @@
10561230 oe.aConstraints.gridwidth = 1;
10571231 /**/
10581232 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1233
+ oe.ctrlPanel.Return();
10601234
10611235 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621236 //textureButton.setEnabled(false);
....@@ -1158,11 +1332,28 @@
11581332 //JPanel worldPanel =
11591333 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601334 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1164
- //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame);
1335
+ centralPanel = new cGridBag();
1336
+ centralPanel.preferredWidth = 20;
1337
+
1338
+ if (Globals.ADVANCED)
1339
+ {
1340
+ timelinePanel = new JPanel(new BorderLayout());
1341
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11651342
1343
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1344
+ cameraPanel.setContinuousLayout(true);
1345
+ cameraPanel.setOneTouchExpandable(true);
1346
+// cameraPanel.setDividerLocation(0.9);
1347
+// cameraPanel.setDividerSize(9);
1348
+ cameraPanel.setResizeWeight(1.0);
1349
+
1350
+ }
1351
+
1352
+ centralPanel.add(cameraView);
1353
+ centralPanel.setFocusable(true);
1354
+ //frame.setJMenuBar(timelineMenubar);
1355
+ //centralPanel.add(timelinePanel);
1356
+
11661357 //topView.camera = ;
11671358 //frontView.camera = new Camera(2);
11681359 //sideView.camera = new Camera(3);
....@@ -1178,12 +1369,13 @@
11781369 //frontView.object = copy;
11791370 //sideView.object = copy;
11801371
1181
- XYZPanel = new JPanel();
1182
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1372
+ XYZPanel = new cGridBag().setVertical(true);
1373
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11831374
1184
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1186
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1375
+ XYZPanel.preferredWidth = 5;
1376
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1377
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1378
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
11871379
11881380 /*
11891381 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1192,7 +1384,7 @@
11921384 gridPanel.add(cameraView);
11931385 gridPanel.add(XYZPanel);
11941386 */
1195
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1387
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11961388 gridPanel.setContinuousLayout(true);
11971389 gridPanel.setOneTouchExpandable(true);
11981390 gridPanel.setDividerLocation(1.0);
....@@ -1220,11 +1412,13 @@
12201412
12211413 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12221414 //tmp.setName("Edit");
1415
+ objectPanel.add(toolboxPanel);
12231416 objectPanel.add(materialPanel);
1224
- JPanel north = new JPanel(new BorderLayout());
1225
- north.setName("Edit");
1226
- north.add(ctrlPanel, BorderLayout.NORTH);
1227
- objectPanel.add(north);
1417
+// JPanel north = new JPanel(new BorderLayout());
1418
+// north.setName("Edit");
1419
+// north.add(ctrlPanel, BorderLayout.NORTH);
1420
+// objectPanel.add(north);
1421
+ objectPanel.add(editPanel);
12281422 objectPanel.add(infoPanel);
12291423
12301424 /*
....@@ -1245,16 +1439,23 @@
12451439 scrollpane.setWheelScrollingEnabled(true);
12461440 scrollpane.addMouseWheelListener(this); // Default not fast enough
12471441
1248
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1249
- scenePanel.add(scrollpane);
1442
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1443
+ scenePanel.preferredWidth = 6;
1444
+
1445
+ JTabbedPane tabbedPane = new JTabbedPane();
1446
+ tabbedPane.add(scrollpane);
12501447
1251
- scenePanel.add(FSPane = new cFileSystemPane(this));
1448
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12521449
1253
- optionsPanel = new JPanel(new GridBagLayout());
1450
+ optionsPanel = new cGridBag().setVertical(true);
12541451
12551452 optionsPanel.setName("Options");
1256
- scenePanel.add(optionsPanel);
1257
-
1453
+
1454
+ AddOptions(optionsPanel); //, aConstraints);
1455
+
1456
+ tabbedPane.add(optionsPanel);
1457
+
1458
+ scenePanel.add(tabbedPane);
12581459
12591460 /*
12601461 cTree jTree = new cTree(null);
....@@ -1288,6 +1489,7 @@
12881489 //bigPanel.setSize(new Dimension(10,10));
12891490 //bigPanel.add(ctrlPanel);
12901491 //bigPanel.add(gridPanel);
1492
+ /**
12911493 bigThree = new JPanel();
12921494 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12931495 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1304,14 +1506,20 @@
13041506 // aConstraints.gridheight = 3;
13051507 aWindowConstraints.gridx = 1;
13061508 aWindowConstraints.fill = GridBagConstraints.BOTH;
1307
- bigThree.add(cameraPanel, aWindowConstraints);
1509
+ bigThree.add(centralPanel, aWindowConstraints);
13081510 aWindowConstraints.weightx = 0;
13091511 aWindowConstraints.gridx = 4;
13101512 aWindowConstraints.gridwidth = 1;
13111513 // aConstraints.gridheight = 3;
13121514 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13131515 bigThree.add(XYZPanel, aWindowConstraints);
1516
+ /**/
13141517
1518
+ bigThree = new cGridBag();
1519
+ bigThree.addComponent(scenePanel);
1520
+ bigThree.addComponent(centralPanel);
1521
+ bigThree.addComponent(XYZPanel);
1522
+
13151523 // // SIDE EFFECT!!!
13161524 // aConstraints.gridx = 0;
13171525 // aConstraints.gridy = 0;
....@@ -1332,14 +1540,17 @@
13321540 //worldPane.add(bigPanel);
13331541 //worldPane.add(worldPanel);
13341542 /**/
1335
- frame.getContentPane().add(/*"Center",*/framePanel);
1543
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1544
+ frame.add(/*"Center",*/framePanel);
13361545 //frame.getContentPane().add(/*"Center",*/ worldPane);
13371546
13381547 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13391548
1340
- frame.setSize(1024, 768);
1341
- frame.show();
1549
+ frame.setSize(1280, 860);
1550
+ frame.setVisible(true);
13421551
1552
+ cameraView.requestFocusInWindow();
1553
+
13431554 gridPanel.setDividerLocation(1.0);
13441555
13451556 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1353,6 +1564,10 @@
13531564 });
13541565 }
13551566
1567
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1568
+ {
1569
+ }
1570
+
13561571 JTree GetTree()
13571572 {
13581573 return objEditor.jTree;
....@@ -1364,260 +1579,173 @@
13641579 ctrlPanel.removeAll();
13651580 }
13661581
1367
- void SetupMaterial(JPanel ctrlPanel)
1582
+ void SetupMaterial(cGridBag panel)
13681583 {
1369
- aConstraints.weighty = 0;
1370
- //aConstraints.weightx = 1;
1371
- /*
1584
+ /*
13721585 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13731586 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1374
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1375
- aConstraints.gridx += 1;
13761587 */
13771588
1378
- aConstraints.gridwidth = 1;
1379
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1380
- aConstraints.gridx += 1;
1381
- aConstraints.weighty = 0;
1382
- aConstraints.gridwidth = 1;
1589
+ cGridBag editBar = new cGridBag().setVertical(false);
1590
+
1591
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1592
+ createMaterialButton.setToolTipText("Create material");
13831593
13841594 /*
13851595 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1386
- aConstraints.gridx += 1;
1387
- aConstraints.weighty = 0;
1388
- aConstraints.gridwidth = 1;
13891596 */
13901597
1391
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1392
- aConstraints.gridx += 1;
1598
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1599
+ clearMaterialButton.setToolTipText("Clear material");
1600
+
1601
+ if (Globals.ADVANCED)
1602
+ {
1603
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1604
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1605
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1606
+ }
13931607
1394
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1395
-
1396
- aConstraints.gridx += 1;
1397
-
1398
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1399
-
1400
- aConstraints.gridx += 1;
1401
-
1402
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1403
-
1404
- aConstraints.gridx = 0;
1405
- aConstraints.gridy += 1;
1406
- aConstraints.weighty = 0;
1407
- aConstraints.gridwidth = 1;
1608
+ editBar.preferredHeight = 15;
1609
+
1610
+ panel.add(editBar);
1611
+
14081612 /**/
14091613 //aConstraints.weighty = 0;
14101614 ////aConstraints.weightx = 1;
14111615 //aConstraints.weighty = 1;
14121616 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14131617 //aConstraints.gridx += 1;
1414
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1415
- aConstraints.weighty = 0;
1416
- aConstraints.gridx = 0;
1417
- aConstraints.gridy += 1;
1418
- aConstraints.gridwidth = 1;
1618
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14191619
1420
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1421
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1422
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1423
- aConstraints.gridx += 1;
1424
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1425
- //aConstraints.weightx = 0;
1426
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1427
- aConstraints.gridx = 0;
1428
- aConstraints.gridy += 1;
1429
- aConstraints.gridwidth = 1;
1620
+ cGridBag colorSection = new cGridBag().setVertical(true);
1621
+
1622
+ cGridBag color = new cGridBag();
1623
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1624
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1625
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1626
+ //colorField.preferredWidth = 200;
1627
+ colorSection.add(color);
14301628
1431
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1432
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1433
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1434
- aConstraints.gridx += 1;
1435
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1436
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1437
- aConstraints.gridx = 0;
1438
- aConstraints.gridy += 1;
1439
- aConstraints.gridwidth = 1;
1629
+ cGridBag modulation = new cGridBag();
1630
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1631
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1632
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1633
+ colorSection.add(modulation);
14401634
1441
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1442
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1443
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1444
- aConstraints.gridx += 1;
1445
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1446
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1447
- aConstraints.gridx = 0;
1448
- aConstraints.gridy += 1;
1449
- aConstraints.gridwidth = 1;
1635
+ cGridBag texture = new cGridBag();
1636
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1637
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1638
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1639
+ colorSection.add(texture);
14501640
1451
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1452
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1453
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1454
- aConstraints.gridx += 1;
1455
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1456
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1457
- aConstraints.gridx = 0;
1458
- aConstraints.gridy += 1;
1459
- aConstraints.gridwidth = 1;
1641
+ cGridBag anisoU = new cGridBag();
1642
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1643
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1644
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1645
+ colorSection.add(anisoU);
14601646
1461
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1462
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1463
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1464
- aConstraints.gridx += 1;
1465
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1466
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1467
- aConstraints.gridx = 0;
1468
- aConstraints.gridy += 1;
1469
- aConstraints.gridwidth = 1;
1647
+ cGridBag anisoV = new cGridBag();
1648
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1649
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1650
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1651
+ colorSection.add(anisoV);
14701652
1471
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1472
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1473
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1474
- aConstraints.gridx += 1;
1475
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1476
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1477
- aConstraints.gridx = 0;
1478
- aConstraints.gridy += 1;
1479
- aConstraints.gridwidth = 1;
1653
+ cGridBag shadowbias = new cGridBag();
1654
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1655
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1656
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1657
+ colorSection.add(shadowbias);
14801658
1481
- //aConstraints.weighty = 1;
1482
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1483
- //aConstraints.gridx += 1;
1484
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1485
- aConstraints.weighty = 0;
1486
- aConstraints.gridx = 0;
1487
- aConstraints.gridy += 1;
1488
- aConstraints.gridwidth = 1;
1659
+ panel.add(new JSeparator());
1660
+
1661
+ panel.add(colorSection);
1662
+
1663
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1664
+
1665
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1666
+
1667
+ cGridBag diffuse = new cGridBag();
1668
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1669
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1670
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1671
+ diffuseSection.add(diffuse);
14891672
1490
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1491
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1492
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1493
- aConstraints.gridx += 1;
1494
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1495
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1496
- aConstraints.gridx = 0;
1497
- aConstraints.gridy += 1;
1498
- aConstraints.gridwidth = 1;
1673
+ cGridBag diffuseness = new cGridBag();
1674
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1675
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1676
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1677
+ diffuseSection.add(diffuseness);
14991678
1500
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1501
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1502
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1503
- aConstraints.gridx += 1;
1504
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1505
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1506
- aConstraints.gridx = 0;
1507
- aConstraints.gridy += 1;
1508
- aConstraints.gridwidth = 1;
1679
+ cGridBag selfshadow = new cGridBag();
1680
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1681
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1683
+ diffuseSection.add(selfshadow);
15091684
1510
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1511
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1512
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1513
- aConstraints.gridx += 1;
1514
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1515
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1516
- aConstraints.gridx = 0;
1517
- aConstraints.gridy += 1;
1518
- aConstraints.gridwidth = 1;
1685
+ cGridBag sheen = new cGridBag();
1686
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1687
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1689
+ diffuseSection.add(sheen);
15191690
1520
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1521
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1522
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1523
- aConstraints.gridx += 1;
1524
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1525
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1526
- aConstraints.gridx = 0;
1527
- aConstraints.gridy += 1;
1528
- aConstraints.gridwidth = 1;
1691
+ cGridBag subsurface = new cGridBag();
1692
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1693
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1694
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1695
+ diffuseSection.add(subsurface);
15291696
1530
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1531
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1533
- aConstraints.gridx += 1;
1534
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1535
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1536
- aConstraints.gridx = 0;
1537
- aConstraints.gridy += 1;
1538
- aConstraints.gridwidth = 1;
1697
+ cGridBag shadow = new cGridBag();
1698
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1699
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1700
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1701
+ diffuseSection.add(shadow);
15391702
1540
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1541
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1542
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1543
- aConstraints.gridx += 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1545
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1546
- aConstraints.gridx = 0;
1547
- aConstraints.gridy += 1;
1548
- aConstraints.gridwidth = 1;
1703
+ cGridBag fakedepth = new cGridBag();
1704
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1705
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1706
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1707
+ diffuseSection.add(fakedepth);
15491708
1550
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1551
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1552
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1553
- aConstraints.gridx += 1;
1554
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1555
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1556
- aConstraints.gridx = 0;
1557
- aConstraints.gridy += 1;
1558
- aConstraints.gridwidth = 1;
1709
+ panel.add(new JSeparator());
1710
+
1711
+ panel.add(diffuseSection);
1712
+
1713
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1714
+
1715
+ cGridBag specularSection = new cGridBag().setVertical(true);
15591716
1560
- //aConstraints.weighty = 1;
1561
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1562
- //aConstraints.gridx += 1;
1563
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1564
- aConstraints.weighty = 0;
1565
- aConstraints.gridx = 0;
1566
- aConstraints.gridy += 1;
1567
- aConstraints.gridwidth = 1;
1717
+ cGridBag specular = new cGridBag();
1718
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1719
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1720
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1721
+ specularSection.add(specular);
15681722
1569
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1570
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1571
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1572
- aConstraints.gridx += 1;
1573
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1574
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1575
- aConstraints.gridx = 0;
1576
- aConstraints.gridy += 1;
1577
- aConstraints.gridwidth = 1;
1723
+ cGridBag lightarea = new cGridBag();
1724
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1725
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1726
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1727
+ specularSection.add(lightarea);
15781728
1579
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1580
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1581
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1582
- aConstraints.gridx += 1;
1583
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1584
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1585
- aConstraints.gridx = 0;
1586
- aConstraints.gridy += 1;
1587
- aConstraints.gridwidth = 1;
1729
+ cGridBag shininess = new cGridBag();
1730
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1731
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1732
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1733
+ specularSection.add(shininess);
15881734
1589
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1590
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1591
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1592
- aConstraints.gridx += 1;
1593
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1594
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1595
- aConstraints.gridx = 0;
1596
- aConstraints.gridy += 1;
1597
- aConstraints.gridwidth = 1;
1735
+ cGridBag metalness = new cGridBag();
1736
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1737
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1738
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1739
+ specularSection.add(metalness);
15981740
1599
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1600
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1601
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1602
- aConstraints.gridx += 1;
1603
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1604
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1605
- aConstraints.gridx = 0;
1606
- aConstraints.gridy += 1;
1607
- aConstraints.gridwidth = 1;
1741
+ cGridBag velvet = new cGridBag();
1742
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1743
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1744
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1745
+ specularSection.add(velvet);
16081746
1609
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1610
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1612
- aConstraints.gridx += 1;
1613
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1614
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1615
- aConstraints.gridx = 0;
1616
- aConstraints.gridy += 1;
1617
- aConstraints.gridwidth = 1;
1618
-
1619
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1620
- Return();
1747
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1748
+ //Return();
16211749 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16221750 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16231751 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1628,130 +1756,93 @@
16281756 // aConstraints.gridy += 1;
16291757 // aConstraints.gridwidth = 1;
16301758
1631
- //aConstraints.weighty = 1;
1632
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1633
- //aConstraints.gridx += 1;
1634
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1635
- aConstraints.weighty = 0;
1636
- aConstraints.gridx = 0;
1637
- aConstraints.gridy += 1;
1638
- aConstraints.gridwidth = 1;
16391759
1640
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1641
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1642
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1643
- aConstraints.gridx += 1;
1644
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1645
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1646
- aConstraints.gridx = 0;
1647
- aConstraints.gridy += 1;
1648
- aConstraints.gridwidth = 1;
1760
+ panel.add(new JSeparator());
1761
+
1762
+ panel.add(specularSection);
1763
+
1764
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1765
+
1766
+ cGridBag globalSection = new cGridBag().setVertical(true);
16491767
1650
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1651
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1652
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1653
- aConstraints.gridx += 1;
1654
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1655
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1656
- aConstraints.gridx = 0;
1657
- aConstraints.gridy += 1;
1658
- aConstraints.gridwidth = 1;
1768
+ cGridBag camera = new cGridBag();
1769
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1770
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1771
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1772
+ globalSection.add(camera);
16591773
1660
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1661
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1662
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1663
- aConstraints.gridx += 1;
1664
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1665
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1666
- aConstraints.gridx = 0;
1667
- aConstraints.gridy += 1;
1668
- aConstraints.gridwidth = 1;
1774
+ cGridBag ambient = new cGridBag();
1775
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1776
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1777
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1778
+ globalSection.add(ambient);
16691779
1670
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1671
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1672
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1673
- aConstraints.gridx += 1;
1674
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1675
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1676
- aConstraints.gridx = 0;
1677
- aConstraints.gridy += 1;
1678
- aConstraints.gridwidth = 1;
1679
- aConstraints.weighty = 0;
1780
+ cGridBag backlit = new cGridBag();
1781
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1782
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1783
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1784
+ globalSection.add(backlit);
16801785
1681
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1682
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1683
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1684
- aConstraints.gridx += 1;
1685
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1686
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1687
- aConstraints.gridx = 0;
1688
- aConstraints.gridy += 1;
1689
- aConstraints.gridwidth = 1;
1786
+ cGridBag opacity = new cGridBag();
1787
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1788
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1789
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1790
+ globalSection.add(opacity);
16901791
1691
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1692
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1693
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1694
- aConstraints.gridx += 1;
1695
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1696
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1697
- aConstraints.gridx = 0;
1698
- aConstraints.gridy += 1;
1699
- aConstraints.gridwidth = 1;
1792
+ panel.add(new JSeparator());
1793
+
1794
+ panel.add(globalSection);
1795
+
1796
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1797
+
1798
+ cGridBag textureSection = new cGridBag().setVertical(true);
17001799
1701
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1702
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1703
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1704
- aConstraints.gridx += 1;
1705
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1706
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1707
- aConstraints.gridx = 0;
1708
- aConstraints.gridy += 1;
1709
- aConstraints.gridwidth = 1;
1800
+ cGridBag bump = new cGridBag();
1801
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1802
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1803
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1804
+ textureSection.add(bump);
17101805
1711
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1712
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1713
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1714
- aConstraints.gridx += 1;
1715
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1716
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1717
- aConstraints.gridx = 0;
1718
- aConstraints.gridy += 1;
1719
- aConstraints.gridwidth = 1;
1806
+ cGridBag noise = new cGridBag();
1807
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1808
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1809
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1810
+ textureSection.add(noise);
17201811
1721
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1722
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1723
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1724
- aConstraints.gridx += 1;
1725
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1726
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1727
- aConstraints.gridx = 0;
1728
- aConstraints.gridy += 1;
1729
- aConstraints.gridwidth = 1;
1812
+ cGridBag power = new cGridBag();
1813
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1814
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1815
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1816
+ textureSection.add(power);
17301817
1731
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1732
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1733
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1734
- aConstraints.gridx += 1;
1735
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1736
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1737
- aConstraints.gridx = 0;
1738
- aConstraints.gridy += 1;
1739
- aConstraints.gridwidth = 1;
1818
+ cGridBag borderfade = new cGridBag();
1819
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1820
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1821
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1822
+ textureSection.add(borderfade);
17401823
1741
- //aConstraints.weighty = 1;
1742
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1743
- //aConstraints.gridx += 1;
1744
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1745
- aConstraints.weighty = 0;
1824
+ cGridBag fog = new cGridBag();
1825
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1826
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1827
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1828
+ textureSection.add(fog);
17461829
1747
- aConstraints.gridx = 0;
1748
- aConstraints.gridy = 0;
1749
- aConstraints.gridwidth = 1;
1830
+ cGridBag opacityPower = new cGridBag();
1831
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1832
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1833
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1834
+ textureSection.add(opacityPower);
1835
+
1836
+ panel.add(new JSeparator());
1837
+
1838
+ panel.add(textureSection);
1839
+
1840
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17501841
17511842 SetMaterial(copy); // .GetMaterial());
17521843
1753
- colorField.addChangeListener(this);
1754
- modulationField.addChangeListener(this);
1844
+ //colorField.addChangeListener(this);
1845
+// modulationField.addChangeListener(this);
17551846 metalnessField.addChangeListener(this);
17561847 diffuseField.addChangeListener(this);
17571848 specularField.addChangeListener(this);
....@@ -1781,12 +1872,15 @@
17811872 opacityPowerField.addChangeListener(this);
17821873 /**/
17831874
1784
- resetSlidersButton.addActionListener(this);
17851875 clearMaterialButton.addActionListener(this);
17861876 createMaterialButton.addActionListener(this);
1787
-
1788
- propagateToggle.addItemListener(this);
1789
- multiplyToggle.addItemListener(this);
1877
+
1878
+ if (Globals.ADVANCED)
1879
+ {
1880
+ resetSlidersButton.addActionListener(this);
1881
+ propagateToggle.addItemListener(this);
1882
+ multiplyToggle.addItemListener(this);
1883
+ }
17901884 }
17911885
17921886 void DropFile(java.io.File[] files, boolean textures)
....@@ -1957,7 +2051,7 @@
19572051
19582052 //? flashIt = false;
19592053 CameraPane pane = (CameraPane) cameraView;
1960
- pane.clickStart(location.x, location.y, 0);
2054
+ pane.clickStart(location.x, location.y, 0, 0);
19612055 pane.clickEnd(location.x, location.y, 0, true);
19622056
19632057 if (group.selection.size() == 1)
....@@ -2006,6 +2100,7 @@
20062100 e2.printStackTrace();
20072101 }
20082102 }
2103
+
20092104 LoadJMEThread loadThread;
20102105
20112106 class LoadJMEThread extends Thread
....@@ -2063,6 +2158,7 @@
20632158 //LoadFile0(filename, converter);
20642159 }
20652160 }
2161
+
20662162 LoadOBJThread loadObjThread;
20672163
20682164 class LoadOBJThread extends Thread
....@@ -2141,19 +2237,19 @@
21412237
21422238 void LoadObjFile(String fullname)
21432239 {
2144
- /*
2240
+ System.out.println("Loading " + fullname);
2241
+ /**/
21452242 //lastFilename = fullname;
21462243 if(loadObjThread == null)
21472244 {
2148
- loadObjThread = new LoadOBJThread();
2149
- loadObjThread.start();
2245
+ loadObjThread = new LoadOBJThread();
2246
+ loadObjThread.start();
21502247 }
21512248
21522249 loadObjThread.add(fullname);
2153
- */
2250
+ /**/
21542251
2155
- System.out.println("Loading " + fullname);
2156
- makeSomething(new FileObject(fullname, true), true);
2252
+ //makeSomething(new FileObject(fullname, true), true);
21572253 }
21582254
21592255 void LoadGFDFile(String fullname)
....@@ -2414,11 +2510,11 @@
24142510
24152511 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24162512 {
2417
- if (GrafreeD.standAlone)
2513
+ if (Grafreed.standAlone)
24182514 {
24192515 /**/
24202516 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2421
- browser.show();
2517
+ browser.setVisible(true);
24222518 String filename = browser.getFile();
24232519 if (filename != null && filename.length() > 0)
24242520 {
....@@ -2563,6 +2659,7 @@
25632659 }
25642660 if (input == null)
25652661 {
2662
+ new Exception().printStackTrace();
25662663 System.exit(0);
25672664 }
25682665
....@@ -2777,7 +2874,8 @@
27772874 return;
27782875 }
27792876
2780
- multiplyToggle.setSelected(mat.multiply);
2877
+ if (multiplyToggle != null)
2878
+ multiplyToggle.setSelected(mat.multiply);
27812879
27822880 assert (object.projectedVertices != null);
27832881
....@@ -2959,25 +3057,42 @@
29593057 // june 2013 copy.HardTouch();
29603058 cameraView.repaint();
29613059 return;
2962
- } else if (event.getSource() == toggleFullItem)
3060
+ } else if (event.getSource() == toggleTimelineItem)
29633061 {
2964
- if (CameraPane.FULLSCREEN)
3062
+ timeline ^= true;
3063
+
3064
+ if (timeline)
29653065 {
2966
- frame.getContentPane().remove(/*"Center",*/bigThree);
2967
- framePanel.add(bigThree);
2968
- frame.getContentPane().add(/*"Center",*/framePanel);
2969
- } else
2970
- {
2971
- frame.getContentPane().remove(/*"Center",*/framePanel);
2972
- frame.getContentPane().add(/*"Center",*/bigThree);
3066
+ centralPanel.remove(cameraView);
3067
+ cameraPanel.add(cameraView);
3068
+ centralPanel.add(cameraPanel);
3069
+ frame.setJMenuBar(timelineMenubar);
3070
+ wasFullScreen = CameraPane.FULLSCREEN;
3071
+ if (!CameraPane.FULLSCREEN)
3072
+ ToggleFullScreen();
3073
+ toggleFullScreenItem.setEnabled(false);
29733074 }
3075
+ else
3076
+ {
3077
+ centralPanel.remove(cameraPanel);
3078
+ centralPanel.add(cameraView);
3079
+ frame.setJMenuBar(null);
3080
+ if (!wasFullScreen)
3081
+ ToggleFullScreen();
3082
+ toggleFullScreenItem.setEnabled(true);
3083
+ }
3084
+
29743085 frame.validate();
2975
- cameraView.ToggleFullScreen();
3086
+ return;
3087
+ } else if (event.getSource() == toggleFullScreenItem)
3088
+ {
3089
+ ToggleFullScreen();
3090
+ frame.validate();
29763091
29773092 return;
2978
- } else if (event.getSource() == toggleRandomItem)
3093
+ } else if (event.getSource() == toggleSwitchItem)
29793094 {
2980
- cameraView.ToggleRandom();
3095
+ cameraView.ToggleSwitch();
29813096 cameraView.repaint();
29823097 return;
29833098 } else if (event.getSource() == toggleHandleItem)
....@@ -3006,6 +3121,10 @@
30063121 {
30073122 copy.live ^= true;
30083123 return;
3124
+ } else if (event.getSource() == selectCB)
3125
+ {
3126
+ copy.dontselect ^= true;
3127
+ return;
30093128 } else if (event.getSource() == hideCB)
30103129 {
30113130 copy.hide ^= true;
....@@ -3020,6 +3139,7 @@
30203139 if (event.getSource() == randomCB)
30213140 {
30223141 copy.random ^= true;
3142
+ objEditor.refreshContents();
30233143 return;
30243144 }
30253145 if (event.getSource() == speedupCB)
....@@ -3043,8 +3163,9 @@
30433163
30443164 public void actionPerformed(ActionEvent event)
30453165 {
3166
+ Object source = event.getSource();
30463167 // SCRIPT DIALOG
3047
- if (event.getSource() == okbutton)
3168
+ if (source == okbutton)
30483169 {
30493170 textpanel.setVisible(false);
30503171 textpanel.remove(textarea);
....@@ -3056,7 +3177,7 @@
30563177 textarea = null;
30573178 textpanel = null;
30583179 }
3059
- if (event.getSource() == cancelbutton)
3180
+ if (source == cancelbutton)
30603181 {
30613182 textpanel.setVisible(false);
30623183 textpanel.remove(textarea);
....@@ -3068,49 +3189,50 @@
30683189 //applySelf();
30693190 //client.refreshEditWindow();
30703191 //refreshContents();
3071
- if (event.getSource() == nameField)
3192
+ if (source == nameField)
30723193 {
30733194 //System.out.println("ObjEditor " + event);
30743195 applySelf0(true);
30753196 //parent.applySelf();
30763197 objEditor.refreshContents();
3077
- } else if (event.getSource() == resetButton)
3198
+ } else if (source == resetButton)
30783199 {
30793200 CameraPane.fullreset = true;
30803201 copy.Reset(); // ResetMeshes();
30813202 copy.Touch();
30823203 objEditor.refreshContents();
3083
- } else if (event.getSource() == stepItem)
3204
+ } else if (source == stepItem)
30843205 {
3085
- cameraView.ONESTEP = true;
3206
+ //cameraView.ONESTEP = true;
3207
+ Globals.ONESTEP = true;
30863208 cameraView.repaint();
30873209 return;
3088
- } else if (event.getSource() == stepButton)
3210
+ } else if (source == stepButton)
30893211 {
30903212 copy.Step();
30913213 copy.Touch();
30923214 objEditor.refreshContents();
3093
- } else if (event.getSource() == slowerButton)
3215
+ } else if (source == slowerButton)
30943216 {
30953217 copy.Slower();
30963218 copy.Touch();
30973219 objEditor.refreshContents();
3098
- } else if (event.getSource() == fasterButton)
3220
+ } else if (source == fasterButton)
30993221 {
31003222 copy.Faster();
31013223 copy.Touch();
31023224 objEditor.refreshContents();
3103
- } else if (event.getSource() == remarkButton)
3225
+ } else if (source == remarkButton)
31043226 {
31053227 copy.Remark();
31063228 copy.Touch();
31073229 objEditor.refreshContents();
3108
- } else if (event.getSource() == stepAllButton)
3230
+ } else if (source == stepAllButton)
31093231 {
31103232 copy.StepAll();
31113233 copy.Touch();
31123234 objEditor.refreshContents();
3113
- } else if (event.getSource() == resetAllButton)
3235
+ } else if (source == resetAllButton)
31143236 {
31153237 //CameraPane.fullreset = true;
31163238 copy.ResetAll(); // ResetMeshes();
....@@ -3143,53 +3265,75 @@
31433265 // Close();
31443266 // }
31453267 // else
3146
- if (event.getSource() == resetSlidersButton)
3268
+ if (source == resetSlidersButton)
31473269 {
31483270 ResetSliders();
3149
- } else if (event.getSource() == clearMaterialButton)
3271
+ } else if (source == clearMaterialButton)
31503272 {
31513273 ClearMaterial();
3152
- } else if (event.getSource() == createMaterialButton)
3274
+ } else if (source == createMaterialButton)
31533275 {
31543276 CreateMaterial();
3155
- } else if (event.getSource() == clearPanelButton)
3277
+ } else if (source == clearPanelButton)
31563278 {
31573279 copy.ClearUI();
31583280 refreshContents(true);
3159
- } /*
3160
- }
3161
-
3162
- public boolean action(Event event, Object arg)
3163
- {
3164
- */ else if (event.getSource() == closeItem)
3281
+ } else if (source == importGFDItem)
3282
+ {
3283
+ ImportGFD();
3284
+ } else
3285
+ if (source == importVRMLX3DItem)
3286
+ {
3287
+ ImportVRMLX3D();
3288
+ } else
3289
+ if (source == import3DSItem)
3290
+ {
3291
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3292
+ } else
3293
+ if (source == importOBJItem)
3294
+ {
3295
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3296
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3297
+ browser.setVisible(true);
3298
+ String filename = browser.getFile();
3299
+ if (filename != null && filename.length() > 0)
3300
+ {
3301
+ String fullname = browser.getDirectory() + filename;
3302
+ makeSomething(ReadOBJ(fullname), true);
3303
+ }
3304
+ } else
3305
+ if (source == closeItem)
31653306 {
31663307 Close();
31673308 //return true;
3168
- } else if (event.getSource() == loadItem)
3309
+ } else if (source == loadItem)
31693310 {
31703311 load();
31713312 //return true;
3172
- } else if (event.getSource() == saveItem)
3313
+ } else if (source == newItem)
3314
+ {
3315
+ New();
3316
+ } else if (source == saveItem)
31733317 {
31743318 save();
31753319 //return true;
3176
- } else if (event.getSource() == saveAsItem)
3320
+ } else if (source == saveAsItem)
31773321 {
31783322 saveAs();
31793323 //return true;
3180
- } else if (event.getSource() == reexportItem)
3324
+ } else if (source == reexportItem)
31813325 {
31823326 reexport();
31833327 //return true;
3184
- } else if (event.getSource() == exportAsItem)
3328
+ } else if (source == exportAsItem)
31853329 {
31863330 export();
31873331 //return true;
3188
- } else if (event.getSource() == povItem)
3332
+ } else if (source == povItem)
31893333 {
31903334 generatePOV();
31913335 //return true;
3192
- } else if (event.getSource() == zBufferItem)
3336
+ } else if (source == zBufferItem)
31933337 {
31943338 try
31953339 {
....@@ -3211,21 +3355,8 @@
32113355 cameraView.repaint();
32123356 //return true;
32133357 }
3214
- */ else if (event.getSource() == editCameraItem)
3215
- {
3216
- cameraView.ProtectCamera();
3217
- cameraView.repaint();
3218
- return;
3219
- } else if (event.getSource() == revertCameraItem)
3220
- {
3221
- cameraView.RevertCamera();
3222
- cameraView.repaint();
3223
- return;
3224
- } else if (event.getSource() == textureButton)
3225
- {
3226
- return; // true;
3227
- } else // combos...
3228
- if (event.getSource() == texresMenu)
3358
+ */ else // combos...
3359
+ if (source == texresMenu)
32293360 {
32303361 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32313362 copy.texres = texresMenu.getSelectedIndex();
....@@ -3237,27 +3368,287 @@
32373368 }
32383369 }
32393370
3240
- void ToggleAnimation()
3371
+ void New()
32413372 {
3242
- if (!CameraPane.ANIMATION)
3373
+ while (copy.Size() > 1)
32433374 {
3244
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3375
+ copy.remove(1);
3376
+ }
3377
+
3378
+ ResetModel();
3379
+ objEditor.refreshContents();
3380
+ }
3381
+
3382
+ static public byte[] Compress(Object3D o)
3383
+ {
3384
+ try
3385
+ {
3386
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3387
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3388
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3389
+
3390
+ Object3D parent = o.parent;
3391
+ o.parent = null;
3392
+
3393
+ out.writeObject(o);
3394
+
3395
+ o.parent = parent;
3396
+
3397
+ out.flush();
3398
+
3399
+ zstream.close();
3400
+ out.close();
3401
+
3402
+ return baos.toByteArray();
3403
+ } catch (Exception e)
3404
+ {
3405
+ System.err.println(e);
3406
+ return null;
3407
+ }
3408
+ }
3409
+
3410
+ static public Object Uncompress(byte[] bytes)
3411
+ {
3412
+ System.out.println("#bytes = " + bytes.length);
3413
+ try
3414
+ {
3415
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3416
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3417
+ ObjectInputStream in = new ObjectInputStream(istream);
3418
+ Object obj = in.readObject();
3419
+ in.close();
3420
+
3421
+ return obj;
3422
+ } catch (Exception e)
3423
+ {
3424
+ System.err.println(e);
3425
+ return null;
3426
+ }
3427
+ }
3428
+
3429
+ static public Object clone(Object o)
3430
+ {
3431
+ try
3432
+ {
3433
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3434
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3435
+
3436
+ out.writeObject(o);
3437
+
3438
+ out.flush();
3439
+ out.close();
3440
+
3441
+ byte[] bytes = baos.toByteArray();
3442
+
3443
+ System.out.println("clone = " + bytes.length);
3444
+
3445
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3446
+ ObjectInputStream in = new ObjectInputStream(bais);
3447
+ Object obj = in.readObject();
3448
+ in.close();
3449
+
3450
+ return obj;
3451
+ } catch (Exception e)
3452
+ {
3453
+ System.err.println(e);
3454
+ return null;
3455
+ }
3456
+ }
3457
+
3458
+ cRadio GetCurrentTab()
3459
+ {
3460
+ cRadio ab;
3461
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3462
+ {
3463
+ ab = (cRadio)e.nextElement();
3464
+ if(ab.GetObject() == copy)
3465
+ {
3466
+ return ab;
3467
+ }
3468
+ }
3469
+
3470
+ return null;
3471
+ }
3472
+
3473
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3474
+
3475
+ public void Save()
3476
+ {
3477
+ System.err.println("Save");
3478
+
3479
+ cRadio tab = GetCurrentTab();
3480
+
3481
+ boolean temp = CameraPane.SWITCH;
3482
+ CameraPane.SWITCH = false;
3483
+
3484
+ copy.ExtractBigData(hashtable);
3485
+
3486
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3487
+ tab.graphs[tab.undoindex++] = Compress(copy);
3488
+
3489
+ copy.RestoreBigData(hashtable);
3490
+
3491
+ CameraPane.SWITCH = temp;
3492
+
3493
+ //assert(hashtable.isEmpty());
3494
+
3495
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3496
+ {
3497
+ tab.graphs[i] = null;
3498
+ }
3499
+
3500
+ // test save
3501
+ if (false)
3502
+ {
3503
+ try
3504
+ {
3505
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3506
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3507
+
3508
+ p.writeObject(copy);
3509
+
3510
+ p.flush();
3511
+
3512
+ ostream.close();
3513
+ } catch (Exception e)
3514
+ {
3515
+ e.printStackTrace();
3516
+ }
3517
+ }
3518
+ }
3519
+
3520
+ void CopyChanged(Object3D obj)
3521
+ {
3522
+ boolean temp = CameraPane.SWITCH;
3523
+ CameraPane.SWITCH = false;
3524
+
3525
+ copy.ExtractBigData(hashtable);
3526
+
3527
+ copy.clear();
3528
+
3529
+ for (int i=0; i<obj.Size(); i++)
3530
+ {
3531
+ copy.add(obj.get(i));
3532
+ }
3533
+
3534
+ copy.RestoreBigData(hashtable);
3535
+
3536
+ CameraPane.SWITCH = temp;
3537
+
3538
+ //assert(hashtable.isEmpty());
3539
+
3540
+ copy.Touch();
3541
+
3542
+ ResetModel();
3543
+ copy.HardTouch(); // recompile?
3544
+
3545
+ cRadio ab;
3546
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3547
+ {
3548
+ ab = (cRadio)e.nextElement();
3549
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3550
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3551
+ if (test != null)
3552
+ {
3553
+ test.editWindow = ab.object.editWindow;
3554
+ ab.object = test;
3555
+ }
3556
+ }
3557
+
3558
+ refreshContents();
3559
+ }
3560
+
3561
+ public void Undo()
3562
+ {
3563
+ System.err.println("Undo");
3564
+
3565
+ cRadio tab = GetCurrentTab();
3566
+
3567
+ if (tab.undoindex == 0)
3568
+ {
3569
+ java.awt.Toolkit.getDefaultToolkit().beep();
3570
+ return;
3571
+ }
3572
+
3573
+ if (tab.graphs[tab.undoindex] == null)
3574
+ {
3575
+ Save();
3576
+ tab.undoindex -= 1;
3577
+ }
3578
+
3579
+ tab.undoindex -= 1;
3580
+
3581
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3582
+ }
3583
+
3584
+ public void Redo()
3585
+ {
3586
+ cRadio tab = GetCurrentTab();
3587
+
3588
+ if (tab.graphs[tab.undoindex + 1] == null)
3589
+ {
3590
+ java.awt.Toolkit.getDefaultToolkit().beep();
3591
+ return;
3592
+ }
3593
+
3594
+ tab.undoindex += 1;
3595
+
3596
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3597
+ }
3598
+
3599
+ void ImportGFD()
3600
+ {
3601
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32453602 browser.show();
32463603 String filename = browser.getFile();
32473604 if (filename != null && filename.length() > 0)
32483605 {
3249
- CameraPane.filename = browser.getDirectory() + filename;
3606
+ String fullname = browser.getDirectory() + filename;
3607
+
3608
+ //Object3D readobj =
3609
+ objEditor.ReadGFD(fullname, objEditor);
3610
+ //makeSomething(readobj);
3611
+ }
3612
+ }
3613
+
3614
+ void ImportVRMLX3D()
3615
+ {
3616
+ if (Grafreed.standAlone)
3617
+ {
3618
+ /**/
3619
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3620
+ browser.show();
3621
+ String filename = browser.getFile();
3622
+ if (filename != null && filename.length() > 0)
3623
+ {
3624
+ String fullname = browser.getDirectory() + filename;
3625
+ LoadVRMLX3D(fullname);
3626
+ }
3627
+ /**/
3628
+ }
3629
+ }
3630
+
3631
+ void ToggleAnimation()
3632
+ {
3633
+ if (!Globals.ANIMATION)
3634
+ {
3635
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3636
+ browser.setVisible(true);
3637
+ String filename = browser.getFile();
3638
+ if (filename != null && filename.length() > 0)
3639
+ {
3640
+ Globals.filename = browser.getDirectory() + filename;
32503641 //CameraPane.framecount = 0;
3251
- CameraPane.imagecount = 0;
3642
+ Globals.imagecount = 0;
32523643
3253
- CameraPane.ANIMATION ^= true;
3644
+ Globals.ANIMATION ^= true;
32543645
3255
- GrafreeD.wav.cursor = 0;
3256
- GrafreeD.wav.loop = 0;
3646
+ Grafreed.wav.cursor = 0;
3647
+ Grafreed.wav.loop = 0;
32573648 }
32583649 } else
32593650 {
3260
- CameraPane.ANIMATION ^= true;
3651
+ Globals.ANIMATION ^= true;
32613652 }
32623653 }
32633654
....@@ -3303,7 +3694,7 @@
33033694 void CreateMaterial()
33043695 {
33053696 //copy.ClearMaterial(); // PATCH
3306
- copy.CreateMaterialS(multiplyToggle.isSelected());
3697
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33073698 if (copy.selection.size() > 0)
33083699 //SetMaterial(copy);
33093700 {
....@@ -3354,7 +3745,7 @@
33543745 assert false;
33553746 }
33563747
3357
- void EditSelection()
3748
+ void EditSelection(boolean newWindow)
33583749 {
33593750 }
33603751
....@@ -3362,11 +3753,11 @@
33623753 {
33633754 copy.ResetBlockLoop(); // temporary problem
33643755
3365
- boolean random = CameraPane.RANDOM;
3366
- CameraPane.RANDOM = false; // parse everything
3756
+ boolean random = CameraPane.SWITCH;
3757
+ CameraPane.SWITCH = false; // parse everything
33673758 copy.ResetDisplayList();
33683759 copy.HardTouch();
3369
- CameraPane.RANDOM = random;
3760
+ CameraPane.SWITCH = random;
33703761 }
33713762
33723763 // public void applySelf()
....@@ -3436,10 +3827,40 @@
34363827 current.fakedepth = (float) fakedepthField.getFloat();
34373828 current.shadowbias = (float) shadowbiasField.getFloat();
34383829
3439
- if (!NumberSlider.frozen)
3830
+ if (!cNumberSlider.frozen)
34403831 {
34413832 //System.out.println("Propagate = " + propagate);
34423833 copy.UpdateMaterial(anchor, current, propagate);
3834
+
3835
+ if (copy.material != null)
3836
+ {
3837
+ cMaterial mat = copy.material;
3838
+
3839
+ colorField.SetToolTipValue((mat.color));
3840
+ modulationField.SetToolTipValue((mat.modulation));
3841
+ metalnessField.SetToolTipValue((mat.metalness));
3842
+ diffuseField.SetToolTipValue((mat.diffuse));
3843
+ specularField.SetToolTipValue((mat.specular));
3844
+ shininessField.SetToolTipValue((mat.shininess));
3845
+ shiftField.SetToolTipValue((mat.shift));
3846
+ ambientField.SetToolTipValue((mat.ambient));
3847
+ lightareaField.SetToolTipValue((mat.lightarea));
3848
+ diffusenessField.SetToolTipValue((mat.factor));
3849
+ velvetField.SetToolTipValue((mat.velvet));
3850
+ sheenField.SetToolTipValue((mat.sheen));
3851
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3852
+ backlitField.SetToolTipValue((mat.bump));
3853
+ anisoField.SetToolTipValue((mat.aniso));
3854
+ anisoVField.SetToolTipValue((mat.anisoV));
3855
+ cameraField.SetToolTipValue((mat.cameralight));
3856
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3857
+ shadowField.SetToolTipValue((mat.shadow));
3858
+ textureField.SetToolTipValue((mat.texture));
3859
+ opacityField.SetToolTipValue((mat.opacity));
3860
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3861
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3862
+ }
3863
+
34433864 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34443865 {
34453866 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3484,6 +3905,7 @@
34843905 || e.getSource() == apertureField
34853906 || e.getSource() == shadowblurField)
34863907 {
3908
+ new Exception().printStackTrace();
34873909 System.exit(0);
34883910 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34893911 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3510,7 +3932,13 @@
35103932 //System.out.println("PARENT = " + parent);
35113933 //if (parent != null)
35123934 // parent.applySelf();
3513
- refreshContents();
3935
+ if (e.getSource() == normalpushField)
3936
+ {
3937
+ objEditor.refreshContents();
3938
+ //Refresh();
3939
+ }
3940
+ else
3941
+ refreshContents();
35143942 // ??? client.refreshEditWindow();
35153943 }
35163944 //else
....@@ -3522,7 +3950,7 @@
35223950 //group.name = nameField.getText();
35233951 //objEditor.applySelf();
35243952
3525
- assert (objEditor == this);
3953
+ // OCT2018: assert (objEditor == this);
35263954 if (copy.selection == null || copy.selection.size() == 0)
35273955 //super.applySelf()
35283956 ; else
....@@ -3546,12 +3974,18 @@
35463974 objEditor.copy = keep;
35473975 }
35483976 }
3977
+
3978
+ if (normalpushField != null)
3979
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35493980 }
35503981
35513982 void SnapObject()
35523983 {
3553
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3554
- SnapObject(obj);
3984
+ if (copy.selection.size() > 0)
3985
+ {
3986
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3987
+ SnapObject(obj);
3988
+ }
35553989 }
35563990
35573991 void SnapObject(Object3D obj)
....@@ -3797,7 +4231,7 @@
37974231
37984232 radioPanel.revalidate();
37994233 radioPanel.repaint();
3800
- ctrlPanel.revalidate(); // ? new
4234
+ ctrlPanel.validate(); // ? new
38014235 ctrlPanel.repaint();
38024236 }
38034237 }
....@@ -3806,6 +4240,8 @@
38064240
38074241 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38084242 {
4243
+ if (Globals.SAVEONMAKE) // && resetmodel)
4244
+ Save();
38094245 //Tween.set(thing, 0).target(1).start(tweenManager);
38104246 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38114247 // if (thing instanceof GenericJointDemo)
....@@ -3892,6 +4328,12 @@
38924328 {
38934329 ResetModel();
38944330 Select(thing.GetTreePath(), true, false); // unselect... false);
4331
+
4332
+ if (thing.Size() == 0)
4333
+ {
4334
+ //EditSelection(false);
4335
+ }
4336
+
38954337 refreshContents();
38964338 }
38974339
....@@ -4009,6 +4451,7 @@
40094451 }
40104452 }
40114453 }
4454
+
40124455 LoadGFDThread loadGFDThread;
40134456
40144457 void ReadGFD(String fullname, iCallBack cb)
....@@ -4028,8 +4471,10 @@
40284471
40294472 try
40304473 {
4474
+ // Try compressed version first.
40314475 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4032
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4476
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4477
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40334478
40344479 readobj = (Object3D) p.readObject();
40354480 istream.close();
....@@ -4037,7 +4482,20 @@
40374482 readobj.ResetDisplayList();
40384483 } catch (Exception e)
40394484 {
4040
- e.printStackTrace();
4485
+ //e.printStackTrace();
4486
+ try
4487
+ {
4488
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4489
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4490
+
4491
+ readobj = (Object3D) p.readObject();
4492
+ istream.close();
4493
+
4494
+ readobj.ResetDisplayList();
4495
+ } catch (Exception e2)
4496
+ {
4497
+ e2.printStackTrace();
4498
+ }
40414499 }
40424500 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40434501 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4083,6 +4541,12 @@
40834541
40844542 void LoadIt(Object obj)
40854543 {
4544
+ if (obj == null)
4545
+ {
4546
+ // Invalid file
4547
+ return;
4548
+ }
4549
+
40864550 System.out.println("Loaded " + obj);
40874551 //new Exception().printStackTrace();
40884552 Object3D readobj = (Object3D) obj;
....@@ -4092,6 +4556,8 @@
40924556
40934557 if (readobj != null)
40944558 {
4559
+ if (Globals.SAVEONMAKE)
4560
+ Save();
40954561 try
40964562 {
40974563 //readobj.deepCopySelf(copy);
....@@ -4154,7 +4620,7 @@
41544620
41554621 void load() // throws ClassNotFoundException
41564622 {
4157
- if (GrafreeD.standAlone)
4623
+ if (Grafreed.standAlone)
41584624 {
41594625 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
41604626 browser.show();
....@@ -4241,11 +4707,13 @@
42414707 try
42424708 {
42434709 FileOutputStream ostream = new FileOutputStream(lastname);
4244
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4710
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4711
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42454712
42464713 p.writeObject(copy);
42474714 p.flush();
42484715
4716
+ zstream.close();
42494717 ostream.close();
42504718
42514719 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4255,11 +4723,12 @@
42554723 {
42564724 }
42574725 }
4726
+
42584727 String lastname;
42594728
42604729 void saveAs()
42614730 {
4262
- if (GrafreeD.standAlone)
4731
+ if (Grafreed.standAlone)
42634732 {
42644733 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42654734 browser.setVisible(true);
....@@ -4364,13 +4833,13 @@
43644833 try
43654834 {
43664835 FileOutputStream ostream = new FileOutputStream(filename);
4367
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4368
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4836
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4837
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43694838
43704839 Object3D objectparent = obj.parent;
43714840 obj.parent = null;
43724841
4373
- Object3D object = (Object3D) GrafreeD.clone(obj);
4842
+ Object3D object = (Object3D) Grafreed.clone(obj);
43744843
43754844 obj.parent = objectparent;
43764845
....@@ -4382,8 +4851,8 @@
43824851 p.writeObject(object);
43834852 p.flush();
43844853
4854
+ zstream.close();
43854855 ostream.close();
4386
- // zstream.close();
43874856
43884857 // group.selection.get(0).parent = parent;
43894858 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4404,7 +4873,7 @@
44044873 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44054874 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44064875 copy.generatePOV(buffer);
4407
- if (GrafreeD.standAlone)
4876
+ if (Grafreed.standAlone)
44084877 {
44094878 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44104879 browser.show();
....@@ -4430,7 +4899,8 @@
44304899 Object3D client;
44314900 Object3D copy;
44324901 MenuBar menuBar;
4433
- Menu windowMenu;
4902
+ Menu fileMenu;
4903
+ MenuItem newItem;
44344904 MenuItem loadItem;
44354905 MenuItem saveItem;
44364906 MenuItem saveAsItem;
....@@ -4438,45 +4908,58 @@
44384908 MenuItem reexportItem;
44394909 MenuItem povItem;
44404910 MenuItem closeItem;
4441
- Menu cameraMenu;
4911
+
44424912 CheckboxMenuItem zBufferItem;
44434913 //MenuItem normalLensItem;
4444
- MenuItem editCameraItem;
4445
- MenuItem revertCameraItem;
4446
- CheckboxMenuItem toggleLiveItem;
44474914 MenuItem stepItem;
4448
- CheckboxMenuItem toggleFullItem;
4915
+ CheckboxMenuItem toggleLiveItem;
4916
+ CheckboxMenuItem toggleFullScreenItem;
4917
+ CheckboxMenuItem toggleTimelineItem;
44494918 CheckboxMenuItem toggleRenderItem;
44504919 CheckboxMenuItem toggleDebugItem;
44514920 CheckboxMenuItem toggleFrustumItem;
44524921 CheckboxMenuItem toggleFootContactItem;
44534922 CheckboxMenuItem toggleDLItem;
44544923 CheckboxMenuItem toggleTextureItem;
4455
- CheckboxMenuItem toggleRandomItem;
4924
+ CheckboxMenuItem toggleSwitchItem;
44564925 CheckboxMenuItem toggleRootItem;
44574926 CheckboxMenuItem animationItem;
44584927 CheckboxMenuItem toggleHandleItem;
44594928 CheckboxMenuItem togglePaintItem;
44604929 JSplitPane mainPanel;
44614930 JScrollPane scrollpane;
4931
+
44624932 JPanel toolbarPanel;
4463
- JPanel treePanel;
4933
+
4934
+ cGridBag treePanel;
4935
+
44644936 JPanel radioPanel;
44654937 ButtonGroup buttonGroup;
4466
- JPanel ctrlPanel;
4467
- JPanel materialPanel;
4938
+
4939
+ cGridBag toolboxPanel;
4940
+ cGridBag materialPanel;
4941
+ cGridBag ctrlPanel;
4942
+
44684943 JScrollPane infoPanel;
4469
- JPanel optionsPanel;
4944
+
4945
+ cGridBag optionsPanel;
4946
+
44704947 JTabbedPane objectPanel;
4471
- JPanel XYZPanel;
4948
+
4949
+ cGridBag XYZPanel;
4950
+
44724951 JSplitPane gridPanel;
44734952 JSplitPane bigPanel;
4474
- JPanel bigThree;
4475
- JTabbedPane scenePanel;
4476
- JPanel cameraPanel;
4953
+
4954
+ cGridBag bigThree;
4955
+ cGridBag scenePanel;
4956
+ cGridBag centralPanel;
4957
+ JSplitPane cameraPanel;
4958
+ JPanel timelinePanel;
4959
+ JMenuBar timelineMenubar;
44774960 JSplitPane framePanel;
44784961 JTextArea/*Field*/ nameField;
4479
- cButton textureButton;
4962
+ //cButton textureButton;
44804963 cButton okButton;
44814964 cButton applyButton;
44824965 cButton cancelButton;
....@@ -4523,65 +5006,72 @@
45235006 // MATERIAL
45245007 JLabel materialLabel;
45255008 JLabel colorLabel;
4526
- NumberSlider colorField;
5009
+ cNumberSlider colorField;
45275010 JLabel modulationLabel;
4528
- NumberSlider modulationField;
5011
+ cNumberSlider modulationField;
45295012 JLabel metalnessLabel;
4530
- NumberSlider metalnessField;
5013
+ cNumberSlider metalnessField;
45315014 JLabel diffuseLabel;
4532
- NumberSlider diffuseField;
5015
+ cNumberSlider diffuseField;
45335016 JLabel specularLabel;
4534
- NumberSlider specularField;
5017
+ cNumberSlider specularField;
45355018 JLabel shininessLabel;
4536
- NumberSlider shininessField;
5019
+ cNumberSlider shininessField;
45375020 JLabel shiftLabel;
4538
- NumberSlider shiftField;
5021
+ cNumberSlider shiftField;
45395022 JLabel ambientLabel;
4540
- NumberSlider ambientField;
5023
+ cNumberSlider ambientField;
45415024 JLabel lightareaLabel;
4542
- NumberSlider lightareaField;
5025
+ cNumberSlider lightareaField;
45435026 JLabel diffusenessLabel;
4544
- NumberSlider diffusenessField;
5027
+ cNumberSlider diffusenessField;
45455028 JLabel velvetLabel;
4546
- NumberSlider velvetField;
5029
+ cNumberSlider velvetField;
45475030 JLabel sheenLabel;
4548
- NumberSlider sheenField;
5031
+ cNumberSlider sheenField;
45495032 JLabel subsurfaceLabel;
4550
- NumberSlider subsurfaceField;
5033
+ cNumberSlider subsurfaceField;
45515034 //JLabel bumpLabel;
45525035 //NumberSlider bumpField;
45535036 JLabel backlitLabel;
4554
- NumberSlider backlitField;
5037
+ cNumberSlider backlitField;
45555038 JLabel anisoLabel;
4556
- NumberSlider anisoField;
5039
+ cNumberSlider anisoField;
45575040 JLabel anisoVLabel;
4558
- NumberSlider anisoVField;
5041
+ cNumberSlider anisoVField;
45595042 JLabel cameraLabel;
4560
- NumberSlider cameraField;
5043
+ cNumberSlider cameraField;
45615044 JLabel selfshadowLabel;
4562
- NumberSlider selfshadowField;
5045
+ cNumberSlider selfshadowField;
45635046 JLabel shadowLabel;
4564
- NumberSlider shadowField;
5047
+ cNumberSlider shadowField;
45655048 JLabel textureLabel;
4566
- NumberSlider textureField;
5049
+ cNumberSlider textureField;
45675050 JLabel opacityLabel;
4568
- NumberSlider opacityField;
5051
+ cNumberSlider opacityField;
45695052 JLabel fakedepthLabel;
4570
- NumberSlider fakedepthField;
5053
+ cNumberSlider fakedepthField;
45715054 JLabel shadowbiasLabel;
4572
- NumberSlider shadowbiasField;
5055
+ cNumberSlider shadowbiasField;
45735056 JLabel bumpLabel;
4574
- NumberSlider bumpField;
5057
+ cNumberSlider bumpField;
45755058 JLabel noiseLabel;
4576
- NumberSlider noiseField;
5059
+ cNumberSlider noiseField;
45775060 JLabel powerLabel;
4578
- NumberSlider powerField;
5061
+ cNumberSlider powerField;
45795062 JLabel borderfadeLabel;
4580
- NumberSlider borderfadeField;
5063
+ cNumberSlider borderfadeField;
45815064 JLabel fogLabel;
4582
- NumberSlider fogField;
5065
+ cNumberSlider fogField;
45835066 JLabel opacityPowerLabel;
4584
- NumberSlider opacityPowerField;
4585
- JTree jTree;
5067
+ cNumberSlider opacityPowerField;
5068
+ cTree jTree;
45865069 //ObjectUI parent;
5070
+
5071
+ cNumberSlider normalpushField;
5072
+
5073
+ private MenuItem importGFDItem;
5074
+ private MenuItem importVRMLX3DItem;
5075
+ private MenuItem import3DSItem;
5076
+ private MenuItem importOBJItem;
45875077 }