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,51 +191,62 @@
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);
234
+
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);
163242 }
164243
165244 public ObjEditor GetEditor()
166245 {
167246 return objEditor; //.GetEditor();
168247 }
248
+
249
+ // Sometimes myself, sometimes my callee's.
169250 ObjEditor objEditor;
170251
171252 /*
....@@ -228,6 +309,7 @@
228309 //localCopy.parent = null;
229310
230311 frame = new JFrame();
312
+ frame.setUndecorated(true);
231313 objEditor = this;
232314 this.callee = callee;
233315
....@@ -258,27 +340,48 @@
258340 return frame.action(event, obj);
259341 }
260342
343
+ // Cannot work without static
344
+ static boolean allparams = true;
345
+
346
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
347
+
261348 void SetupMenu()
262349 {
263350 frame.setMenuBar(menuBar = new MenuBar());
264
- menuBar.add(windowMenu = new Menu("File"));
265
- windowMenu.add(loadItem = new MenuItem("Load..."));
266
- windowMenu.add("-");
267
- windowMenu.add(saveItem = new MenuItem("Save"));
268
- 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..."));
269371 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
270
- windowMenu.add("-");
271
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
272
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
273
- windowMenu.add("-");
372
+ fileMenu.add("-");
373
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
374
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
375
+ fileMenu.add("-");
274376 if (client.parent != null)
275377 {
276
- windowMenu.add(closeItem = new MenuItem("Close"));
378
+ fileMenu.add(closeItem = new MenuItem("Close"));
277379 } else
278380 {
279
- windowMenu.add(closeItem = new MenuItem("Exit"));
381
+ fileMenu.add(closeItem = new MenuItem("Exit"));
280382 }
281383
384
+ newItem.addActionListener(this);
282385 loadItem.addActionListener(this);
283386 saveItem.addActionListener(this);
284387 saveAsItem.addActionListener(this);
....@@ -287,79 +390,64 @@
287390 //povItem.addActionListener(this);
288391 closeItem.addActionListener(this);
289392
290
- menuBar.add(cameraMenu = new Menu("View"));
291
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
292
- //zBufferItem.addActionListener(this);
293
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
294
- //normalLensItem.addActionListener(this);
295
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
296
- revertCameraItem.addActionListener(this);
297
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
298
- toggleTimelineItem.addItemListener(this);
299
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
300
- toggleFullScreenItem.addItemListener(this);
301
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
302
- cameraMenu.add("-");
303
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
304
- toggleTextureItem.addItemListener(this);
305
- toggleTextureItem.setState(CameraPane.textureon);
306
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
307
- toggleLiveItem.addItemListener(this);
308
- toggleLiveItem.setState(CameraPane.isLIVE());
309
- cameraMenu.add(stepItem = new MenuItem("Step"));
310
- stepItem.addActionListener(this);
311
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
312
-// toggleDLItem.addItemListener(this);
313
-// toggleDLItem.setState(false);
314
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
315
- toggleRenderItem.addItemListener(this);
316
- toggleRenderItem.setState(!CameraPane.frozen);
317
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
318
- toggleDebugItem.addItemListener(this);
319
- toggleDebugItem.setState(CameraPane.DEBUG);
320
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
321
- toggleFrustumItem.addItemListener(this);
322
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
323
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
324
- toggleFootContactItem.addItemListener(this);
325
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
326
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
327
- toggleRandomItem.addItemListener(this);
328
- toggleRandomItem.setState(CameraPane.RANDOM);
329
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
330
- toggleHandleItem.addItemListener(this);
331
- toggleHandleItem.setState(CameraPane.HANDLES);
332
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
333
- togglePaintItem.addItemListener(this);
334
- togglePaintItem.setState(CameraPane.PAINTMODE);
335
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
336
-// toggleRootItem.addItemListener(this);
337
-// toggleRootItem.setState(false);
338
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
339
-// animationItem.addItemListener(this);
340
-// animationItem.setState(CameraPane.ANIMATION);
341
- cameraMenu.add("-");
342
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
343
- editCameraItem.addActionListener(this);
344
-
345393 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
+
346420 toolbarPanel = new JPanel();
347421 toolbarPanel.setName("Toolbar");
348
- treePanel = new JPanel();
422
+ treePanel = new cGridBag();
349423 treePanel.setName("Tree");
350
- ctrlPanel = new JPanel(); // new GridBagLayout());
351
- ctrlPanel.setName("Edit");
352
- 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);
353438 materialPanel.setName("Material");
439
+
354440 /*JTextPane*/
355441 infoarea = createTextPane();
442
+ doc = infoarea.getStyledDocument();
443
+
356444 infoarea.setEditable(true);
357445 SetText();
358446 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
359447 // infoarea.setOpaque(false);
360448 // //infoarea.setForeground(textcolor);
361
- infoarea.setLineWrap(true);
362
- infoarea.setWrapStyleWord(true);
449
+// TEXTAREA infoarea.setLineWrap(true);
450
+// TEXTAREA infoarea.setWrapStyleWord(true);
363451 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
364452 infoPanel.setPreferredSize(new Dimension(50, 200));
365453 infoPanel.setName("Info");
....@@ -370,16 +458,23 @@
370458 mainPanel.setName("Main");
371459 mainPanel.setContinuousLayout(true);
372460 mainPanel.setOneTouchExpandable(true);
373
- mainPanel.setDividerLocation(1.0);
374461 mainPanel.setDividerSize(9);
375
- mainPanel.setResizeWeight(0);
376
-
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
+
377472 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
378473 //mainPanel.setLayout(new GridBagLayout());
379474 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
380
- treePanel.setLayout(new GridBagLayout());
381
- ctrlPanel.setLayout(new GridBagLayout());
382
- materialPanel.setLayout(new GridBagLayout());
475
+// treePanel.setLayout(new GridBagLayout());
476
+ //ctrlPanel.setLayout(new GridBagLayout());
477
+ //materialPanel.setLayout(new GridBagLayout());
383478
384479 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
385480 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -418,7 +513,7 @@
418513 static String newline = "\n";
419514 protected static final String buttonString = "JButton";
420515 StyledDocument doc;
421
- JTextArea infoarea;
516
+ JTextPane infoarea;
422517
423518 void ClearInfo()
424519 {
....@@ -441,10 +536,10 @@
441536 e.printStackTrace();
442537 }
443538
444
- String selection = infoarea.getText();
445
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
446
- java.awt.datatransfer.Clipboard clipboard =
447
- 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();
448543 //clipboard.setContents(data, data);
449544 }
450545
....@@ -467,13 +562,13 @@
467562 //SendInfo("Name:", "bold");
468563 if (sel.GetTextures() != null || debug)
469564 {
470
- si.SendInfo(sel.toString(), "bold");
565
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
471566 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
472567 if (sel.Size() > 0)
473568 {
474569 si.SendInfo("#children = " + sel.Size(), "regular");
475570 }
476
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
571
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
477572 if (debug)
478573 {
479574 try
....@@ -485,7 +580,10 @@
485580 }
486581
487582 if (full)
488
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
583
+ {
584
+ si.SendInfo(" BBox min: " + minima, "regular");
585
+ si.SendInfo(" BBox max: " + maxima, "regular");
586
+ }
489587
490588 if (sel.bRep != null)
491589 {
....@@ -512,7 +610,7 @@
512610 }
513611 if (sel.support != null)
514612 {
515
- si.SendInfo(" support: " + sel.support, "regular");
613
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
516614 }
517615 if (sel.scriptnode != null)
518616 {
....@@ -583,6 +681,9 @@
583681 {
584682 CameraPane.pointflow = (PointFlow) sel;
585683 }
684
+
685
+ si.SendInfo("_____________________", "regular");
686
+ si.SendInfo("", "regular");
586687 }
587688 }
588689
....@@ -598,68 +699,140 @@
598699 }
599700 }
600701
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
+
601744 void ToggleFullScreen()
602745 {
603
- if (CameraPane.FULLSCREEN)
746
+ cameraView.ToggleFullScreen();
747
+
748
+ if (!CameraPane.FULLSCREEN)
604749 {
605
- frame.getContentPane().remove(/*"Center",*/bigThree);
606
- framePanel.add(bigThree);
607
- 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
+
608768 } else
609769 {
610
- frame.getContentPane().remove(/*"Center",*/framePanel);
611
- framePanel.remove(bigThree);
612
- 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);
613787 }
614
- cameraView.ToggleFullScreen();
615788 }
616789
617
- private JTextArea createTextPane()
790
+ private JTextPane createTextPane()
618791 {
619
- String[] initString =
620
- {
621
- "This is an editable JTextPane, ", //regular
622
- "another ", //italic
623
- "styled ", //bold
624
- "text ", //small
625
- "component, ", //large
626
- "which supports embedded components..." + newline,//regular
627
- " " + newline, //button
628
- "...and embedded icons..." + newline, //regular
629
- " ", //icon
630
- newline + "JTextPane is a subclass of JEditorPane that "
631
- + "uses a StyledEditorKit and StyledDocument, and provides "
632
- + "cover methods for interacting with those objects."
633
- };
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
+// }
634834
635
- String[] initStyles =
636
- {
637
- "regular", "italic", "bold", "small", "large",
638
- "regular", "button", "regular", "icon",
639
- "regular"
640
- };
641
-
642
- JTextPane textPane = new JTextPane();
643
- textPane.setEditable(true);
644
- /*StyledDocument*/ doc = textPane.getStyledDocument();
645
- addStylesToDocument(doc);
646
-
647
- try
648
- {
649
- for (int j = 0; j < 2; j++)
650
- {
651
- for (int i = 0; i < initString.length; i++)
652
- {
653
- doc.insertString(doc.getLength(), initString[i],
654
- doc.getStyle(initStyles[i]));
655
- }
656
- }
657
- } catch (BadLocationException ble)
658
- {
659
- System.err.println("Couldn't insert initial text into text pane.");
660
- }
661
-
662
- return new JTextArea(); // textPane;
835
+ return new JTextPane(); // textPane;
663836 }
664837
665838 protected void addStylesToDocument(StyledDocument doc)
....@@ -712,7 +885,7 @@
712885 protected static ImageIcon createImageIcon(String path,
713886 String description)
714887 {
715
- java.net.URL imgURL = GrafreeD.class.getResource(path);
888
+ java.net.URL imgURL = Grafreed.class.getResource(path);
716889 if (imgURL != null)
717890 {
718891 return new ImageIcon(imgURL, description);
....@@ -744,6 +917,7 @@
744917 // NumberSlider vDivsField;
745918 // JCheckBox endcaps;
746919 JCheckBox liveCB;
920
+ JCheckBox selectCB;
747921 JCheckBox hideCB;
748922 JCheckBox link2masterCB;
749923 JCheckBox markCB;
....@@ -751,7 +925,12 @@
751925 JCheckBox speedupCB;
752926 JCheckBox rewindCB;
753927 JCheckBox flipVCB;
928
+
929
+ cCheckBox toggleTextureCB;
930
+ cCheckBox toggleSwitchCB;
931
+
754932 JComboBox texresMenu;
933
+
755934 JButton resetButton;
756935 JButton stepButton;
757936 JButton stepAllButton;
....@@ -759,115 +938,87 @@
759938 JButton slowerButton;
760939 JButton fasterButton;
761940 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;
762951
763
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
952
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
764953 {
765954 JCheckBox cb;
766955
767
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
768
- oe.aConstraints.gridwidth = 1; // 3;
769
-// oe.aConstraints.weightx = 1;
770
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
771
- 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);
772957 cb.addItemListener(this);
773
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
774
- oe.aConstraints.gridwidth = 1;
775
- oe.aConstraints.gridx += 1;
776958
777959 return cb;
778960 }
779961
780
- cButton AddButton(ObjEditor oe, String label)
962
+ cButton AddButton(cGridBag panel, String label)
781963 {
782964 cButton cb;
783965
784
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
785
- oe.aConstraints.gridwidth = 1;
786
-// oe.aConstraints.weightx = 1;
787
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
788
- 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);
789967 cb.addActionListener(this);
790
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
791
- oe.aConstraints.gridwidth = 1;
792
- oe.aConstraints.gridx += 1;
793968
794969 return cb;
795970 }
796971
797
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
972
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
798973 {
799974 JComboBox combo;
800975
801
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
802
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
803
- oe.aConstraints.gridx += 1;
976
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
804977 combo.addActionListener(this);
805978
806979 return combo;
807980 }
808981
809
- 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)
810983 {
811
- NumberSlider combo;
984
+ cGridBag control = new cGridBag();
985
+
986
+ cNumberSlider combo;
812987
813988 JLabel jlabel = new JLabel(label);
814
-
815
- aConstraints.fill = GridBagConstraints.VERTICAL;
816989 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
817
- aConstraints.gridwidth = 2;
818
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
819
- aConstraints.gridx += 1;
820
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
821
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
822
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
823
- aConstraints.gridx += 1;
824
- aConstraints.gridwidth = 1;
825
-
990
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
991
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
826992 combo.setFloat(current);
827
-
828
- combo.label = jlabel;
829
-
830
- combo.addChangeListener(this);
831
-
832
- return combo;
993
+
994
+ panel.add(control);
995
+
996
+ return control;
833997 }
834998
835
- 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)
8361000 {
837
- NumberSlider combo;
1001
+ cGridBag control = new cGridBag();
1002
+
1003
+ cNumberSlider combo;
8381004
8391005 JLabel jlabel = new JLabel(label);
840
-
841
- aConstraints.fill = GridBagConstraints.VERTICAL;
8421006 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
843
- aConstraints.gridwidth = 2;
844
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
845
- aConstraints.gridx += 1;
846
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
847
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
848
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
851
-
1007
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1008
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8521009 combo.setInteger(current);
8531010
854
- combo.label = jlabel;
855
-
856
- combo.addChangeListener(this);
857
-
858
- return combo;
1011
+ panel.add(control);
1012
+
1013
+ return control;
8591014 }
8601015
861
- JTextArea AddText(JPanel ctrlPanel, String name)
1016
+ JTextArea AddText(cGridBag ctrlPanel, String name)
8621017 {
8631018 JTextArea text;
8641019
865
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
866
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
867
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1020
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8681021 text.addCaretListener(this);
869
- aConstraints.gridx += 1;
870
- aConstraints.gridwidth = 1;
8711022
8721023 return text;
8731024 }
....@@ -897,9 +1048,16 @@
8971048 objEditor.ctrlPanel.remove(j);
8981049 }
8991050
1051
+ void Remove(cNumberSlider j)
1052
+ {
1053
+ j.removeChangeListener(this);
1054
+ //objEditor.ctrlPanel.remove(j.label);
1055
+ objEditor.ctrlPanel.remove(j);
1056
+ }
1057
+
9001058 /*
9011059 */
902
- void Return() // ObjEditor oe)
1060
+ void Return0() // ObjEditor oe)
9031061 {
9041062 aConstraints.gridy += 1;
9051063 aConstraints.gridx = 0;
....@@ -954,35 +1112,77 @@
9541112
9551113 void SetupUI2(ObjEditor oe)
9561114 {
957
-// oe.aConstraints.weightx = 0;
958
-// oe.aConstraints.weighty = 0;
959
-// oe.aConstraints.gridx = 0;
960
-// oe.aConstraints.gridy = 0;
961
- SetupName(oe);
1115
+ //SetupName(oe);
9621116
963
- 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)
9641126 return;
9651127
966
- liveCB = AddCheckBox(oe, "Live", copy.live);
967
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
968
- 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");
9691134 // Return();
970
- markCB = AddCheckBox(oe, "Mark", copy.marked);
971
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
972
- randomCB = AddCheckBox(oe, "Rand", copy.random);
973
- Return();
974
- resetButton = AddButton(oe, "Reset");
975
- 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");
9761167 // resetAllButton = AddButton(oe, "Reset All");
9771168 // stepAllButton = AddButton(oe, "Step All");
978
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9791169 // Return();
980
- slowerButton = AddButton(oe, "Slow");
981
- fasterButton = AddButton(oe, "Fast");
982
- 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");
9831176
984
- Return();
1177
+ oe.ctrlPanel.add(objectCommandsPanel);
1178
+ oe.ctrlPanel.Return();
9851179
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();
1185
+
9861186 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871187 // ObjEditor.aConstraints.gridx += 1;
9881188
....@@ -1076,7 +1276,7 @@
10761276 oe.aConstraints.gridwidth = 1;
10771277 /**/
10781278 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1279
+ oe.ctrlPanel.Return();
10801280
10811281 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821282 //textureButton.setEnabled(false);
....@@ -1178,11 +1378,25 @@
11781378 //JPanel worldPanel =
11791379 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11801380 //worldPanel.setName("World");
1181
- centralPanel = new JPanel(new BorderLayout());
1182
- timelinePanel = new JPanel(new BorderLayout());
1183
- 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);
11841388
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
+
11851398 centralPanel.add(cameraView);
1399
+ centralPanel.setFocusable(true);
11861400 //frame.setJMenuBar(timelineMenubar);
11871401 //centralPanel.add(timelinePanel);
11881402
....@@ -1201,12 +1415,13 @@
12011415 //frontView.object = copy;
12021416 //sideView.object = copy;
12031417
1204
- XYZPanel = new JPanel();
1205
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1418
+ XYZPanel = new cGridBag().setVertical(true);
1419
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12061420
1207
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1208
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1209
- 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);
12101425
12111426 /*
12121427 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1244,11 +1459,13 @@
12441459 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12451460 //tmp.setName("Edit");
12461461 objectPanel.add(materialPanel);
1247
- JPanel north = new JPanel(new BorderLayout());
1248
- north.setName("Edit");
1249
- north.add(ctrlPanel, BorderLayout.NORTH);
1250
- 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);
12511467 objectPanel.add(infoPanel);
1468
+ objectPanel.add(toolboxPanel);
12521469
12531470 /*
12541471 aConstraints.gridx = 0;
....@@ -1257,7 +1474,7 @@
12571474 aConstraints.gridy += 1;
12581475 aConstraints.gridwidth = 1;
12591476 mainPanel.add(objectPanel, aConstraints);
1260
- */
1477
+ */
12611478
12621479 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12631480 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1268,16 +1485,23 @@
12681485 scrollpane.setWheelScrollingEnabled(true);
12691486 scrollpane.addMouseWheelListener(this); // Default not fast enough
12701487
1271
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1272
- scenePanel.add(scrollpane);
1488
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1489
+ scenePanel.preferredWidth = 6;
1490
+
1491
+ JTabbedPane tabbedPane = new JTabbedPane();
1492
+ tabbedPane.add(scrollpane);
12731493
1274
- scenePanel.add(FSPane = new cFileSystemPane(this));
1275
-
1276
- optionsPanel = new JPanel(new GridBagLayout());
1494
+ optionsPanel = new cGridBag().setVertical(false);
12771495
12781496 optionsPanel.setName("Options");
1279
- scenePanel.add(optionsPanel);
1497
+
1498
+ AddOptions(optionsPanel); //, aConstraints);
1499
+
1500
+ tabbedPane.add(optionsPanel);
1501
+
1502
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12801503
1504
+ scenePanel.add(tabbedPane);
12811505
12821506 /*
12831507 cTree jTree = new cTree(null);
....@@ -1311,6 +1535,7 @@
13111535 //bigPanel.setSize(new Dimension(10,10));
13121536 //bigPanel.add(ctrlPanel);
13131537 //bigPanel.add(gridPanel);
1538
+ /**
13141539 bigThree = new JPanel();
13151540 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13161541 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1334,7 +1559,13 @@
13341559 // aConstraints.gridheight = 3;
13351560 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13361561 bigThree.add(XYZPanel, aWindowConstraints);
1562
+ /**/
13371563
1564
+ bigThree = new cGridBag();
1565
+ bigThree.addComponent(scenePanel);
1566
+ bigThree.addComponent(centralPanel);
1567
+ bigThree.addComponent(XYZPanel);
1568
+
13381569 // // SIDE EFFECT!!!
13391570 // aConstraints.gridx = 0;
13401571 // aConstraints.gridy = 0;
....@@ -1355,14 +1586,19 @@
13551586 //worldPane.add(bigPanel);
13561587 //worldPane.add(worldPanel);
13571588 /**/
1358
- frame.getContentPane().add(/*"Center",*/framePanel);
1589
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1590
+ frame.add(/*"Center",*/framePanel);
13591591 //frame.getContentPane().add(/*"Center",*/ worldPane);
13601592
13611593 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13621594
1363
- frame.setSize(1024, 768);
1364
- frame.show();
1595
+ frame.setSize(1280, 860);
1596
+
1597
+ frame.validate();
1598
+ frame.setVisible(true);
13651599
1600
+ cameraView.requestFocusInWindow();
1601
+
13661602 gridPanel.setDividerLocation(1.0);
13671603
13681604 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1376,6 +1612,10 @@
13761612 });
13771613 }
13781614
1615
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1616
+ {
1617
+ }
1618
+
13791619 JTree GetTree()
13801620 {
13811621 return objEditor.jTree;
....@@ -1387,260 +1627,173 @@
13871627 ctrlPanel.removeAll();
13881628 }
13891629
1390
- void SetupMaterial(JPanel ctrlPanel)
1630
+ void SetupMaterial(cGridBag panel)
13911631 {
1392
- aConstraints.weighty = 0;
1393
- //aConstraints.weightx = 1;
1394
- /*
1632
+ /*
13951633 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13961634 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1397
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1398
- aConstraints.gridx += 1;
13991635 */
14001636
1401
- aConstraints.gridwidth = 1;
1402
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1403
- aConstraints.gridx += 1;
1404
- aConstraints.weighty = 0;
1405
- 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");
14061641
14071642 /*
14081643 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1409
- aConstraints.gridx += 1;
1410
- aConstraints.weighty = 0;
1411
- aConstraints.gridwidth = 1;
14121644 */
14131645
1414
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1415
- 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
+ }
14161655
1417
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1418
-
1419
- aConstraints.gridx += 1;
1420
-
1421
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1422
-
1423
- aConstraints.gridx += 1;
1424
-
1425
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1426
-
1427
- aConstraints.gridx = 0;
1428
- aConstraints.gridy += 1;
1429
- aConstraints.weighty = 0;
1430
- aConstraints.gridwidth = 1;
1656
+ editBar.preferredHeight = 15;
1657
+
1658
+ panel.add(editBar);
1659
+
14311660 /**/
14321661 //aConstraints.weighty = 0;
14331662 ////aConstraints.weightx = 1;
14341663 //aConstraints.weighty = 1;
14351664 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14361665 //aConstraints.gridx += 1;
1437
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1438
- aConstraints.weighty = 0;
1439
- aConstraints.gridx = 0;
1440
- aConstraints.gridy += 1;
1441
- aConstraints.gridwidth = 1;
1666
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14421667
1443
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1444
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1445
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1446
- aConstraints.gridx += 1;
1447
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1448
- //aConstraints.weightx = 0;
1449
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1450
- aConstraints.gridx = 0;
1451
- aConstraints.gridy += 1;
1452
- 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);
14531676
1454
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1455
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1456
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1457
- aConstraints.gridx += 1;
1458
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1459
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1460
- aConstraints.gridx = 0;
1461
- aConstraints.gridy += 1;
1462
- 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);
14631682
1464
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1465
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1466
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1467
- aConstraints.gridx += 1;
1468
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1469
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1470
- aConstraints.gridx = 0;
1471
- aConstraints.gridy += 1;
1472
- 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);
14731688
1474
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1475
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1476
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1477
- aConstraints.gridx += 1;
1478
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1479
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1480
- aConstraints.gridx = 0;
1481
- aConstraints.gridy += 1;
1482
- 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);
14831694
1484
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1485
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1486
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1487
- aConstraints.gridx += 1;
1488
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1489
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1490
- aConstraints.gridx = 0;
1491
- aConstraints.gridy += 1;
1492
- 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);
14931700
1494
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1495
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1496
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1497
- aConstraints.gridx += 1;
1498
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1499
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1500
- aConstraints.gridx = 0;
1501
- aConstraints.gridy += 1;
1502
- 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);
15031706
1504
- //aConstraints.weighty = 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1506
- //aConstraints.gridx += 1;
1507
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1508
- aConstraints.weighty = 0;
1509
- aConstraints.gridx = 0;
1510
- aConstraints.gridy += 1;
1511
- 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);
15121720
1513
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1514
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1515
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1516
- aConstraints.gridx += 1;
1517
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1518
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1519
- aConstraints.gridx = 0;
1520
- aConstraints.gridy += 1;
1521
- 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);
15221726
1523
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1524
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1525
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1526
- aConstraints.gridx += 1;
1527
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1528
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1529
- aConstraints.gridx = 0;
1530
- aConstraints.gridy += 1;
1531
- 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);
15321732
1533
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1534
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1535
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1536
- aConstraints.gridx += 1;
1537
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1538
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1539
- aConstraints.gridx = 0;
1540
- aConstraints.gridy += 1;
1541
- 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);
15421738
1543
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1544
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1545
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1546
- aConstraints.gridx += 1;
1547
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1548
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1549
- aConstraints.gridx = 0;
1550
- aConstraints.gridy += 1;
1551
- 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);
15521744
1553
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1554
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1555
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1556
- aConstraints.gridx += 1;
1557
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1558
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1559
- aConstraints.gridx = 0;
1560
- aConstraints.gridy += 1;
1561
- 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);
15621750
1563
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1564
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1565
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1566
- aConstraints.gridx += 1;
1567
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1568
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1569
- aConstraints.gridx = 0;
1570
- aConstraints.gridy += 1;
1571
- 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);
15721756
1573
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1574
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1575
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1576
- aConstraints.gridx += 1;
1577
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1578
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1579
- aConstraints.gridx = 0;
1580
- aConstraints.gridy += 1;
1581
- 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);
15821764
1583
- //aConstraints.weighty = 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1585
- //aConstraints.gridx += 1;
1586
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1587
- aConstraints.weighty = 0;
1588
- aConstraints.gridx = 0;
1589
- aConstraints.gridy += 1;
1590
- 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);
15911770
1592
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1593
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1595
- aConstraints.gridx += 1;
1596
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1597
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1598
- aConstraints.gridx = 0;
1599
- aConstraints.gridy += 1;
1600
- 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);
16011776
1602
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1603
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1604
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1605
- aConstraints.gridx += 1;
1606
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1607
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1608
- aConstraints.gridx = 0;
1609
- aConstraints.gridy += 1;
1610
- 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);
16111782
1612
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1613
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1614
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1615
- aConstraints.gridx += 1;
1616
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1617
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1618
- aConstraints.gridx = 0;
1619
- aConstraints.gridy += 1;
1620
- 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);
16211788
1622
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1623
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1624
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1625
- aConstraints.gridx += 1;
1626
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1627
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1628
- aConstraints.gridx = 0;
1629
- aConstraints.gridy += 1;
1630
- 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);
16311794
1632
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1633
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1634
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1635
- aConstraints.gridx += 1;
1636
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1637
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1638
- aConstraints.gridx = 0;
1639
- aConstraints.gridy += 1;
1640
- aConstraints.gridwidth = 1;
1641
-
1642
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1643
- Return();
1795
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1796
+ //Return();
16441797 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16451798 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16461799 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1651,130 +1804,93 @@
16511804 // aConstraints.gridy += 1;
16521805 // aConstraints.gridwidth = 1;
16531806
1654
- //aConstraints.weighty = 1;
1655
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1656
- //aConstraints.gridx += 1;
1657
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1658
- aConstraints.weighty = 0;
1659
- aConstraints.gridx = 0;
1660
- aConstraints.gridy += 1;
1661
- aConstraints.gridwidth = 1;
16621807
1663
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1664
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1665
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1666
- aConstraints.gridx += 1;
1667
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1668
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1669
- aConstraints.gridx = 0;
1670
- aConstraints.gridy += 1;
1671
- 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);
16721815
1673
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1674
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1675
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1676
- aConstraints.gridx += 1;
1677
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1678
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1679
- aConstraints.gridx = 0;
1680
- aConstraints.gridy += 1;
1681
- 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);
16821821
1683
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1684
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1685
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1686
- aConstraints.gridx += 1;
1687
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1688
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1689
- aConstraints.gridx = 0;
1690
- aConstraints.gridy += 1;
1691
- 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);
16921827
1693
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1694
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1695
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1696
- aConstraints.gridx += 1;
1697
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1698
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1699
- aConstraints.gridx = 0;
1700
- aConstraints.gridy += 1;
1701
- aConstraints.gridwidth = 1;
1702
- 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);
17031833
1704
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1705
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1706
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1707
- aConstraints.gridx += 1;
1708
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1709
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1710
- aConstraints.gridx = 0;
1711
- aConstraints.gridy += 1;
1712
- 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);
17131839
1714
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1715
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1716
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1717
- aConstraints.gridx += 1;
1718
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1719
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1720
- aConstraints.gridx = 0;
1721
- aConstraints.gridy += 1;
1722
- 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);
17231847
1724
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1725
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1726
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1727
- aConstraints.gridx += 1;
1728
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1729
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1730
- aConstraints.gridx = 0;
1731
- aConstraints.gridy += 1;
1732
- 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);
17331853
1734
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1735
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1736
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1737
- aConstraints.gridx += 1;
1738
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1739
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1740
- aConstraints.gridx = 0;
1741
- aConstraints.gridy += 1;
1742
- 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);
17431859
1744
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1745
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1746
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1747
- aConstraints.gridx += 1;
1748
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1749
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1750
- aConstraints.gridx = 0;
1751
- aConstraints.gridy += 1;
1752
- 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);
17531865
1754
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1755
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1756
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1757
- aConstraints.gridx += 1;
1758
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1759
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1760
- aConstraints.gridx = 0;
1761
- aConstraints.gridy += 1;
1762
- 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);
17631871
1764
- //aConstraints.weighty = 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1766
- //aConstraints.gridx += 1;
1767
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1768
- 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);
17691877
1770
- aConstraints.gridx = 0;
1771
- aConstraints.gridy = 0;
1772
- 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);
17731889
17741890 SetMaterial(copy); // .GetMaterial());
17751891
1776
- colorField.addChangeListener(this);
1777
- modulationField.addChangeListener(this);
1892
+ //colorField.addChangeListener(this);
1893
+// modulationField.addChangeListener(this);
17781894 metalnessField.addChangeListener(this);
17791895 diffuseField.addChangeListener(this);
17801896 specularField.addChangeListener(this);
....@@ -1804,12 +1920,15 @@
18041920 opacityPowerField.addChangeListener(this);
18051921 /**/
18061922
1807
- resetSlidersButton.addActionListener(this);
18081923 clearMaterialButton.addActionListener(this);
18091924 createMaterialButton.addActionListener(this);
1810
-
1811
- propagateToggle.addItemListener(this);
1812
- multiplyToggle.addItemListener(this);
1925
+
1926
+ if (Globals.ADVANCED)
1927
+ {
1928
+ resetSlidersButton.addActionListener(this);
1929
+ propagateToggle.addItemListener(this);
1930
+ multiplyToggle.addItemListener(this);
1931
+ }
18131932 }
18141933
18151934 void DropFile(java.io.File[] files, boolean textures)
....@@ -1980,7 +2099,7 @@
19802099
19812100 //? flashIt = false;
19822101 CameraPane pane = (CameraPane) cameraView;
1983
- pane.clickStart(location.x, location.y, 0);
2102
+ pane.clickStart(location.x, location.y, 0, 0);
19842103 pane.clickEnd(location.x, location.y, 0, true);
19852104
19862105 if (group.selection.size() == 1)
....@@ -2029,6 +2148,7 @@
20292148 e2.printStackTrace();
20302149 }
20312150 }
2151
+
20322152 LoadJMEThread loadThread;
20332153
20342154 class LoadJMEThread extends Thread
....@@ -2086,6 +2206,7 @@
20862206 //LoadFile0(filename, converter);
20872207 }
20882208 }
2209
+
20892210 LoadOBJThread loadObjThread;
20902211
20912212 class LoadOBJThread extends Thread
....@@ -2164,19 +2285,19 @@
21642285
21652286 void LoadObjFile(String fullname)
21662287 {
2167
- /*
2288
+ System.out.println("Loading " + fullname);
2289
+ /**/
21682290 //lastFilename = fullname;
21692291 if(loadObjThread == null)
21702292 {
2171
- loadObjThread = new LoadOBJThread();
2172
- loadObjThread.start();
2293
+ loadObjThread = new LoadOBJThread();
2294
+ loadObjThread.start();
21732295 }
21742296
21752297 loadObjThread.add(fullname);
2176
- */
2298
+ /**/
21772299
2178
- System.out.println("Loading " + fullname);
2179
- makeSomething(new FileObject(fullname, true), true);
2300
+ //makeSomething(new FileObject(fullname, true), true);
21802301 }
21812302
21822303 void LoadGFDFile(String fullname)
....@@ -2437,11 +2558,11 @@
24372558
24382559 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24392560 {
2440
- if (GrafreeD.standAlone)
2561
+ if (Grafreed.standAlone)
24412562 {
24422563 /**/
24432564 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2444
- browser.show();
2565
+ browser.setVisible(true);
24452566 String filename = browser.getFile();
24462567 if (filename != null && filename.length() > 0)
24472568 {
....@@ -2586,6 +2707,7 @@
25862707 }
25872708 if (input == null)
25882709 {
2710
+ new Exception().printStackTrace();
25892711 System.exit(0);
25902712 }
25912713
....@@ -2792,6 +2914,8 @@
27922914
27932915 void SetMaterial(Object3D object)
27942916 {
2917
+ latestObject = object;
2918
+
27952919 cMaterial mat = object.material;
27962920
27972921 if (mat == null)
....@@ -2800,7 +2924,8 @@
28002924 return;
28012925 }
28022926
2803
- multiplyToggle.setSelected(mat.multiply);
2927
+ if (multiplyToggle != null)
2928
+ multiplyToggle.setSelected(mat.multiply);
28042929
28052930 assert (object.projectedVertices != null);
28062931
....@@ -2902,12 +3027,17 @@
29023027 // }
29033028
29043029 /**/
2905
- if (deselect)
3030
+ if (deselect || child == null)
29063031 {
29073032 //group.deselectAll();
29083033 //freeze = true;
29093034 GetTree().clearSelection();
29103035 //freeze = false;
3036
+
3037
+ if (child == null)
3038
+ {
3039
+ return;
3040
+ }
29113041 }
29123042
29133043 //group.addSelectee(child);
....@@ -2976,7 +3106,7 @@
29763106 cameraView.ToggleDL();
29773107 cameraView.repaint();
29783108 return;
2979
- } else if (event.getSource() == toggleTextureItem)
3109
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29803110 {
29813111 cameraView.ToggleTexture();
29823112 // june 2013 copy.HardTouch();
....@@ -2989,7 +3119,8 @@
29893119 if (timeline)
29903120 {
29913121 centralPanel.remove(cameraView);
2992
- centralPanel.add(timelinePanel);
3122
+ cameraPanel.add(cameraView);
3123
+ centralPanel.add(cameraPanel);
29933124 frame.setJMenuBar(timelineMenubar);
29943125 wasFullScreen = CameraPane.FULLSCREEN;
29953126 if (!CameraPane.FULLSCREEN)
....@@ -2998,7 +3129,7 @@
29983129 }
29993130 else
30003131 {
3001
- centralPanel.remove(timelinePanel);
3132
+ centralPanel.remove(cameraPanel);
30023133 centralPanel.add(cameraView);
30033134 frame.setJMenuBar(null);
30043135 if (!wasFullScreen)
....@@ -3014,9 +3145,9 @@
30143145 frame.validate();
30153146
30163147 return;
3017
- } else if (event.getSource() == toggleRandomItem)
3148
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
30183149 {
3019
- cameraView.ToggleRandom();
3150
+ cameraView.ToggleSwitch();
30203151 cameraView.repaint();
30213152 return;
30223153 } else if (event.getSource() == toggleHandleItem)
....@@ -3045,6 +3176,10 @@
30453176 {
30463177 copy.live ^= true;
30473178 return;
3179
+ } else if (event.getSource() == selectCB)
3180
+ {
3181
+ copy.dontselect ^= true;
3182
+ return;
30483183 } else if (event.getSource() == hideCB)
30493184 {
30503185 copy.hide ^= true;
....@@ -3059,6 +3194,7 @@
30593194 if (event.getSource() == randomCB)
30603195 {
30613196 copy.random ^= true;
3197
+ objEditor.refreshContents();
30623198 return;
30633199 }
30643200 if (event.getSource() == speedupCB)
....@@ -3082,8 +3218,9 @@
30823218
30833219 public void actionPerformed(ActionEvent event)
30843220 {
3221
+ Object source = event.getSource();
30853222 // SCRIPT DIALOG
3086
- if (event.getSource() == okbutton)
3223
+ if (source == okbutton)
30873224 {
30883225 textpanel.setVisible(false);
30893226 textpanel.remove(textarea);
....@@ -3095,7 +3232,7 @@
30953232 textarea = null;
30963233 textpanel = null;
30973234 }
3098
- if (event.getSource() == cancelbutton)
3235
+ if (source == cancelbutton)
30993236 {
31003237 textpanel.setVisible(false);
31013238 textpanel.remove(textarea);
....@@ -3107,49 +3244,50 @@
31073244 //applySelf();
31083245 //client.refreshEditWindow();
31093246 //refreshContents();
3110
- if (event.getSource() == nameField)
3247
+ if (source == nameField)
31113248 {
31123249 //System.out.println("ObjEditor " + event);
31133250 applySelf0(true);
31143251 //parent.applySelf();
31153252 objEditor.refreshContents();
3116
- } else if (event.getSource() == resetButton)
3253
+ } else if (source == resetButton)
31173254 {
31183255 CameraPane.fullreset = true;
31193256 copy.Reset(); // ResetMeshes();
31203257 copy.Touch();
31213258 objEditor.refreshContents();
3122
- } else if (event.getSource() == stepItem)
3259
+ } else if (source == stepItem)
31233260 {
3124
- cameraView.ONESTEP = true;
3261
+ //cameraView.ONESTEP = true;
3262
+ Globals.ONESTEP = true;
31253263 cameraView.repaint();
31263264 return;
3127
- } else if (event.getSource() == stepButton)
3265
+ } else if (source == stepButton)
31283266 {
31293267 copy.Step();
31303268 copy.Touch();
31313269 objEditor.refreshContents();
3132
- } else if (event.getSource() == slowerButton)
3270
+ } else if (source == slowerButton)
31333271 {
31343272 copy.Slower();
31353273 copy.Touch();
31363274 objEditor.refreshContents();
3137
- } else if (event.getSource() == fasterButton)
3275
+ } else if (source == fasterButton)
31383276 {
31393277 copy.Faster();
31403278 copy.Touch();
31413279 objEditor.refreshContents();
3142
- } else if (event.getSource() == remarkButton)
3280
+ } else if (source == remarkButton)
31433281 {
31443282 copy.Remark();
31453283 copy.Touch();
31463284 objEditor.refreshContents();
3147
- } else if (event.getSource() == stepAllButton)
3285
+ } else if (source == stepAllButton)
31483286 {
31493287 copy.StepAll();
31503288 copy.Touch();
31513289 objEditor.refreshContents();
3152
- } else if (event.getSource() == resetAllButton)
3290
+ } else if (source == resetAllButton)
31533291 {
31543292 //CameraPane.fullreset = true;
31553293 copy.ResetAll(); // ResetMeshes();
....@@ -3182,53 +3320,75 @@
31823320 // Close();
31833321 // }
31843322 // else
3185
- if (event.getSource() == resetSlidersButton)
3323
+ if (source == resetSlidersButton)
31863324 {
31873325 ResetSliders();
3188
- } else if (event.getSource() == clearMaterialButton)
3326
+ } else if (source == clearMaterialButton)
31893327 {
31903328 ClearMaterial();
3191
- } else if (event.getSource() == createMaterialButton)
3329
+ } else if (source == createMaterialButton)
31923330 {
31933331 CreateMaterial();
3194
- } else if (event.getSource() == clearPanelButton)
3332
+ } else if (source == clearPanelButton)
31953333 {
31963334 copy.ClearUI();
31973335 refreshContents(true);
3198
- } /*
3199
- }
3200
-
3201
- public boolean action(Event event, Object arg)
3202
- {
3203
- */ 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)
32043361 {
32053362 Close();
32063363 //return true;
3207
- } else if (event.getSource() == loadItem)
3364
+ } else if (source == loadItem)
32083365 {
32093366 load();
32103367 //return true;
3211
- } else if (event.getSource() == saveItem)
3368
+ } else if (source == newItem)
3369
+ {
3370
+ New();
3371
+ } else if (source == saveItem)
32123372 {
32133373 save();
32143374 //return true;
3215
- } else if (event.getSource() == saveAsItem)
3375
+ } else if (source == saveAsItem)
32163376 {
32173377 saveAs();
32183378 //return true;
3219
- } else if (event.getSource() == reexportItem)
3379
+ } else if (source == reexportItem)
32203380 {
32213381 reexport();
32223382 //return true;
3223
- } else if (event.getSource() == exportAsItem)
3383
+ } else if (source == exportAsItem)
32243384 {
32253385 export();
32263386 //return true;
3227
- } else if (event.getSource() == povItem)
3387
+ } else if (source == povItem)
32283388 {
32293389 generatePOV();
32303390 //return true;
3231
- } else if (event.getSource() == zBufferItem)
3391
+ } else if (source == zBufferItem)
32323392 {
32333393 try
32343394 {
....@@ -3250,21 +3410,8 @@
32503410 cameraView.repaint();
32513411 //return true;
32523412 }
3253
- */ else if (event.getSource() == editCameraItem)
3254
- {
3255
- cameraView.ProtectCamera();
3256
- cameraView.repaint();
3257
- return;
3258
- } else if (event.getSource() == revertCameraItem)
3259
- {
3260
- cameraView.RevertCamera();
3261
- cameraView.repaint();
3262
- return;
3263
-// } else if (event.getSource() == textureButton)
3264
-// {
3265
-// return; // true;
3266
- } else // combos...
3267
- if (event.getSource() == texresMenu)
3413
+ */ else // combos...
3414
+ if (source == texresMenu)
32683415 {
32693416 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32703417 copy.texres = texresMenu.getSelectedIndex();
....@@ -3276,27 +3423,302 @@
32763423 }
32773424 }
32783425
3279
- void ToggleAnimation()
3426
+ void New()
32803427 {
3281
- if (!CameraPane.ANIMATION)
3428
+ while (copy.Size() > 1)
32823429 {
3283
- 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);
32843672 browser.show();
32853673 String filename = browser.getFile();
32863674 if (filename != null && filename.length() > 0)
32873675 {
3288
- 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;
32893711 //CameraPane.framecount = 0;
3290
- CameraPane.imagecount = 0;
3712
+ Globals.imagecount = 0;
32913713
3292
- CameraPane.ANIMATION ^= true;
3714
+ Globals.ANIMATION ^= true;
32933715
3294
- GrafreeD.wav.cursor = 0;
3295
- GrafreeD.wav.loop = 0;
3716
+ Grafreed.wav.cursor = 0;
3717
+ Grafreed.wav.loop = 0;
32963718 }
32973719 } else
32983720 {
3299
- CameraPane.ANIMATION ^= true;
3721
+ Globals.ANIMATION ^= true;
33003722 }
33013723 }
33023724
....@@ -3342,7 +3764,7 @@
33423764 void CreateMaterial()
33433765 {
33443766 //copy.ClearMaterial(); // PATCH
3345
- copy.CreateMaterialS(multiplyToggle.isSelected());
3767
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33463768 if (copy.selection.size() > 0)
33473769 //SetMaterial(copy);
33483770 {
....@@ -3393,7 +3815,7 @@
33933815 assert false;
33943816 }
33953817
3396
- void EditSelection()
3818
+ void EditSelection(boolean newWindow)
33973819 {
33983820 }
33993821
....@@ -3401,11 +3823,11 @@
34013823 {
34023824 copy.ResetBlockLoop(); // temporary problem
34033825
3404
- boolean random = CameraPane.RANDOM;
3405
- CameraPane.RANDOM = false; // parse everything
3826
+ boolean random = CameraPane.SWITCH;
3827
+ CameraPane.SWITCH = false; // parse everything
34063828 copy.ResetDisplayList();
34073829 copy.HardTouch();
3408
- CameraPane.RANDOM = random;
3830
+ CameraPane.SWITCH = random;
34093831 }
34103832
34113833 // public void applySelf()
....@@ -3475,10 +3897,40 @@
34753897 current.fakedepth = (float) fakedepthField.getFloat();
34763898 current.shadowbias = (float) shadowbiasField.getFloat();
34773899
3478
- if (!NumberSlider.frozen)
3900
+ if (!cNumberSlider.frozen)
34793901 {
34803902 //System.out.println("Propagate = " + propagate);
34813903 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
+
34823934 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34833935 {
34843936 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3523,6 +3975,7 @@
35233975 || e.getSource() == apertureField
35243976 || e.getSource() == shadowblurField)
35253977 {
3978
+ new Exception().printStackTrace();
35263979 System.exit(0);
35273980 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35283981 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3549,7 +4002,13 @@
35494002 //System.out.println("PARENT = " + parent);
35504003 //if (parent != null)
35514004 // parent.applySelf();
3552
- refreshContents();
4005
+ if (e.getSource() == normalpushField)
4006
+ {
4007
+ objEditor.refreshContents();
4008
+ //Refresh();
4009
+ }
4010
+ else
4011
+ refreshContents();
35534012 // ??? client.refreshEditWindow();
35544013 }
35554014 //else
....@@ -3561,7 +4020,7 @@
35614020 //group.name = nameField.getText();
35624021 //objEditor.applySelf();
35634022
3564
- assert (objEditor == this);
4023
+ // OCT2018: assert (objEditor == this);
35654024 if (copy.selection == null || copy.selection.size() == 0)
35664025 //super.applySelf()
35674026 ; else
....@@ -3585,6 +4044,9 @@
35854044 objEditor.copy = keep;
35864045 }
35874046 }
4047
+
4048
+ if (normalpushField != null)
4049
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35884050 }
35894051
35904052 void SnapObject()
....@@ -3839,7 +4301,7 @@
38394301
38404302 radioPanel.revalidate();
38414303 radioPanel.repaint();
3842
- ctrlPanel.revalidate(); // ? new
4304
+ ctrlPanel.validate(); // ? new
38434305 ctrlPanel.repaint();
38444306 }
38454307 }
....@@ -3848,6 +4310,8 @@
38484310
38494311 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38504312 {
4313
+ if (Globals.SAVEONMAKE) // && resetmodel)
4314
+ Save();
38514315 //Tween.set(thing, 0).target(1).start(tweenManager);
38524316 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38534317 // if (thing instanceof GenericJointDemo)
....@@ -3934,6 +4398,12 @@
39344398 {
39354399 ResetModel();
39364400 Select(thing.GetTreePath(), true, false); // unselect... false);
4401
+
4402
+ if (thing.Size() == 0)
4403
+ {
4404
+ //EditSelection(false);
4405
+ }
4406
+
39374407 refreshContents();
39384408 }
39394409
....@@ -4051,6 +4521,7 @@
40514521 }
40524522 }
40534523 }
4524
+
40544525 LoadGFDThread loadGFDThread;
40554526
40564527 void ReadGFD(String fullname, iCallBack cb)
....@@ -4070,8 +4541,10 @@
40704541
40714542 try
40724543 {
4544
+ // Try compressed version first.
40734545 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4074
- 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);
40754548
40764549 readobj = (Object3D) p.readObject();
40774550 istream.close();
....@@ -4079,7 +4552,20 @@
40794552 readobj.ResetDisplayList();
40804553 } catch (Exception e)
40814554 {
4082
- 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
+ }
40834569 }
40844570 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40854571 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4125,6 +4611,12 @@
41254611
41264612 void LoadIt(Object obj)
41274613 {
4614
+ if (obj == null)
4615
+ {
4616
+ // Invalid file
4617
+ return;
4618
+ }
4619
+
41284620 System.out.println("Loaded " + obj);
41294621 //new Exception().printStackTrace();
41304622 Object3D readobj = (Object3D) obj;
....@@ -4134,6 +4626,8 @@
41344626
41354627 if (readobj != null)
41364628 {
4629
+ if (Globals.SAVEONMAKE)
4630
+ Save();
41374631 try
41384632 {
41394633 //readobj.deepCopySelf(copy);
....@@ -4196,7 +4690,7 @@
41964690
41974691 void load() // throws ClassNotFoundException
41984692 {
4199
- if (GrafreeD.standAlone)
4693
+ if (Grafreed.standAlone)
42004694 {
42014695 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42024696 browser.show();
....@@ -4283,11 +4777,13 @@
42834777 try
42844778 {
42854779 FileOutputStream ostream = new FileOutputStream(lastname);
4286
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4780
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4781
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42874782
42884783 p.writeObject(copy);
42894784 p.flush();
42904785
4786
+ zstream.close();
42914787 ostream.close();
42924788
42934789 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4297,17 +4793,20 @@
42974793 {
42984794 }
42994795 }
4796
+
43004797 String lastname;
43014798
43024799 void saveAs()
43034800 {
4304
- if (GrafreeD.standAlone)
4801
+ if (Grafreed.standAlone)
43054802 {
43064803 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43074804 browser.setVisible(true);
43084805 String filename = browser.getFile();
43094806 if (filename != null && filename.length() > 0)
43104807 {
4808
+ if (!filename.endsWith(".gfd"))
4809
+ filename += ".gfd";
43114810 lastname = browser.getDirectory() + filename;
43124811 save();
43134812 }
....@@ -4406,13 +4905,13 @@
44064905 try
44074906 {
44084907 FileOutputStream ostream = new FileOutputStream(filename);
4409
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4410
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4908
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4909
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44114910
44124911 Object3D objectparent = obj.parent;
44134912 obj.parent = null;
44144913
4415
- Object3D object = (Object3D) GrafreeD.clone(obj);
4914
+ Object3D object = (Object3D) Grafreed.clone(obj);
44164915
44174916 obj.parent = objectparent;
44184917
....@@ -4424,8 +4923,8 @@
44244923 p.writeObject(object);
44254924 p.flush();
44264925
4926
+ zstream.close();
44274927 ostream.close();
4428
- // zstream.close();
44294928
44304929 // group.selection.get(0).parent = parent;
44314930 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4446,7 +4945,7 @@
44464945 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44474946 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44484947 copy.generatePOV(buffer);
4449
- if (GrafreeD.standAlone)
4948
+ if (Grafreed.standAlone)
44504949 {
44514950 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44524951 browser.show();
....@@ -4472,7 +4971,8 @@
44724971 Object3D client;
44734972 Object3D copy;
44744973 MenuBar menuBar;
4475
- Menu windowMenu;
4974
+ Menu fileMenu;
4975
+ MenuItem newItem;
44764976 MenuItem loadItem;
44774977 MenuItem saveItem;
44784978 MenuItem saveAsItem;
....@@ -4480,13 +4980,11 @@
44804980 MenuItem reexportItem;
44814981 MenuItem povItem;
44824982 MenuItem closeItem;
4483
- Menu cameraMenu;
4983
+
44844984 CheckboxMenuItem zBufferItem;
44854985 //MenuItem normalLensItem;
4486
- MenuItem editCameraItem;
4487
- MenuItem revertCameraItem;
4488
- CheckboxMenuItem toggleLiveItem;
44894986 MenuItem stepItem;
4987
+ CheckboxMenuItem toggleLiveItem;
44904988 CheckboxMenuItem toggleFullScreenItem;
44914989 CheckboxMenuItem toggleTimelineItem;
44924990 CheckboxMenuItem toggleRenderItem;
....@@ -4495,28 +4993,42 @@
44954993 CheckboxMenuItem toggleFootContactItem;
44964994 CheckboxMenuItem toggleDLItem;
44974995 CheckboxMenuItem toggleTextureItem;
4498
- CheckboxMenuItem toggleRandomItem;
4996
+ CheckboxMenuItem toggleSwitchItem;
44994997 CheckboxMenuItem toggleRootItem;
45004998 CheckboxMenuItem animationItem;
45014999 CheckboxMenuItem toggleHandleItem;
45025000 CheckboxMenuItem togglePaintItem;
45035001 JSplitPane mainPanel;
45045002 JScrollPane scrollpane;
5003
+
45055004 JPanel toolbarPanel;
4506
- JPanel treePanel;
5005
+
5006
+ cGridBag treePanel;
5007
+
45075008 JPanel radioPanel;
45085009 ButtonGroup buttonGroup;
4509
- JPanel ctrlPanel;
4510
- JPanel materialPanel;
5010
+
5011
+ cGridBag toolboxPanel;
5012
+ cGridBag materialPanel;
5013
+ cGridBag ctrlPanel;
5014
+
45115015 JScrollPane infoPanel;
4512
- JPanel optionsPanel;
5016
+
5017
+ cGridBag optionsPanel;
5018
+
45135019 JTabbedPane objectPanel;
4514
- JPanel XYZPanel;
5020
+ boolean materialFlushed;
5021
+ Object3D latestObject;
5022
+
5023
+ cGridBag XYZPanel;
5024
+
45155025 JSplitPane gridPanel;
45165026 JSplitPane bigPanel;
4517
- JPanel bigThree;
4518
- JTabbedPane scenePanel;
4519
- JPanel centralPanel;
5027
+
5028
+ cGridBag bigThree;
5029
+ cGridBag scenePanel;
5030
+ cGridBag centralPanel;
5031
+ JSplitPane cameraPanel;
45205032 JPanel timelinePanel;
45215033 JMenuBar timelineMenubar;
45225034 JSplitPane framePanel;
....@@ -4568,65 +5080,72 @@
45685080 // MATERIAL
45695081 JLabel materialLabel;
45705082 JLabel colorLabel;
4571
- NumberSlider colorField;
5083
+ cNumberSlider colorField;
45725084 JLabel modulationLabel;
4573
- NumberSlider modulationField;
5085
+ cNumberSlider modulationField;
45745086 JLabel metalnessLabel;
4575
- NumberSlider metalnessField;
5087
+ cNumberSlider metalnessField;
45765088 JLabel diffuseLabel;
4577
- NumberSlider diffuseField;
5089
+ cNumberSlider diffuseField;
45785090 JLabel specularLabel;
4579
- NumberSlider specularField;
5091
+ cNumberSlider specularField;
45805092 JLabel shininessLabel;
4581
- NumberSlider shininessField;
5093
+ cNumberSlider shininessField;
45825094 JLabel shiftLabel;
4583
- NumberSlider shiftField;
5095
+ cNumberSlider shiftField;
45845096 JLabel ambientLabel;
4585
- NumberSlider ambientField;
5097
+ cNumberSlider ambientField;
45865098 JLabel lightareaLabel;
4587
- NumberSlider lightareaField;
5099
+ cNumberSlider lightareaField;
45885100 JLabel diffusenessLabel;
4589
- NumberSlider diffusenessField;
5101
+ cNumberSlider diffusenessField;
45905102 JLabel velvetLabel;
4591
- NumberSlider velvetField;
5103
+ cNumberSlider velvetField;
45925104 JLabel sheenLabel;
4593
- NumberSlider sheenField;
5105
+ cNumberSlider sheenField;
45945106 JLabel subsurfaceLabel;
4595
- NumberSlider subsurfaceField;
5107
+ cNumberSlider subsurfaceField;
45965108 //JLabel bumpLabel;
45975109 //NumberSlider bumpField;
45985110 JLabel backlitLabel;
4599
- NumberSlider backlitField;
5111
+ cNumberSlider backlitField;
46005112 JLabel anisoLabel;
4601
- NumberSlider anisoField;
5113
+ cNumberSlider anisoField;
46025114 JLabel anisoVLabel;
4603
- NumberSlider anisoVField;
5115
+ cNumberSlider anisoVField;
46045116 JLabel cameraLabel;
4605
- NumberSlider cameraField;
5117
+ cNumberSlider cameraField;
46065118 JLabel selfshadowLabel;
4607
- NumberSlider selfshadowField;
5119
+ cNumberSlider selfshadowField;
46085120 JLabel shadowLabel;
4609
- NumberSlider shadowField;
5121
+ cNumberSlider shadowField;
46105122 JLabel textureLabel;
4611
- NumberSlider textureField;
5123
+ cNumberSlider textureField;
46125124 JLabel opacityLabel;
4613
- NumberSlider opacityField;
5125
+ cNumberSlider opacityField;
46145126 JLabel fakedepthLabel;
4615
- NumberSlider fakedepthField;
5127
+ cNumberSlider fakedepthField;
46165128 JLabel shadowbiasLabel;
4617
- NumberSlider shadowbiasField;
5129
+ cNumberSlider shadowbiasField;
46185130 JLabel bumpLabel;
4619
- NumberSlider bumpField;
5131
+ cNumberSlider bumpField;
46205132 JLabel noiseLabel;
4621
- NumberSlider noiseField;
5133
+ cNumberSlider noiseField;
46225134 JLabel powerLabel;
4623
- NumberSlider powerField;
5135
+ cNumberSlider powerField;
46245136 JLabel borderfadeLabel;
4625
- NumberSlider borderfadeField;
5137
+ cNumberSlider borderfadeField;
46265138 JLabel fogLabel;
4627
- NumberSlider fogField;
5139
+ cNumberSlider fogField;
46285140 JLabel opacityPowerLabel;
4629
- NumberSlider opacityPowerField;
4630
- JTree jTree;
5141
+ cNumberSlider opacityPowerField;
5142
+ cTree jTree;
46315143 //ObjectUI parent;
5144
+
5145
+ cNumberSlider normalpushField;
5146
+
5147
+ private MenuItem importGFDItem;
5148
+ private MenuItem importVRMLX3DItem;
5149
+ private MenuItem import3DSItem;
5150
+ private MenuItem importOBJItem;
46325151 }