Normand Briere
2019-06-27 1807e7752960ac229cddd34b100e92cadbac9459
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.*;
....@@ -14,10 +15,15 @@
1415 //import javax.swing.plaf.ColorUIResource;
1516 //import javax.swing.plaf.metal.DefaultMetalTheme;
1617
18
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
19
+import javax.swing.plaf.basic.BasicSplitPaneUI;
20
+
1721 //import javax.media.opengl.GLCanvas;
1822
1923 import //weka.core.
2024 matrix.Matrix;
25
+
26
+import grafeme.ui.*;
2127
2228 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2329 ActionListener, ChangeListener,
....@@ -31,6 +37,70 @@
3137 boolean timeline;
3238 boolean wasFullScreen;
3339
40
+ GroupEditor callee;
41
+ JFrame frame;
42
+
43
+ static ObjEditor theFrame;
44
+
45
+ cButton GetButton(String name, boolean border)
46
+ {
47
+ try
48
+ {
49
+ ImageIcon icon = GetIcon(name);
50
+ return new cButton(icon, border);
51
+ }
52
+ catch (Exception e)
53
+ {
54
+ return new cButton(name, border);
55
+ }
56
+ }
57
+
58
+ cToggleButton GetToggleButton(String name, boolean border)
59
+ {
60
+ try
61
+ {
62
+ ImageIcon icon = GetIcon(name);
63
+ return new cToggleButton(icon, border);
64
+ }
65
+ catch (Exception e)
66
+ {
67
+ return new cToggleButton(name, border);
68
+ }
69
+ }
70
+
71
+ cCheckBox GetCheckBox(String name, boolean border)
72
+ {
73
+ try
74
+ {
75
+ ImageIcon icon = GetIcon(name);
76
+ return new cCheckBox(icon, border);
77
+ }
78
+ catch (Exception e)
79
+ {
80
+ return new cCheckBox(name, border);
81
+ }
82
+ }
83
+
84
+ private ImageIcon GetIcon(String name) throws IOException
85
+ {
86
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
87
+
88
+ if (image.getWidth() != 24 && image.getHeight() != 24)
89
+ {
90
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
91
+ Graphics2D g = resized.createGraphics();
92
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
93
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
94
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
95
+ g.dispose();
96
+
97
+ image = resized;
98
+ }
99
+
100
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
101
+ return icon;
102
+ }
103
+
34104 // SCRIPT
35105
36106 transient JFrame textpanel = null;
....@@ -121,47 +191,54 @@
121191 void keyPressed(int key, int modifiers)
122192 {
123193 System.out.println("KEY PRESSED");
124
- CameraPane.theRenderer.keyPressed(key, modifiers);
194
+ Globals.theRenderer.keyPressed(key, modifiers);
125195 }
126196 */
127197
128198 static GridBagConstraints aConstraints;
129199 static GridBagConstraints aWindowConstraints;
130
- GroupEditor callee;
131
- JFrame frame;
200
+
132201 static int GRIDWIDTH = 100; // 4;
133202
134203 public void closeUI()
135204 {
136205 //new Exception().printStackTrace();
137
- System.out.println("this = " + this);
138
- System.out.println("objEditor = " + objEditor);
206
+// System.out.println("this = " + this);
207
+// System.out.println("objEditor = " + objEditor);
139208 //nameField.removeActionListener(this);
140
- objEditor.ctrlPanel.remove(nameField);
209
+// objEditor.ctrlPanel.remove(nameField);
141210
142
- if (!GroupEditor.allparams)
211
+ objEditor.ctrlPanel.remove(namePanel);
212
+
213
+ if (!allparams)
143214 return;
144215
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);
216
+// objEditor.ctrlPanel.remove(liveCB);
217
+// objEditor.ctrlPanel.remove(hideCB);
218
+// objEditor.ctrlPanel.remove(markCB);
219
+//
220
+// objEditor.ctrlPanel.remove(randomCB);
221
+// objEditor.ctrlPanel.remove(speedupCB);
222
+// objEditor.ctrlPanel.remove(rewindCB);
223
+//
224
+// objEditor.ctrlPanel.remove(resetButton);
225
+// objEditor.ctrlPanel.remove(stepButton);
226
+//// objEditor.ctrlPanel.remove(stepAllButton);
227
+//// objEditor.ctrlPanel.remove(resetAllButton);
228
+// objEditor.ctrlPanel.remove(link2masterCB);
229
+// //objEditor.ctrlPanel.remove(flipVCB);
230
+// //objEditor.ctrlPanel.remove(texresMenu);
231
+// objEditor.ctrlPanel.remove(slowerButton);
232
+// objEditor.ctrlPanel.remove(fasterButton);
233
+// objEditor.ctrlPanel.remove(remarkButton);
163234
164
- Remove(normalpushField);
235
+ objEditor.ctrlPanel.remove(setupPanel);
236
+ objEditor.ctrlPanel.remove(setupPanel2);
237
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
238
+ objEditor.ctrlPanel.remove(pushPanel);
239
+ //objEditor.ctrlPanel.remove(fillPanel);
240
+
241
+ //Remove(normalpushField);
165242 }
166243
167244 public ObjEditor GetEditor()
....@@ -232,6 +309,7 @@
232309 //localCopy.parent = null;
233310
234311 frame = new JFrame();
312
+ frame.setUndecorated(true);
235313 objEditor = this;
236314 this.callee = callee;
237315
....@@ -262,27 +340,48 @@
262340 return frame.action(event, obj);
263341 }
264342
343
+ // Cannot work without static
344
+ static boolean allparams = true;
345
+
346
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
347
+
265348 void SetupMenu()
266349 {
267350 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..."));
351
+ menuBar.add(fileMenu = new Menu("File"));
352
+ fileMenu.add(newItem = new MenuItem("New"));
353
+ fileMenu.add(loadItem = new MenuItem("Open..."));
354
+
355
+ //oe.menuBar.add(menu = new Menu("Include"));
356
+ Menu menu = new Menu("Import");
357
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
358
+ importOBJItem.addActionListener(this);
359
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
360
+ import3DSItem.addActionListener(this);
361
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
362
+ importVRMLX3DItem.addActionListener(this);
363
+ menu.add("-");
364
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
365
+ importGFDItem.addActionListener(this);
366
+ fileMenu.add(menu);
367
+ fileMenu.add("-");
368
+
369
+ fileMenu.add(saveItem = new MenuItem("Save"));
370
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
273371 //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("-");
372
+ fileMenu.add("-");
373
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
374
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
375
+ fileMenu.add("-");
278376 if (client.parent != null)
279377 {
280
- windowMenu.add(closeItem = new MenuItem("Close"));
378
+ fileMenu.add(closeItem = new MenuItem("Close"));
281379 } else
282380 {
283
- windowMenu.add(closeItem = new MenuItem("Exit"));
381
+ fileMenu.add(closeItem = new MenuItem("Exit"));
284382 }
285383
384
+ newItem.addActionListener(this);
286385 loadItem.addActionListener(this);
287386 saveItem.addActionListener(this);
288387 saveAsItem.addActionListener(this);
....@@ -291,79 +390,64 @@
291390 //povItem.addActionListener(this);
292391 closeItem.addActionListener(this);
293392
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
-
349393 objectPanel = new JTabbedPane();
394
+
395
+ ChangeListener changeListener = new ChangeListener()
396
+ {
397
+ public void stateChanged(ChangeEvent changeEvent)
398
+ {
399
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
400
+// {
401
+// if (latestObject != null)
402
+// {
403
+// refreshContents(true);
404
+// SetMaterial(latestObject);
405
+// }
406
+//
407
+// materialFlushed = true;
408
+// }
409
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
410
+// {
411
+// if (listUI.size() == 0)
412
+// EditSelection(false);
413
+// }
414
+
415
+ refreshContents(false); // To refresh Info tab
416
+ }
417
+ };
418
+ objectPanel.addChangeListener(changeListener);
419
+
350420 toolbarPanel = new JPanel();
351421 toolbarPanel.setName("Toolbar");
352
- treePanel = new JPanel();
422
+ treePanel = new cGridBag();
353423 treePanel.setName("Tree");
354
- ctrlPanel = new JPanel(); // new GridBagLayout());
355
- ctrlPanel.setName("Edit");
356
- materialPanel = new JPanel();
424
+
425
+ editPanel = new cGridBag().setVertical(true);
426
+ editPanel.setName("Edit");
427
+
428
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
429
+
430
+ editCommandsPanel = new cGridBag();
431
+ editPanel.add(editCommandsPanel);
432
+ editPanel.add(ctrlPanel);
433
+
434
+ toolboxPanel = new cGridBag().setVertical(false);
435
+ toolboxPanel.setName("Toolbox");
436
+
437
+ materialPanel = new cGridBag().setVertical(true);
357438 materialPanel.setName("Material");
439
+
358440 /*JTextPane*/
359441 infoarea = createTextPane();
442
+ doc = infoarea.getStyledDocument();
443
+
360444 infoarea.setEditable(true);
361445 SetText();
362446 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
363447 // infoarea.setOpaque(false);
364448 // //infoarea.setForeground(textcolor);
365
- infoarea.setLineWrap(true);
366
- infoarea.setWrapStyleWord(true);
449
+// TEXTAREA infoarea.setLineWrap(true);
450
+// TEXTAREA infoarea.setWrapStyleWord(true);
367451 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
368452 infoPanel.setPreferredSize(new Dimension(50, 200));
369453 infoPanel.setName("Info");
....@@ -374,16 +458,23 @@
374458 mainPanel.setName("Main");
375459 mainPanel.setContinuousLayout(true);
376460 mainPanel.setOneTouchExpandable(true);
377
- mainPanel.setDividerLocation(1.0);
378461 mainPanel.setDividerSize(9);
379
- mainPanel.setResizeWeight(0);
380
-
462
+ mainPanel.setDividerLocation(0.5); //1.0);
463
+ mainPanel.setResizeWeight(0.5);
464
+
465
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
466
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
467
+ divider.setDividerSize(15);
468
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
469
+
470
+ mainPanel.setUI(new BasicSplitPaneUI());
471
+
381472 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
382473 //mainPanel.setLayout(new GridBagLayout());
383474 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
384
- treePanel.setLayout(new GridBagLayout());
385
- ctrlPanel.setLayout(new GridBagLayout());
386
- materialPanel.setLayout(new GridBagLayout());
475
+// treePanel.setLayout(new GridBagLayout());
476
+ //ctrlPanel.setLayout(new GridBagLayout());
477
+ //materialPanel.setLayout(new GridBagLayout());
387478
388479 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
389480 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -422,7 +513,7 @@
422513 static String newline = "\n";
423514 protected static final String buttonString = "JButton";
424515 StyledDocument doc;
425
- JTextArea infoarea;
516
+ JTextPane infoarea;
426517
427518 void ClearInfo()
428519 {
....@@ -445,10 +536,10 @@
445536 e.printStackTrace();
446537 }
447538
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();
539
+// String selection = infoarea.getText();
540
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
541
+// java.awt.datatransfer.Clipboard clipboard =
542
+// Toolkit.getDefaultToolkit().getSystemClipboard();
452543 //clipboard.setContents(data, data);
453544 }
454545
....@@ -471,13 +562,13 @@
471562 //SendInfo("Name:", "bold");
472563 if (sel.GetTextures() != null || debug)
473564 {
474
- si.SendInfo(sel.toString(), "bold");
565
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
475566 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
476567 if (sel.Size() > 0)
477568 {
478569 si.SendInfo("#children = " + sel.Size(), "regular");
479570 }
480
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
571
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
481572 if (debug)
482573 {
483574 try
....@@ -489,7 +580,10 @@
489580 }
490581
491582 if (full)
492
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
583
+ {
584
+ si.SendInfo(" BBox min: " + minima, "regular");
585
+ si.SendInfo(" BBox max: " + maxima, "regular");
586
+ }
493587
494588 if (sel.bRep != null)
495589 {
....@@ -516,7 +610,7 @@
516610 }
517611 if (sel.support != null)
518612 {
519
- si.SendInfo(" support: " + sel.support, "regular");
613
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
520614 }
521615 if (sel.scriptnode != null)
522616 {
....@@ -587,6 +681,9 @@
587681 {
588682 CameraPane.pointflow = (PointFlow) sel;
589683 }
684
+
685
+ si.SendInfo("_____________________", "regular");
686
+ si.SendInfo("", "regular");
590687 }
591688 }
592689
....@@ -602,68 +699,140 @@
602699 }
603700 }
604701
702
+static GraphicsDevice device = GraphicsEnvironment
703
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
704
+
705
+ Rectangle keeprect;
706
+ cRadio radio;
707
+
708
+cButton keepButton;
709
+ cButton twoButton; // Full 3D
710
+ cButton sixButton;
711
+ cButton threeButton;
712
+ cButton sevenButton;
713
+ cButton fourButton; // full panel
714
+ cButton oneButton; // full XYZ
715
+ //cButton currentLayout;
716
+
717
+ boolean maximized;
718
+
719
+ cButton fullscreenLayout;
720
+
721
+ void Minimize()
722
+ {
723
+ frame.setState(Frame.ICONIFIED);
724
+ }
725
+
726
+ void Maximize()
727
+ {
728
+ if (maximized)
729
+ {
730
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
731
+ }
732
+ else
733
+ {
734
+ keeprect = frame.getBounds();
735
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
736
+ Dimension rect2 = frame.getToolkit().getScreenSize();
737
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
738
+// frame.setState(Frame.MAXIMIZED_BOTH);
739
+ }
740
+
741
+ maximized ^= true;
742
+ }
743
+
605744 void ToggleFullScreen()
606745 {
607
- if (CameraPane.FULLSCREEN)
746
+ cameraView.ToggleFullScreen();
747
+
748
+ if (!CameraPane.FULLSCREEN)
608749 {
609
- frame.getContentPane().remove(/*"Center",*/bigThree);
610
- framePanel.add(bigThree);
611
- frame.getContentPane().add(/*"Center",*/framePanel);
750
+ device.setFullScreenWindow(null);
751
+ //frame.setVisible(false);
752
+// frame.removeNotify();
753
+// frame.setUndecorated(false);
754
+// frame.addNotify();
755
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
756
+
757
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
758
+// X framePanel.add(bigThree);
759
+// X frame.getContentPane().add(/*"Center",*/framePanel);
760
+ framePanel.setDividerLocation(1);
761
+
762
+ //frame.setVisible(true);
763
+ radio.layout = keepButton;
764
+ //theFrame = null;
765
+ keepButton = null;
766
+ radio.layout.doClick();
767
+
612768 } else
613769 {
614
- frame.getContentPane().remove(/*"Center",*/framePanel);
615
- framePanel.remove(bigThree);
616
- frame.getContentPane().add(/*"Center",*/bigThree);
770
+ keepButton = radio.layout;
771
+ //keeprect = frame.getBounds();
772
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
773
+// frame.getToolkit().getScreenSize().height);
774
+ //frame.setVisible(false);
775
+ device.setFullScreenWindow(frame);
776
+// frame.removeNotify();
777
+// frame.setUndecorated(true);
778
+// frame.addNotify();
779
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
780
+// X framePanel.remove(bigThree);
781
+// X frame.getContentPane().add(/*"Center",*/bigThree);
782
+ framePanel.setDividerLocation(0);
783
+
784
+ radio.layout = fullscreenLayout;
785
+ radio.layout.doClick();
786
+ //frame.setVisible(true);
617787 }
618
- cameraView.ToggleFullScreen();
619788 }
620789
621
- private JTextArea createTextPane()
790
+ private JTextPane createTextPane()
622791 {
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
- };
792
+// TEXTAREA String[] initString =
793
+// {
794
+// "This is an editable JTextPane, ", //regular
795
+// "another ", //italic
796
+// "styled ", //bold
797
+// "text ", //small
798
+// "component, ", //large
799
+// "which supports embedded components..." + newline,//regular
800
+// " " + newline, //button
801
+// "...and embedded icons..." + newline, //regular
802
+// " ", //icon
803
+// newline + "JTextPane is a subclass of JEditorPane that "
804
+// + "uses a StyledEditorKit and StyledDocument, and provides "
805
+// + "cover methods for interacting with those objects."
806
+// };
807
+//
808
+// String[] initStyles =
809
+// {
810
+// "regular", "italic", "bold", "small", "large",
811
+// "regular", "button", "regular", "icon",
812
+// "regular"
813
+// };
814
+//
815
+// JTextPane textPane = new JTextPane();
816
+// textPane.setEditable(true);
817
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
818
+// addStylesToDocument(doc);
819
+//
820
+// try
821
+// {
822
+// for (int j = 0; j < 2; j++)
823
+// {
824
+// for (int i = 0; i < initString.length; i++)
825
+// {
826
+// doc.insertString(doc.getLength(), initString[i],
827
+// doc.getStyle(initStyles[i]));
828
+// }
829
+// }
830
+// } catch (BadLocationException ble)
831
+// {
832
+// System.err.println("Couldn't insert initial text into text pane.");
833
+// }
638834
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;
835
+ return new JTextPane(); // textPane;
667836 }
668837
669838 protected void addStylesToDocument(StyledDocument doc)
....@@ -716,7 +885,7 @@
716885 protected static ImageIcon createImageIcon(String path,
717886 String description)
718887 {
719
- java.net.URL imgURL = GrafreeD.class.getResource(path);
888
+ java.net.URL imgURL = Grafreed.class.getResource(path);
720889 if (imgURL != null)
721890 {
722891 return new ImageIcon(imgURL, description);
....@@ -748,6 +917,7 @@
748917 // NumberSlider vDivsField;
749918 // JCheckBox endcaps;
750919 JCheckBox liveCB;
920
+ JCheckBox selectCB;
751921 JCheckBox hideCB;
752922 JCheckBox link2masterCB;
753923 JCheckBox markCB;
....@@ -755,7 +925,12 @@
755925 JCheckBox speedupCB;
756926 JCheckBox rewindCB;
757927 JCheckBox flipVCB;
928
+
929
+ cCheckBox toggleTextureCB;
930
+ cCheckBox toggleSwitchCB;
931
+
758932 JComboBox texresMenu;
933
+
759934 JButton resetButton;
760935 JButton stepButton;
761936 JButton stepAllButton;
....@@ -763,115 +938,87 @@
763938 JButton slowerButton;
764939 JButton fasterButton;
765940 JButton remarkButton;
941
+
942
+ cGridBag editPanel;
943
+ cGridBag editCommandsPanel;
944
+
945
+ cGridBag namePanel;
946
+ cGridBag setupPanel;
947
+ cGridBag setupPanel2;
948
+ cGridBag objectCommandsPanel;
949
+ cGridBag pushPanel;
950
+ cGridBag fillPanel;
766951
767
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
952
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
768953 {
769954 JCheckBox cb;
770955
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);
956
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
776957 cb.addItemListener(this);
777
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
778
- oe.aConstraints.gridwidth = 1;
779
- oe.aConstraints.gridx += 1;
780958
781959 return cb;
782960 }
783961
784
- cButton AddButton(ObjEditor oe, String label)
962
+ cButton AddButton(cGridBag panel, String label)
785963 {
786964 cButton cb;
787965
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);
966
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
793967 cb.addActionListener(this);
794
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
795
- oe.aConstraints.gridwidth = 1;
796
- oe.aConstraints.gridx += 1;
797968
798969 return cb;
799970 }
800971
801
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
972
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
802973 {
803974 JComboBox combo;
804975
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;
976
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808977 combo.addActionListener(this);
809978
810979 return combo;
811980 }
812981
813
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
982
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
814983 {
815
- NumberSlider combo;
984
+ cGridBag control = new cGridBag();
985
+
986
+ cNumberSlider combo;
816987
817988 JLabel jlabel = new JLabel(label);
818
-
819
- aConstraints.fill = GridBagConstraints.VERTICAL;
820989 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
-
990
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
991
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830992 combo.setFloat(current);
831
-
832
- combo.label = jlabel;
833
-
834
- combo.addChangeListener(this);
835
-
836
- return combo;
993
+
994
+ panel.add(control);
995
+
996
+ return control;
837997 }
838998
839
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
999
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
8401000 {
841
- NumberSlider combo;
1001
+ cGridBag control = new cGridBag();
1002
+
1003
+ cNumberSlider combo;
8421004
8431005 JLabel jlabel = new JLabel(label);
844
-
845
- aConstraints.fill = GridBagConstraints.VERTICAL;
8461006 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
-
1007
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1008
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8561009 combo.setInteger(current);
8571010
858
- combo.label = jlabel;
859
-
860
- combo.addChangeListener(this);
861
-
862
- return combo;
1011
+ panel.add(control);
1012
+
1013
+ return control;
8631014 }
8641015
865
- JTextArea AddText(JPanel ctrlPanel, String name)
1016
+ JTextArea AddText(cGridBag ctrlPanel, String name)
8661017 {
8671018 JTextArea text;
8681019
869
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
870
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
871
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1020
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8721021 text.addCaretListener(this);
873
- aConstraints.gridx += 1;
874
- aConstraints.gridwidth = 1;
8751022
8761023 return text;
8771024 }
....@@ -901,9 +1048,16 @@
9011048 objEditor.ctrlPanel.remove(j);
9021049 }
9031050
1051
+ void Remove(cNumberSlider j)
1052
+ {
1053
+ j.removeChangeListener(this);
1054
+ //objEditor.ctrlPanel.remove(j.label);
1055
+ objEditor.ctrlPanel.remove(j);
1056
+ }
1057
+
9041058 /*
9051059 */
906
- void Return() // ObjEditor oe)
1060
+ void Return0() // ObjEditor oe)
9071061 {
9081062 aConstraints.gridy += 1;
9091063 aConstraints.gridx = 0;
....@@ -958,37 +1112,76 @@
9581112
9591113 void SetupUI2(ObjEditor oe)
9601114 {
961
-// oe.aConstraints.weightx = 0;
962
-// oe.aConstraints.weighty = 0;
963
-// oe.aConstraints.gridx = 0;
964
-// oe.aConstraints.gridy = 0;
965
- SetupName(oe);
1115
+ //SetupName(oe);
9661116
967
- if (!GroupEditor.allparams)
1117
+ namePanel = new cGridBag();
1118
+
1119
+ nameField = AddText(namePanel, copy.GetName());
1120
+ namePanel.add(nameField);
1121
+ oe.ctrlPanel.add(namePanel);
1122
+
1123
+ oe.ctrlPanel.Return();
1124
+
1125
+ if (!allparams)
9681126 return;
9691127
970
- liveCB = AddCheckBox(oe, "Live", copy.live);
971
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
972
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1128
+ setupPanel = new cGridBag().setVertical(false);
1129
+
1130
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1131
+ liveCB.setToolTipText("Animate object");
1132
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1133
+ selectCB.setToolTipText("Make object selectable");
9731134 // 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");
1135
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1136
+ hideCB.setToolTipText("Hide object");
1137
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1138
+ markCB.setToolTipText("As animation target transform");
1139
+
1140
+ setupPanel2 = new cGridBag().setVertical(false);
1141
+
1142
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1143
+ rewindCB.setToolTipText("Rewind animation");
1144
+
1145
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1146
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
1147
+
1148
+ if (Globals.ADVANCED)
1149
+ {
1150
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1151
+ link2masterCB.setToolTipText("Attach to support");
1152
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1153
+ speedupCB.setToolTipText("Option motion capture");
1154
+ }
1155
+
1156
+ oe.ctrlPanel.add(setupPanel);
1157
+ oe.ctrlPanel.Return();
1158
+ oe.ctrlPanel.add(setupPanel2);
1159
+ oe.ctrlPanel.Return();
1160
+
1161
+ objectCommandsPanel = new cGridBag().setVertical(false);
1162
+
1163
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1164
+ resetButton.setToolTipText("Jump to frame zero");
1165
+ stepButton = AddButton(objectCommandsPanel, "Step");
1166
+ stepButton.setToolTipText("Step one frame");
9801167 // resetAllButton = AddButton(oe, "Reset All");
9811168 // stepAllButton = AddButton(oe, "Step All");
982
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9831169 // Return();
984
- slowerButton = AddButton(oe, "Slow");
985
- fasterButton = AddButton(oe, "Fast");
986
- remarkButton = AddButton(oe, "Rem");
1170
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1171
+ slowerButton.setToolTipText("Decrease animation speed");
1172
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1173
+ fasterButton.setToolTipText("Increase animation speed");
1174
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1175
+ remarkButton.setToolTipText("Set the current transform as the target");
9871176
988
- Return();
1177
+ oe.ctrlPanel.add(objectCommandsPanel);
1178
+ oe.ctrlPanel.Return();
9891179
990
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
991
- Return();
1180
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1181
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1182
+ //Return();
1183
+
1184
+ oe.ctrlPanel.Return();
9921185
9931186 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9941187 // ObjEditor.aConstraints.gridx += 1;
....@@ -1083,7 +1276,7 @@
10831276 oe.aConstraints.gridwidth = 1;
10841277 /**/
10851278 nameField = AddText(oe.ctrlPanel, copy.GetName());
1086
- Return();
1279
+ oe.ctrlPanel.Return();
10871280
10881281 //ctrlPanel.add(textureButton = new Button("Texture..."));
10891282 //textureButton.setEnabled(false);
....@@ -1185,11 +1378,25 @@
11851378 //JPanel worldPanel =
11861379 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11871380 //worldPanel.setName("World");
1188
- centralPanel = new JPanel(new BorderLayout());
1189
- timelinePanel = new JPanel(new BorderLayout());
1190
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1381
+ centralPanel = new cGridBag();
1382
+ centralPanel.preferredWidth = 20;
1383
+
1384
+ if (Globals.ADVANCED)
1385
+ {
1386
+ timelinePanel = new JPanel(new BorderLayout());
1387
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11911388
1389
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1390
+ cameraPanel.setContinuousLayout(true);
1391
+ cameraPanel.setOneTouchExpandable(true);
1392
+// cameraPanel.setDividerLocation(0.9);
1393
+// cameraPanel.setDividerSize(9);
1394
+ cameraPanel.setResizeWeight(1.0);
1395
+
1396
+ }
1397
+
11921398 centralPanel.add(cameraView);
1399
+ centralPanel.setFocusable(true);
11931400 //frame.setJMenuBar(timelineMenubar);
11941401 //centralPanel.add(timelinePanel);
11951402
....@@ -1208,12 +1415,13 @@
12081415 //frontView.object = copy;
12091416 //sideView.object = copy;
12101417
1211
- XYZPanel = new JPanel();
1212
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1418
+ XYZPanel = new cGridBag().setVertical(true);
1419
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12131420
1214
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1215
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1216
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1421
+ XYZPanel.preferredWidth = 5;
1422
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1423
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1424
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12171425
12181426 /*
12191427 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1251,11 +1459,13 @@
12511459 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12521460 //tmp.setName("Edit");
12531461 objectPanel.add(materialPanel);
1254
- JPanel north = new JPanel(new BorderLayout());
1255
- north.setName("Edit");
1256
- north.add(ctrlPanel, BorderLayout.NORTH);
1257
- objectPanel.add(north);
1462
+// JPanel north = new JPanel(new BorderLayout());
1463
+// north.setName("Edit");
1464
+// north.add(ctrlPanel, BorderLayout.NORTH);
1465
+// objectPanel.add(north);
1466
+ objectPanel.add(editPanel);
12581467 objectPanel.add(infoPanel);
1468
+ objectPanel.add(toolboxPanel);
12591469
12601470 /*
12611471 aConstraints.gridx = 0;
....@@ -1264,7 +1474,7 @@
12641474 aConstraints.gridy += 1;
12651475 aConstraints.gridwidth = 1;
12661476 mainPanel.add(objectPanel, aConstraints);
1267
- */
1477
+ */
12681478
12691479 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12701480 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1275,16 +1485,23 @@
12751485 scrollpane.setWheelScrollingEnabled(true);
12761486 scrollpane.addMouseWheelListener(this); // Default not fast enough
12771487
1278
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1279
- scenePanel.add(scrollpane);
1488
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1489
+ scenePanel.preferredWidth = 6;
1490
+
1491
+ JTabbedPane tabbedPane = new JTabbedPane();
1492
+ tabbedPane.add(scrollpane);
12801493
1281
- scenePanel.add(FSPane = new cFileSystemPane(this));
1282
-
1283
- optionsPanel = new JPanel(new GridBagLayout());
1494
+ optionsPanel = new cGridBag().setVertical(false);
12841495
12851496 optionsPanel.setName("Options");
1286
- scenePanel.add(optionsPanel);
1497
+
1498
+ AddOptions(optionsPanel); //, aConstraints);
1499
+
1500
+ tabbedPane.add(optionsPanel);
1501
+
1502
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12871503
1504
+ scenePanel.add(tabbedPane);
12881505
12891506 /*
12901507 cTree jTree = new cTree(null);
....@@ -1318,6 +1535,7 @@
13181535 //bigPanel.setSize(new Dimension(10,10));
13191536 //bigPanel.add(ctrlPanel);
13201537 //bigPanel.add(gridPanel);
1538
+ /**
13211539 bigThree = new JPanel();
13221540 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13231541 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1341,7 +1559,13 @@
13411559 // aConstraints.gridheight = 3;
13421560 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13431561 bigThree.add(XYZPanel, aWindowConstraints);
1562
+ /**/
13441563
1564
+ bigThree = new cGridBag();
1565
+ bigThree.addComponent(scenePanel);
1566
+ bigThree.addComponent(centralPanel);
1567
+ bigThree.addComponent(XYZPanel);
1568
+
13451569 // // SIDE EFFECT!!!
13461570 // aConstraints.gridx = 0;
13471571 // aConstraints.gridy = 0;
....@@ -1362,14 +1586,19 @@
13621586 //worldPane.add(bigPanel);
13631587 //worldPane.add(worldPanel);
13641588 /**/
1365
- frame.getContentPane().add(/*"Center",*/framePanel);
1589
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1590
+ frame.add(/*"Center",*/framePanel);
13661591 //frame.getContentPane().add(/*"Center",*/ worldPane);
13671592
13681593 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13691594
1370
- frame.setSize(1024, 768);
1371
- frame.show();
1595
+ frame.setSize(1280, 860);
1596
+
1597
+ frame.validate();
1598
+ frame.setVisible(true);
13721599
1600
+ cameraView.requestFocusInWindow();
1601
+
13731602 gridPanel.setDividerLocation(1.0);
13741603
13751604 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1383,6 +1612,10 @@
13831612 });
13841613 }
13851614
1615
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1616
+ {
1617
+ }
1618
+
13861619 JTree GetTree()
13871620 {
13881621 return objEditor.jTree;
....@@ -1394,260 +1627,173 @@
13941627 ctrlPanel.removeAll();
13951628 }
13961629
1397
- void SetupMaterial(JPanel ctrlPanel)
1630
+ void SetupMaterial(cGridBag panel)
13981631 {
1399
- aConstraints.weighty = 0;
1400
- //aConstraints.weightx = 1;
1401
- /*
1632
+ /*
14021633 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14031634 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1404
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1405
- aConstraints.gridx += 1;
14061635 */
14071636
1408
- aConstraints.gridwidth = 1;
1409
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1410
- aConstraints.gridx += 1;
1411
- aConstraints.weighty = 0;
1412
- aConstraints.gridwidth = 1;
1637
+ cGridBag editBar = new cGridBag().setVertical(false);
1638
+
1639
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1640
+ createMaterialButton.setToolTipText("Create material");
14131641
14141642 /*
14151643 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1416
- aConstraints.gridx += 1;
1417
- aConstraints.weighty = 0;
1418
- aConstraints.gridwidth = 1;
14191644 */
14201645
1421
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1422
- aConstraints.gridx += 1;
1646
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1647
+ clearMaterialButton.setToolTipText("Clear material");
1648
+
1649
+ if (Globals.ADVANCED)
1650
+ {
1651
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1652
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1653
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1654
+ }
14231655
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;
1656
+ editBar.preferredHeight = 15;
1657
+
1658
+ panel.add(editBar);
1659
+
14381660 /**/
14391661 //aConstraints.weighty = 0;
14401662 ////aConstraints.weightx = 1;
14411663 //aConstraints.weighty = 1;
14421664 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14431665 //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;
1666
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14491667
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;
1668
+ cGridBag colorSection = new cGridBag().setVertical(true);
1669
+
1670
+ cGridBag color = new cGridBag();
1671
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1672
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1673
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1674
+ //colorField.preferredWidth = 200;
1675
+ colorSection.add(color);
14601676
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;
1677
+ cGridBag modulation = new cGridBag();
1678
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1679
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1680
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1681
+ colorSection.add(modulation);
14701682
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;
1683
+ cGridBag texture = new cGridBag();
1684
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1685
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1686
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1687
+ colorSection.add(texture);
14801688
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;
1689
+ cGridBag anisoU = new cGridBag();
1690
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1691
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1693
+ colorSection.add(anisoU);
14901694
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;
1695
+ cGridBag anisoV = new cGridBag();
1696
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1697
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1699
+ colorSection.add(anisoV);
15001700
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;
1701
+ cGridBag shadowbias = new cGridBag();
1702
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1703
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1704
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1705
+ colorSection.add(shadowbias);
15101706
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;
1707
+ panel.add(new JSeparator());
1708
+
1709
+ panel.add(colorSection);
1710
+
1711
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1712
+
1713
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1714
+
1715
+ cGridBag diffuse = new cGridBag();
1716
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1717
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1718
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1719
+ diffuseSection.add(diffuse);
15191720
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;
1721
+ cGridBag diffuseness = new cGridBag();
1722
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1723
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1724
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1725
+ diffuseSection.add(diffuseness);
15291726
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;
1727
+ cGridBag selfshadow = new cGridBag();
1728
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1729
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1730
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1731
+ diffuseSection.add(selfshadow);
15391732
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;
1733
+ cGridBag sheen = new cGridBag();
1734
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1735
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1736
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1737
+ diffuseSection.add(sheen);
15491738
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;
1739
+ cGridBag subsurface = new cGridBag();
1740
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1741
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1742
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1743
+ diffuseSection.add(subsurface);
15591744
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;
1745
+ cGridBag shadow = new cGridBag();
1746
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1747
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1748
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1749
+ diffuseSection.add(shadow);
15691750
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;
1751
+ cGridBag fakedepth = new cGridBag();
1752
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1753
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1754
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1755
+ diffuseSection.add(fakedepth);
15791756
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;
1757
+ panel.add(new JSeparator());
1758
+
1759
+ panel.add(diffuseSection);
1760
+
1761
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1762
+
1763
+ cGridBag specularSection = new cGridBag().setVertical(true);
15891764
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;
1765
+ cGridBag specular = new cGridBag();
1766
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1767
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1768
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1769
+ specularSection.add(specular);
15981770
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;
1771
+ cGridBag lightarea = new cGridBag();
1772
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1773
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1774
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1775
+ specularSection.add(lightarea);
16081776
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;
1777
+ cGridBag shininess = new cGridBag();
1778
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1779
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1780
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1781
+ specularSection.add(shininess);
16181782
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;
1783
+ cGridBag metalness = new cGridBag();
1784
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1785
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1786
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1787
+ specularSection.add(metalness);
16281788
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;
1789
+ cGridBag velvet = new cGridBag();
1790
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1791
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1792
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1793
+ specularSection.add(velvet);
16381794
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();
1795
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1796
+ //Return();
16511797 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16521798 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16531799 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1658,130 +1804,93 @@
16581804 // aConstraints.gridy += 1;
16591805 // aConstraints.gridwidth = 1;
16601806
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;
16691807
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;
1808
+ panel.add(new JSeparator());
1809
+
1810
+ panel.add(specularSection);
1811
+
1812
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1813
+
1814
+ cGridBag globalSection = new cGridBag().setVertical(true);
16791815
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;
1816
+ cGridBag camera = new cGridBag();
1817
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1818
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1819
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1820
+ globalSection.add(camera);
16891821
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;
1822
+ cGridBag ambient = new cGridBag();
1823
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1824
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1825
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1826
+ globalSection.add(ambient);
16991827
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;
1828
+ cGridBag backlit = new cGridBag();
1829
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1830
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1831
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1832
+ globalSection.add(backlit);
17101833
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;
1834
+ cGridBag opacity = new cGridBag();
1835
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1836
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1837
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1838
+ globalSection.add(opacity);
17201839
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;
1840
+ panel.add(new JSeparator());
1841
+
1842
+ panel.add(globalSection);
1843
+
1844
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1845
+
1846
+ cGridBag textureSection = new cGridBag().setVertical(true);
17301847
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;
1848
+ cGridBag bump = new cGridBag();
1849
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1850
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1851
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1852
+ textureSection.add(bump);
17401853
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;
1854
+ cGridBag noise = new cGridBag();
1855
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1856
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1857
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1858
+ textureSection.add(noise);
17501859
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;
1860
+ cGridBag power = new cGridBag();
1861
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1862
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1863
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1864
+ textureSection.add(power);
17601865
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;
1866
+ cGridBag borderfade = new cGridBag();
1867
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1868
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1869
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1870
+ textureSection.add(borderfade);
17701871
1771
- //aConstraints.weighty = 1;
1772
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1773
- //aConstraints.gridx += 1;
1774
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1775
- aConstraints.weighty = 0;
1872
+ cGridBag fog = new cGridBag();
1873
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1874
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1875
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1876
+ textureSection.add(fog);
17761877
1777
- aConstraints.gridx = 0;
1778
- aConstraints.gridy = 0;
1779
- aConstraints.gridwidth = 1;
1878
+ cGridBag opacityPower = new cGridBag();
1879
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1880
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1881
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1882
+ textureSection.add(opacityPower);
1883
+
1884
+ panel.add(new JSeparator());
1885
+
1886
+ panel.add(textureSection);
1887
+
1888
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17801889
17811890 SetMaterial(copy); // .GetMaterial());
17821891
1783
- colorField.addChangeListener(this);
1784
- modulationField.addChangeListener(this);
1892
+ //colorField.addChangeListener(this);
1893
+// modulationField.addChangeListener(this);
17851894 metalnessField.addChangeListener(this);
17861895 diffuseField.addChangeListener(this);
17871896 specularField.addChangeListener(this);
....@@ -1811,12 +1920,15 @@
18111920 opacityPowerField.addChangeListener(this);
18121921 /**/
18131922
1814
- resetSlidersButton.addActionListener(this);
18151923 clearMaterialButton.addActionListener(this);
18161924 createMaterialButton.addActionListener(this);
1817
-
1818
- propagateToggle.addItemListener(this);
1819
- multiplyToggle.addItemListener(this);
1925
+
1926
+ if (Globals.ADVANCED)
1927
+ {
1928
+ resetSlidersButton.addActionListener(this);
1929
+ propagateToggle.addItemListener(this);
1930
+ multiplyToggle.addItemListener(this);
1931
+ }
18201932 }
18211933
18221934 void DropFile(java.io.File[] files, boolean textures)
....@@ -1987,7 +2099,7 @@
19872099
19882100 //? flashIt = false;
19892101 CameraPane pane = (CameraPane) cameraView;
1990
- pane.clickStart(location.x, location.y, 0);
2102
+ pane.clickStart(location.x, location.y, 0, 0);
19912103 pane.clickEnd(location.x, location.y, 0, true);
19922104
19932105 if (group.selection.size() == 1)
....@@ -2036,6 +2148,7 @@
20362148 e2.printStackTrace();
20372149 }
20382150 }
2151
+
20392152 LoadJMEThread loadThread;
20402153
20412154 class LoadJMEThread extends Thread
....@@ -2093,6 +2206,7 @@
20932206 //LoadFile0(filename, converter);
20942207 }
20952208 }
2209
+
20962210 LoadOBJThread loadObjThread;
20972211
20982212 class LoadOBJThread extends Thread
....@@ -2171,19 +2285,19 @@
21712285
21722286 void LoadObjFile(String fullname)
21732287 {
2174
- /*
2288
+ System.out.println("Loading " + fullname);
2289
+ /**/
21752290 //lastFilename = fullname;
21762291 if(loadObjThread == null)
21772292 {
2178
- loadObjThread = new LoadOBJThread();
2179
- loadObjThread.start();
2293
+ loadObjThread = new LoadOBJThread();
2294
+ loadObjThread.start();
21802295 }
21812296
21822297 loadObjThread.add(fullname);
2183
- */
2298
+ /**/
21842299
2185
- System.out.println("Loading " + fullname);
2186
- makeSomething(new FileObject(fullname, true), true);
2300
+ //makeSomething(new FileObject(fullname, true), true);
21872301 }
21882302
21892303 void LoadGFDFile(String fullname)
....@@ -2444,11 +2558,11 @@
24442558
24452559 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24462560 {
2447
- if (GrafreeD.standAlone)
2561
+ if (Grafreed.standAlone)
24482562 {
24492563 /**/
24502564 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2451
- browser.show();
2565
+ browser.setVisible(true);
24522566 String filename = browser.getFile();
24532567 if (filename != null && filename.length() > 0)
24542568 {
....@@ -2593,6 +2707,7 @@
25932707 }
25942708 if (input == null)
25952709 {
2710
+ new Exception().printStackTrace();
25962711 System.exit(0);
25972712 }
25982713
....@@ -2799,6 +2914,8 @@
27992914
28002915 void SetMaterial(Object3D object)
28012916 {
2917
+ latestObject = object;
2918
+
28022919 cMaterial mat = object.material;
28032920
28042921 if (mat == null)
....@@ -2807,7 +2924,8 @@
28072924 return;
28082925 }
28092926
2810
- multiplyToggle.setSelected(mat.multiply);
2927
+ if (multiplyToggle != null)
2928
+ multiplyToggle.setSelected(mat.multiply);
28112929
28122930 assert (object.projectedVertices != null);
28132931
....@@ -2909,12 +3027,17 @@
29093027 // }
29103028
29113029 /**/
2912
- if (deselect)
3030
+ if (deselect || child == null)
29133031 {
29143032 //group.deselectAll();
29153033 //freeze = true;
29163034 GetTree().clearSelection();
29173035 //freeze = false;
3036
+
3037
+ if (child == null)
3038
+ {
3039
+ return;
3040
+ }
29183041 }
29193042
29203043 //group.addSelectee(child);
....@@ -2983,7 +3106,7 @@
29833106 cameraView.ToggleDL();
29843107 cameraView.repaint();
29853108 return;
2986
- } else if (event.getSource() == toggleTextureItem)
3109
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29873110 {
29883111 cameraView.ToggleTexture();
29893112 // june 2013 copy.HardTouch();
....@@ -2996,7 +3119,8 @@
29963119 if (timeline)
29973120 {
29983121 centralPanel.remove(cameraView);
2999
- centralPanel.add(timelinePanel);
3122
+ cameraPanel.add(cameraView);
3123
+ centralPanel.add(cameraPanel);
30003124 frame.setJMenuBar(timelineMenubar);
30013125 wasFullScreen = CameraPane.FULLSCREEN;
30023126 if (!CameraPane.FULLSCREEN)
....@@ -3005,7 +3129,7 @@
30053129 }
30063130 else
30073131 {
3008
- centralPanel.remove(timelinePanel);
3132
+ centralPanel.remove(cameraPanel);
30093133 centralPanel.add(cameraView);
30103134 frame.setJMenuBar(null);
30113135 if (!wasFullScreen)
....@@ -3021,9 +3145,9 @@
30213145 frame.validate();
30223146
30233147 return;
3024
- } else if (event.getSource() == toggleRandomItem)
3148
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
30253149 {
3026
- cameraView.ToggleRandom();
3150
+ cameraView.ToggleSwitch();
30273151 cameraView.repaint();
30283152 return;
30293153 } else if (event.getSource() == toggleHandleItem)
....@@ -3052,6 +3176,10 @@
30523176 {
30533177 copy.live ^= true;
30543178 return;
3179
+ } else if (event.getSource() == selectCB)
3180
+ {
3181
+ copy.dontselect ^= true;
3182
+ return;
30553183 } else if (event.getSource() == hideCB)
30563184 {
30573185 copy.hide ^= true;
....@@ -3066,6 +3194,7 @@
30663194 if (event.getSource() == randomCB)
30673195 {
30683196 copy.random ^= true;
3197
+ objEditor.refreshContents();
30693198 return;
30703199 }
30713200 if (event.getSource() == speedupCB)
....@@ -3089,8 +3218,9 @@
30893218
30903219 public void actionPerformed(ActionEvent event)
30913220 {
3221
+ Object source = event.getSource();
30923222 // SCRIPT DIALOG
3093
- if (event.getSource() == okbutton)
3223
+ if (source == okbutton)
30943224 {
30953225 textpanel.setVisible(false);
30963226 textpanel.remove(textarea);
....@@ -3102,7 +3232,7 @@
31023232 textarea = null;
31033233 textpanel = null;
31043234 }
3105
- if (event.getSource() == cancelbutton)
3235
+ if (source == cancelbutton)
31063236 {
31073237 textpanel.setVisible(false);
31083238 textpanel.remove(textarea);
....@@ -3114,49 +3244,50 @@
31143244 //applySelf();
31153245 //client.refreshEditWindow();
31163246 //refreshContents();
3117
- if (event.getSource() == nameField)
3247
+ if (source == nameField)
31183248 {
31193249 //System.out.println("ObjEditor " + event);
31203250 applySelf0(true);
31213251 //parent.applySelf();
31223252 objEditor.refreshContents();
3123
- } else if (event.getSource() == resetButton)
3253
+ } else if (source == resetButton)
31243254 {
31253255 CameraPane.fullreset = true;
31263256 copy.Reset(); // ResetMeshes();
31273257 copy.Touch();
31283258 objEditor.refreshContents();
3129
- } else if (event.getSource() == stepItem)
3259
+ } else if (source == stepItem)
31303260 {
3131
- cameraView.ONESTEP = true;
3261
+ //cameraView.ONESTEP = true;
3262
+ Globals.ONESTEP = true;
31323263 cameraView.repaint();
31333264 return;
3134
- } else if (event.getSource() == stepButton)
3265
+ } else if (source == stepButton)
31353266 {
31363267 copy.Step();
31373268 copy.Touch();
31383269 objEditor.refreshContents();
3139
- } else if (event.getSource() == slowerButton)
3270
+ } else if (source == slowerButton)
31403271 {
31413272 copy.Slower();
31423273 copy.Touch();
31433274 objEditor.refreshContents();
3144
- } else if (event.getSource() == fasterButton)
3275
+ } else if (source == fasterButton)
31453276 {
31463277 copy.Faster();
31473278 copy.Touch();
31483279 objEditor.refreshContents();
3149
- } else if (event.getSource() == remarkButton)
3280
+ } else if (source == remarkButton)
31503281 {
31513282 copy.Remark();
31523283 copy.Touch();
31533284 objEditor.refreshContents();
3154
- } else if (event.getSource() == stepAllButton)
3285
+ } else if (source == stepAllButton)
31553286 {
31563287 copy.StepAll();
31573288 copy.Touch();
31583289 objEditor.refreshContents();
3159
- } else if (event.getSource() == resetAllButton)
3290
+ } else if (source == resetAllButton)
31603291 {
31613292 //CameraPane.fullreset = true;
31623293 copy.ResetAll(); // ResetMeshes();
....@@ -3189,53 +3320,75 @@
31893320 // Close();
31903321 // }
31913322 // else
3192
- if (event.getSource() == resetSlidersButton)
3323
+ if (source == resetSlidersButton)
31933324 {
31943325 ResetSliders();
3195
- } else if (event.getSource() == clearMaterialButton)
3326
+ } else if (source == clearMaterialButton)
31963327 {
31973328 ClearMaterial();
3198
- } else if (event.getSource() == createMaterialButton)
3329
+ } else if (source == createMaterialButton)
31993330 {
32003331 CreateMaterial();
3201
- } else if (event.getSource() == clearPanelButton)
3332
+ } else if (source == clearPanelButton)
32023333 {
32033334 copy.ClearUI();
32043335 refreshContents(true);
3205
- } /*
3206
- }
3207
-
3208
- public boolean action(Event event, Object arg)
3209
- {
3210
- */ else if (event.getSource() == closeItem)
3336
+ } else if (source == importGFDItem)
3337
+ {
3338
+ ImportGFD();
3339
+ } else
3340
+ if (source == importVRMLX3DItem)
3341
+ {
3342
+ ImportVRMLX3D();
3343
+ } else
3344
+ if (source == import3DSItem)
3345
+ {
3346
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3347
+ } else
3348
+ if (source == importOBJItem)
3349
+ {
3350
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3351
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3352
+ browser.setVisible(true);
3353
+ String filename = browser.getFile();
3354
+ if (filename != null && filename.length() > 0)
3355
+ {
3356
+ String fullname = browser.getDirectory() + filename;
3357
+ makeSomething(ReadOBJ(fullname), true);
3358
+ }
3359
+ } else
3360
+ if (source == closeItem)
32113361 {
32123362 Close();
32133363 //return true;
3214
- } else if (event.getSource() == loadItem)
3364
+ } else if (source == loadItem)
32153365 {
32163366 load();
32173367 //return true;
3218
- } else if (event.getSource() == saveItem)
3368
+ } else if (source == newItem)
3369
+ {
3370
+ New();
3371
+ } else if (source == saveItem)
32193372 {
32203373 save();
32213374 //return true;
3222
- } else if (event.getSource() == saveAsItem)
3375
+ } else if (source == saveAsItem)
32233376 {
32243377 saveAs();
32253378 //return true;
3226
- } else if (event.getSource() == reexportItem)
3379
+ } else if (source == reexportItem)
32273380 {
32283381 reexport();
32293382 //return true;
3230
- } else if (event.getSource() == exportAsItem)
3383
+ } else if (source == exportAsItem)
32313384 {
32323385 export();
32333386 //return true;
3234
- } else if (event.getSource() == povItem)
3387
+ } else if (source == povItem)
32353388 {
32363389 generatePOV();
32373390 //return true;
3238
- } else if (event.getSource() == zBufferItem)
3391
+ } else if (source == zBufferItem)
32393392 {
32403393 try
32413394 {
....@@ -3257,21 +3410,8 @@
32573410 cameraView.repaint();
32583411 //return true;
32593412 }
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)
3413
+ */ else // combos...
3414
+ if (source == texresMenu)
32753415 {
32763416 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32773417 copy.texres = texresMenu.getSelectedIndex();
....@@ -3283,27 +3423,302 @@
32833423 }
32843424 }
32853425
3286
- void ToggleAnimation()
3426
+ void New()
32873427 {
3288
- if (!CameraPane.ANIMATION)
3428
+ while (copy.Size() > 1)
32893429 {
3290
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3430
+ copy.remove(1);
3431
+ }
3432
+
3433
+ ResetModel();
3434
+ objEditor.refreshContents();
3435
+ }
3436
+
3437
+ static public byte[] Compress(Object3D o)
3438
+ {
3439
+ try
3440
+ {
3441
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3442
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3443
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3444
+
3445
+ Object3D parent = o.parent;
3446
+ o.parent = null;
3447
+
3448
+ out.writeObject(o);
3449
+
3450
+ o.parent = parent;
3451
+
3452
+ out.flush();
3453
+
3454
+ zstream.close();
3455
+ out.close();
3456
+
3457
+ return baos.toByteArray();
3458
+ } catch (Exception e)
3459
+ {
3460
+ System.err.println(e);
3461
+ return null;
3462
+ }
3463
+ }
3464
+
3465
+ static public Object Uncompress(byte[] bytes)
3466
+ {
3467
+ System.out.println("#bytes = " + bytes.length);
3468
+ try
3469
+ {
3470
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3471
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3472
+ ObjectInputStream in = new ObjectInputStream(istream);
3473
+ Object obj = in.readObject();
3474
+ in.close();
3475
+
3476
+ return obj;
3477
+ } catch (Exception e)
3478
+ {
3479
+ System.err.println(e);
3480
+ return null;
3481
+ }
3482
+ }
3483
+
3484
+ static public Object clone(Object o)
3485
+ {
3486
+ try
3487
+ {
3488
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3489
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3490
+
3491
+ out.writeObject(o);
3492
+
3493
+ out.flush();
3494
+ out.close();
3495
+
3496
+ byte[] bytes = baos.toByteArray();
3497
+
3498
+ System.out.println("clone = " + bytes.length);
3499
+
3500
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3501
+ ObjectInputStream in = new ObjectInputStream(bais);
3502
+ Object obj = in.readObject();
3503
+ in.close();
3504
+
3505
+ return obj;
3506
+ } catch (Exception e)
3507
+ {
3508
+ System.err.println(e);
3509
+ return null;
3510
+ }
3511
+ }
3512
+
3513
+ cRadio GetCurrentTab()
3514
+ {
3515
+ cRadio ab;
3516
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3517
+ {
3518
+ ab = (cRadio)e.nextElement();
3519
+ if(ab.GetObject() == copy)
3520
+ {
3521
+ return ab;
3522
+ }
3523
+ }
3524
+
3525
+ return null;
3526
+ }
3527
+
3528
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3529
+
3530
+ public void Save()
3531
+ {
3532
+ System.err.println("Save");
3533
+
3534
+ cRadio tab = GetCurrentTab();
3535
+
3536
+ boolean temp = CameraPane.SWITCH;
3537
+ CameraPane.SWITCH = false;
3538
+
3539
+ copy.ExtractBigData(hashtable);
3540
+
3541
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3542
+ tab.graphs[tab.undoindex++] = Compress(copy);
3543
+
3544
+ copy.RestoreBigData(hashtable);
3545
+
3546
+ CameraPane.SWITCH = temp;
3547
+
3548
+ //assert(hashtable.isEmpty());
3549
+
3550
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3551
+ {
3552
+ tab.graphs[i] = null;
3553
+ }
3554
+
3555
+ SetUndoStates();
3556
+
3557
+ // test save
3558
+ if (false)
3559
+ {
3560
+ try
3561
+ {
3562
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3563
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3564
+
3565
+ p.writeObject(copy);
3566
+
3567
+ p.flush();
3568
+
3569
+ ostream.close();
3570
+ } catch (Exception e)
3571
+ {
3572
+ e.printStackTrace();
3573
+ }
3574
+ }
3575
+ }
3576
+
3577
+ void CopyChanged(Object3D obj)
3578
+ {
3579
+ SetUndoStates();
3580
+
3581
+ boolean temp = CameraPane.SWITCH;
3582
+ CameraPane.SWITCH = false;
3583
+
3584
+ copy.ExtractBigData(hashtable);
3585
+
3586
+ copy.clear();
3587
+
3588
+ for (int i=0; i<obj.Size(); i++)
3589
+ {
3590
+ copy.add(obj.get(i));
3591
+ }
3592
+
3593
+ copy.RestoreBigData(hashtable);
3594
+
3595
+ CameraPane.SWITCH = temp;
3596
+
3597
+ //assert(hashtable.isEmpty());
3598
+
3599
+ copy.Touch();
3600
+
3601
+ ResetModel();
3602
+ copy.HardTouch(); // recompile?
3603
+
3604
+ cRadio ab;
3605
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3606
+ {
3607
+ ab = (cRadio)e.nextElement();
3608
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3609
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3610
+ if (test != null)
3611
+ {
3612
+ test.editWindow = ab.object.editWindow;
3613
+ ab.object = test;
3614
+ }
3615
+ }
3616
+
3617
+ refreshContents();
3618
+ }
3619
+
3620
+ cButton undoButton;
3621
+ cButton redoButton;
3622
+
3623
+ void SetUndoStates()
3624
+ {
3625
+ cRadio tab = GetCurrentTab();
3626
+
3627
+ undoButton.setEnabled(tab.undoindex > 0);
3628
+ redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null);
3629
+ }
3630
+
3631
+ public void Undo()
3632
+ {
3633
+ System.err.println("Undo");
3634
+
3635
+ cRadio tab = GetCurrentTab();
3636
+
3637
+ if (tab.undoindex == 0)
3638
+ {
3639
+ java.awt.Toolkit.getDefaultToolkit().beep();
3640
+ return;
3641
+ }
3642
+
3643
+ if (tab.graphs[tab.undoindex] == null)
3644
+ {
3645
+ Save();
3646
+ tab.undoindex -= 1;
3647
+ }
3648
+
3649
+ tab.undoindex -= 1;
3650
+
3651
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3652
+ }
3653
+
3654
+ public void Redo()
3655
+ {
3656
+ cRadio tab = GetCurrentTab();
3657
+
3658
+ if (tab.graphs[tab.undoindex + 1] == null)
3659
+ {
3660
+ java.awt.Toolkit.getDefaultToolkit().beep();
3661
+ return;
3662
+ }
3663
+
3664
+ tab.undoindex += 1;
3665
+
3666
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3667
+ }
3668
+
3669
+ void ImportGFD()
3670
+ {
3671
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32913672 browser.show();
32923673 String filename = browser.getFile();
32933674 if (filename != null && filename.length() > 0)
32943675 {
3295
- CameraPane.filename = browser.getDirectory() + filename;
3676
+ String fullname = browser.getDirectory() + filename;
3677
+
3678
+ //Object3D readobj =
3679
+ objEditor.ReadGFD(fullname, objEditor);
3680
+ //makeSomething(readobj);
3681
+ }
3682
+ }
3683
+
3684
+ void ImportVRMLX3D()
3685
+ {
3686
+ if (Grafreed.standAlone)
3687
+ {
3688
+ /**/
3689
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3690
+ browser.show();
3691
+ String filename = browser.getFile();
3692
+ if (filename != null && filename.length() > 0)
3693
+ {
3694
+ String fullname = browser.getDirectory() + filename;
3695
+ LoadVRMLX3D(fullname);
3696
+ }
3697
+ /**/
3698
+ }
3699
+ }
3700
+
3701
+ void ToggleAnimation()
3702
+ {
3703
+ if (!Globals.ANIMATION)
3704
+ {
3705
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3706
+ browser.setVisible(true);
3707
+ String filename = browser.getFile();
3708
+ if (filename != null && filename.length() > 0)
3709
+ {
3710
+ Globals.filename = browser.getDirectory() + filename;
32963711 //CameraPane.framecount = 0;
3297
- CameraPane.imagecount = 0;
3712
+ Globals.imagecount = 0;
32983713
3299
- CameraPane.ANIMATION ^= true;
3714
+ Globals.ANIMATION ^= true;
33003715
3301
- GrafreeD.wav.cursor = 0;
3302
- GrafreeD.wav.loop = 0;
3716
+ Grafreed.wav.cursor = 0;
3717
+ Grafreed.wav.loop = 0;
33033718 }
33043719 } else
33053720 {
3306
- CameraPane.ANIMATION ^= true;
3721
+ Globals.ANIMATION ^= true;
33073722 }
33083723 }
33093724
....@@ -3349,7 +3764,7 @@
33493764 void CreateMaterial()
33503765 {
33513766 //copy.ClearMaterial(); // PATCH
3352
- copy.CreateMaterialS(multiplyToggle.isSelected());
3767
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33533768 if (copy.selection.size() > 0)
33543769 //SetMaterial(copy);
33553770 {
....@@ -3400,7 +3815,7 @@
34003815 assert false;
34013816 }
34023817
3403
- void EditSelection()
3818
+ void EditSelection(boolean newWindow)
34043819 {
34053820 }
34063821
....@@ -3408,11 +3823,11 @@
34083823 {
34093824 copy.ResetBlockLoop(); // temporary problem
34103825
3411
- boolean random = CameraPane.RANDOM;
3412
- CameraPane.RANDOM = false; // parse everything
3826
+ boolean random = CameraPane.SWITCH;
3827
+ CameraPane.SWITCH = false; // parse everything
34133828 copy.ResetDisplayList();
34143829 copy.HardTouch();
3415
- CameraPane.RANDOM = random;
3830
+ CameraPane.SWITCH = random;
34163831 }
34173832
34183833 // public void applySelf()
....@@ -3482,10 +3897,40 @@
34823897 current.fakedepth = (float) fakedepthField.getFloat();
34833898 current.shadowbias = (float) shadowbiasField.getFloat();
34843899
3485
- if (!NumberSlider.frozen)
3900
+ if (!cNumberSlider.frozen)
34863901 {
34873902 //System.out.println("Propagate = " + propagate);
34883903 copy.UpdateMaterial(anchor, current, propagate);
3904
+
3905
+ if (copy.material != null)
3906
+ {
3907
+ cMaterial mat = copy.material;
3908
+
3909
+ colorField.SetToolTipValue((mat.color));
3910
+ modulationField.SetToolTipValue((mat.modulation));
3911
+ metalnessField.SetToolTipValue((mat.metalness));
3912
+ diffuseField.SetToolTipValue((mat.diffuse));
3913
+ specularField.SetToolTipValue((mat.specular));
3914
+ shininessField.SetToolTipValue((mat.shininess));
3915
+ shiftField.SetToolTipValue((mat.shift));
3916
+ ambientField.SetToolTipValue((mat.ambient));
3917
+ lightareaField.SetToolTipValue((mat.lightarea));
3918
+ diffusenessField.SetToolTipValue((mat.factor));
3919
+ velvetField.SetToolTipValue((mat.velvet));
3920
+ sheenField.SetToolTipValue((mat.sheen));
3921
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3922
+ backlitField.SetToolTipValue((mat.bump));
3923
+ anisoField.SetToolTipValue((mat.aniso));
3924
+ anisoVField.SetToolTipValue((mat.anisoV));
3925
+ cameraField.SetToolTipValue((mat.cameralight));
3926
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3927
+ shadowField.SetToolTipValue((mat.shadow));
3928
+ textureField.SetToolTipValue((mat.texture));
3929
+ opacityField.SetToolTipValue((mat.opacity));
3930
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3931
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3932
+ }
3933
+
34893934 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34903935 {
34913936 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3530,6 +3975,7 @@
35303975 || e.getSource() == apertureField
35313976 || e.getSource() == shadowblurField)
35323977 {
3978
+ new Exception().printStackTrace();
35333979 System.exit(0);
35343980 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35353981 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3600,7 +4046,7 @@
36004046 }
36014047
36024048 if (normalpushField != null)
3603
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
4049
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36044050 }
36054051
36064052 void SnapObject()
....@@ -3855,7 +4301,7 @@
38554301
38564302 radioPanel.revalidate();
38574303 radioPanel.repaint();
3858
- ctrlPanel.revalidate(); // ? new
4304
+ ctrlPanel.validate(); // ? new
38594305 ctrlPanel.repaint();
38604306 }
38614307 }
....@@ -3864,6 +4310,8 @@
38644310
38654311 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38664312 {
4313
+ if (Globals.SAVEONMAKE) // && resetmodel)
4314
+ Save();
38674315 //Tween.set(thing, 0).target(1).start(tweenManager);
38684316 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38694317 // if (thing instanceof GenericJointDemo)
....@@ -3950,6 +4398,12 @@
39504398 {
39514399 ResetModel();
39524400 Select(thing.GetTreePath(), true, false); // unselect... false);
4401
+
4402
+ if (thing.Size() == 0)
4403
+ {
4404
+ //EditSelection(false);
4405
+ }
4406
+
39534407 refreshContents();
39544408 }
39554409
....@@ -4067,6 +4521,7 @@
40674521 }
40684522 }
40694523 }
4524
+
40704525 LoadGFDThread loadGFDThread;
40714526
40724527 void ReadGFD(String fullname, iCallBack cb)
....@@ -4086,8 +4541,10 @@
40864541
40874542 try
40884543 {
4544
+ // Try compressed version first.
40894545 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4090
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4546
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4547
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40914548
40924549 readobj = (Object3D) p.readObject();
40934550 istream.close();
....@@ -4095,7 +4552,20 @@
40954552 readobj.ResetDisplayList();
40964553 } catch (Exception e)
40974554 {
4098
- e.printStackTrace();
4555
+ //e.printStackTrace();
4556
+ try
4557
+ {
4558
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4559
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4560
+
4561
+ readobj = (Object3D) p.readObject();
4562
+ istream.close();
4563
+
4564
+ readobj.ResetDisplayList();
4565
+ } catch (Exception e2)
4566
+ {
4567
+ e2.printStackTrace();
4568
+ }
40994569 }
41004570 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
41014571 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4141,6 +4611,12 @@
41414611
41424612 void LoadIt(Object obj)
41434613 {
4614
+ if (obj == null)
4615
+ {
4616
+ // Invalid file
4617
+ return;
4618
+ }
4619
+
41444620 System.out.println("Loaded " + obj);
41454621 //new Exception().printStackTrace();
41464622 Object3D readobj = (Object3D) obj;
....@@ -4150,6 +4626,8 @@
41504626
41514627 if (readobj != null)
41524628 {
4629
+ if (Globals.SAVEONMAKE)
4630
+ Save();
41534631 try
41544632 {
41554633 //readobj.deepCopySelf(copy);
....@@ -4212,7 +4690,7 @@
42124690
42134691 void load() // throws ClassNotFoundException
42144692 {
4215
- if (GrafreeD.standAlone)
4693
+ if (Grafreed.standAlone)
42164694 {
42174695 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42184696 browser.show();
....@@ -4299,11 +4777,13 @@
42994777 try
43004778 {
43014779 FileOutputStream ostream = new FileOutputStream(lastname);
4302
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4780
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4781
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43034782
43044783 p.writeObject(copy);
43054784 p.flush();
43064785
4786
+ zstream.close();
43074787 ostream.close();
43084788
43094789 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4313,17 +4793,20 @@
43134793 {
43144794 }
43154795 }
4796
+
43164797 String lastname;
43174798
43184799 void saveAs()
43194800 {
4320
- if (GrafreeD.standAlone)
4801
+ if (Grafreed.standAlone)
43214802 {
43224803 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43234804 browser.setVisible(true);
43244805 String filename = browser.getFile();
43254806 if (filename != null && filename.length() > 0)
43264807 {
4808
+ if (!filename.endsWith(".gfd"))
4809
+ filename += ".gfd";
43274810 lastname = browser.getDirectory() + filename;
43284811 save();
43294812 }
....@@ -4422,13 +4905,13 @@
44224905 try
44234906 {
44244907 FileOutputStream ostream = new FileOutputStream(filename);
4425
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4426
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4908
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4909
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44274910
44284911 Object3D objectparent = obj.parent;
44294912 obj.parent = null;
44304913
4431
- Object3D object = (Object3D) GrafreeD.clone(obj);
4914
+ Object3D object = (Object3D) Grafreed.clone(obj);
44324915
44334916 obj.parent = objectparent;
44344917
....@@ -4440,8 +4923,8 @@
44404923 p.writeObject(object);
44414924 p.flush();
44424925
4926
+ zstream.close();
44434927 ostream.close();
4444
- // zstream.close();
44454928
44464929 // group.selection.get(0).parent = parent;
44474930 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4462,7 +4945,7 @@
44624945 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44634946 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44644947 copy.generatePOV(buffer);
4465
- if (GrafreeD.standAlone)
4948
+ if (Grafreed.standAlone)
44664949 {
44674950 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44684951 browser.show();
....@@ -4488,7 +4971,8 @@
44884971 Object3D client;
44894972 Object3D copy;
44904973 MenuBar menuBar;
4491
- Menu windowMenu;
4974
+ Menu fileMenu;
4975
+ MenuItem newItem;
44924976 MenuItem loadItem;
44934977 MenuItem saveItem;
44944978 MenuItem saveAsItem;
....@@ -4496,13 +4980,11 @@
44964980 MenuItem reexportItem;
44974981 MenuItem povItem;
44984982 MenuItem closeItem;
4499
- Menu cameraMenu;
4983
+
45004984 CheckboxMenuItem zBufferItem;
45014985 //MenuItem normalLensItem;
4502
- MenuItem editCameraItem;
4503
- MenuItem revertCameraItem;
4504
- CheckboxMenuItem toggleLiveItem;
45054986 MenuItem stepItem;
4987
+ CheckboxMenuItem toggleLiveItem;
45064988 CheckboxMenuItem toggleFullScreenItem;
45074989 CheckboxMenuItem toggleTimelineItem;
45084990 CheckboxMenuItem toggleRenderItem;
....@@ -4511,28 +4993,42 @@
45114993 CheckboxMenuItem toggleFootContactItem;
45124994 CheckboxMenuItem toggleDLItem;
45134995 CheckboxMenuItem toggleTextureItem;
4514
- CheckboxMenuItem toggleRandomItem;
4996
+ CheckboxMenuItem toggleSwitchItem;
45154997 CheckboxMenuItem toggleRootItem;
45164998 CheckboxMenuItem animationItem;
45174999 CheckboxMenuItem toggleHandleItem;
45185000 CheckboxMenuItem togglePaintItem;
45195001 JSplitPane mainPanel;
45205002 JScrollPane scrollpane;
5003
+
45215004 JPanel toolbarPanel;
4522
- JPanel treePanel;
5005
+
5006
+ cGridBag treePanel;
5007
+
45235008 JPanel radioPanel;
45245009 ButtonGroup buttonGroup;
4525
- JPanel ctrlPanel;
4526
- JPanel materialPanel;
5010
+
5011
+ cGridBag toolboxPanel;
5012
+ cGridBag materialPanel;
5013
+ cGridBag ctrlPanel;
5014
+
45275015 JScrollPane infoPanel;
4528
- JPanel optionsPanel;
5016
+
5017
+ cGridBag optionsPanel;
5018
+
45295019 JTabbedPane objectPanel;
4530
- JPanel XYZPanel;
5020
+ boolean materialFlushed;
5021
+ Object3D latestObject;
5022
+
5023
+ cGridBag XYZPanel;
5024
+
45315025 JSplitPane gridPanel;
45325026 JSplitPane bigPanel;
4533
- JPanel bigThree;
4534
- JTabbedPane scenePanel;
4535
- JPanel centralPanel;
5027
+
5028
+ cGridBag bigThree;
5029
+ cGridBag scenePanel;
5030
+ cGridBag centralPanel;
5031
+ JSplitPane cameraPanel;
45365032 JPanel timelinePanel;
45375033 JMenuBar timelineMenubar;
45385034 JSplitPane framePanel;
....@@ -4584,67 +5080,72 @@
45845080 // MATERIAL
45855081 JLabel materialLabel;
45865082 JLabel colorLabel;
4587
- NumberSlider colorField;
5083
+ cNumberSlider colorField;
45885084 JLabel modulationLabel;
4589
- NumberSlider modulationField;
5085
+ cNumberSlider modulationField;
45905086 JLabel metalnessLabel;
4591
- NumberSlider metalnessField;
5087
+ cNumberSlider metalnessField;
45925088 JLabel diffuseLabel;
4593
- NumberSlider diffuseField;
5089
+ cNumberSlider diffuseField;
45945090 JLabel specularLabel;
4595
- NumberSlider specularField;
5091
+ cNumberSlider specularField;
45965092 JLabel shininessLabel;
4597
- NumberSlider shininessField;
5093
+ cNumberSlider shininessField;
45985094 JLabel shiftLabel;
4599
- NumberSlider shiftField;
5095
+ cNumberSlider shiftField;
46005096 JLabel ambientLabel;
4601
- NumberSlider ambientField;
5097
+ cNumberSlider ambientField;
46025098 JLabel lightareaLabel;
4603
- NumberSlider lightareaField;
5099
+ cNumberSlider lightareaField;
46045100 JLabel diffusenessLabel;
4605
- NumberSlider diffusenessField;
5101
+ cNumberSlider diffusenessField;
46065102 JLabel velvetLabel;
4607
- NumberSlider velvetField;
5103
+ cNumberSlider velvetField;
46085104 JLabel sheenLabel;
4609
- NumberSlider sheenField;
5105
+ cNumberSlider sheenField;
46105106 JLabel subsurfaceLabel;
4611
- NumberSlider subsurfaceField;
5107
+ cNumberSlider subsurfaceField;
46125108 //JLabel bumpLabel;
46135109 //NumberSlider bumpField;
46145110 JLabel backlitLabel;
4615
- NumberSlider backlitField;
5111
+ cNumberSlider backlitField;
46165112 JLabel anisoLabel;
4617
- NumberSlider anisoField;
5113
+ cNumberSlider anisoField;
46185114 JLabel anisoVLabel;
4619
- NumberSlider anisoVField;
5115
+ cNumberSlider anisoVField;
46205116 JLabel cameraLabel;
4621
- NumberSlider cameraField;
5117
+ cNumberSlider cameraField;
46225118 JLabel selfshadowLabel;
4623
- NumberSlider selfshadowField;
5119
+ cNumberSlider selfshadowField;
46245120 JLabel shadowLabel;
4625
- NumberSlider shadowField;
5121
+ cNumberSlider shadowField;
46265122 JLabel textureLabel;
4627
- NumberSlider textureField;
5123
+ cNumberSlider textureField;
46285124 JLabel opacityLabel;
4629
- NumberSlider opacityField;
5125
+ cNumberSlider opacityField;
46305126 JLabel fakedepthLabel;
4631
- NumberSlider fakedepthField;
5127
+ cNumberSlider fakedepthField;
46325128 JLabel shadowbiasLabel;
4633
- NumberSlider shadowbiasField;
5129
+ cNumberSlider shadowbiasField;
46345130 JLabel bumpLabel;
4635
- NumberSlider bumpField;
5131
+ cNumberSlider bumpField;
46365132 JLabel noiseLabel;
4637
- NumberSlider noiseField;
5133
+ cNumberSlider noiseField;
46385134 JLabel powerLabel;
4639
- NumberSlider powerField;
5135
+ cNumberSlider powerField;
46405136 JLabel borderfadeLabel;
4641
- NumberSlider borderfadeField;
5137
+ cNumberSlider borderfadeField;
46425138 JLabel fogLabel;
4643
- NumberSlider fogField;
5139
+ cNumberSlider fogField;
46445140 JLabel opacityPowerLabel;
4645
- NumberSlider opacityPowerField;
4646
- JTree jTree;
5141
+ cNumberSlider opacityPowerField;
5142
+ cTree jTree;
46475143 //ObjectUI parent;
46485144
4649
- NumberSlider normalpushField;
5145
+ cNumberSlider normalpushField;
5146
+
5147
+ private MenuItem importGFDItem;
5148
+ private MenuItem importVRMLX3DItem;
5149
+ private MenuItem import3DSItem;
5150
+ private MenuItem importOBJItem;
46505151 }