Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
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,
....@@ -31,6 +34,70 @@
3134 boolean timeline;
3235 boolean wasFullScreen;
3336
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
+
34101 // SCRIPT
35102
36103 transient JFrame textpanel = null;
....@@ -121,47 +188,54 @@
121188 void keyPressed(int key, int modifiers)
122189 {
123190 System.out.println("KEY PRESSED");
124
- CameraPane.theRenderer.keyPressed(key, modifiers);
191
+ Globals.theRenderer.keyPressed(key, modifiers);
125192 }
126193 */
127194
128195 static GridBagConstraints aConstraints;
129196 static GridBagConstraints aWindowConstraints;
130
- GroupEditor callee;
131
- JFrame frame;
197
+
132198 static int GRIDWIDTH = 100; // 4;
133199
134200 public void closeUI()
135201 {
136202 //new Exception().printStackTrace();
137
- System.out.println("this = " + this);
138
- System.out.println("objEditor = " + objEditor);
203
+// System.out.println("this = " + this);
204
+// System.out.println("objEditor = " + objEditor);
139205 //nameField.removeActionListener(this);
140
- objEditor.ctrlPanel.remove(nameField);
206
+// objEditor.ctrlPanel.remove(nameField);
141207
142
- if (!GroupEditor.allparams)
208
+ objEditor.ctrlPanel.remove(namePanel);
209
+
210
+ if (!allparams)
143211 return;
144212
145
- objEditor.ctrlPanel.remove(liveCB);
146
- objEditor.ctrlPanel.remove(hideCB);
147
- objEditor.ctrlPanel.remove(markCB);
148
-
149
- objEditor.ctrlPanel.remove(randomCB);
150
- objEditor.ctrlPanel.remove(speedupCB);
151
- objEditor.ctrlPanel.remove(rewindCB);
152
-
153
- objEditor.ctrlPanel.remove(resetButton);
154
- objEditor.ctrlPanel.remove(stepButton);
155
-// objEditor.ctrlPanel.remove(stepAllButton);
156
-// objEditor.ctrlPanel.remove(resetAllButton);
157
- objEditor.ctrlPanel.remove(link2masterCB);
158
- //objEditor.ctrlPanel.remove(flipVCB);
159
- //objEditor.ctrlPanel.remove(texresMenu);
160
- objEditor.ctrlPanel.remove(slowerButton);
161
- objEditor.ctrlPanel.remove(fasterButton);
162
- 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);
163231
164
- Remove(normalpushField);
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);
165239 }
166240
167241 public ObjEditor GetEditor()
....@@ -232,6 +306,7 @@
232306 //localCopy.parent = null;
233307
234308 frame = new JFrame();
309
+ frame.setUndecorated(true);
235310 objEditor = this;
236311 this.callee = callee;
237312
....@@ -262,27 +337,48 @@
262337 return frame.action(event, obj);
263338 }
264339
340
+ // Cannot work without static
341
+ static boolean allparams = true;
342
+
343
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
344
+
265345 void SetupMenu()
266346 {
267347 frame.setMenuBar(menuBar = new MenuBar());
268
- menuBar.add(windowMenu = new Menu("File"));
269
- windowMenu.add(loadItem = new MenuItem("Load..."));
270
- windowMenu.add("-");
271
- windowMenu.add(saveItem = new MenuItem("Save"));
272
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
348
+ menuBar.add(fileMenu = new Menu("File"));
349
+ fileMenu.add(newItem = new MenuItem("New"));
350
+ fileMenu.add(loadItem = new MenuItem("Open..."));
351
+
352
+ //oe.menuBar.add(menu = new Menu("Include"));
353
+ Menu menu = new Menu("Import");
354
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
355
+ importOBJItem.addActionListener(this);
356
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
357
+ import3DSItem.addActionListener(this);
358
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
359
+ importVRMLX3DItem.addActionListener(this);
360
+ menu.add("-");
361
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
362
+ importGFDItem.addActionListener(this);
363
+ fileMenu.add(menu);
364
+ fileMenu.add("-");
365
+
366
+ fileMenu.add(saveItem = new MenuItem("Save"));
367
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
273368 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
274
- windowMenu.add("-");
275
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
276
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
277
- windowMenu.add("-");
369
+ fileMenu.add("-");
370
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
371
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
372
+ fileMenu.add("-");
278373 if (client.parent != null)
279374 {
280
- windowMenu.add(closeItem = new MenuItem("Close"));
375
+ fileMenu.add(closeItem = new MenuItem("Close"));
281376 } else
282377 {
283
- windowMenu.add(closeItem = new MenuItem("Exit"));
378
+ fileMenu.add(closeItem = new MenuItem("Exit"));
284379 }
285380
381
+ newItem.addActionListener(this);
286382 loadItem.addActionListener(this);
287383 saveItem.addActionListener(this);
288384 saveAsItem.addActionListener(this);
....@@ -291,79 +387,64 @@
291387 //povItem.addActionListener(this);
292388 closeItem.addActionListener(this);
293389
294
- menuBar.add(cameraMenu = new Menu("View"));
295
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
296
- //zBufferItem.addActionListener(this);
297
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
298
- //normalLensItem.addActionListener(this);
299
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
300
- revertCameraItem.addActionListener(this);
301
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
302
- toggleTimelineItem.addItemListener(this);
303
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
304
- toggleFullScreenItem.addItemListener(this);
305
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
306
- cameraMenu.add("-");
307
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
308
- toggleTextureItem.addItemListener(this);
309
- toggleTextureItem.setState(CameraPane.textureon);
310
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
311
- toggleLiveItem.addItemListener(this);
312
- toggleLiveItem.setState(CameraPane.isLIVE());
313
- cameraMenu.add(stepItem = new MenuItem("Step"));
314
- stepItem.addActionListener(this);
315
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
316
-// toggleDLItem.addItemListener(this);
317
-// toggleDLItem.setState(false);
318
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
319
- toggleRenderItem.addItemListener(this);
320
- toggleRenderItem.setState(!CameraPane.frozen);
321
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
322
- toggleDebugItem.addItemListener(this);
323
- toggleDebugItem.setState(CameraPane.DEBUG);
324
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
325
- toggleFrustumItem.addItemListener(this);
326
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
327
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
328
- toggleFootContactItem.addItemListener(this);
329
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
330
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
331
- toggleRandomItem.addItemListener(this);
332
- toggleRandomItem.setState(CameraPane.RANDOM);
333
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
334
- toggleHandleItem.addItemListener(this);
335
- toggleHandleItem.setState(CameraPane.HANDLES);
336
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
337
- togglePaintItem.addItemListener(this);
338
- togglePaintItem.setState(CameraPane.PAINTMODE);
339
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
340
-// toggleRootItem.addItemListener(this);
341
-// toggleRootItem.setState(false);
342
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
343
-// animationItem.addItemListener(this);
344
-// animationItem.setState(CameraPane.ANIMATION);
345
- cameraMenu.add("-");
346
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
347
- editCameraItem.addActionListener(this);
348
-
349390 objectPanel = new JTabbedPane();
391
+
392
+ ChangeListener changeListener = new ChangeListener()
393
+ {
394
+ public void stateChanged(ChangeEvent changeEvent)
395
+ {
396
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
397
+// {
398
+// if (latestObject != null)
399
+// {
400
+// refreshContents(true);
401
+// SetMaterial(latestObject);
402
+// }
403
+//
404
+// materialFlushed = true;
405
+// }
406
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
407
+// {
408
+// if (listUI.size() == 0)
409
+// EditSelection(false);
410
+// }
411
+
412
+ refreshContents(false); // To refresh Info tab
413
+ }
414
+ };
415
+ objectPanel.addChangeListener(changeListener);
416
+
350417 toolbarPanel = new JPanel();
351418 toolbarPanel.setName("Toolbar");
352
- treePanel = new JPanel();
419
+ treePanel = new cGridBag();
353420 treePanel.setName("Tree");
354
- ctrlPanel = new JPanel(); // new GridBagLayout());
355
- ctrlPanel.setName("Edit");
356
- materialPanel = new JPanel();
421
+
422
+ editPanel = new cGridBag().setVertical(true);
423
+ editPanel.setName("Edit");
424
+
425
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
426
+
427
+ editCommandsPanel = new cGridBag();
428
+ editPanel.add(editCommandsPanel);
429
+ editPanel.add(ctrlPanel);
430
+
431
+ toolboxPanel = new cGridBag().setVertical(false);
432
+ toolboxPanel.setName("Toolbox");
433
+
434
+ materialPanel = new cGridBag().setVertical(true);
357435 materialPanel.setName("Material");
436
+
358437 /*JTextPane*/
359438 infoarea = createTextPane();
439
+ doc = infoarea.getStyledDocument();
440
+
360441 infoarea.setEditable(true);
361442 SetText();
362443 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
363444 // infoarea.setOpaque(false);
364445 // //infoarea.setForeground(textcolor);
365
- infoarea.setLineWrap(true);
366
- infoarea.setWrapStyleWord(true);
446
+// TEXTAREA infoarea.setLineWrap(true);
447
+// TEXTAREA infoarea.setWrapStyleWord(true);
367448 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
368449 infoPanel.setPreferredSize(new Dimension(50, 200));
369450 infoPanel.setName("Info");
....@@ -374,16 +455,16 @@
374455 mainPanel.setName("Main");
375456 mainPanel.setContinuousLayout(true);
376457 mainPanel.setOneTouchExpandable(true);
377
- mainPanel.setDividerLocation(1.0);
378458 mainPanel.setDividerSize(9);
379
- mainPanel.setResizeWeight(0);
459
+ mainPanel.setDividerLocation(0.5); //1.0);
460
+ mainPanel.setResizeWeight(0.5);
380461
381462 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
382463 //mainPanel.setLayout(new GridBagLayout());
383464 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
384
- treePanel.setLayout(new GridBagLayout());
385
- ctrlPanel.setLayout(new GridBagLayout());
386
- materialPanel.setLayout(new GridBagLayout());
465
+// treePanel.setLayout(new GridBagLayout());
466
+ //ctrlPanel.setLayout(new GridBagLayout());
467
+ //materialPanel.setLayout(new GridBagLayout());
387468
388469 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
389470 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -422,7 +503,7 @@
422503 static String newline = "\n";
423504 protected static final String buttonString = "JButton";
424505 StyledDocument doc;
425
- JTextArea infoarea;
506
+ JTextPane infoarea;
426507
427508 void ClearInfo()
428509 {
....@@ -445,10 +526,10 @@
445526 e.printStackTrace();
446527 }
447528
448
- String selection = infoarea.getText();
449
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
450
- java.awt.datatransfer.Clipboard clipboard =
451
- Toolkit.getDefaultToolkit().getSystemClipboard();
529
+// String selection = infoarea.getText();
530
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
531
+// java.awt.datatransfer.Clipboard clipboard =
532
+// Toolkit.getDefaultToolkit().getSystemClipboard();
452533 //clipboard.setContents(data, data);
453534 }
454535
....@@ -471,13 +552,13 @@
471552 //SendInfo("Name:", "bold");
472553 if (sel.GetTextures() != null || debug)
473554 {
474
- si.SendInfo(sel.toString(), "bold");
555
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
475556 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
476557 if (sel.Size() > 0)
477558 {
478559 si.SendInfo("#children = " + sel.Size(), "regular");
479560 }
480
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
561
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
481562 if (debug)
482563 {
483564 try
....@@ -489,7 +570,10 @@
489570 }
490571
491572 if (full)
492
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
573
+ {
574
+ si.SendInfo(" BBox min: " + minima, "regular");
575
+ si.SendInfo(" BBox max: " + maxima, "regular");
576
+ }
493577
494578 if (sel.bRep != null)
495579 {
....@@ -516,7 +600,7 @@
516600 }
517601 if (sel.support != null)
518602 {
519
- si.SendInfo(" support: " + sel.support, "regular");
603
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
520604 }
521605 if (sel.scriptnode != null)
522606 {
....@@ -587,6 +671,9 @@
587671 {
588672 CameraPane.pointflow = (PointFlow) sel;
589673 }
674
+
675
+ si.SendInfo("_____________________", "regular");
676
+ si.SendInfo("", "regular");
590677 }
591678 }
592679
....@@ -602,68 +689,140 @@
602689 }
603690 }
604691
692
+static GraphicsDevice device = GraphicsEnvironment
693
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
694
+
695
+ Rectangle keeprect;
696
+ cRadio radio;
697
+
698
+cButton keepButton;
699
+ cButton twoButton; // Full 3D
700
+ cButton sixButton;
701
+ cButton threeButton;
702
+ cButton sevenButton;
703
+ cButton fourButton; // full panel
704
+ cButton oneButton; // full XYZ
705
+ //cButton currentLayout;
706
+
707
+ boolean maximized;
708
+
709
+ cButton fullscreenLayout;
710
+
711
+ void Minimize()
712
+ {
713
+ frame.setState(Frame.ICONIFIED);
714
+ }
715
+
716
+ void Maximize()
717
+ {
718
+ if (maximized)
719
+ {
720
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
721
+ }
722
+ else
723
+ {
724
+ keeprect = frame.getBounds();
725
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
726
+ Dimension rect2 = frame.getToolkit().getScreenSize();
727
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
728
+// frame.setState(Frame.MAXIMIZED_BOTH);
729
+ }
730
+
731
+ maximized ^= true;
732
+ }
733
+
605734 void ToggleFullScreen()
606735 {
607
- if (CameraPane.FULLSCREEN)
736
+ cameraView.ToggleFullScreen();
737
+
738
+ if (!CameraPane.FULLSCREEN)
608739 {
609
- frame.getContentPane().remove(/*"Center",*/bigThree);
610
- framePanel.add(bigThree);
611
- frame.getContentPane().add(/*"Center",*/framePanel);
740
+ device.setFullScreenWindow(null);
741
+ //frame.setVisible(false);
742
+// frame.removeNotify();
743
+// frame.setUndecorated(false);
744
+// frame.addNotify();
745
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
746
+
747
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
748
+// X framePanel.add(bigThree);
749
+// X frame.getContentPane().add(/*"Center",*/framePanel);
750
+ framePanel.setDividerLocation(1);
751
+
752
+ //frame.setVisible(true);
753
+ radio.layout = keepButton;
754
+ //theFrame = null;
755
+ keepButton = null;
756
+ radio.layout.doClick();
757
+
612758 } else
613759 {
614
- frame.getContentPane().remove(/*"Center",*/framePanel);
615
- framePanel.remove(bigThree);
616
- frame.getContentPane().add(/*"Center",*/bigThree);
760
+ keepButton = radio.layout;
761
+ //keeprect = frame.getBounds();
762
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
763
+// frame.getToolkit().getScreenSize().height);
764
+ //frame.setVisible(false);
765
+ device.setFullScreenWindow(frame);
766
+// frame.removeNotify();
767
+// frame.setUndecorated(true);
768
+// frame.addNotify();
769
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
770
+// X framePanel.remove(bigThree);
771
+// X frame.getContentPane().add(/*"Center",*/bigThree);
772
+ framePanel.setDividerLocation(0);
773
+
774
+ radio.layout = fullscreenLayout;
775
+ radio.layout.doClick();
776
+ //frame.setVisible(true);
617777 }
618
- cameraView.ToggleFullScreen();
619778 }
620779
621
- private JTextArea createTextPane()
780
+ private JTextPane createTextPane()
622781 {
623
- String[] initString =
624
- {
625
- "This is an editable JTextPane, ", //regular
626
- "another ", //italic
627
- "styled ", //bold
628
- "text ", //small
629
- "component, ", //large
630
- "which supports embedded components..." + newline,//regular
631
- " " + newline, //button
632
- "...and embedded icons..." + newline, //regular
633
- " ", //icon
634
- newline + "JTextPane is a subclass of JEditorPane that "
635
- + "uses a StyledEditorKit and StyledDocument, and provides "
636
- + "cover methods for interacting with those objects."
637
- };
782
+// TEXTAREA String[] initString =
783
+// {
784
+// "This is an editable JTextPane, ", //regular
785
+// "another ", //italic
786
+// "styled ", //bold
787
+// "text ", //small
788
+// "component, ", //large
789
+// "which supports embedded components..." + newline,//regular
790
+// " " + newline, //button
791
+// "...and embedded icons..." + newline, //regular
792
+// " ", //icon
793
+// newline + "JTextPane is a subclass of JEditorPane that "
794
+// + "uses a StyledEditorKit and StyledDocument, and provides "
795
+// + "cover methods for interacting with those objects."
796
+// };
797
+//
798
+// String[] initStyles =
799
+// {
800
+// "regular", "italic", "bold", "small", "large",
801
+// "regular", "button", "regular", "icon",
802
+// "regular"
803
+// };
804
+//
805
+// JTextPane textPane = new JTextPane();
806
+// textPane.setEditable(true);
807
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
808
+// addStylesToDocument(doc);
809
+//
810
+// try
811
+// {
812
+// for (int j = 0; j < 2; j++)
813
+// {
814
+// for (int i = 0; i < initString.length; i++)
815
+// {
816
+// doc.insertString(doc.getLength(), initString[i],
817
+// doc.getStyle(initStyles[i]));
818
+// }
819
+// }
820
+// } catch (BadLocationException ble)
821
+// {
822
+// System.err.println("Couldn't insert initial text into text pane.");
823
+// }
638824
639
- String[] initStyles =
640
- {
641
- "regular", "italic", "bold", "small", "large",
642
- "regular", "button", "regular", "icon",
643
- "regular"
644
- };
645
-
646
- JTextPane textPane = new JTextPane();
647
- textPane.setEditable(true);
648
- /*StyledDocument*/ doc = textPane.getStyledDocument();
649
- addStylesToDocument(doc);
650
-
651
- try
652
- {
653
- for (int j = 0; j < 2; j++)
654
- {
655
- for (int i = 0; i < initString.length; i++)
656
- {
657
- doc.insertString(doc.getLength(), initString[i],
658
- doc.getStyle(initStyles[i]));
659
- }
660
- }
661
- } catch (BadLocationException ble)
662
- {
663
- System.err.println("Couldn't insert initial text into text pane.");
664
- }
665
-
666
- return new JTextArea(); // textPane;
825
+ return new JTextPane(); // textPane;
667826 }
668827
669828 protected void addStylesToDocument(StyledDocument doc)
....@@ -716,7 +875,7 @@
716875 protected static ImageIcon createImageIcon(String path,
717876 String description)
718877 {
719
- java.net.URL imgURL = GrafreeD.class.getResource(path);
878
+ java.net.URL imgURL = Grafreed.class.getResource(path);
720879 if (imgURL != null)
721880 {
722881 return new ImageIcon(imgURL, description);
....@@ -748,6 +907,7 @@
748907 // NumberSlider vDivsField;
749908 // JCheckBox endcaps;
750909 JCheckBox liveCB;
910
+ JCheckBox selectCB;
751911 JCheckBox hideCB;
752912 JCheckBox link2masterCB;
753913 JCheckBox markCB;
....@@ -755,7 +915,12 @@
755915 JCheckBox speedupCB;
756916 JCheckBox rewindCB;
757917 JCheckBox flipVCB;
918
+
919
+ cCheckBox toggleTextureCB;
920
+ cCheckBox toggleSwitchCB;
921
+
758922 JComboBox texresMenu;
923
+
759924 JButton resetButton;
760925 JButton stepButton;
761926 JButton stepAllButton;
....@@ -763,115 +928,87 @@
763928 JButton slowerButton;
764929 JButton fasterButton;
765930 JButton remarkButton;
931
+
932
+ cGridBag editPanel;
933
+ cGridBag editCommandsPanel;
934
+
935
+ cGridBag namePanel;
936
+ cGridBag setupPanel;
937
+ cGridBag setupPanel2;
938
+ cGridBag objectCommandsPanel;
939
+ cGridBag pushPanel;
940
+ cGridBag fillPanel;
766941
767
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
942
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
768943 {
769944 JCheckBox cb;
770945
771
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
772
- oe.aConstraints.gridwidth = 1; // 3;
773
-// oe.aConstraints.weightx = 1;
774
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
775
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
946
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
776947 cb.addItemListener(this);
777
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
778
- oe.aConstraints.gridwidth = 1;
779
- oe.aConstraints.gridx += 1;
780948
781949 return cb;
782950 }
783951
784
- cButton AddButton(ObjEditor oe, String label)
952
+ cButton AddButton(cGridBag panel, String label)
785953 {
786954 cButton cb;
787955
788
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
789
- oe.aConstraints.gridwidth = 1;
790
-// oe.aConstraints.weightx = 1;
791
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
792
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
956
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
793957 cb.addActionListener(this);
794
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
795
- oe.aConstraints.gridwidth = 1;
796
- oe.aConstraints.gridx += 1;
797958
798959 return cb;
799960 }
800961
801
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
962
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
802963 {
803964 JComboBox combo;
804965
805
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
806
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
807
- oe.aConstraints.gridx += 1;
966
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808967 combo.addActionListener(this);
809968
810969 return combo;
811970 }
812971
813
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
972
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
814973 {
815
- NumberSlider combo;
974
+ cGridBag control = new cGridBag();
975
+
976
+ cNumberSlider combo;
816977
817978 JLabel jlabel = new JLabel(label);
818
-
819
- aConstraints.fill = GridBagConstraints.VERTICAL;
820979 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
821
- aConstraints.gridwidth = 1;
822
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
823
- aConstraints.gridx += 1;
824
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
825
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
826
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.gridwidth = 1;
829
-
980
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
981
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830982 combo.setFloat(current);
831
-
832
- combo.label = jlabel;
833
-
834
- combo.addChangeListener(this);
835
-
836
- return combo;
983
+
984
+ panel.add(control);
985
+
986
+ return control;
837987 }
838988
839
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
989
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
840990 {
841
- NumberSlider combo;
991
+ cGridBag control = new cGridBag();
992
+
993
+ cNumberSlider combo;
842994
843995 JLabel jlabel = new JLabel(label);
844
-
845
- aConstraints.fill = GridBagConstraints.VERTICAL;
846996 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
847
- aConstraints.gridwidth = 2;
848
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
- aConstraints.gridx += 1;
850
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
851
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
852
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
853
- aConstraints.gridx += 1;
854
- aConstraints.gridwidth = 1;
855
-
997
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
998
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
856999 combo.setInteger(current);
8571000
858
- combo.label = jlabel;
859
-
860
- combo.addChangeListener(this);
861
-
862
- return combo;
1001
+ panel.add(control);
1002
+
1003
+ return control;
8631004 }
8641005
865
- JTextArea AddText(JPanel ctrlPanel, String name)
1006
+ JTextArea AddText(cGridBag ctrlPanel, String name)
8661007 {
8671008 JTextArea text;
8681009
869
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
870
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
871
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1010
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8721011 text.addCaretListener(this);
873
- aConstraints.gridx += 1;
874
- aConstraints.gridwidth = 1;
8751012
8761013 return text;
8771014 }
....@@ -901,9 +1038,16 @@
9011038 objEditor.ctrlPanel.remove(j);
9021039 }
9031040
1041
+ void Remove(cNumberSlider j)
1042
+ {
1043
+ j.removeChangeListener(this);
1044
+ //objEditor.ctrlPanel.remove(j.label);
1045
+ objEditor.ctrlPanel.remove(j);
1046
+ }
1047
+
9041048 /*
9051049 */
906
- void Return() // ObjEditor oe)
1050
+ void Return0() // ObjEditor oe)
9071051 {
9081052 aConstraints.gridy += 1;
9091053 aConstraints.gridx = 0;
....@@ -958,37 +1102,76 @@
9581102
9591103 void SetupUI2(ObjEditor oe)
9601104 {
961
-// oe.aConstraints.weightx = 0;
962
-// oe.aConstraints.weighty = 0;
963
-// oe.aConstraints.gridx = 0;
964
-// oe.aConstraints.gridy = 0;
965
- SetupName(oe);
1105
+ //SetupName(oe);
9661106
967
- if (!GroupEditor.allparams)
1107
+ namePanel = new cGridBag();
1108
+
1109
+ nameField = AddText(namePanel, copy.GetName());
1110
+ namePanel.add(nameField);
1111
+ oe.ctrlPanel.add(namePanel);
1112
+
1113
+ oe.ctrlPanel.Return();
1114
+
1115
+ if (!allparams)
9681116 return;
9691117
970
- liveCB = AddCheckBox(oe, "Live", copy.live);
971
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
972
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1118
+ setupPanel = new cGridBag().setVertical(false);
1119
+
1120
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1121
+ liveCB.setToolTipText("Animate object");
1122
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1123
+ selectCB.setToolTipText("Make object selectable");
9731124 // Return();
974
- markCB = AddCheckBox(oe, "Mark", copy.marked);
975
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
976
- randomCB = AddCheckBox(oe, "Rand", copy.random);
977
- Return();
978
- resetButton = AddButton(oe, "Reset");
979
- stepButton = AddButton(oe, "Step");
1125
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1126
+ hideCB.setToolTipText("Hide object");
1127
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1128
+ markCB.setToolTipText("Set the animation target transform");
1129
+
1130
+ setupPanel2 = new cGridBag().setVertical(false);
1131
+
1132
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1133
+ rewindCB.setToolTipText("Rewind animation");
1134
+
1135
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1136
+ randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1137
+
1138
+ if (Globals.ADVANCED)
1139
+ {
1140
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1141
+ link2masterCB.setToolTipText("Attach to support");
1142
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1143
+ speedupCB.setToolTipText("Option motion capture");
1144
+ }
1145
+
1146
+ oe.ctrlPanel.add(setupPanel);
1147
+ oe.ctrlPanel.Return();
1148
+ oe.ctrlPanel.add(setupPanel2);
1149
+ oe.ctrlPanel.Return();
1150
+
1151
+ objectCommandsPanel = new cGridBag().setVertical(false);
1152
+
1153
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1154
+ resetButton.setToolTipText("Jump to frame zero");
1155
+ stepButton = AddButton(objectCommandsPanel, "Step");
1156
+ stepButton.setToolTipText("Step one frame");
9801157 // resetAllButton = AddButton(oe, "Reset All");
9811158 // stepAllButton = AddButton(oe, "Step All");
982
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9831159 // Return();
984
- slowerButton = AddButton(oe, "Slow");
985
- fasterButton = AddButton(oe, "Fast");
986
- remarkButton = AddButton(oe, "Rem");
1160
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1161
+ slowerButton.setToolTipText("Decrease animation speed");
1162
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1163
+ fasterButton.setToolTipText("Increase animation speed");
1164
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1165
+ remarkButton.setToolTipText("Set the current transform as the target");
9871166
988
- Return();
1167
+ oe.ctrlPanel.add(objectCommandsPanel);
1168
+ oe.ctrlPanel.Return();
9891169
990
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
991
- Return();
1170
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1171
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1172
+ //Return();
1173
+
1174
+ oe.ctrlPanel.Return();
9921175
9931176 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9941177 // ObjEditor.aConstraints.gridx += 1;
....@@ -1083,7 +1266,7 @@
10831266 oe.aConstraints.gridwidth = 1;
10841267 /**/
10851268 nameField = AddText(oe.ctrlPanel, copy.GetName());
1086
- Return();
1269
+ oe.ctrlPanel.Return();
10871270
10881271 //ctrlPanel.add(textureButton = new Button("Texture..."));
10891272 //textureButton.setEnabled(false);
....@@ -1185,11 +1368,25 @@
11851368 //JPanel worldPanel =
11861369 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11871370 //worldPanel.setName("World");
1188
- centralPanel = new JPanel(new BorderLayout());
1189
- timelinePanel = new JPanel(new BorderLayout());
1190
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1371
+ centralPanel = new cGridBag();
1372
+ centralPanel.preferredWidth = 20;
1373
+
1374
+ if (Globals.ADVANCED)
1375
+ {
1376
+ timelinePanel = new JPanel(new BorderLayout());
1377
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11911378
1379
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1380
+ cameraPanel.setContinuousLayout(true);
1381
+ cameraPanel.setOneTouchExpandable(true);
1382
+// cameraPanel.setDividerLocation(0.9);
1383
+// cameraPanel.setDividerSize(9);
1384
+ cameraPanel.setResizeWeight(1.0);
1385
+
1386
+ }
1387
+
11921388 centralPanel.add(cameraView);
1389
+ centralPanel.setFocusable(true);
11931390 //frame.setJMenuBar(timelineMenubar);
11941391 //centralPanel.add(timelinePanel);
11951392
....@@ -1208,12 +1405,13 @@
12081405 //frontView.object = copy;
12091406 //sideView.object = copy;
12101407
1211
- XYZPanel = new JPanel();
1212
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1408
+ XYZPanel = new cGridBag().setVertical(true);
1409
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12131410
1214
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1215
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1216
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1411
+ XYZPanel.preferredWidth = 5;
1412
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1413
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1414
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12171415
12181416 /*
12191417 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1251,11 +1449,13 @@
12511449 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12521450 //tmp.setName("Edit");
12531451 objectPanel.add(materialPanel);
1254
- JPanel north = new JPanel(new BorderLayout());
1255
- north.setName("Edit");
1256
- north.add(ctrlPanel, BorderLayout.NORTH);
1257
- objectPanel.add(north);
1452
+// JPanel north = new JPanel(new BorderLayout());
1453
+// north.setName("Edit");
1454
+// north.add(ctrlPanel, BorderLayout.NORTH);
1455
+// objectPanel.add(north);
1456
+ objectPanel.add(editPanel);
12581457 objectPanel.add(infoPanel);
1458
+ objectPanel.add(toolboxPanel);
12591459
12601460 /*
12611461 aConstraints.gridx = 0;
....@@ -1264,7 +1464,7 @@
12641464 aConstraints.gridy += 1;
12651465 aConstraints.gridwidth = 1;
12661466 mainPanel.add(objectPanel, aConstraints);
1267
- */
1467
+ */
12681468
12691469 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12701470 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1275,16 +1475,23 @@
12751475 scrollpane.setWheelScrollingEnabled(true);
12761476 scrollpane.addMouseWheelListener(this); // Default not fast enough
12771477
1278
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1279
- scenePanel.add(scrollpane);
1478
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1479
+ scenePanel.preferredWidth = 6;
1480
+
1481
+ JTabbedPane tabbedPane = new JTabbedPane();
1482
+ tabbedPane.add(scrollpane);
12801483
1281
- scenePanel.add(FSPane = new cFileSystemPane(this));
1282
-
1283
- optionsPanel = new JPanel(new GridBagLayout());
1484
+ optionsPanel = new cGridBag().setVertical(false);
12841485
12851486 optionsPanel.setName("Options");
1286
- scenePanel.add(optionsPanel);
1487
+
1488
+ AddOptions(optionsPanel); //, aConstraints);
1489
+
1490
+ tabbedPane.add(optionsPanel);
1491
+
1492
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12871493
1494
+ scenePanel.add(tabbedPane);
12881495
12891496 /*
12901497 cTree jTree = new cTree(null);
....@@ -1318,6 +1525,7 @@
13181525 //bigPanel.setSize(new Dimension(10,10));
13191526 //bigPanel.add(ctrlPanel);
13201527 //bigPanel.add(gridPanel);
1528
+ /**
13211529 bigThree = new JPanel();
13221530 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13231531 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1341,7 +1549,13 @@
13411549 // aConstraints.gridheight = 3;
13421550 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13431551 bigThree.add(XYZPanel, aWindowConstraints);
1552
+ /**/
13441553
1554
+ bigThree = new cGridBag();
1555
+ bigThree.addComponent(scenePanel);
1556
+ bigThree.addComponent(centralPanel);
1557
+ bigThree.addComponent(XYZPanel);
1558
+
13451559 // // SIDE EFFECT!!!
13461560 // aConstraints.gridx = 0;
13471561 // aConstraints.gridy = 0;
....@@ -1362,14 +1576,19 @@
13621576 //worldPane.add(bigPanel);
13631577 //worldPane.add(worldPanel);
13641578 /**/
1365
- frame.getContentPane().add(/*"Center",*/framePanel);
1579
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1580
+ frame.add(/*"Center",*/framePanel);
13661581 //frame.getContentPane().add(/*"Center",*/ worldPane);
13671582
13681583 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13691584
1370
- frame.setSize(1024, 768);
1371
- frame.show();
1585
+ frame.setSize(1280, 860);
1586
+
1587
+ frame.validate();
1588
+ frame.setVisible(true);
13721589
1590
+ cameraView.requestFocusInWindow();
1591
+
13731592 gridPanel.setDividerLocation(1.0);
13741593
13751594 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1383,6 +1602,10 @@
13831602 });
13841603 }
13851604
1605
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1606
+ {
1607
+ }
1608
+
13861609 JTree GetTree()
13871610 {
13881611 return objEditor.jTree;
....@@ -1394,260 +1617,173 @@
13941617 ctrlPanel.removeAll();
13951618 }
13961619
1397
- void SetupMaterial(JPanel ctrlPanel)
1620
+ void SetupMaterial(cGridBag panel)
13981621 {
1399
- aConstraints.weighty = 0;
1400
- //aConstraints.weightx = 1;
1401
- /*
1622
+ /*
14021623 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14031624 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1404
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1405
- aConstraints.gridx += 1;
14061625 */
14071626
1408
- aConstraints.gridwidth = 1;
1409
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1410
- aConstraints.gridx += 1;
1411
- aConstraints.weighty = 0;
1412
- aConstraints.gridwidth = 1;
1627
+ cGridBag editBar = new cGridBag().setVertical(false);
1628
+
1629
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1630
+ createMaterialButton.setToolTipText("Create material");
14131631
14141632 /*
14151633 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1416
- aConstraints.gridx += 1;
1417
- aConstraints.weighty = 0;
1418
- aConstraints.gridwidth = 1;
14191634 */
14201635
1421
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1422
- aConstraints.gridx += 1;
1636
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1637
+ clearMaterialButton.setToolTipText("Clear material");
1638
+
1639
+ if (Globals.ADVANCED)
1640
+ {
1641
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1642
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1643
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1644
+ }
14231645
1424
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1425
-
1426
- aConstraints.gridx += 1;
1427
-
1428
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1429
-
1430
- aConstraints.gridx += 1;
1431
-
1432
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1433
-
1434
- aConstraints.gridx = 0;
1435
- aConstraints.gridy += 1;
1436
- aConstraints.weighty = 0;
1437
- aConstraints.gridwidth = 1;
1646
+ editBar.preferredHeight = 15;
1647
+
1648
+ panel.add(editBar);
1649
+
14381650 /**/
14391651 //aConstraints.weighty = 0;
14401652 ////aConstraints.weightx = 1;
14411653 //aConstraints.weighty = 1;
14421654 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14431655 //aConstraints.gridx += 1;
1444
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1445
- aConstraints.weighty = 0;
1446
- aConstraints.gridx = 0;
1447
- aConstraints.gridy += 1;
1448
- aConstraints.gridwidth = 1;
1656
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14491657
1450
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1451
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1452
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1453
- aConstraints.gridx += 1;
1454
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1455
- //aConstraints.weightx = 0;
1456
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1457
- aConstraints.gridx = 0;
1458
- aConstraints.gridy += 1;
1459
- aConstraints.gridwidth = 1;
1658
+ cGridBag colorSection = new cGridBag().setVertical(true);
1659
+
1660
+ cGridBag color = new cGridBag();
1661
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1662
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1663
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1664
+ //colorField.preferredWidth = 200;
1665
+ colorSection.add(color);
14601666
1461
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1462
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1463
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1464
- aConstraints.gridx += 1;
1465
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1466
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1467
- aConstraints.gridx = 0;
1468
- aConstraints.gridy += 1;
1469
- aConstraints.gridwidth = 1;
1667
+ cGridBag modulation = new cGridBag();
1668
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1669
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1670
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1671
+ colorSection.add(modulation);
14701672
1471
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1472
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1473
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1474
- aConstraints.gridx += 1;
1475
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1476
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1477
- aConstraints.gridx = 0;
1478
- aConstraints.gridy += 1;
1479
- aConstraints.gridwidth = 1;
1673
+ cGridBag texture = new cGridBag();
1674
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1675
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1676
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1677
+ colorSection.add(texture);
14801678
1481
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1482
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1483
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1484
- aConstraints.gridx += 1;
1485
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1486
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1487
- aConstraints.gridx = 0;
1488
- aConstraints.gridy += 1;
1489
- aConstraints.gridwidth = 1;
1679
+ cGridBag anisoU = new cGridBag();
1680
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1681
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1683
+ colorSection.add(anisoU);
14901684
1491
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1492
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1493
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1494
- aConstraints.gridx += 1;
1495
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1496
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1497
- aConstraints.gridx = 0;
1498
- aConstraints.gridy += 1;
1499
- aConstraints.gridwidth = 1;
1685
+ cGridBag anisoV = new cGridBag();
1686
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1687
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1689
+ colorSection.add(anisoV);
15001690
1501
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1502
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1503
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1504
- aConstraints.gridx += 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1506
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1507
- aConstraints.gridx = 0;
1508
- aConstraints.gridy += 1;
1509
- aConstraints.gridwidth = 1;
1691
+ cGridBag shadowbias = new cGridBag();
1692
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1693
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1694
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1695
+ colorSection.add(shadowbias);
15101696
1511
- //aConstraints.weighty = 1;
1512
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1513
- //aConstraints.gridx += 1;
1514
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1515
- aConstraints.weighty = 0;
1516
- aConstraints.gridx = 0;
1517
- aConstraints.gridy += 1;
1518
- aConstraints.gridwidth = 1;
1697
+ panel.add(new JSeparator());
1698
+
1699
+ panel.add(colorSection);
1700
+
1701
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1702
+
1703
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1704
+
1705
+ cGridBag diffuse = new cGridBag();
1706
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1707
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1709
+ diffuseSection.add(diffuse);
15191710
1520
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1521
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1522
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1523
- aConstraints.gridx += 1;
1524
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1525
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1526
- aConstraints.gridx = 0;
1527
- aConstraints.gridy += 1;
1528
- aConstraints.gridwidth = 1;
1711
+ cGridBag diffuseness = new cGridBag();
1712
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1713
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1714
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1715
+ diffuseSection.add(diffuseness);
15291716
1530
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1531
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1533
- aConstraints.gridx += 1;
1534
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1535
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1536
- aConstraints.gridx = 0;
1537
- aConstraints.gridy += 1;
1538
- aConstraints.gridwidth = 1;
1717
+ cGridBag selfshadow = new cGridBag();
1718
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1719
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1720
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1721
+ diffuseSection.add(selfshadow);
15391722
1540
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1541
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1542
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1543
- aConstraints.gridx += 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1545
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1546
- aConstraints.gridx = 0;
1547
- aConstraints.gridy += 1;
1548
- aConstraints.gridwidth = 1;
1723
+ cGridBag sheen = new cGridBag();
1724
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1725
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1726
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1727
+ diffuseSection.add(sheen);
15491728
1550
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1551
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1552
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1553
- aConstraints.gridx += 1;
1554
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1555
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1556
- aConstraints.gridx = 0;
1557
- aConstraints.gridy += 1;
1558
- aConstraints.gridwidth = 1;
1729
+ cGridBag subsurface = new cGridBag();
1730
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1731
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1732
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1733
+ diffuseSection.add(subsurface);
15591734
1560
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1561
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1562
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1563
- aConstraints.gridx += 1;
1564
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1565
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1566
- aConstraints.gridx = 0;
1567
- aConstraints.gridy += 1;
1568
- aConstraints.gridwidth = 1;
1735
+ cGridBag shadow = new cGridBag();
1736
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1737
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1738
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1739
+ diffuseSection.add(shadow);
15691740
1570
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1571
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1572
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1573
- aConstraints.gridx += 1;
1574
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1575
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1576
- aConstraints.gridx = 0;
1577
- aConstraints.gridy += 1;
1578
- aConstraints.gridwidth = 1;
1741
+ cGridBag fakedepth = new cGridBag();
1742
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1743
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1744
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1745
+ diffuseSection.add(fakedepth);
15791746
1580
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1581
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1583
- aConstraints.gridx += 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1585
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1586
- aConstraints.gridx = 0;
1587
- aConstraints.gridy += 1;
1588
- aConstraints.gridwidth = 1;
1747
+ panel.add(new JSeparator());
1748
+
1749
+ panel.add(diffuseSection);
1750
+
1751
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1752
+
1753
+ cGridBag specularSection = new cGridBag().setVertical(true);
15891754
1590
- //aConstraints.weighty = 1;
1591
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1592
- //aConstraints.gridx += 1;
1593
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1594
- aConstraints.weighty = 0;
1595
- aConstraints.gridx = 0;
1596
- aConstraints.gridy += 1;
1597
- aConstraints.gridwidth = 1;
1755
+ cGridBag specular = new cGridBag();
1756
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1757
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1758
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1759
+ specularSection.add(specular);
15981760
1599
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1600
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1601
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1602
- aConstraints.gridx += 1;
1603
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1604
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1605
- aConstraints.gridx = 0;
1606
- aConstraints.gridy += 1;
1607
- aConstraints.gridwidth = 1;
1761
+ cGridBag lightarea = new cGridBag();
1762
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1763
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1764
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1765
+ specularSection.add(lightarea);
16081766
1609
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1610
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1612
- aConstraints.gridx += 1;
1613
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1614
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1615
- aConstraints.gridx = 0;
1616
- aConstraints.gridy += 1;
1617
- aConstraints.gridwidth = 1;
1767
+ cGridBag shininess = new cGridBag();
1768
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1769
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1770
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1771
+ specularSection.add(shininess);
16181772
1619
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1620
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1621
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1622
- aConstraints.gridx += 1;
1623
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1624
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1625
- aConstraints.gridx = 0;
1626
- aConstraints.gridy += 1;
1627
- aConstraints.gridwidth = 1;
1773
+ cGridBag metalness = new cGridBag();
1774
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1775
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1776
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1777
+ specularSection.add(metalness);
16281778
1629
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1630
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1632
- aConstraints.gridx += 1;
1633
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1634
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
1779
+ cGridBag velvet = new cGridBag();
1780
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1781
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1782
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1783
+ specularSection.add(velvet);
16381784
1639
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1640
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- aConstraints.gridwidth = 1;
1648
-
1649
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1650
- Return();
1785
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1786
+ //Return();
16511787 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16521788 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16531789 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1658,130 +1794,93 @@
16581794 // aConstraints.gridy += 1;
16591795 // aConstraints.gridwidth = 1;
16601796
1661
- //aConstraints.weighty = 1;
1662
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1663
- //aConstraints.gridx += 1;
1664
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1665
- aConstraints.weighty = 0;
1666
- aConstraints.gridx = 0;
1667
- aConstraints.gridy += 1;
1668
- aConstraints.gridwidth = 1;
16691797
1670
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1671
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1672
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1673
- aConstraints.gridx += 1;
1674
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1675
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1676
- aConstraints.gridx = 0;
1677
- aConstraints.gridy += 1;
1678
- aConstraints.gridwidth = 1;
1798
+ panel.add(new JSeparator());
1799
+
1800
+ panel.add(specularSection);
1801
+
1802
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1803
+
1804
+ cGridBag globalSection = new cGridBag().setVertical(true);
16791805
1680
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1681
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- aConstraints.gridwidth = 1;
1806
+ cGridBag camera = new cGridBag();
1807
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1808
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1809
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1810
+ globalSection.add(camera);
16891811
1690
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1691
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- aConstraints.gridwidth = 1;
1812
+ cGridBag ambient = new cGridBag();
1813
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1814
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1815
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1816
+ globalSection.add(ambient);
16991817
1700
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1701
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- aConstraints.gridwidth = 1;
1709
- aConstraints.weighty = 0;
1818
+ cGridBag backlit = new cGridBag();
1819
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1820
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1821
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1822
+ globalSection.add(backlit);
17101823
1711
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1712
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1713
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1714
- aConstraints.gridx += 1;
1715
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1716
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1717
- aConstraints.gridx = 0;
1718
- aConstraints.gridy += 1;
1719
- aConstraints.gridwidth = 1;
1824
+ cGridBag opacity = new cGridBag();
1825
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1826
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1827
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1828
+ globalSection.add(opacity);
17201829
1721
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1722
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1723
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1724
- aConstraints.gridx += 1;
1725
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1726
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1727
- aConstraints.gridx = 0;
1728
- aConstraints.gridy += 1;
1729
- aConstraints.gridwidth = 1;
1830
+ panel.add(new JSeparator());
1831
+
1832
+ panel.add(globalSection);
1833
+
1834
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1835
+
1836
+ cGridBag textureSection = new cGridBag().setVertical(true);
17301837
1731
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1732
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1733
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1734
- aConstraints.gridx += 1;
1735
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1736
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1737
- aConstraints.gridx = 0;
1738
- aConstraints.gridy += 1;
1739
- aConstraints.gridwidth = 1;
1838
+ cGridBag bump = new cGridBag();
1839
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1840
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1841
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1842
+ textureSection.add(bump);
17401843
1741
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1742
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1743
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1744
- aConstraints.gridx += 1;
1745
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1746
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1747
- aConstraints.gridx = 0;
1748
- aConstraints.gridy += 1;
1749
- aConstraints.gridwidth = 1;
1844
+ cGridBag noise = new cGridBag();
1845
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1846
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1847
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1848
+ textureSection.add(noise);
17501849
1751
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1752
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1753
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1754
- aConstraints.gridx += 1;
1755
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1756
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1757
- aConstraints.gridx = 0;
1758
- aConstraints.gridy += 1;
1759
- aConstraints.gridwidth = 1;
1850
+ cGridBag power = new cGridBag();
1851
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1852
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1853
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1854
+ textureSection.add(power);
17601855
1761
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1762
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1763
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1764
- aConstraints.gridx += 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1766
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1767
- aConstraints.gridx = 0;
1768
- aConstraints.gridy += 1;
1769
- aConstraints.gridwidth = 1;
1856
+ cGridBag borderfade = new cGridBag();
1857
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1858
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1859
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1860
+ textureSection.add(borderfade);
17701861
1771
- //aConstraints.weighty = 1;
1772
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1773
- //aConstraints.gridx += 1;
1774
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1775
- aConstraints.weighty = 0;
1862
+ cGridBag fog = new cGridBag();
1863
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1864
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1865
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1866
+ textureSection.add(fog);
17761867
1777
- aConstraints.gridx = 0;
1778
- aConstraints.gridy = 0;
1779
- aConstraints.gridwidth = 1;
1868
+ cGridBag opacityPower = new cGridBag();
1869
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1870
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1871
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1872
+ textureSection.add(opacityPower);
1873
+
1874
+ panel.add(new JSeparator());
1875
+
1876
+ panel.add(textureSection);
1877
+
1878
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17801879
17811880 SetMaterial(copy); // .GetMaterial());
17821881
1783
- colorField.addChangeListener(this);
1784
- modulationField.addChangeListener(this);
1882
+ //colorField.addChangeListener(this);
1883
+// modulationField.addChangeListener(this);
17851884 metalnessField.addChangeListener(this);
17861885 diffuseField.addChangeListener(this);
17871886 specularField.addChangeListener(this);
....@@ -1811,12 +1910,15 @@
18111910 opacityPowerField.addChangeListener(this);
18121911 /**/
18131912
1814
- resetSlidersButton.addActionListener(this);
18151913 clearMaterialButton.addActionListener(this);
18161914 createMaterialButton.addActionListener(this);
1817
-
1818
- propagateToggle.addItemListener(this);
1819
- multiplyToggle.addItemListener(this);
1915
+
1916
+ if (Globals.ADVANCED)
1917
+ {
1918
+ resetSlidersButton.addActionListener(this);
1919
+ propagateToggle.addItemListener(this);
1920
+ multiplyToggle.addItemListener(this);
1921
+ }
18201922 }
18211923
18221924 void DropFile(java.io.File[] files, boolean textures)
....@@ -1987,7 +2089,7 @@
19872089
19882090 //? flashIt = false;
19892091 CameraPane pane = (CameraPane) cameraView;
1990
- pane.clickStart(location.x, location.y, 0);
2092
+ pane.clickStart(location.x, location.y, 0, 0);
19912093 pane.clickEnd(location.x, location.y, 0, true);
19922094
19932095 if (group.selection.size() == 1)
....@@ -2036,6 +2138,7 @@
20362138 e2.printStackTrace();
20372139 }
20382140 }
2141
+
20392142 LoadJMEThread loadThread;
20402143
20412144 class LoadJMEThread extends Thread
....@@ -2093,6 +2196,7 @@
20932196 //LoadFile0(filename, converter);
20942197 }
20952198 }
2199
+
20962200 LoadOBJThread loadObjThread;
20972201
20982202 class LoadOBJThread extends Thread
....@@ -2171,19 +2275,19 @@
21712275
21722276 void LoadObjFile(String fullname)
21732277 {
2174
- /*
2278
+ System.out.println("Loading " + fullname);
2279
+ /**/
21752280 //lastFilename = fullname;
21762281 if(loadObjThread == null)
21772282 {
2178
- loadObjThread = new LoadOBJThread();
2179
- loadObjThread.start();
2283
+ loadObjThread = new LoadOBJThread();
2284
+ loadObjThread.start();
21802285 }
21812286
21822287 loadObjThread.add(fullname);
2183
- */
2288
+ /**/
21842289
2185
- System.out.println("Loading " + fullname);
2186
- makeSomething(new FileObject(fullname, true), true);
2290
+ //makeSomething(new FileObject(fullname, true), true);
21872291 }
21882292
21892293 void LoadGFDFile(String fullname)
....@@ -2444,11 +2548,11 @@
24442548
24452549 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24462550 {
2447
- if (GrafreeD.standAlone)
2551
+ if (Grafreed.standAlone)
24482552 {
24492553 /**/
24502554 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2451
- browser.show();
2555
+ browser.setVisible(true);
24522556 String filename = browser.getFile();
24532557 if (filename != null && filename.length() > 0)
24542558 {
....@@ -2593,6 +2697,7 @@
25932697 }
25942698 if (input == null)
25952699 {
2700
+ new Exception().printStackTrace();
25962701 System.exit(0);
25972702 }
25982703
....@@ -2799,6 +2904,8 @@
27992904
28002905 void SetMaterial(Object3D object)
28012906 {
2907
+ latestObject = object;
2908
+
28022909 cMaterial mat = object.material;
28032910
28042911 if (mat == null)
....@@ -2807,7 +2914,8 @@
28072914 return;
28082915 }
28092916
2810
- multiplyToggle.setSelected(mat.multiply);
2917
+ if (multiplyToggle != null)
2918
+ multiplyToggle.setSelected(mat.multiply);
28112919
28122920 assert (object.projectedVertices != null);
28132921
....@@ -2983,7 +3091,7 @@
29833091 cameraView.ToggleDL();
29843092 cameraView.repaint();
29853093 return;
2986
- } else if (event.getSource() == toggleTextureItem)
3094
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29873095 {
29883096 cameraView.ToggleTexture();
29893097 // june 2013 copy.HardTouch();
....@@ -2996,7 +3104,8 @@
29963104 if (timeline)
29973105 {
29983106 centralPanel.remove(cameraView);
2999
- centralPanel.add(timelinePanel);
3107
+ cameraPanel.add(cameraView);
3108
+ centralPanel.add(cameraPanel);
30003109 frame.setJMenuBar(timelineMenubar);
30013110 wasFullScreen = CameraPane.FULLSCREEN;
30023111 if (!CameraPane.FULLSCREEN)
....@@ -3005,7 +3114,7 @@
30053114 }
30063115 else
30073116 {
3008
- centralPanel.remove(timelinePanel);
3117
+ centralPanel.remove(cameraPanel);
30093118 centralPanel.add(cameraView);
30103119 frame.setJMenuBar(null);
30113120 if (!wasFullScreen)
....@@ -3021,9 +3130,9 @@
30213130 frame.validate();
30223131
30233132 return;
3024
- } else if (event.getSource() == toggleRandomItem)
3133
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
30253134 {
3026
- cameraView.ToggleRandom();
3135
+ cameraView.ToggleSwitch();
30273136 cameraView.repaint();
30283137 return;
30293138 } else if (event.getSource() == toggleHandleItem)
....@@ -3052,6 +3161,10 @@
30523161 {
30533162 copy.live ^= true;
30543163 return;
3164
+ } else if (event.getSource() == selectCB)
3165
+ {
3166
+ copy.dontselect ^= true;
3167
+ return;
30553168 } else if (event.getSource() == hideCB)
30563169 {
30573170 copy.hide ^= true;
....@@ -3066,6 +3179,7 @@
30663179 if (event.getSource() == randomCB)
30673180 {
30683181 copy.random ^= true;
3182
+ objEditor.refreshContents();
30693183 return;
30703184 }
30713185 if (event.getSource() == speedupCB)
....@@ -3089,8 +3203,9 @@
30893203
30903204 public void actionPerformed(ActionEvent event)
30913205 {
3206
+ Object source = event.getSource();
30923207 // SCRIPT DIALOG
3093
- if (event.getSource() == okbutton)
3208
+ if (source == okbutton)
30943209 {
30953210 textpanel.setVisible(false);
30963211 textpanel.remove(textarea);
....@@ -3102,7 +3217,7 @@
31023217 textarea = null;
31033218 textpanel = null;
31043219 }
3105
- if (event.getSource() == cancelbutton)
3220
+ if (source == cancelbutton)
31063221 {
31073222 textpanel.setVisible(false);
31083223 textpanel.remove(textarea);
....@@ -3114,49 +3229,50 @@
31143229 //applySelf();
31153230 //client.refreshEditWindow();
31163231 //refreshContents();
3117
- if (event.getSource() == nameField)
3232
+ if (source == nameField)
31183233 {
31193234 //System.out.println("ObjEditor " + event);
31203235 applySelf0(true);
31213236 //parent.applySelf();
31223237 objEditor.refreshContents();
3123
- } else if (event.getSource() == resetButton)
3238
+ } else if (source == resetButton)
31243239 {
31253240 CameraPane.fullreset = true;
31263241 copy.Reset(); // ResetMeshes();
31273242 copy.Touch();
31283243 objEditor.refreshContents();
3129
- } else if (event.getSource() == stepItem)
3244
+ } else if (source == stepItem)
31303245 {
3131
- cameraView.ONESTEP = true;
3246
+ //cameraView.ONESTEP = true;
3247
+ Globals.ONESTEP = true;
31323248 cameraView.repaint();
31333249 return;
3134
- } else if (event.getSource() == stepButton)
3250
+ } else if (source == stepButton)
31353251 {
31363252 copy.Step();
31373253 copy.Touch();
31383254 objEditor.refreshContents();
3139
- } else if (event.getSource() == slowerButton)
3255
+ } else if (source == slowerButton)
31403256 {
31413257 copy.Slower();
31423258 copy.Touch();
31433259 objEditor.refreshContents();
3144
- } else if (event.getSource() == fasterButton)
3260
+ } else if (source == fasterButton)
31453261 {
31463262 copy.Faster();
31473263 copy.Touch();
31483264 objEditor.refreshContents();
3149
- } else if (event.getSource() == remarkButton)
3265
+ } else if (source == remarkButton)
31503266 {
31513267 copy.Remark();
31523268 copy.Touch();
31533269 objEditor.refreshContents();
3154
- } else if (event.getSource() == stepAllButton)
3270
+ } else if (source == stepAllButton)
31553271 {
31563272 copy.StepAll();
31573273 copy.Touch();
31583274 objEditor.refreshContents();
3159
- } else if (event.getSource() == resetAllButton)
3275
+ } else if (source == resetAllButton)
31603276 {
31613277 //CameraPane.fullreset = true;
31623278 copy.ResetAll(); // ResetMeshes();
....@@ -3189,53 +3305,75 @@
31893305 // Close();
31903306 // }
31913307 // else
3192
- if (event.getSource() == resetSlidersButton)
3308
+ if (source == resetSlidersButton)
31933309 {
31943310 ResetSliders();
3195
- } else if (event.getSource() == clearMaterialButton)
3311
+ } else if (source == clearMaterialButton)
31963312 {
31973313 ClearMaterial();
3198
- } else if (event.getSource() == createMaterialButton)
3314
+ } else if (source == createMaterialButton)
31993315 {
32003316 CreateMaterial();
3201
- } else if (event.getSource() == clearPanelButton)
3317
+ } else if (source == clearPanelButton)
32023318 {
32033319 copy.ClearUI();
32043320 refreshContents(true);
3205
- } /*
3206
- }
3207
-
3208
- public boolean action(Event event, Object arg)
3209
- {
3210
- */ else if (event.getSource() == closeItem)
3321
+ } else if (source == importGFDItem)
3322
+ {
3323
+ ImportGFD();
3324
+ } else
3325
+ if (source == importVRMLX3DItem)
3326
+ {
3327
+ ImportVRMLX3D();
3328
+ } else
3329
+ if (source == import3DSItem)
3330
+ {
3331
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3332
+ } else
3333
+ if (source == importOBJItem)
3334
+ {
3335
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3336
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3337
+ browser.setVisible(true);
3338
+ String filename = browser.getFile();
3339
+ if (filename != null && filename.length() > 0)
3340
+ {
3341
+ String fullname = browser.getDirectory() + filename;
3342
+ makeSomething(ReadOBJ(fullname), true);
3343
+ }
3344
+ } else
3345
+ if (source == closeItem)
32113346 {
32123347 Close();
32133348 //return true;
3214
- } else if (event.getSource() == loadItem)
3349
+ } else if (source == loadItem)
32153350 {
32163351 load();
32173352 //return true;
3218
- } else if (event.getSource() == saveItem)
3353
+ } else if (source == newItem)
3354
+ {
3355
+ New();
3356
+ } else if (source == saveItem)
32193357 {
32203358 save();
32213359 //return true;
3222
- } else if (event.getSource() == saveAsItem)
3360
+ } else if (source == saveAsItem)
32233361 {
32243362 saveAs();
32253363 //return true;
3226
- } else if (event.getSource() == reexportItem)
3364
+ } else if (source == reexportItem)
32273365 {
32283366 reexport();
32293367 //return true;
3230
- } else if (event.getSource() == exportAsItem)
3368
+ } else if (source == exportAsItem)
32313369 {
32323370 export();
32333371 //return true;
3234
- } else if (event.getSource() == povItem)
3372
+ } else if (source == povItem)
32353373 {
32363374 generatePOV();
32373375 //return true;
3238
- } else if (event.getSource() == zBufferItem)
3376
+ } else if (source == zBufferItem)
32393377 {
32403378 try
32413379 {
....@@ -3257,21 +3395,8 @@
32573395 cameraView.repaint();
32583396 //return true;
32593397 }
3260
- */ else if (event.getSource() == editCameraItem)
3261
- {
3262
- cameraView.ProtectCamera();
3263
- cameraView.repaint();
3264
- return;
3265
- } else if (event.getSource() == revertCameraItem)
3266
- {
3267
- cameraView.RevertCamera();
3268
- cameraView.repaint();
3269
- return;
3270
-// } else if (event.getSource() == textureButton)
3271
-// {
3272
-// return; // true;
3273
- } else // combos...
3274
- if (event.getSource() == texresMenu)
3398
+ */ else // combos...
3399
+ if (source == texresMenu)
32753400 {
32763401 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32773402 copy.texres = texresMenu.getSelectedIndex();
....@@ -3283,27 +3408,302 @@
32833408 }
32843409 }
32853410
3286
- void ToggleAnimation()
3411
+ void New()
32873412 {
3288
- if (!CameraPane.ANIMATION)
3413
+ while (copy.Size() > 1)
32893414 {
3290
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3415
+ copy.remove(1);
3416
+ }
3417
+
3418
+ ResetModel();
3419
+ objEditor.refreshContents();
3420
+ }
3421
+
3422
+ static public byte[] Compress(Object3D o)
3423
+ {
3424
+ try
3425
+ {
3426
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3427
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3428
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3429
+
3430
+ Object3D parent = o.parent;
3431
+ o.parent = null;
3432
+
3433
+ out.writeObject(o);
3434
+
3435
+ o.parent = parent;
3436
+
3437
+ out.flush();
3438
+
3439
+ zstream.close();
3440
+ out.close();
3441
+
3442
+ return baos.toByteArray();
3443
+ } catch (Exception e)
3444
+ {
3445
+ System.err.println(e);
3446
+ return null;
3447
+ }
3448
+ }
3449
+
3450
+ static public Object Uncompress(byte[] bytes)
3451
+ {
3452
+ System.out.println("#bytes = " + bytes.length);
3453
+ try
3454
+ {
3455
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3456
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3457
+ ObjectInputStream in = new ObjectInputStream(istream);
3458
+ Object obj = in.readObject();
3459
+ in.close();
3460
+
3461
+ return obj;
3462
+ } catch (Exception e)
3463
+ {
3464
+ System.err.println(e);
3465
+ return null;
3466
+ }
3467
+ }
3468
+
3469
+ static public Object clone(Object o)
3470
+ {
3471
+ try
3472
+ {
3473
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3474
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3475
+
3476
+ out.writeObject(o);
3477
+
3478
+ out.flush();
3479
+ out.close();
3480
+
3481
+ byte[] bytes = baos.toByteArray();
3482
+
3483
+ System.out.println("clone = " + bytes.length);
3484
+
3485
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3486
+ ObjectInputStream in = new ObjectInputStream(bais);
3487
+ Object obj = in.readObject();
3488
+ in.close();
3489
+
3490
+ return obj;
3491
+ } catch (Exception e)
3492
+ {
3493
+ System.err.println(e);
3494
+ return null;
3495
+ }
3496
+ }
3497
+
3498
+ cRadio GetCurrentTab()
3499
+ {
3500
+ cRadio ab;
3501
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3502
+ {
3503
+ ab = (cRadio)e.nextElement();
3504
+ if(ab.GetObject() == copy)
3505
+ {
3506
+ return ab;
3507
+ }
3508
+ }
3509
+
3510
+ return null;
3511
+ }
3512
+
3513
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3514
+
3515
+ public void Save()
3516
+ {
3517
+ System.err.println("Save");
3518
+
3519
+ cRadio tab = GetCurrentTab();
3520
+
3521
+ boolean temp = CameraPane.SWITCH;
3522
+ CameraPane.SWITCH = false;
3523
+
3524
+ copy.ExtractBigData(hashtable);
3525
+
3526
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3527
+ tab.graphs[tab.undoindex++] = Compress(copy);
3528
+
3529
+ copy.RestoreBigData(hashtable);
3530
+
3531
+ CameraPane.SWITCH = temp;
3532
+
3533
+ //assert(hashtable.isEmpty());
3534
+
3535
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3536
+ {
3537
+ tab.graphs[i] = null;
3538
+ }
3539
+
3540
+ SetUndoStates();
3541
+
3542
+ // test save
3543
+ if (false)
3544
+ {
3545
+ try
3546
+ {
3547
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3548
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3549
+
3550
+ p.writeObject(copy);
3551
+
3552
+ p.flush();
3553
+
3554
+ ostream.close();
3555
+ } catch (Exception e)
3556
+ {
3557
+ e.printStackTrace();
3558
+ }
3559
+ }
3560
+ }
3561
+
3562
+ void CopyChanged(Object3D obj)
3563
+ {
3564
+ SetUndoStates();
3565
+
3566
+ boolean temp = CameraPane.SWITCH;
3567
+ CameraPane.SWITCH = false;
3568
+
3569
+ copy.ExtractBigData(hashtable);
3570
+
3571
+ copy.clear();
3572
+
3573
+ for (int i=0; i<obj.Size(); i++)
3574
+ {
3575
+ copy.add(obj.get(i));
3576
+ }
3577
+
3578
+ copy.RestoreBigData(hashtable);
3579
+
3580
+ CameraPane.SWITCH = temp;
3581
+
3582
+ //assert(hashtable.isEmpty());
3583
+
3584
+ copy.Touch();
3585
+
3586
+ ResetModel();
3587
+ copy.HardTouch(); // recompile?
3588
+
3589
+ cRadio ab;
3590
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3591
+ {
3592
+ ab = (cRadio)e.nextElement();
3593
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3594
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3595
+ if (test != null)
3596
+ {
3597
+ test.editWindow = ab.object.editWindow;
3598
+ ab.object = test;
3599
+ }
3600
+ }
3601
+
3602
+ refreshContents();
3603
+ }
3604
+
3605
+ cButton undoButton;
3606
+ cButton redoButton;
3607
+
3608
+ void SetUndoStates()
3609
+ {
3610
+ cRadio tab = GetCurrentTab();
3611
+
3612
+ undoButton.setEnabled(tab.undoindex > 0);
3613
+ redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null);
3614
+ }
3615
+
3616
+ public void Undo()
3617
+ {
3618
+ System.err.println("Undo");
3619
+
3620
+ cRadio tab = GetCurrentTab();
3621
+
3622
+ if (tab.undoindex == 0)
3623
+ {
3624
+ java.awt.Toolkit.getDefaultToolkit().beep();
3625
+ return;
3626
+ }
3627
+
3628
+ if (tab.graphs[tab.undoindex] == null)
3629
+ {
3630
+ Save();
3631
+ tab.undoindex -= 1;
3632
+ }
3633
+
3634
+ tab.undoindex -= 1;
3635
+
3636
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3637
+ }
3638
+
3639
+ public void Redo()
3640
+ {
3641
+ cRadio tab = GetCurrentTab();
3642
+
3643
+ if (tab.graphs[tab.undoindex + 1] == null)
3644
+ {
3645
+ java.awt.Toolkit.getDefaultToolkit().beep();
3646
+ return;
3647
+ }
3648
+
3649
+ tab.undoindex += 1;
3650
+
3651
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3652
+ }
3653
+
3654
+ void ImportGFD()
3655
+ {
3656
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32913657 browser.show();
32923658 String filename = browser.getFile();
32933659 if (filename != null && filename.length() > 0)
32943660 {
3295
- CameraPane.filename = browser.getDirectory() + filename;
3661
+ String fullname = browser.getDirectory() + filename;
3662
+
3663
+ //Object3D readobj =
3664
+ objEditor.ReadGFD(fullname, objEditor);
3665
+ //makeSomething(readobj);
3666
+ }
3667
+ }
3668
+
3669
+ void ImportVRMLX3D()
3670
+ {
3671
+ if (Grafreed.standAlone)
3672
+ {
3673
+ /**/
3674
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3675
+ browser.show();
3676
+ String filename = browser.getFile();
3677
+ if (filename != null && filename.length() > 0)
3678
+ {
3679
+ String fullname = browser.getDirectory() + filename;
3680
+ LoadVRMLX3D(fullname);
3681
+ }
3682
+ /**/
3683
+ }
3684
+ }
3685
+
3686
+ void ToggleAnimation()
3687
+ {
3688
+ if (!Globals.ANIMATION)
3689
+ {
3690
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3691
+ browser.setVisible(true);
3692
+ String filename = browser.getFile();
3693
+ if (filename != null && filename.length() > 0)
3694
+ {
3695
+ Globals.filename = browser.getDirectory() + filename;
32963696 //CameraPane.framecount = 0;
3297
- CameraPane.imagecount = 0;
3697
+ Globals.imagecount = 0;
32983698
3299
- CameraPane.ANIMATION ^= true;
3699
+ Globals.ANIMATION ^= true;
33003700
3301
- GrafreeD.wav.cursor = 0;
3302
- GrafreeD.wav.loop = 0;
3701
+ Grafreed.wav.cursor = 0;
3702
+ Grafreed.wav.loop = 0;
33033703 }
33043704 } else
33053705 {
3306
- CameraPane.ANIMATION ^= true;
3706
+ Globals.ANIMATION ^= true;
33073707 }
33083708 }
33093709
....@@ -3349,7 +3749,7 @@
33493749 void CreateMaterial()
33503750 {
33513751 //copy.ClearMaterial(); // PATCH
3352
- copy.CreateMaterialS(multiplyToggle.isSelected());
3752
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33533753 if (copy.selection.size() > 0)
33543754 //SetMaterial(copy);
33553755 {
....@@ -3400,7 +3800,7 @@
34003800 assert false;
34013801 }
34023802
3403
- void EditSelection()
3803
+ void EditSelection(boolean newWindow)
34043804 {
34053805 }
34063806
....@@ -3408,11 +3808,11 @@
34083808 {
34093809 copy.ResetBlockLoop(); // temporary problem
34103810
3411
- boolean random = CameraPane.RANDOM;
3412
- CameraPane.RANDOM = false; // parse everything
3811
+ boolean random = CameraPane.SWITCH;
3812
+ CameraPane.SWITCH = false; // parse everything
34133813 copy.ResetDisplayList();
34143814 copy.HardTouch();
3415
- CameraPane.RANDOM = random;
3815
+ CameraPane.SWITCH = random;
34163816 }
34173817
34183818 // public void applySelf()
....@@ -3482,10 +3882,40 @@
34823882 current.fakedepth = (float) fakedepthField.getFloat();
34833883 current.shadowbias = (float) shadowbiasField.getFloat();
34843884
3485
- if (!NumberSlider.frozen)
3885
+ if (!cNumberSlider.frozen)
34863886 {
34873887 //System.out.println("Propagate = " + propagate);
34883888 copy.UpdateMaterial(anchor, current, propagate);
3889
+
3890
+ if (copy.material != null)
3891
+ {
3892
+ cMaterial mat = copy.material;
3893
+
3894
+ colorField.SetToolTipValue((mat.color));
3895
+ modulationField.SetToolTipValue((mat.modulation));
3896
+ metalnessField.SetToolTipValue((mat.metalness));
3897
+ diffuseField.SetToolTipValue((mat.diffuse));
3898
+ specularField.SetToolTipValue((mat.specular));
3899
+ shininessField.SetToolTipValue((mat.shininess));
3900
+ shiftField.SetToolTipValue((mat.shift));
3901
+ ambientField.SetToolTipValue((mat.ambient));
3902
+ lightareaField.SetToolTipValue((mat.lightarea));
3903
+ diffusenessField.SetToolTipValue((mat.factor));
3904
+ velvetField.SetToolTipValue((mat.velvet));
3905
+ sheenField.SetToolTipValue((mat.sheen));
3906
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3907
+ backlitField.SetToolTipValue((mat.bump));
3908
+ anisoField.SetToolTipValue((mat.aniso));
3909
+ anisoVField.SetToolTipValue((mat.anisoV));
3910
+ cameraField.SetToolTipValue((mat.cameralight));
3911
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3912
+ shadowField.SetToolTipValue((mat.shadow));
3913
+ textureField.SetToolTipValue((mat.texture));
3914
+ opacityField.SetToolTipValue((mat.opacity));
3915
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3916
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3917
+ }
3918
+
34893919 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34903920 {
34913921 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3530,6 +3960,7 @@
35303960 || e.getSource() == apertureField
35313961 || e.getSource() == shadowblurField)
35323962 {
3963
+ new Exception().printStackTrace();
35333964 System.exit(0);
35343965 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35353966 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3600,7 +4031,7 @@
36004031 }
36014032
36024033 if (normalpushField != null)
3603
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
4034
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36044035 }
36054036
36064037 void SnapObject()
....@@ -3855,7 +4286,7 @@
38554286
38564287 radioPanel.revalidate();
38574288 radioPanel.repaint();
3858
- ctrlPanel.revalidate(); // ? new
4289
+ ctrlPanel.validate(); // ? new
38594290 ctrlPanel.repaint();
38604291 }
38614292 }
....@@ -3864,6 +4295,8 @@
38644295
38654296 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38664297 {
4298
+ if (Globals.SAVEONMAKE) // && resetmodel)
4299
+ Save();
38674300 //Tween.set(thing, 0).target(1).start(tweenManager);
38684301 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38694302 // if (thing instanceof GenericJointDemo)
....@@ -3950,6 +4383,12 @@
39504383 {
39514384 ResetModel();
39524385 Select(thing.GetTreePath(), true, false); // unselect... false);
4386
+
4387
+ if (thing.Size() == 0)
4388
+ {
4389
+ //EditSelection(false);
4390
+ }
4391
+
39534392 refreshContents();
39544393 }
39554394
....@@ -4067,6 +4506,7 @@
40674506 }
40684507 }
40694508 }
4509
+
40704510 LoadGFDThread loadGFDThread;
40714511
40724512 void ReadGFD(String fullname, iCallBack cb)
....@@ -4086,8 +4526,10 @@
40864526
40874527 try
40884528 {
4529
+ // Try compressed version first.
40894530 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4090
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4531
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4532
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40914533
40924534 readobj = (Object3D) p.readObject();
40934535 istream.close();
....@@ -4095,7 +4537,20 @@
40954537 readobj.ResetDisplayList();
40964538 } catch (Exception e)
40974539 {
4098
- e.printStackTrace();
4540
+ //e.printStackTrace();
4541
+ try
4542
+ {
4543
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4544
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4545
+
4546
+ readobj = (Object3D) p.readObject();
4547
+ istream.close();
4548
+
4549
+ readobj.ResetDisplayList();
4550
+ } catch (Exception e2)
4551
+ {
4552
+ e2.printStackTrace();
4553
+ }
40994554 }
41004555 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
41014556 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4141,6 +4596,12 @@
41414596
41424597 void LoadIt(Object obj)
41434598 {
4599
+ if (obj == null)
4600
+ {
4601
+ // Invalid file
4602
+ return;
4603
+ }
4604
+
41444605 System.out.println("Loaded " + obj);
41454606 //new Exception().printStackTrace();
41464607 Object3D readobj = (Object3D) obj;
....@@ -4150,6 +4611,8 @@
41504611
41514612 if (readobj != null)
41524613 {
4614
+ if (Globals.SAVEONMAKE)
4615
+ Save();
41534616 try
41544617 {
41554618 //readobj.deepCopySelf(copy);
....@@ -4212,7 +4675,7 @@
42124675
42134676 void load() // throws ClassNotFoundException
42144677 {
4215
- if (GrafreeD.standAlone)
4678
+ if (Grafreed.standAlone)
42164679 {
42174680 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42184681 browser.show();
....@@ -4299,11 +4762,13 @@
42994762 try
43004763 {
43014764 FileOutputStream ostream = new FileOutputStream(lastname);
4302
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4765
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4766
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43034767
43044768 p.writeObject(copy);
43054769 p.flush();
43064770
4771
+ zstream.close();
43074772 ostream.close();
43084773
43094774 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4313,17 +4778,20 @@
43134778 {
43144779 }
43154780 }
4781
+
43164782 String lastname;
43174783
43184784 void saveAs()
43194785 {
4320
- if (GrafreeD.standAlone)
4786
+ if (Grafreed.standAlone)
43214787 {
43224788 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43234789 browser.setVisible(true);
43244790 String filename = browser.getFile();
43254791 if (filename != null && filename.length() > 0)
43264792 {
4793
+ if (!filename.endsWith(".gfd"))
4794
+ filename += ".gfd";
43274795 lastname = browser.getDirectory() + filename;
43284796 save();
43294797 }
....@@ -4422,13 +4890,13 @@
44224890 try
44234891 {
44244892 FileOutputStream ostream = new FileOutputStream(filename);
4425
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4426
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4893
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4894
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44274895
44284896 Object3D objectparent = obj.parent;
44294897 obj.parent = null;
44304898
4431
- Object3D object = (Object3D) GrafreeD.clone(obj);
4899
+ Object3D object = (Object3D) Grafreed.clone(obj);
44324900
44334901 obj.parent = objectparent;
44344902
....@@ -4440,8 +4908,8 @@
44404908 p.writeObject(object);
44414909 p.flush();
44424910
4911
+ zstream.close();
44434912 ostream.close();
4444
- // zstream.close();
44454913
44464914 // group.selection.get(0).parent = parent;
44474915 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4462,7 +4930,7 @@
44624930 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44634931 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44644932 copy.generatePOV(buffer);
4465
- if (GrafreeD.standAlone)
4933
+ if (Grafreed.standAlone)
44664934 {
44674935 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44684936 browser.show();
....@@ -4488,7 +4956,8 @@
44884956 Object3D client;
44894957 Object3D copy;
44904958 MenuBar menuBar;
4491
- Menu windowMenu;
4959
+ Menu fileMenu;
4960
+ MenuItem newItem;
44924961 MenuItem loadItem;
44934962 MenuItem saveItem;
44944963 MenuItem saveAsItem;
....@@ -4496,13 +4965,11 @@
44964965 MenuItem reexportItem;
44974966 MenuItem povItem;
44984967 MenuItem closeItem;
4499
- Menu cameraMenu;
4968
+
45004969 CheckboxMenuItem zBufferItem;
45014970 //MenuItem normalLensItem;
4502
- MenuItem editCameraItem;
4503
- MenuItem revertCameraItem;
4504
- CheckboxMenuItem toggleLiveItem;
45054971 MenuItem stepItem;
4972
+ CheckboxMenuItem toggleLiveItem;
45064973 CheckboxMenuItem toggleFullScreenItem;
45074974 CheckboxMenuItem toggleTimelineItem;
45084975 CheckboxMenuItem toggleRenderItem;
....@@ -4511,28 +4978,42 @@
45114978 CheckboxMenuItem toggleFootContactItem;
45124979 CheckboxMenuItem toggleDLItem;
45134980 CheckboxMenuItem toggleTextureItem;
4514
- CheckboxMenuItem toggleRandomItem;
4981
+ CheckboxMenuItem toggleSwitchItem;
45154982 CheckboxMenuItem toggleRootItem;
45164983 CheckboxMenuItem animationItem;
45174984 CheckboxMenuItem toggleHandleItem;
45184985 CheckboxMenuItem togglePaintItem;
45194986 JSplitPane mainPanel;
45204987 JScrollPane scrollpane;
4988
+
45214989 JPanel toolbarPanel;
4522
- JPanel treePanel;
4990
+
4991
+ cGridBag treePanel;
4992
+
45234993 JPanel radioPanel;
45244994 ButtonGroup buttonGroup;
4525
- JPanel ctrlPanel;
4526
- JPanel materialPanel;
4995
+
4996
+ cGridBag toolboxPanel;
4997
+ cGridBag materialPanel;
4998
+ cGridBag ctrlPanel;
4999
+
45275000 JScrollPane infoPanel;
4528
- JPanel optionsPanel;
5001
+
5002
+ cGridBag optionsPanel;
5003
+
45295004 JTabbedPane objectPanel;
4530
- JPanel XYZPanel;
5005
+ boolean materialFlushed;
5006
+ Object3D latestObject;
5007
+
5008
+ cGridBag XYZPanel;
5009
+
45315010 JSplitPane gridPanel;
45325011 JSplitPane bigPanel;
4533
- JPanel bigThree;
4534
- JTabbedPane scenePanel;
4535
- JPanel centralPanel;
5012
+
5013
+ cGridBag bigThree;
5014
+ cGridBag scenePanel;
5015
+ cGridBag centralPanel;
5016
+ JSplitPane cameraPanel;
45365017 JPanel timelinePanel;
45375018 JMenuBar timelineMenubar;
45385019 JSplitPane framePanel;
....@@ -4584,67 +5065,72 @@
45845065 // MATERIAL
45855066 JLabel materialLabel;
45865067 JLabel colorLabel;
4587
- NumberSlider colorField;
5068
+ cNumberSlider colorField;
45885069 JLabel modulationLabel;
4589
- NumberSlider modulationField;
5070
+ cNumberSlider modulationField;
45905071 JLabel metalnessLabel;
4591
- NumberSlider metalnessField;
5072
+ cNumberSlider metalnessField;
45925073 JLabel diffuseLabel;
4593
- NumberSlider diffuseField;
5074
+ cNumberSlider diffuseField;
45945075 JLabel specularLabel;
4595
- NumberSlider specularField;
5076
+ cNumberSlider specularField;
45965077 JLabel shininessLabel;
4597
- NumberSlider shininessField;
5078
+ cNumberSlider shininessField;
45985079 JLabel shiftLabel;
4599
- NumberSlider shiftField;
5080
+ cNumberSlider shiftField;
46005081 JLabel ambientLabel;
4601
- NumberSlider ambientField;
5082
+ cNumberSlider ambientField;
46025083 JLabel lightareaLabel;
4603
- NumberSlider lightareaField;
5084
+ cNumberSlider lightareaField;
46045085 JLabel diffusenessLabel;
4605
- NumberSlider diffusenessField;
5086
+ cNumberSlider diffusenessField;
46065087 JLabel velvetLabel;
4607
- NumberSlider velvetField;
5088
+ cNumberSlider velvetField;
46085089 JLabel sheenLabel;
4609
- NumberSlider sheenField;
5090
+ cNumberSlider sheenField;
46105091 JLabel subsurfaceLabel;
4611
- NumberSlider subsurfaceField;
5092
+ cNumberSlider subsurfaceField;
46125093 //JLabel bumpLabel;
46135094 //NumberSlider bumpField;
46145095 JLabel backlitLabel;
4615
- NumberSlider backlitField;
5096
+ cNumberSlider backlitField;
46165097 JLabel anisoLabel;
4617
- NumberSlider anisoField;
5098
+ cNumberSlider anisoField;
46185099 JLabel anisoVLabel;
4619
- NumberSlider anisoVField;
5100
+ cNumberSlider anisoVField;
46205101 JLabel cameraLabel;
4621
- NumberSlider cameraField;
5102
+ cNumberSlider cameraField;
46225103 JLabel selfshadowLabel;
4623
- NumberSlider selfshadowField;
5104
+ cNumberSlider selfshadowField;
46245105 JLabel shadowLabel;
4625
- NumberSlider shadowField;
5106
+ cNumberSlider shadowField;
46265107 JLabel textureLabel;
4627
- NumberSlider textureField;
5108
+ cNumberSlider textureField;
46285109 JLabel opacityLabel;
4629
- NumberSlider opacityField;
5110
+ cNumberSlider opacityField;
46305111 JLabel fakedepthLabel;
4631
- NumberSlider fakedepthField;
5112
+ cNumberSlider fakedepthField;
46325113 JLabel shadowbiasLabel;
4633
- NumberSlider shadowbiasField;
5114
+ cNumberSlider shadowbiasField;
46345115 JLabel bumpLabel;
4635
- NumberSlider bumpField;
5116
+ cNumberSlider bumpField;
46365117 JLabel noiseLabel;
4637
- NumberSlider noiseField;
5118
+ cNumberSlider noiseField;
46385119 JLabel powerLabel;
4639
- NumberSlider powerField;
5120
+ cNumberSlider powerField;
46405121 JLabel borderfadeLabel;
4641
- NumberSlider borderfadeField;
5122
+ cNumberSlider borderfadeField;
46425123 JLabel fogLabel;
4643
- NumberSlider fogField;
5124
+ cNumberSlider fogField;
46445125 JLabel opacityPowerLabel;
4645
- NumberSlider opacityPowerField;
4646
- JTree jTree;
5126
+ cNumberSlider opacityPowerField;
5127
+ cTree jTree;
46475128 //ObjectUI parent;
46485129
4649
- NumberSlider normalpushField;
5130
+ cNumberSlider normalpushField;
5131
+
5132
+ private MenuItem importGFDItem;
5133
+ private MenuItem importVRMLX3DItem;
5134
+ private MenuItem import3DSItem;
5135
+ private MenuItem importOBJItem;
46505136 }