Normand Briere
2019-06-25 26b24f5b623e709a88e91e9bce0864f9d5e8f084
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -19,6 +20,8 @@
1920 import //weka.core.
2021 matrix.Matrix;
2122
23
+import grafeme.ui.*;
24
+
2225 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2326 ActionListener, ChangeListener,
2427 InputMethodListener,
....@@ -28,7 +31,73 @@
2831 iSendInfo
2932 //KeyListener
3033 {
34
+ boolean timeline;
35
+ boolean wasFullScreen;
3136
37
+ GroupEditor callee;
38
+ JFrame frame;
39
+
40
+ static ObjEditor theFrame;
41
+
42
+ cButton GetButton(String name, boolean border)
43
+ {
44
+ try
45
+ {
46
+ ImageIcon icon = GetIcon(name);
47
+ return new cButton(icon, border);
48
+ }
49
+ catch (Exception e)
50
+ {
51
+ return new cButton(name, border);
52
+ }
53
+ }
54
+
55
+ cToggleButton GetToggleButton(String name, boolean border)
56
+ {
57
+ try
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cToggleButton(icon, border);
61
+ }
62
+ catch (Exception e)
63
+ {
64
+ return new cToggleButton(name, border);
65
+ }
66
+ }
67
+
68
+ cCheckBox GetCheckBox(String name, boolean border)
69
+ {
70
+ try
71
+ {
72
+ ImageIcon icon = GetIcon(name);
73
+ return new cCheckBox(icon, border);
74
+ }
75
+ catch (Exception e)
76
+ {
77
+ return new cCheckBox(name, border);
78
+ }
79
+ }
80
+
81
+ private ImageIcon GetIcon(String name) throws IOException
82
+ {
83
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
84
+
85
+ if (image.getWidth() != 24 && image.getHeight() != 24)
86
+ {
87
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
88
+ Graphics2D g = resized.createGraphics();
89
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
90
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
91
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
92
+ g.dispose();
93
+
94
+ image = resized;
95
+ }
96
+
97
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
98
+ return icon;
99
+ }
100
+
32101 // SCRIPT
33102
34103 transient JFrame textpanel = null;
....@@ -119,51 +188,62 @@
119188 void keyPressed(int key, int modifiers)
120189 {
121190 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
191
+ Globals.theRenderer.keyPressed(key, modifiers);
123192 }
124193 */
125194
126195 static GridBagConstraints aConstraints;
127196 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
197
+
130198 static int GRIDWIDTH = 100; // 4;
131199
132200 public void closeUI()
133201 {
134202 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
203
+// System.out.println("this = " + this);
204
+// System.out.println("objEditor = " + objEditor);
137205 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
206
+// objEditor.ctrlPanel.remove(nameField);
207
+
208
+ objEditor.ctrlPanel.remove(namePanel);
139209
140210 if (!GroupEditor.allparams)
141211 return;
142212
143
- objEditor.ctrlPanel.remove(liveCB);
144
- objEditor.ctrlPanel.remove(hideCB);
145
- objEditor.ctrlPanel.remove(markCB);
146
-
147
- objEditor.ctrlPanel.remove(randomCB);
148
- objEditor.ctrlPanel.remove(speedupCB);
149
- objEditor.ctrlPanel.remove(rewindCB);
150
-
151
- objEditor.ctrlPanel.remove(resetButton);
152
- objEditor.ctrlPanel.remove(stepButton);
153
-// objEditor.ctrlPanel.remove(stepAllButton);
154
-// objEditor.ctrlPanel.remove(resetAllButton);
155
- objEditor.ctrlPanel.remove(link2masterCB);
156
- //objEditor.ctrlPanel.remove(flipVCB);
157
- //objEditor.ctrlPanel.remove(texresMenu);
158
- objEditor.ctrlPanel.remove(slowerButton);
159
- objEditor.ctrlPanel.remove(fasterButton);
160
- objEditor.ctrlPanel.remove(remarkButton);
213
+// objEditor.ctrlPanel.remove(liveCB);
214
+// objEditor.ctrlPanel.remove(hideCB);
215
+// objEditor.ctrlPanel.remove(markCB);
216
+//
217
+// objEditor.ctrlPanel.remove(randomCB);
218
+// objEditor.ctrlPanel.remove(speedupCB);
219
+// objEditor.ctrlPanel.remove(rewindCB);
220
+//
221
+// objEditor.ctrlPanel.remove(resetButton);
222
+// objEditor.ctrlPanel.remove(stepButton);
223
+//// objEditor.ctrlPanel.remove(stepAllButton);
224
+//// objEditor.ctrlPanel.remove(resetAllButton);
225
+// objEditor.ctrlPanel.remove(link2masterCB);
226
+// //objEditor.ctrlPanel.remove(flipVCB);
227
+// //objEditor.ctrlPanel.remove(texresMenu);
228
+// objEditor.ctrlPanel.remove(slowerButton);
229
+// objEditor.ctrlPanel.remove(fasterButton);
230
+// objEditor.ctrlPanel.remove(remarkButton);
231
+
232
+ objEditor.ctrlPanel.remove(setupPanel);
233
+ objEditor.ctrlPanel.remove(setupPanel2);
234
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
235
+ objEditor.ctrlPanel.remove(pushPanel);
236
+ //objEditor.ctrlPanel.remove(fillPanel);
237
+
238
+ //Remove(normalpushField);
161239 }
162240
163241 public ObjEditor GetEditor()
164242 {
165243 return objEditor; //.GetEditor();
166244 }
245
+
246
+ // Sometimes myself, sometimes my callee's.
167247 ObjEditor objEditor;
168248
169249 /*
....@@ -226,6 +306,7 @@
226306 //localCopy.parent = null;
227307
228308 frame = new JFrame();
309
+ frame.setUndecorated(true);
229310 objEditor = this;
230311 this.callee = callee;
231312
....@@ -238,7 +319,7 @@
238319 //if (!isDisplayable())
239320 //setUndecorated(true);
240321
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
322
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242323 client = inClient;
243324 copy = localCopy;
244325 copy.editWindow = this;
....@@ -259,24 +340,40 @@
259340 void SetupMenu()
260341 {
261342 frame.setMenuBar(menuBar = new MenuBar());
262
- menuBar.add(windowMenu = new Menu("File"));
263
- windowMenu.add(loadItem = new MenuItem("Load..."));
264
- windowMenu.add("-");
265
- windowMenu.add(saveItem = new MenuItem("Save"));
266
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
343
+ menuBar.add(fileMenu = new Menu("File"));
344
+ fileMenu.add(newItem = new MenuItem("New"));
345
+ fileMenu.add(loadItem = new MenuItem("Open..."));
346
+
347
+ //oe.menuBar.add(menu = new Menu("Include"));
348
+ Menu menu = new Menu("Import");
349
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
350
+ importOBJItem.addActionListener(this);
351
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
352
+ import3DSItem.addActionListener(this);
353
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
354
+ importVRMLX3DItem.addActionListener(this);
355
+ menu.add("-");
356
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
357
+ importGFDItem.addActionListener(this);
358
+ fileMenu.add(menu);
359
+ fileMenu.add("-");
360
+
361
+ fileMenu.add(saveItem = new MenuItem("Save"));
362
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
267363 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
268
- windowMenu.add("-");
269
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
270
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
271
- windowMenu.add("-");
364
+ fileMenu.add("-");
365
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
366
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
367
+ fileMenu.add("-");
272368 if (client.parent != null)
273369 {
274
- windowMenu.add(closeItem = new MenuItem("Close"));
370
+ fileMenu.add(closeItem = new MenuItem("Close"));
275371 } else
276372 {
277
- windowMenu.add(closeItem = new MenuItem("Exit"));
373
+ fileMenu.add(closeItem = new MenuItem("Exit"));
278374 }
279375
376
+ newItem.addActionListener(this);
280377 loadItem.addActionListener(this);
281378 saveItem.addActionListener(this);
282379 saveAsItem.addActionListener(this);
....@@ -285,77 +382,59 @@
285382 //povItem.addActionListener(this);
286383 closeItem.addActionListener(this);
287384
288
- menuBar.add(cameraMenu = new Menu("View"));
289
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
290
- //zBufferItem.addActionListener(this);
291
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
292
- //normalLensItem.addActionListener(this);
293
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294
- revertCameraItem.addActionListener(this);
295
- cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullItem.addItemListener(this);
297
- toggleFullItem.setState(CameraPane.FULLSCREEN);
298
- cameraMenu.add("-");
299
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
300
- toggleTextureItem.addItemListener(this);
301
- toggleTextureItem.setState(CameraPane.textureon);
302
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
303
- toggleLiveItem.addItemListener(this);
304
- toggleLiveItem.setState(CameraPane.isLIVE());
305
- cameraMenu.add(stepItem = new MenuItem("Step"));
306
- stepItem.addActionListener(this);
307
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
308
-// toggleDLItem.addItemListener(this);
309
-// toggleDLItem.setState(false);
310
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
311
- toggleRenderItem.addItemListener(this);
312
- toggleRenderItem.setState(!CameraPane.frozen);
313
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
314
- toggleDebugItem.addItemListener(this);
315
- toggleDebugItem.setState(CameraPane.DEBUG);
316
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
317
- toggleFrustumItem.addItemListener(this);
318
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
319
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
320
- toggleFootContactItem.addItemListener(this);
321
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
322
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
323
- toggleRandomItem.addItemListener(this);
324
- toggleRandomItem.setState(CameraPane.RANDOM);
325
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
326
- toggleHandleItem.addItemListener(this);
327
- toggleHandleItem.setState(CameraPane.HANDLES);
328
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
329
- togglePaintItem.addItemListener(this);
330
- togglePaintItem.setState(CameraPane.PAINTMODE);
331
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
332
-// toggleRootItem.addItemListener(this);
333
-// toggleRootItem.setState(false);
334
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
335
-// animationItem.addItemListener(this);
336
-// animationItem.setState(CameraPane.ANIMATION);
337
- cameraMenu.add("-");
338
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
339
- editCameraItem.addActionListener(this);
340
-
341385 objectPanel = new JTabbedPane();
386
+
387
+ ChangeListener changeListener = new ChangeListener()
388
+ {
389
+ public void stateChanged(ChangeEvent changeEvent)
390
+ {
391
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
392
+// {
393
+// if (latestObject != null)
394
+// {
395
+// refreshContents(true);
396
+// SetMaterial(latestObject);
397
+// }
398
+//
399
+// materialFlushed = true;
400
+// }
401
+
402
+ refreshContents(false); // To refresh Info tab
403
+ }
404
+ };
405
+ objectPanel.addChangeListener(changeListener);
406
+
342407 toolbarPanel = new JPanel();
343408 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
409
+ treePanel = new cGridBag();
345410 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
347
- ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
411
+
412
+ editPanel = new cGridBag().setVertical(true);
413
+ editPanel.setName("Edit");
414
+
415
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
416
+
417
+ editCommandsPanel = new cGridBag();
418
+ editPanel.add(editCommandsPanel);
419
+ editPanel.add(ctrlPanel);
420
+
421
+ toolboxPanel = new cGridBag().setVertical(false);
422
+ toolboxPanel.setName("Toolbox");
423
+
424
+ materialPanel = new cGridBag().setVertical(true);
349425 materialPanel.setName("Material");
426
+
350427 /*JTextPane*/
351428 infoarea = createTextPane();
429
+ doc = infoarea.getStyledDocument();
430
+
352431 infoarea.setEditable(true);
353432 SetText();
354433 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355434 // infoarea.setOpaque(false);
356435 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
436
+// TEXTAREA infoarea.setLineWrap(true);
437
+// TEXTAREA infoarea.setWrapStyleWord(true);
359438 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
360439 infoPanel.setPreferredSize(new Dimension(50, 200));
361440 infoPanel.setName("Info");
....@@ -366,16 +445,16 @@
366445 mainPanel.setName("Main");
367446 mainPanel.setContinuousLayout(true);
368447 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370448 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
449
+ mainPanel.setDividerLocation(0.5); //1.0);
450
+ mainPanel.setResizeWeight(0.5);
372451
373452 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374453 //mainPanel.setLayout(new GridBagLayout());
375454 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
455
+// treePanel.setLayout(new GridBagLayout());
456
+ //ctrlPanel.setLayout(new GridBagLayout());
457
+ //materialPanel.setLayout(new GridBagLayout());
379458
380459 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381460 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +493,7 @@
414493 static String newline = "\n";
415494 protected static final String buttonString = "JButton";
416495 StyledDocument doc;
417
- JTextArea infoarea;
496
+ JTextPane infoarea;
418497
419498 void ClearInfo()
420499 {
....@@ -437,10 +516,10 @@
437516 e.printStackTrace();
438517 }
439518
440
- String selection = infoarea.getText();
441
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
442
- java.awt.datatransfer.Clipboard clipboard =
443
- Toolkit.getDefaultToolkit().getSystemClipboard();
519
+// String selection = infoarea.getText();
520
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
521
+// java.awt.datatransfer.Clipboard clipboard =
522
+// Toolkit.getDefaultToolkit().getSystemClipboard();
444523 //clipboard.setContents(data, data);
445524 }
446525
....@@ -463,13 +542,13 @@
463542 //SendInfo("Name:", "bold");
464543 if (sel.GetTextures() != null || debug)
465544 {
466
- si.SendInfo(sel.toString(), "bold");
545
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
467546 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
468547 if (sel.Size() > 0)
469548 {
470549 si.SendInfo("#children = " + sel.Size(), "regular");
471550 }
472
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
551
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
473552 if (debug)
474553 {
475554 try
....@@ -481,7 +560,10 @@
481560 }
482561
483562 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
563
+ {
564
+ si.SendInfo(" BBox min: " + minima, "regular");
565
+ si.SendInfo(" BBox max: " + maxima, "regular");
566
+ }
485567
486568 if (sel.bRep != null)
487569 {
....@@ -508,7 +590,7 @@
508590 }
509591 if (sel.support != null)
510592 {
511
- si.SendInfo(" support: " + sel.support, "regular");
593
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
512594 }
513595 if (sel.scriptnode != null)
514596 {
....@@ -579,6 +661,9 @@
579661 {
580662 CameraPane.pointflow = (PointFlow) sel;
581663 }
664
+
665
+ si.SendInfo("_____________________", "regular");
666
+ si.SendInfo("", "regular");
582667 }
583668 }
584669
....@@ -594,52 +679,140 @@
594679 }
595680 }
596681
597
- private JTextArea createTextPane()
598
- {
599
- String[] initString =
600
- {
601
- "This is an editable JTextPane, ", //regular
602
- "another ", //italic
603
- "styled ", //bold
604
- "text ", //small
605
- "component, ", //large
606
- "which supports embedded components..." + newline,//regular
607
- " " + newline, //button
608
- "...and embedded icons..." + newline, //regular
609
- " ", //icon
610
- newline + "JTextPane is a subclass of JEditorPane that "
611
- + "uses a StyledEditorKit and StyledDocument, and provides "
612
- + "cover methods for interacting with those objects."
613
- };
682
+static GraphicsDevice device = GraphicsEnvironment
683
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
614684
615
- String[] initStyles =
616
- {
617
- "regular", "italic", "bold", "small", "large",
618
- "regular", "button", "regular", "icon",
619
- "regular"
620
- };
685
+ Rectangle keeprect;
686
+ cRadio radio;
687
+
688
+cButton keepButton;
689
+ cButton twoButton; // Full 3D
690
+ cButton sixButton;
691
+ cButton threeButton;
692
+ cButton sevenButton;
693
+ cButton fourButton; // full panel
694
+ cButton oneButton; // full XYZ
695
+ //cButton currentLayout;
696
+
697
+ boolean maximized;
698
+
699
+ cButton fullscreenLayout;
621700
622
- JTextPane textPane = new JTextPane();
623
- textPane.setEditable(true);
624
- /*StyledDocument*/ doc = textPane.getStyledDocument();
625
- addStylesToDocument(doc);
626
-
627
- try
701
+ void Minimize()
628702 {
629
- for (int j = 0; j < 2; j++)
703
+ frame.setState(Frame.ICONIFIED);
704
+ }
705
+
706
+ void Maximize()
707
+ {
708
+ if (maximized)
630709 {
631
- for (int i = 0; i < initString.length; i++)
632
- {
633
- doc.insertString(doc.getLength(), initString[i],
634
- doc.getStyle(initStyles[i]));
635
- }
710
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
636711 }
637
- } catch (BadLocationException ble)
712
+ else
713
+ {
714
+ keeprect = frame.getBounds();
715
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
716
+ Dimension rect2 = frame.getToolkit().getScreenSize();
717
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
718
+// frame.setState(Frame.MAXIMIZED_BOTH);
719
+ }
720
+
721
+ maximized ^= true;
722
+ }
723
+
724
+ void ToggleFullScreen()
638725 {
639
- System.err.println("Couldn't insert initial text into text pane.");
726
+ cameraView.ToggleFullScreen();
727
+
728
+ if (!CameraPane.FULLSCREEN)
729
+ {
730
+ device.setFullScreenWindow(null);
731
+ //frame.setVisible(false);
732
+// frame.removeNotify();
733
+// frame.setUndecorated(false);
734
+// frame.addNotify();
735
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
736
+
737
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
738
+// X framePanel.add(bigThree);
739
+// X frame.getContentPane().add(/*"Center",*/framePanel);
740
+ framePanel.setDividerLocation(1);
741
+
742
+ //frame.setVisible(true);
743
+ radio.layout = keepButton;
744
+ //theFrame = null;
745
+ keepButton = null;
746
+ radio.layout.doClick();
747
+
748
+ } else
749
+ {
750
+ keepButton = radio.layout;
751
+ //keeprect = frame.getBounds();
752
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
753
+// frame.getToolkit().getScreenSize().height);
754
+ //frame.setVisible(false);
755
+ device.setFullScreenWindow(frame);
756
+// frame.removeNotify();
757
+// frame.setUndecorated(true);
758
+// frame.addNotify();
759
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
760
+// X framePanel.remove(bigThree);
761
+// X frame.getContentPane().add(/*"Center",*/bigThree);
762
+ framePanel.setDividerLocation(0);
763
+
764
+ radio.layout = fullscreenLayout;
765
+ radio.layout.doClick();
766
+ //frame.setVisible(true);
767
+ }
640768 }
641769
642
- return new JTextArea(); // textPane;
770
+ private JTextPane createTextPane()
771
+ {
772
+// TEXTAREA String[] initString =
773
+// {
774
+// "This is an editable JTextPane, ", //regular
775
+// "another ", //italic
776
+// "styled ", //bold
777
+// "text ", //small
778
+// "component, ", //large
779
+// "which supports embedded components..." + newline,//regular
780
+// " " + newline, //button
781
+// "...and embedded icons..." + newline, //regular
782
+// " ", //icon
783
+// newline + "JTextPane is a subclass of JEditorPane that "
784
+// + "uses a StyledEditorKit and StyledDocument, and provides "
785
+// + "cover methods for interacting with those objects."
786
+// };
787
+//
788
+// String[] initStyles =
789
+// {
790
+// "regular", "italic", "bold", "small", "large",
791
+// "regular", "button", "regular", "icon",
792
+// "regular"
793
+// };
794
+//
795
+// JTextPane textPane = new JTextPane();
796
+// textPane.setEditable(true);
797
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
798
+// addStylesToDocument(doc);
799
+//
800
+// try
801
+// {
802
+// for (int j = 0; j < 2; j++)
803
+// {
804
+// for (int i = 0; i < initString.length; i++)
805
+// {
806
+// doc.insertString(doc.getLength(), initString[i],
807
+// doc.getStyle(initStyles[i]));
808
+// }
809
+// }
810
+// } catch (BadLocationException ble)
811
+// {
812
+// System.err.println("Couldn't insert initial text into text pane.");
813
+// }
814
+
815
+ return new JTextPane(); // textPane;
643816 }
644817
645818 protected void addStylesToDocument(StyledDocument doc)
....@@ -692,7 +865,7 @@
692865 protected static ImageIcon createImageIcon(String path,
693866 String description)
694867 {
695
- java.net.URL imgURL = GrafreeD.class.getResource(path);
868
+ java.net.URL imgURL = Grafreed.class.getResource(path);
696869 if (imgURL != null)
697870 {
698871 return new ImageIcon(imgURL, description);
....@@ -724,6 +897,7 @@
724897 // NumberSlider vDivsField;
725898 // JCheckBox endcaps;
726899 JCheckBox liveCB;
900
+ JCheckBox selectCB;
727901 JCheckBox hideCB;
728902 JCheckBox link2masterCB;
729903 JCheckBox markCB;
....@@ -731,7 +905,12 @@
731905 JCheckBox speedupCB;
732906 JCheckBox rewindCB;
733907 JCheckBox flipVCB;
908
+
909
+ cCheckBox toggleTextureCB;
910
+ cCheckBox toggleSwitchCB;
911
+
734912 JComboBox texresMenu;
913
+
735914 JButton resetButton;
736915 JButton stepButton;
737916 JButton stepAllButton;
....@@ -739,115 +918,87 @@
739918 JButton slowerButton;
740919 JButton fasterButton;
741920 JButton remarkButton;
921
+
922
+ cGridBag editPanel;
923
+ cGridBag editCommandsPanel;
924
+
925
+ cGridBag namePanel;
926
+ cGridBag setupPanel;
927
+ cGridBag setupPanel2;
928
+ cGridBag objectCommandsPanel;
929
+ cGridBag pushPanel;
930
+ cGridBag fillPanel;
742931
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
932
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
744933 {
745934 JCheckBox cb;
746935
747
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
748
- oe.aConstraints.gridwidth = 1; // 3;
749
-// oe.aConstraints.weightx = 1;
750
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
751
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
936
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
752937 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
756938
757939 return cb;
758940 }
759941
760
- cButton AddButton(ObjEditor oe, String label)
942
+ cButton AddButton(cGridBag panel, String label)
761943 {
762944 cButton cb;
763945
764
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
765
- oe.aConstraints.gridwidth = 1;
766
-// oe.aConstraints.weightx = 1;
767
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
768
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
946
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
769947 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
773948
774949 return cb;
775950 }
776951
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
952
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
778953 {
779954 JComboBox combo;
780955
781
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
782
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
783
- oe.aConstraints.gridx += 1;
956
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
784957 combo.addActionListener(this);
785958
786959 return combo;
787960 }
788961
789
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
962
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
790963 {
791
- NumberSlider combo;
964
+ cGridBag control = new cGridBag();
965
+
966
+ cNumberSlider combo;
792967
793968 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
796969 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
797
- aConstraints.gridwidth = 2;
798
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
799
- aConstraints.gridx += 1;
800
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
801
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
802
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
803
- aConstraints.gridx += 1;
804
- aConstraints.gridwidth = 1;
805
-
970
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
971
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
806972 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
973
+
974
+ panel.add(control);
975
+
976
+ return control;
813977 }
814978
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
979
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
816980 {
817
- NumberSlider combo;
981
+ cGridBag control = new cGridBag();
982
+
983
+ cNumberSlider combo;
818984
819985 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822986 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
823
- aConstraints.gridwidth = 2;
824
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
825
- aConstraints.gridx += 1;
826
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
827
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
828
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
829
- aConstraints.gridx += 1;
830
- aConstraints.gridwidth = 1;
831
-
987
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
988
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832989 combo.setInteger(current);
833990
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
991
+ panel.add(control);
992
+
993
+ return control;
839994 }
840995
841
- JTextArea AddText(JPanel ctrlPanel, String name)
996
+ JTextArea AddText(cGridBag ctrlPanel, String name)
842997 {
843998 JTextArea text;
844999
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1000
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8481001 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
8511002
8521003 return text;
8531004 }
....@@ -877,9 +1028,16 @@
8771028 objEditor.ctrlPanel.remove(j);
8781029 }
8791030
1031
+ void Remove(cNumberSlider j)
1032
+ {
1033
+ j.removeChangeListener(this);
1034
+ //objEditor.ctrlPanel.remove(j.label);
1035
+ objEditor.ctrlPanel.remove(j);
1036
+ }
1037
+
8801038 /*
8811039 */
882
- void Return() // ObjEditor oe)
1040
+ void Return0() // ObjEditor oe)
8831041 {
8841042 aConstraints.gridy += 1;
8851043 aConstraints.gridx = 0;
....@@ -934,35 +1092,77 @@
9341092
9351093 void SetupUI2(ObjEditor oe)
9361094 {
937
-// oe.aConstraints.weightx = 0;
938
-// oe.aConstraints.weighty = 0;
939
-// oe.aConstraints.gridx = 0;
940
-// oe.aConstraints.gridy = 0;
941
- SetupName(oe);
1095
+ //SetupName(oe);
1096
+
1097
+ namePanel = new cGridBag();
1098
+
1099
+ nameField = AddText(namePanel, copy.GetName());
1100
+ namePanel.add(nameField);
1101
+ oe.ctrlPanel.add(namePanel);
1102
+
1103
+ oe.ctrlPanel.Return();
9421104
9431105 if (!GroupEditor.allparams)
9441106 return;
9451107
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1108
+ setupPanel = new cGridBag().setVertical(false);
1109
+
1110
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1111
+ liveCB.setToolTipText("Animate object");
1112
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1113
+ selectCB.setToolTipText("Make object selectable");
9491114 // Return();
950
- markCB = AddCheckBox(oe, "Mark", copy.marked);
951
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
952
- randomCB = AddCheckBox(oe, "Rand", copy.random);
953
- Return();
954
- resetButton = AddButton(oe, "Reset");
955
- stepButton = AddButton(oe, "Step");
1115
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1116
+ hideCB.setToolTipText("Hide object");
1117
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1118
+ markCB.setToolTipText("Set the animation target transform");
1119
+
1120
+ setupPanel2 = new cGridBag().setVertical(false);
1121
+
1122
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1123
+ rewindCB.setToolTipText("Rewind animation");
1124
+
1125
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1126
+ randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1127
+
1128
+ if (Globals.ADVANCED)
1129
+ {
1130
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1131
+ link2masterCB.setToolTipText("Attach to support");
1132
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1133
+ speedupCB.setToolTipText("Option motion capture");
1134
+ }
1135
+
1136
+ oe.ctrlPanel.add(setupPanel);
1137
+ oe.ctrlPanel.Return();
1138
+ oe.ctrlPanel.add(setupPanel2);
1139
+ oe.ctrlPanel.Return();
1140
+
1141
+ objectCommandsPanel = new cGridBag().setVertical(false);
1142
+
1143
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1144
+ resetButton.setToolTipText("Jump to frame zero");
1145
+ stepButton = AddButton(objectCommandsPanel, "Step");
1146
+ stepButton.setToolTipText("Step one frame");
9561147 // resetAllButton = AddButton(oe, "Reset All");
9571148 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9591149 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- remarkButton = AddButton(oe, "Rem");
1150
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1151
+ slowerButton.setToolTipText("Decrease animation speed");
1152
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1153
+ fasterButton.setToolTipText("Increase animation speed");
1154
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1155
+ remarkButton.setToolTipText("Set the current transform as the target");
9631156
964
- Return();
1157
+ oe.ctrlPanel.add(objectCommandsPanel);
1158
+ oe.ctrlPanel.Return();
9651159
1160
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1161
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1162
+ //Return();
1163
+
1164
+ oe.ctrlPanel.Return();
1165
+
9661166 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671167 // ObjEditor.aConstraints.gridx += 1;
9681168
....@@ -1056,7 +1256,7 @@
10561256 oe.aConstraints.gridwidth = 1;
10571257 /**/
10581258 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1259
+ oe.ctrlPanel.Return();
10601260
10611261 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621262 //textureButton.setEnabled(false);
....@@ -1158,10 +1358,28 @@
11581358 //JPanel worldPanel =
11591359 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601360 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1361
+ centralPanel = new cGridBag();
1362
+ centralPanel.preferredWidth = 20;
1363
+
1364
+ if (Globals.ADVANCED)
1365
+ {
1366
+ timelinePanel = new JPanel(new BorderLayout());
1367
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11641368
1369
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1370
+ cameraPanel.setContinuousLayout(true);
1371
+ cameraPanel.setOneTouchExpandable(true);
1372
+// cameraPanel.setDividerLocation(0.9);
1373
+// cameraPanel.setDividerSize(9);
1374
+ cameraPanel.setResizeWeight(1.0);
1375
+
1376
+ }
1377
+
1378
+ centralPanel.add(cameraView);
1379
+ centralPanel.setFocusable(true);
1380
+ //frame.setJMenuBar(timelineMenubar);
1381
+ //centralPanel.add(timelinePanel);
1382
+
11651383 //topView.camera = ;
11661384 //frontView.camera = new Camera(2);
11671385 //sideView.camera = new Camera(3);
....@@ -1177,12 +1395,13 @@
11771395 //frontView.object = copy;
11781396 //sideView.object = copy;
11791397
1180
- XYZPanel = new JPanel();
1181
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1398
+ XYZPanel = new cGridBag().setVertical(true);
1399
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11821400
1183
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1184
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1401
+ XYZPanel.preferredWidth = 5;
1402
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1403
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1404
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
11861405
11871406 /*
11881407 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1191,7 +1410,7 @@
11911410 gridPanel.add(cameraView);
11921411 gridPanel.add(XYZPanel);
11931412 */
1194
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1413
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11951414 gridPanel.setContinuousLayout(true);
11961415 gridPanel.setOneTouchExpandable(true);
11971416 gridPanel.setDividerLocation(1.0);
....@@ -1220,10 +1439,12 @@
12201439 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12211440 //tmp.setName("Edit");
12221441 objectPanel.add(materialPanel);
1223
- JPanel north = new JPanel(new BorderLayout());
1224
- north.setName("Edit");
1225
- north.add(ctrlPanel, BorderLayout.NORTH);
1226
- objectPanel.add(north);
1442
+ objectPanel.add(toolboxPanel);
1443
+// JPanel north = new JPanel(new BorderLayout());
1444
+// north.setName("Edit");
1445
+// north.add(ctrlPanel, BorderLayout.NORTH);
1446
+// objectPanel.add(north);
1447
+ objectPanel.add(editPanel);
12271448 objectPanel.add(infoPanel);
12281449
12291450 /*
....@@ -1244,16 +1465,23 @@
12441465 scrollpane.setWheelScrollingEnabled(true);
12451466 scrollpane.addMouseWheelListener(this); // Default not fast enough
12461467
1247
- /*JTabbedPane*/ jtp = new JTabbedPane();
1248
- jtp.add(scrollpane);
1468
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1469
+ scenePanel.preferredWidth = 6;
1470
+
1471
+ JTabbedPane tabbedPane = new JTabbedPane();
1472
+ tabbedPane.add(scrollpane);
12491473
1250
- jtp.add(FSPane = new cFileSystemPane(this));
1251
-
1252
- optionsPanel = new JPanel(new GridBagLayout());
1474
+ optionsPanel = new cGridBag().setVertical(false);
12531475
12541476 optionsPanel.setName("Options");
1255
- jtp.add(optionsPanel);
1477
+
1478
+ AddOptions(optionsPanel); //, aConstraints);
1479
+
1480
+ tabbedPane.add(optionsPanel);
1481
+
1482
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12561483
1484
+ scenePanel.add(tabbedPane);
12571485
12581486 /*
12591487 cTree jTree = new cTree(null);
....@@ -1275,7 +1503,7 @@
12751503 jtp.add(tree);
12761504 */
12771505
1278
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);
1506
+ bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
12791507 bigPanel.setContinuousLayout(true);
12801508 bigPanel.setOneTouchExpandable(true);
12811509 bigPanel.setDividerLocation(0.8);
....@@ -1287,6 +1515,7 @@
12871515 //bigPanel.setSize(new Dimension(10,10));
12881516 //bigPanel.add(ctrlPanel);
12891517 //bigPanel.add(gridPanel);
1518
+ /**
12901519 bigThree = new JPanel();
12911520 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12921521 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1297,20 +1526,26 @@
12971526 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
12981527 aWindowConstraints.weightx = 0;
12991528 aWindowConstraints.weighty = 1;
1300
- bigThree.add(jtp, aWindowConstraints);
1529
+ bigThree.add(scenePanel, aWindowConstraints);
13011530 aWindowConstraints.weightx = 1;
13021531 aWindowConstraints.gridwidth = 3;
13031532 // aConstraints.gridheight = 3;
13041533 aWindowConstraints.gridx = 1;
13051534 aWindowConstraints.fill = GridBagConstraints.BOTH;
1306
- bigThree.add(cameraPanel, aWindowConstraints);
1535
+ bigThree.add(centralPanel, aWindowConstraints);
13071536 aWindowConstraints.weightx = 0;
13081537 aWindowConstraints.gridx = 4;
13091538 aWindowConstraints.gridwidth = 1;
13101539 // aConstraints.gridheight = 3;
13111540 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13121541 bigThree.add(XYZPanel, aWindowConstraints);
1542
+ /**/
13131543
1544
+ bigThree = new cGridBag();
1545
+ bigThree.addComponent(scenePanel);
1546
+ bigThree.addComponent(centralPanel);
1547
+ bigThree.addComponent(XYZPanel);
1548
+
13141549 // // SIDE EFFECT!!!
13151550 // aConstraints.gridx = 0;
13161551 // aConstraints.gridy = 0;
....@@ -1331,14 +1566,19 @@
13311566 //worldPane.add(bigPanel);
13321567 //worldPane.add(worldPanel);
13331568 /**/
1334
- frame.getContentPane().add(/*"Center",*/framePanel);
1569
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1570
+ frame.add(/*"Center",*/framePanel);
13351571 //frame.getContentPane().add(/*"Center",*/ worldPane);
13361572
13371573 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13381574
1339
- frame.setSize(1024, 768);
1340
- frame.show();
1575
+ frame.setSize(1280, 860);
1576
+
1577
+ frame.validate();
1578
+ frame.setVisible(true);
13411579
1580
+ cameraView.requestFocusInWindow();
1581
+
13421582 gridPanel.setDividerLocation(1.0);
13431583
13441584 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1352,6 +1592,10 @@
13521592 });
13531593 }
13541594
1595
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1596
+ {
1597
+ }
1598
+
13551599 JTree GetTree()
13561600 {
13571601 return objEditor.jTree;
....@@ -1363,260 +1607,173 @@
13631607 ctrlPanel.removeAll();
13641608 }
13651609
1366
- void SetupMaterial(JPanel ctrlPanel)
1610
+ void SetupMaterial(cGridBag panel)
13671611 {
1368
- aConstraints.weighty = 0;
1369
- //aConstraints.weightx = 1;
1370
- /*
1612
+ /*
13711613 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13721614 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1373
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1374
- aConstraints.gridx += 1;
13751615 */
13761616
1377
- aConstraints.gridwidth = 1;
1378
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1379
- aConstraints.gridx += 1;
1380
- aConstraints.weighty = 0;
1381
- aConstraints.gridwidth = 1;
1617
+ cGridBag editBar = new cGridBag().setVertical(false);
1618
+
1619
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1620
+ createMaterialButton.setToolTipText("Create material");
13821621
13831622 /*
13841623 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
13881624 */
13891625
1390
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1391
- aConstraints.gridx += 1;
1626
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1627
+ clearMaterialButton.setToolTipText("Clear material");
1628
+
1629
+ if (Globals.ADVANCED)
1630
+ {
1631
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1632
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1633
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1634
+ }
13921635
1393
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1394
-
1395
- aConstraints.gridx += 1;
1396
-
1397
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1398
-
1399
- aConstraints.gridx += 1;
1400
-
1401
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1402
-
1403
- aConstraints.gridx = 0;
1404
- aConstraints.gridy += 1;
1405
- aConstraints.weighty = 0;
1406
- aConstraints.gridwidth = 1;
1636
+ editBar.preferredHeight = 15;
1637
+
1638
+ panel.add(editBar);
1639
+
14071640 /**/
14081641 //aConstraints.weighty = 0;
14091642 ////aConstraints.weightx = 1;
14101643 //aConstraints.weighty = 1;
14111644 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14121645 //aConstraints.gridx += 1;
1413
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1414
- aConstraints.weighty = 0;
1415
- aConstraints.gridx = 0;
1416
- aConstraints.gridy += 1;
1417
- aConstraints.gridwidth = 1;
1646
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14181647
1419
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1420
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1421
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1422
- aConstraints.gridx += 1;
1423
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1424
- //aConstraints.weightx = 0;
1425
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1426
- aConstraints.gridx = 0;
1427
- aConstraints.gridy += 1;
1428
- aConstraints.gridwidth = 1;
1648
+ cGridBag colorSection = new cGridBag().setVertical(true);
1649
+
1650
+ cGridBag color = new cGridBag();
1651
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1652
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1653
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1654
+ //colorField.preferredWidth = 200;
1655
+ colorSection.add(color);
14291656
1430
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1431
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1432
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1433
- aConstraints.gridx += 1;
1434
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1435
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1436
- aConstraints.gridx = 0;
1437
- aConstraints.gridy += 1;
1438
- aConstraints.gridwidth = 1;
1657
+ cGridBag modulation = new cGridBag();
1658
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1659
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1660
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1661
+ colorSection.add(modulation);
14391662
1440
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1441
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1442
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1443
- aConstraints.gridx += 1;
1444
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1445
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1446
- aConstraints.gridx = 0;
1447
- aConstraints.gridy += 1;
1448
- aConstraints.gridwidth = 1;
1663
+ cGridBag texture = new cGridBag();
1664
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1665
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1666
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1667
+ colorSection.add(texture);
14491668
1450
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1451
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1452
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1453
- aConstraints.gridx += 1;
1454
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1455
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1456
- aConstraints.gridx = 0;
1457
- aConstraints.gridy += 1;
1458
- aConstraints.gridwidth = 1;
1669
+ cGridBag anisoU = new cGridBag();
1670
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1671
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1672
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1673
+ colorSection.add(anisoU);
14591674
1460
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1461
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1462
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1463
- aConstraints.gridx += 1;
1464
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1465
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1466
- aConstraints.gridx = 0;
1467
- aConstraints.gridy += 1;
1468
- aConstraints.gridwidth = 1;
1675
+ cGridBag anisoV = new cGridBag();
1676
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1677
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1678
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1679
+ colorSection.add(anisoV);
14691680
1470
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1471
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1472
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1473
- aConstraints.gridx += 1;
1474
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1475
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1476
- aConstraints.gridx = 0;
1477
- aConstraints.gridy += 1;
1478
- aConstraints.gridwidth = 1;
1681
+ cGridBag shadowbias = new cGridBag();
1682
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1683
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1684
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1685
+ colorSection.add(shadowbias);
14791686
1480
- //aConstraints.weighty = 1;
1481
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1482
- //aConstraints.gridx += 1;
1483
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1484
- aConstraints.weighty = 0;
1485
- aConstraints.gridx = 0;
1486
- aConstraints.gridy += 1;
1487
- aConstraints.gridwidth = 1;
1687
+ panel.add(new JSeparator());
1688
+
1689
+ panel.add(colorSection);
1690
+
1691
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1692
+
1693
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1694
+
1695
+ cGridBag diffuse = new cGridBag();
1696
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1697
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1699
+ diffuseSection.add(diffuse);
14881700
1489
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1490
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1491
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1492
- aConstraints.gridx += 1;
1493
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1494
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1495
- aConstraints.gridx = 0;
1496
- aConstraints.gridy += 1;
1497
- aConstraints.gridwidth = 1;
1701
+ cGridBag diffuseness = new cGridBag();
1702
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1703
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1704
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1705
+ diffuseSection.add(diffuseness);
14981706
1499
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1500
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1501
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1502
- aConstraints.gridx += 1;
1503
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1504
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1505
- aConstraints.gridx = 0;
1506
- aConstraints.gridy += 1;
1507
- aConstraints.gridwidth = 1;
1707
+ cGridBag selfshadow = new cGridBag();
1708
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1709
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1710
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1711
+ diffuseSection.add(selfshadow);
15081712
1509
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1510
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1511
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1512
- aConstraints.gridx += 1;
1513
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1514
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1515
- aConstraints.gridx = 0;
1516
- aConstraints.gridy += 1;
1517
- aConstraints.gridwidth = 1;
1713
+ cGridBag sheen = new cGridBag();
1714
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1715
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1716
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1717
+ diffuseSection.add(sheen);
15181718
1519
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1520
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1521
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1522
- aConstraints.gridx += 1;
1523
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1524
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1525
- aConstraints.gridx = 0;
1526
- aConstraints.gridy += 1;
1527
- aConstraints.gridwidth = 1;
1719
+ cGridBag subsurface = new cGridBag();
1720
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1721
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1722
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1723
+ diffuseSection.add(subsurface);
15281724
1529
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1530
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1531
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1532
- aConstraints.gridx += 1;
1533
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1534
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1535
- aConstraints.gridx = 0;
1536
- aConstraints.gridy += 1;
1537
- aConstraints.gridwidth = 1;
1725
+ cGridBag shadow = new cGridBag();
1726
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1727
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1728
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1729
+ diffuseSection.add(shadow);
15381730
1539
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1540
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1541
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1542
- aConstraints.gridx += 1;
1543
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1544
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1545
- aConstraints.gridx = 0;
1546
- aConstraints.gridy += 1;
1547
- aConstraints.gridwidth = 1;
1731
+ cGridBag fakedepth = new cGridBag();
1732
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1733
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1734
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1735
+ diffuseSection.add(fakedepth);
15481736
1549
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1550
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1551
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1552
- aConstraints.gridx += 1;
1553
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1554
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1555
- aConstraints.gridx = 0;
1556
- aConstraints.gridy += 1;
1557
- aConstraints.gridwidth = 1;
1737
+ panel.add(new JSeparator());
1738
+
1739
+ panel.add(diffuseSection);
1740
+
1741
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1742
+
1743
+ cGridBag specularSection = new cGridBag().setVertical(true);
15581744
1559
- //aConstraints.weighty = 1;
1560
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1561
- //aConstraints.gridx += 1;
1562
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1563
- aConstraints.weighty = 0;
1564
- aConstraints.gridx = 0;
1565
- aConstraints.gridy += 1;
1566
- aConstraints.gridwidth = 1;
1745
+ cGridBag specular = new cGridBag();
1746
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1747
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1748
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1749
+ specularSection.add(specular);
15671750
1568
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1569
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1570
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1571
- aConstraints.gridx += 1;
1572
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1573
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1574
- aConstraints.gridx = 0;
1575
- aConstraints.gridy += 1;
1576
- aConstraints.gridwidth = 1;
1751
+ cGridBag lightarea = new cGridBag();
1752
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1753
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1754
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1755
+ specularSection.add(lightarea);
15771756
1578
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1579
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1580
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1581
- aConstraints.gridx += 1;
1582
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1583
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1584
- aConstraints.gridx = 0;
1585
- aConstraints.gridy += 1;
1586
- aConstraints.gridwidth = 1;
1757
+ cGridBag shininess = new cGridBag();
1758
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1759
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1760
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1761
+ specularSection.add(shininess);
15871762
1588
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1589
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1590
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1591
- aConstraints.gridx += 1;
1592
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1593
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1594
- aConstraints.gridx = 0;
1595
- aConstraints.gridy += 1;
1596
- aConstraints.gridwidth = 1;
1763
+ cGridBag metalness = new cGridBag();
1764
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1765
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1766
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1767
+ specularSection.add(metalness);
15971768
1598
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1599
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1600
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1601
- aConstraints.gridx += 1;
1602
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1603
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1604
- aConstraints.gridx = 0;
1605
- aConstraints.gridy += 1;
1606
- aConstraints.gridwidth = 1;
1769
+ cGridBag velvet = new cGridBag();
1770
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1771
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1772
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1773
+ specularSection.add(velvet);
16071774
1608
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1609
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1610
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1611
- aConstraints.gridx += 1;
1612
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1613
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1614
- aConstraints.gridx = 0;
1615
- aConstraints.gridy += 1;
1616
- aConstraints.gridwidth = 1;
1617
-
1618
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1619
- Return();
1775
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1776
+ //Return();
16201777 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16211778 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16221779 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1627,130 +1784,93 @@
16271784 // aConstraints.gridy += 1;
16281785 // aConstraints.gridwidth = 1;
16291786
1630
- //aConstraints.weighty = 1;
1631
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1632
- //aConstraints.gridx += 1;
1633
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1634
- aConstraints.weighty = 0;
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
16381787
1639
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1640
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- aConstraints.gridwidth = 1;
1788
+ panel.add(new JSeparator());
1789
+
1790
+ panel.add(specularSection);
1791
+
1792
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1793
+
1794
+ cGridBag globalSection = new cGridBag().setVertical(true);
16481795
1649
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1650
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1652
- aConstraints.gridx += 1;
1653
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1654
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1655
- aConstraints.gridx = 0;
1656
- aConstraints.gridy += 1;
1657
- aConstraints.gridwidth = 1;
1796
+ cGridBag camera = new cGridBag();
1797
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1798
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1799
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1800
+ globalSection.add(camera);
16581801
1659
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1660
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1661
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1662
- aConstraints.gridx += 1;
1663
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1664
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1665
- aConstraints.gridx = 0;
1666
- aConstraints.gridy += 1;
1667
- aConstraints.gridwidth = 1;
1802
+ cGridBag ambient = new cGridBag();
1803
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1804
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1805
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1806
+ globalSection.add(ambient);
16681807
1669
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1670
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1672
- aConstraints.gridx += 1;
1673
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1674
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1675
- aConstraints.gridx = 0;
1676
- aConstraints.gridy += 1;
1677
- aConstraints.gridwidth = 1;
1678
- aConstraints.weighty = 0;
1808
+ cGridBag backlit = new cGridBag();
1809
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1810
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1811
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1812
+ globalSection.add(backlit);
16791813
1680
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1681
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- aConstraints.gridwidth = 1;
1814
+ cGridBag opacity = new cGridBag();
1815
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1816
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1817
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1818
+ globalSection.add(opacity);
16891819
1690
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1691
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- aConstraints.gridwidth = 1;
1820
+ panel.add(new JSeparator());
1821
+
1822
+ panel.add(globalSection);
1823
+
1824
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1825
+
1826
+ cGridBag textureSection = new cGridBag().setVertical(true);
16991827
1700
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1701
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- aConstraints.gridwidth = 1;
1828
+ cGridBag bump = new cGridBag();
1829
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1830
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1831
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1832
+ textureSection.add(bump);
17091833
1710
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1711
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1712
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1713
- aConstraints.gridx += 1;
1714
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1715
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1716
- aConstraints.gridx = 0;
1717
- aConstraints.gridy += 1;
1718
- aConstraints.gridwidth = 1;
1834
+ cGridBag noise = new cGridBag();
1835
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1836
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1837
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1838
+ textureSection.add(noise);
17191839
1720
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1721
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1722
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1723
- aConstraints.gridx += 1;
1724
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1725
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1726
- aConstraints.gridx = 0;
1727
- aConstraints.gridy += 1;
1728
- aConstraints.gridwidth = 1;
1840
+ cGridBag power = new cGridBag();
1841
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1842
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1843
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1844
+ textureSection.add(power);
17291845
1730
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1731
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1732
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1733
- aConstraints.gridx += 1;
1734
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1735
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1736
- aConstraints.gridx = 0;
1737
- aConstraints.gridy += 1;
1738
- aConstraints.gridwidth = 1;
1846
+ cGridBag borderfade = new cGridBag();
1847
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1848
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1849
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1850
+ textureSection.add(borderfade);
17391851
1740
- //aConstraints.weighty = 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1742
- //aConstraints.gridx += 1;
1743
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1744
- aConstraints.weighty = 0;
1852
+ cGridBag fog = new cGridBag();
1853
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1854
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1855
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1856
+ textureSection.add(fog);
17451857
1746
- aConstraints.gridx = 0;
1747
- aConstraints.gridy = 0;
1748
- aConstraints.gridwidth = 1;
1858
+ cGridBag opacityPower = new cGridBag();
1859
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1860
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1861
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1862
+ textureSection.add(opacityPower);
1863
+
1864
+ panel.add(new JSeparator());
1865
+
1866
+ panel.add(textureSection);
1867
+
1868
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17491869
17501870 SetMaterial(copy); // .GetMaterial());
17511871
1752
- colorField.addChangeListener(this);
1753
- modulationField.addChangeListener(this);
1872
+ //colorField.addChangeListener(this);
1873
+// modulationField.addChangeListener(this);
17541874 metalnessField.addChangeListener(this);
17551875 diffuseField.addChangeListener(this);
17561876 specularField.addChangeListener(this);
....@@ -1780,12 +1900,15 @@
17801900 opacityPowerField.addChangeListener(this);
17811901 /**/
17821902
1783
- resetSlidersButton.addActionListener(this);
17841903 clearMaterialButton.addActionListener(this);
17851904 createMaterialButton.addActionListener(this);
1786
-
1787
- propagateToggle.addItemListener(this);
1788
- multiplyToggle.addItemListener(this);
1905
+
1906
+ if (Globals.ADVANCED)
1907
+ {
1908
+ resetSlidersButton.addActionListener(this);
1909
+ propagateToggle.addItemListener(this);
1910
+ multiplyToggle.addItemListener(this);
1911
+ }
17891912 }
17901913
17911914 void DropFile(java.io.File[] files, boolean textures)
....@@ -1956,7 +2079,7 @@
19562079
19572080 //? flashIt = false;
19582081 CameraPane pane = (CameraPane) cameraView;
1959
- pane.clickStart(location.x, location.y, 0);
2082
+ pane.clickStart(location.x, location.y, 0, 0);
19602083 pane.clickEnd(location.x, location.y, 0, true);
19612084
19622085 if (group.selection.size() == 1)
....@@ -2005,6 +2128,7 @@
20052128 e2.printStackTrace();
20062129 }
20072130 }
2131
+
20082132 LoadJMEThread loadThread;
20092133
20102134 class LoadJMEThread extends Thread
....@@ -2062,6 +2186,7 @@
20622186 //LoadFile0(filename, converter);
20632187 }
20642188 }
2189
+
20652190 LoadOBJThread loadObjThread;
20662191
20672192 class LoadOBJThread extends Thread
....@@ -2140,19 +2265,19 @@
21402265
21412266 void LoadObjFile(String fullname)
21422267 {
2143
- /*
2268
+ System.out.println("Loading " + fullname);
2269
+ /**/
21442270 //lastFilename = fullname;
21452271 if(loadObjThread == null)
21462272 {
2147
- loadObjThread = new LoadOBJThread();
2148
- loadObjThread.start();
2273
+ loadObjThread = new LoadOBJThread();
2274
+ loadObjThread.start();
21492275 }
21502276
21512277 loadObjThread.add(fullname);
2152
- */
2278
+ /**/
21532279
2154
- System.out.println("Loading " + fullname);
2155
- makeSomething(new FileObject(fullname, true), true);
2280
+ //makeSomething(new FileObject(fullname, true), true);
21562281 }
21572282
21582283 void LoadGFDFile(String fullname)
....@@ -2413,11 +2538,11 @@
24132538
24142539 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24152540 {
2416
- if (GrafreeD.standAlone)
2541
+ if (Grafreed.standAlone)
24172542 {
24182543 /**/
24192544 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2420
- browser.show();
2545
+ browser.setVisible(true);
24212546 String filename = browser.getFile();
24222547 if (filename != null && filename.length() > 0)
24232548 {
....@@ -2562,6 +2687,7 @@
25622687 }
25632688 if (input == null)
25642689 {
2690
+ new Exception().printStackTrace();
25652691 System.exit(0);
25662692 }
25672693
....@@ -2768,6 +2894,8 @@
27682894
27692895 void SetMaterial(Object3D object)
27702896 {
2897
+ latestObject = object;
2898
+
27712899 cMaterial mat = object.material;
27722900
27732901 if (mat == null)
....@@ -2776,7 +2904,8 @@
27762904 return;
27772905 }
27782906
2779
- multiplyToggle.setSelected(mat.multiply);
2907
+ if (multiplyToggle != null)
2908
+ multiplyToggle.setSelected(mat.multiply);
27802909
27812910 assert (object.projectedVertices != null);
27822911
....@@ -2952,31 +3081,48 @@
29523081 cameraView.ToggleDL();
29533082 cameraView.repaint();
29543083 return;
2955
- } else if (event.getSource() == toggleTextureItem)
3084
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29563085 {
29573086 cameraView.ToggleTexture();
29583087 // june 2013 copy.HardTouch();
29593088 cameraView.repaint();
29603089 return;
2961
- } else if (event.getSource() == toggleFullItem)
3090
+ } else if (event.getSource() == toggleTimelineItem)
29623091 {
2963
- if (CameraPane.FULLSCREEN)
3092
+ timeline ^= true;
3093
+
3094
+ if (timeline)
29643095 {
2965
- frame.getContentPane().remove(/*"Center",*/bigThree);
2966
- framePanel.add(bigThree);
2967
- frame.getContentPane().add(/*"Center",*/framePanel);
2968
- } else
2969
- {
2970
- frame.getContentPane().remove(/*"Center",*/framePanel);
2971
- frame.getContentPane().add(/*"Center",*/bigThree);
3096
+ centralPanel.remove(cameraView);
3097
+ cameraPanel.add(cameraView);
3098
+ centralPanel.add(cameraPanel);
3099
+ frame.setJMenuBar(timelineMenubar);
3100
+ wasFullScreen = CameraPane.FULLSCREEN;
3101
+ if (!CameraPane.FULLSCREEN)
3102
+ ToggleFullScreen();
3103
+ toggleFullScreenItem.setEnabled(false);
29723104 }
3105
+ else
3106
+ {
3107
+ centralPanel.remove(cameraPanel);
3108
+ centralPanel.add(cameraView);
3109
+ frame.setJMenuBar(null);
3110
+ if (!wasFullScreen)
3111
+ ToggleFullScreen();
3112
+ toggleFullScreenItem.setEnabled(true);
3113
+ }
3114
+
29733115 frame.validate();
2974
- cameraView.ToggleFullScreen();
3116
+ return;
3117
+ } else if (event.getSource() == toggleFullScreenItem)
3118
+ {
3119
+ ToggleFullScreen();
3120
+ frame.validate();
29753121
29763122 return;
2977
- } else if (event.getSource() == toggleRandomItem)
3123
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29783124 {
2979
- cameraView.ToggleRandom();
3125
+ cameraView.ToggleSwitch();
29803126 cameraView.repaint();
29813127 return;
29823128 } else if (event.getSource() == toggleHandleItem)
....@@ -3005,6 +3151,10 @@
30053151 {
30063152 copy.live ^= true;
30073153 return;
3154
+ } else if (event.getSource() == selectCB)
3155
+ {
3156
+ copy.dontselect ^= true;
3157
+ return;
30083158 } else if (event.getSource() == hideCB)
30093159 {
30103160 copy.hide ^= true;
....@@ -3019,6 +3169,7 @@
30193169 if (event.getSource() == randomCB)
30203170 {
30213171 copy.random ^= true;
3172
+ objEditor.refreshContents();
30223173 return;
30233174 }
30243175 if (event.getSource() == speedupCB)
....@@ -3042,8 +3193,9 @@
30423193
30433194 public void actionPerformed(ActionEvent event)
30443195 {
3196
+ Object source = event.getSource();
30453197 // SCRIPT DIALOG
3046
- if (event.getSource() == okbutton)
3198
+ if (source == okbutton)
30473199 {
30483200 textpanel.setVisible(false);
30493201 textpanel.remove(textarea);
....@@ -3055,7 +3207,7 @@
30553207 textarea = null;
30563208 textpanel = null;
30573209 }
3058
- if (event.getSource() == cancelbutton)
3210
+ if (source == cancelbutton)
30593211 {
30603212 textpanel.setVisible(false);
30613213 textpanel.remove(textarea);
....@@ -3067,49 +3219,50 @@
30673219 //applySelf();
30683220 //client.refreshEditWindow();
30693221 //refreshContents();
3070
- if (event.getSource() == nameField)
3222
+ if (source == nameField)
30713223 {
30723224 //System.out.println("ObjEditor " + event);
30733225 applySelf0(true);
30743226 //parent.applySelf();
30753227 objEditor.refreshContents();
3076
- } else if (event.getSource() == resetButton)
3228
+ } else if (source == resetButton)
30773229 {
30783230 CameraPane.fullreset = true;
30793231 copy.Reset(); // ResetMeshes();
30803232 copy.Touch();
30813233 objEditor.refreshContents();
3082
- } else if (event.getSource() == stepItem)
3234
+ } else if (source == stepItem)
30833235 {
3084
- cameraView.ONESTEP = true;
3236
+ //cameraView.ONESTEP = true;
3237
+ Globals.ONESTEP = true;
30853238 cameraView.repaint();
30863239 return;
3087
- } else if (event.getSource() == stepButton)
3240
+ } else if (source == stepButton)
30883241 {
30893242 copy.Step();
30903243 copy.Touch();
30913244 objEditor.refreshContents();
3092
- } else if (event.getSource() == slowerButton)
3245
+ } else if (source == slowerButton)
30933246 {
30943247 copy.Slower();
30953248 copy.Touch();
30963249 objEditor.refreshContents();
3097
- } else if (event.getSource() == fasterButton)
3250
+ } else if (source == fasterButton)
30983251 {
30993252 copy.Faster();
31003253 copy.Touch();
31013254 objEditor.refreshContents();
3102
- } else if (event.getSource() == remarkButton)
3255
+ } else if (source == remarkButton)
31033256 {
31043257 copy.Remark();
31053258 copy.Touch();
31063259 objEditor.refreshContents();
3107
- } else if (event.getSource() == stepAllButton)
3260
+ } else if (source == stepAllButton)
31083261 {
31093262 copy.StepAll();
31103263 copy.Touch();
31113264 objEditor.refreshContents();
3112
- } else if (event.getSource() == resetAllButton)
3265
+ } else if (source == resetAllButton)
31133266 {
31143267 //CameraPane.fullreset = true;
31153268 copy.ResetAll(); // ResetMeshes();
....@@ -3142,53 +3295,75 @@
31423295 // Close();
31433296 // }
31443297 // else
3145
- if (event.getSource() == resetSlidersButton)
3298
+ if (source == resetSlidersButton)
31463299 {
31473300 ResetSliders();
3148
- } else if (event.getSource() == clearMaterialButton)
3301
+ } else if (source == clearMaterialButton)
31493302 {
31503303 ClearMaterial();
3151
- } else if (event.getSource() == createMaterialButton)
3304
+ } else if (source == createMaterialButton)
31523305 {
31533306 CreateMaterial();
3154
- } else if (event.getSource() == clearPanelButton)
3307
+ } else if (source == clearPanelButton)
31553308 {
31563309 copy.ClearUI();
31573310 refreshContents(true);
3158
- } /*
3159
- }
3160
-
3161
- public boolean action(Event event, Object arg)
3162
- {
3163
- */ else if (event.getSource() == closeItem)
3311
+ } else if (source == importGFDItem)
3312
+ {
3313
+ ImportGFD();
3314
+ } else
3315
+ if (source == importVRMLX3DItem)
3316
+ {
3317
+ ImportVRMLX3D();
3318
+ } else
3319
+ if (source == import3DSItem)
3320
+ {
3321
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3322
+ } else
3323
+ if (source == importOBJItem)
3324
+ {
3325
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3326
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3327
+ browser.setVisible(true);
3328
+ String filename = browser.getFile();
3329
+ if (filename != null && filename.length() > 0)
3330
+ {
3331
+ String fullname = browser.getDirectory() + filename;
3332
+ makeSomething(ReadOBJ(fullname), true);
3333
+ }
3334
+ } else
3335
+ if (source == closeItem)
31643336 {
31653337 Close();
31663338 //return true;
3167
- } else if (event.getSource() == loadItem)
3339
+ } else if (source == loadItem)
31683340 {
31693341 load();
31703342 //return true;
3171
- } else if (event.getSource() == saveItem)
3343
+ } else if (source == newItem)
3344
+ {
3345
+ New();
3346
+ } else if (source == saveItem)
31723347 {
31733348 save();
31743349 //return true;
3175
- } else if (event.getSource() == saveAsItem)
3350
+ } else if (source == saveAsItem)
31763351 {
31773352 saveAs();
31783353 //return true;
3179
- } else if (event.getSource() == reexportItem)
3354
+ } else if (source == reexportItem)
31803355 {
31813356 reexport();
31823357 //return true;
3183
- } else if (event.getSource() == exportAsItem)
3358
+ } else if (source == exportAsItem)
31843359 {
31853360 export();
31863361 //return true;
3187
- } else if (event.getSource() == povItem)
3362
+ } else if (source == povItem)
31883363 {
31893364 generatePOV();
31903365 //return true;
3191
- } else if (event.getSource() == zBufferItem)
3366
+ } else if (source == zBufferItem)
31923367 {
31933368 try
31943369 {
....@@ -3210,21 +3385,8 @@
32103385 cameraView.repaint();
32113386 //return true;
32123387 }
3213
- */ else if (event.getSource() == editCameraItem)
3214
- {
3215
- cameraView.ProtectCamera();
3216
- cameraView.repaint();
3217
- return;
3218
- } else if (event.getSource() == revertCameraItem)
3219
- {
3220
- cameraView.RevertCamera();
3221
- cameraView.repaint();
3222
- return;
3223
- } else if (event.getSource() == textureButton)
3224
- {
3225
- return; // true;
3226
- } else // combos...
3227
- if (event.getSource() == texresMenu)
3388
+ */ else // combos...
3389
+ if (source == texresMenu)
32283390 {
32293391 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32303392 copy.texres = texresMenu.getSelectedIndex();
....@@ -3236,27 +3398,287 @@
32363398 }
32373399 }
32383400
3239
- void ToggleAnimation()
3401
+ void New()
32403402 {
3241
- if (!CameraPane.ANIMATION)
3403
+ while (copy.Size() > 1)
32423404 {
3243
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3405
+ copy.remove(1);
3406
+ }
3407
+
3408
+ ResetModel();
3409
+ objEditor.refreshContents();
3410
+ }
3411
+
3412
+ static public byte[] Compress(Object3D o)
3413
+ {
3414
+ try
3415
+ {
3416
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3417
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3418
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3419
+
3420
+ Object3D parent = o.parent;
3421
+ o.parent = null;
3422
+
3423
+ out.writeObject(o);
3424
+
3425
+ o.parent = parent;
3426
+
3427
+ out.flush();
3428
+
3429
+ zstream.close();
3430
+ out.close();
3431
+
3432
+ return baos.toByteArray();
3433
+ } catch (Exception e)
3434
+ {
3435
+ System.err.println(e);
3436
+ return null;
3437
+ }
3438
+ }
3439
+
3440
+ static public Object Uncompress(byte[] bytes)
3441
+ {
3442
+ System.out.println("#bytes = " + bytes.length);
3443
+ try
3444
+ {
3445
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3446
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3447
+ ObjectInputStream in = new ObjectInputStream(istream);
3448
+ Object obj = in.readObject();
3449
+ in.close();
3450
+
3451
+ return obj;
3452
+ } catch (Exception e)
3453
+ {
3454
+ System.err.println(e);
3455
+ return null;
3456
+ }
3457
+ }
3458
+
3459
+ static public Object clone(Object o)
3460
+ {
3461
+ try
3462
+ {
3463
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3464
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3465
+
3466
+ out.writeObject(o);
3467
+
3468
+ out.flush();
3469
+ out.close();
3470
+
3471
+ byte[] bytes = baos.toByteArray();
3472
+
3473
+ System.out.println("clone = " + bytes.length);
3474
+
3475
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3476
+ ObjectInputStream in = new ObjectInputStream(bais);
3477
+ Object obj = in.readObject();
3478
+ in.close();
3479
+
3480
+ return obj;
3481
+ } catch (Exception e)
3482
+ {
3483
+ System.err.println(e);
3484
+ return null;
3485
+ }
3486
+ }
3487
+
3488
+ cRadio GetCurrentTab()
3489
+ {
3490
+ cRadio ab;
3491
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3492
+ {
3493
+ ab = (cRadio)e.nextElement();
3494
+ if(ab.GetObject() == copy)
3495
+ {
3496
+ return ab;
3497
+ }
3498
+ }
3499
+
3500
+ return null;
3501
+ }
3502
+
3503
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3504
+
3505
+ public void Save()
3506
+ {
3507
+ System.err.println("Save");
3508
+
3509
+ cRadio tab = GetCurrentTab();
3510
+
3511
+ boolean temp = CameraPane.SWITCH;
3512
+ CameraPane.SWITCH = false;
3513
+
3514
+ copy.ExtractBigData(hashtable);
3515
+
3516
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3517
+ tab.graphs[tab.undoindex++] = Compress(copy);
3518
+
3519
+ copy.RestoreBigData(hashtable);
3520
+
3521
+ CameraPane.SWITCH = temp;
3522
+
3523
+ //assert(hashtable.isEmpty());
3524
+
3525
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3526
+ {
3527
+ tab.graphs[i] = null;
3528
+ }
3529
+
3530
+ // test save
3531
+ if (false)
3532
+ {
3533
+ try
3534
+ {
3535
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3536
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3537
+
3538
+ p.writeObject(copy);
3539
+
3540
+ p.flush();
3541
+
3542
+ ostream.close();
3543
+ } catch (Exception e)
3544
+ {
3545
+ e.printStackTrace();
3546
+ }
3547
+ }
3548
+ }
3549
+
3550
+ void CopyChanged(Object3D obj)
3551
+ {
3552
+ boolean temp = CameraPane.SWITCH;
3553
+ CameraPane.SWITCH = false;
3554
+
3555
+ copy.ExtractBigData(hashtable);
3556
+
3557
+ copy.clear();
3558
+
3559
+ for (int i=0; i<obj.Size(); i++)
3560
+ {
3561
+ copy.add(obj.get(i));
3562
+ }
3563
+
3564
+ copy.RestoreBigData(hashtable);
3565
+
3566
+ CameraPane.SWITCH = temp;
3567
+
3568
+ //assert(hashtable.isEmpty());
3569
+
3570
+ copy.Touch();
3571
+
3572
+ ResetModel();
3573
+ copy.HardTouch(); // recompile?
3574
+
3575
+ cRadio ab;
3576
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3577
+ {
3578
+ ab = (cRadio)e.nextElement();
3579
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3580
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3581
+ if (test != null)
3582
+ {
3583
+ test.editWindow = ab.object.editWindow;
3584
+ ab.object = test;
3585
+ }
3586
+ }
3587
+
3588
+ refreshContents();
3589
+ }
3590
+
3591
+ public void Undo()
3592
+ {
3593
+ System.err.println("Undo");
3594
+
3595
+ cRadio tab = GetCurrentTab();
3596
+
3597
+ if (tab.undoindex == 0)
3598
+ {
3599
+ java.awt.Toolkit.getDefaultToolkit().beep();
3600
+ return;
3601
+ }
3602
+
3603
+ if (tab.graphs[tab.undoindex] == null)
3604
+ {
3605
+ Save();
3606
+ tab.undoindex -= 1;
3607
+ }
3608
+
3609
+ tab.undoindex -= 1;
3610
+
3611
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3612
+ }
3613
+
3614
+ public void Redo()
3615
+ {
3616
+ cRadio tab = GetCurrentTab();
3617
+
3618
+ if (tab.graphs[tab.undoindex + 1] == null)
3619
+ {
3620
+ java.awt.Toolkit.getDefaultToolkit().beep();
3621
+ return;
3622
+ }
3623
+
3624
+ tab.undoindex += 1;
3625
+
3626
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3627
+ }
3628
+
3629
+ void ImportGFD()
3630
+ {
3631
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32443632 browser.show();
32453633 String filename = browser.getFile();
32463634 if (filename != null && filename.length() > 0)
32473635 {
3248
- CameraPane.filename = browser.getDirectory() + filename;
3636
+ String fullname = browser.getDirectory() + filename;
3637
+
3638
+ //Object3D readobj =
3639
+ objEditor.ReadGFD(fullname, objEditor);
3640
+ //makeSomething(readobj);
3641
+ }
3642
+ }
3643
+
3644
+ void ImportVRMLX3D()
3645
+ {
3646
+ if (Grafreed.standAlone)
3647
+ {
3648
+ /**/
3649
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3650
+ browser.show();
3651
+ String filename = browser.getFile();
3652
+ if (filename != null && filename.length() > 0)
3653
+ {
3654
+ String fullname = browser.getDirectory() + filename;
3655
+ LoadVRMLX3D(fullname);
3656
+ }
3657
+ /**/
3658
+ }
3659
+ }
3660
+
3661
+ void ToggleAnimation()
3662
+ {
3663
+ if (!Globals.ANIMATION)
3664
+ {
3665
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3666
+ browser.setVisible(true);
3667
+ String filename = browser.getFile();
3668
+ if (filename != null && filename.length() > 0)
3669
+ {
3670
+ Globals.filename = browser.getDirectory() + filename;
32493671 //CameraPane.framecount = 0;
3250
- CameraPane.imagecount = 0;
3672
+ Globals.imagecount = 0;
32513673
3252
- CameraPane.ANIMATION ^= true;
3674
+ Globals.ANIMATION ^= true;
32533675
3254
- GrafreeD.wav.cursor = 0;
3255
- GrafreeD.wav.loop = 0;
3676
+ Grafreed.wav.cursor = 0;
3677
+ Grafreed.wav.loop = 0;
32563678 }
32573679 } else
32583680 {
3259
- CameraPane.ANIMATION ^= true;
3681
+ Globals.ANIMATION ^= true;
32603682 }
32613683 }
32623684
....@@ -3302,7 +3724,7 @@
33023724 void CreateMaterial()
33033725 {
33043726 //copy.ClearMaterial(); // PATCH
3305
- copy.CreateMaterialS(multiplyToggle.isSelected());
3727
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33063728 if (copy.selection.size() > 0)
33073729 //SetMaterial(copy);
33083730 {
....@@ -3353,7 +3775,7 @@
33533775 assert false;
33543776 }
33553777
3356
- void EditSelection()
3778
+ void EditSelection(boolean newWindow)
33573779 {
33583780 }
33593781
....@@ -3361,11 +3783,11 @@
33613783 {
33623784 copy.ResetBlockLoop(); // temporary problem
33633785
3364
- boolean random = CameraPane.RANDOM;
3365
- CameraPane.RANDOM = false; // parse everything
3786
+ boolean random = CameraPane.SWITCH;
3787
+ CameraPane.SWITCH = false; // parse everything
33663788 copy.ResetDisplayList();
33673789 copy.HardTouch();
3368
- CameraPane.RANDOM = random;
3790
+ CameraPane.SWITCH = random;
33693791 }
33703792
33713793 // public void applySelf()
....@@ -3435,10 +3857,40 @@
34353857 current.fakedepth = (float) fakedepthField.getFloat();
34363858 current.shadowbias = (float) shadowbiasField.getFloat();
34373859
3438
- if (!NumberSlider.frozen)
3860
+ if (!cNumberSlider.frozen)
34393861 {
34403862 //System.out.println("Propagate = " + propagate);
34413863 copy.UpdateMaterial(anchor, current, propagate);
3864
+
3865
+ if (copy.material != null)
3866
+ {
3867
+ cMaterial mat = copy.material;
3868
+
3869
+ colorField.SetToolTipValue((mat.color));
3870
+ modulationField.SetToolTipValue((mat.modulation));
3871
+ metalnessField.SetToolTipValue((mat.metalness));
3872
+ diffuseField.SetToolTipValue((mat.diffuse));
3873
+ specularField.SetToolTipValue((mat.specular));
3874
+ shininessField.SetToolTipValue((mat.shininess));
3875
+ shiftField.SetToolTipValue((mat.shift));
3876
+ ambientField.SetToolTipValue((mat.ambient));
3877
+ lightareaField.SetToolTipValue((mat.lightarea));
3878
+ diffusenessField.SetToolTipValue((mat.factor));
3879
+ velvetField.SetToolTipValue((mat.velvet));
3880
+ sheenField.SetToolTipValue((mat.sheen));
3881
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3882
+ backlitField.SetToolTipValue((mat.bump));
3883
+ anisoField.SetToolTipValue((mat.aniso));
3884
+ anisoVField.SetToolTipValue((mat.anisoV));
3885
+ cameraField.SetToolTipValue((mat.cameralight));
3886
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3887
+ shadowField.SetToolTipValue((mat.shadow));
3888
+ textureField.SetToolTipValue((mat.texture));
3889
+ opacityField.SetToolTipValue((mat.opacity));
3890
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3891
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3892
+ }
3893
+
34423894 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34433895 {
34443896 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3483,6 +3935,7 @@
34833935 || e.getSource() == apertureField
34843936 || e.getSource() == shadowblurField)
34853937 {
3938
+ new Exception().printStackTrace();
34863939 System.exit(0);
34873940 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34883941 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3509,7 +3962,13 @@
35093962 //System.out.println("PARENT = " + parent);
35103963 //if (parent != null)
35113964 // parent.applySelf();
3512
- refreshContents();
3965
+ if (e.getSource() == normalpushField)
3966
+ {
3967
+ objEditor.refreshContents();
3968
+ //Refresh();
3969
+ }
3970
+ else
3971
+ refreshContents();
35133972 // ??? client.refreshEditWindow();
35143973 }
35153974 //else
....@@ -3521,7 +3980,7 @@
35213980 //group.name = nameField.getText();
35223981 //objEditor.applySelf();
35233982
3524
- assert (objEditor == this);
3983
+ // OCT2018: assert (objEditor == this);
35253984 if (copy.selection == null || copy.selection.size() == 0)
35263985 //super.applySelf()
35273986 ; else
....@@ -3545,12 +4004,18 @@
35454004 objEditor.copy = keep;
35464005 }
35474006 }
4007
+
4008
+ if (normalpushField != null)
4009
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35484010 }
35494011
35504012 void SnapObject()
35514013 {
3552
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3553
- SnapObject(obj);
4014
+ if (copy.selection.size() > 0)
4015
+ {
4016
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
4017
+ SnapObject(obj);
4018
+ }
35544019 }
35554020
35564021 void SnapObject(Object3D obj)
....@@ -3796,7 +4261,7 @@
37964261
37974262 radioPanel.revalidate();
37984263 radioPanel.repaint();
3799
- ctrlPanel.revalidate(); // ? new
4264
+ ctrlPanel.validate(); // ? new
38004265 ctrlPanel.repaint();
38014266 }
38024267 }
....@@ -3805,6 +4270,8 @@
38054270
38064271 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38074272 {
4273
+ if (Globals.SAVEONMAKE) // && resetmodel)
4274
+ Save();
38084275 //Tween.set(thing, 0).target(1).start(tweenManager);
38094276 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38104277 // if (thing instanceof GenericJointDemo)
....@@ -3891,6 +4358,12 @@
38914358 {
38924359 ResetModel();
38934360 Select(thing.GetTreePath(), true, false); // unselect... false);
4361
+
4362
+ if (thing.Size() == 0)
4363
+ {
4364
+ //EditSelection(false);
4365
+ }
4366
+
38944367 refreshContents();
38954368 }
38964369
....@@ -4008,6 +4481,7 @@
40084481 }
40094482 }
40104483 }
4484
+
40114485 LoadGFDThread loadGFDThread;
40124486
40134487 void ReadGFD(String fullname, iCallBack cb)
....@@ -4027,8 +4501,10 @@
40274501
40284502 try
40294503 {
4504
+ // Try compressed version first.
40304505 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4031
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4506
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4507
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40324508
40334509 readobj = (Object3D) p.readObject();
40344510 istream.close();
....@@ -4036,7 +4512,20 @@
40364512 readobj.ResetDisplayList();
40374513 } catch (Exception e)
40384514 {
4039
- e.printStackTrace();
4515
+ //e.printStackTrace();
4516
+ try
4517
+ {
4518
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4519
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4520
+
4521
+ readobj = (Object3D) p.readObject();
4522
+ istream.close();
4523
+
4524
+ readobj.ResetDisplayList();
4525
+ } catch (Exception e2)
4526
+ {
4527
+ e2.printStackTrace();
4528
+ }
40404529 }
40414530 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40424531 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4082,6 +4571,12 @@
40824571
40834572 void LoadIt(Object obj)
40844573 {
4574
+ if (obj == null)
4575
+ {
4576
+ // Invalid file
4577
+ return;
4578
+ }
4579
+
40854580 System.out.println("Loaded " + obj);
40864581 //new Exception().printStackTrace();
40874582 Object3D readobj = (Object3D) obj;
....@@ -4091,6 +4586,8 @@
40914586
40924587 if (readobj != null)
40934588 {
4589
+ if (Globals.SAVEONMAKE)
4590
+ Save();
40944591 try
40954592 {
40964593 //readobj.deepCopySelf(copy);
....@@ -4153,7 +4650,7 @@
41534650
41544651 void load() // throws ClassNotFoundException
41554652 {
4156
- if (GrafreeD.standAlone)
4653
+ if (Grafreed.standAlone)
41574654 {
41584655 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
41594656 browser.show();
....@@ -4240,11 +4737,13 @@
42404737 try
42414738 {
42424739 FileOutputStream ostream = new FileOutputStream(lastname);
4243
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4740
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4741
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42444742
42454743 p.writeObject(copy);
42464744 p.flush();
42474745
4746
+ zstream.close();
42484747 ostream.close();
42494748
42504749 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4254,11 +4753,12 @@
42544753 {
42554754 }
42564755 }
4756
+
42574757 String lastname;
42584758
42594759 void saveAs()
42604760 {
4261
- if (GrafreeD.standAlone)
4761
+ if (Grafreed.standAlone)
42624762 {
42634763 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42644764 browser.setVisible(true);
....@@ -4363,13 +4863,13 @@
43634863 try
43644864 {
43654865 FileOutputStream ostream = new FileOutputStream(filename);
4366
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4367
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4866
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4867
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43684868
43694869 Object3D objectparent = obj.parent;
43704870 obj.parent = null;
43714871
4372
- Object3D object = (Object3D) GrafreeD.clone(obj);
4872
+ Object3D object = (Object3D) Grafreed.clone(obj);
43734873
43744874 obj.parent = objectparent;
43754875
....@@ -4381,8 +4881,8 @@
43814881 p.writeObject(object);
43824882 p.flush();
43834883
4884
+ zstream.close();
43844885 ostream.close();
4385
- // zstream.close();
43864886
43874887 // group.selection.get(0).parent = parent;
43884888 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4403,7 +4903,7 @@
44034903 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44044904 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44054905 copy.generatePOV(buffer);
4406
- if (GrafreeD.standAlone)
4906
+ if (Grafreed.standAlone)
44074907 {
44084908 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44094909 browser.show();
....@@ -4429,7 +4929,8 @@
44294929 Object3D client;
44304930 Object3D copy;
44314931 MenuBar menuBar;
4432
- Menu windowMenu;
4932
+ Menu fileMenu;
4933
+ MenuItem newItem;
44334934 MenuItem loadItem;
44344935 MenuItem saveItem;
44354936 MenuItem saveAsItem;
....@@ -4437,45 +4938,60 @@
44374938 MenuItem reexportItem;
44384939 MenuItem povItem;
44394940 MenuItem closeItem;
4440
- Menu cameraMenu;
4941
+
44414942 CheckboxMenuItem zBufferItem;
44424943 //MenuItem normalLensItem;
4443
- MenuItem editCameraItem;
4444
- MenuItem revertCameraItem;
4445
- CheckboxMenuItem toggleLiveItem;
44464944 MenuItem stepItem;
4447
- CheckboxMenuItem toggleFullItem;
4945
+ CheckboxMenuItem toggleLiveItem;
4946
+ CheckboxMenuItem toggleFullScreenItem;
4947
+ CheckboxMenuItem toggleTimelineItem;
44484948 CheckboxMenuItem toggleRenderItem;
44494949 CheckboxMenuItem toggleDebugItem;
44504950 CheckboxMenuItem toggleFrustumItem;
44514951 CheckboxMenuItem toggleFootContactItem;
44524952 CheckboxMenuItem toggleDLItem;
44534953 CheckboxMenuItem toggleTextureItem;
4454
- CheckboxMenuItem toggleRandomItem;
4954
+ CheckboxMenuItem toggleSwitchItem;
44554955 CheckboxMenuItem toggleRootItem;
44564956 CheckboxMenuItem animationItem;
44574957 CheckboxMenuItem toggleHandleItem;
44584958 CheckboxMenuItem togglePaintItem;
44594959 JSplitPane mainPanel;
44604960 JScrollPane scrollpane;
4961
+
44614962 JPanel toolbarPanel;
4462
- JPanel treePanel;
4963
+
4964
+ cGridBag treePanel;
4965
+
44634966 JPanel radioPanel;
44644967 ButtonGroup buttonGroup;
4465
- JPanel ctrlPanel;
4466
- JPanel materialPanel;
4968
+
4969
+ cGridBag toolboxPanel;
4970
+ cGridBag materialPanel;
4971
+ cGridBag ctrlPanel;
4972
+
44674973 JScrollPane infoPanel;
4468
- JPanel optionsPanel;
4974
+
4975
+ cGridBag optionsPanel;
4976
+
44694977 JTabbedPane objectPanel;
4470
- JPanel XYZPanel;
4978
+ boolean materialFlushed;
4979
+ Object3D latestObject;
4980
+
4981
+ cGridBag XYZPanel;
4982
+
44714983 JSplitPane gridPanel;
44724984 JSplitPane bigPanel;
4473
- JPanel bigThree;
4474
- JTabbedPane jtp;
4475
- JPanel cameraPanel;
4985
+
4986
+ cGridBag bigThree;
4987
+ cGridBag scenePanel;
4988
+ cGridBag centralPanel;
4989
+ JSplitPane cameraPanel;
4990
+ JPanel timelinePanel;
4991
+ JMenuBar timelineMenubar;
44764992 JSplitPane framePanel;
44774993 JTextArea/*Field*/ nameField;
4478
- cButton textureButton;
4994
+ //cButton textureButton;
44794995 cButton okButton;
44804996 cButton applyButton;
44814997 cButton cancelButton;
....@@ -4522,65 +5038,72 @@
45225038 // MATERIAL
45235039 JLabel materialLabel;
45245040 JLabel colorLabel;
4525
- NumberSlider colorField;
5041
+ cNumberSlider colorField;
45265042 JLabel modulationLabel;
4527
- NumberSlider modulationField;
5043
+ cNumberSlider modulationField;
45285044 JLabel metalnessLabel;
4529
- NumberSlider metalnessField;
5045
+ cNumberSlider metalnessField;
45305046 JLabel diffuseLabel;
4531
- NumberSlider diffuseField;
5047
+ cNumberSlider diffuseField;
45325048 JLabel specularLabel;
4533
- NumberSlider specularField;
5049
+ cNumberSlider specularField;
45345050 JLabel shininessLabel;
4535
- NumberSlider shininessField;
5051
+ cNumberSlider shininessField;
45365052 JLabel shiftLabel;
4537
- NumberSlider shiftField;
5053
+ cNumberSlider shiftField;
45385054 JLabel ambientLabel;
4539
- NumberSlider ambientField;
5055
+ cNumberSlider ambientField;
45405056 JLabel lightareaLabel;
4541
- NumberSlider lightareaField;
5057
+ cNumberSlider lightareaField;
45425058 JLabel diffusenessLabel;
4543
- NumberSlider diffusenessField;
5059
+ cNumberSlider diffusenessField;
45445060 JLabel velvetLabel;
4545
- NumberSlider velvetField;
5061
+ cNumberSlider velvetField;
45465062 JLabel sheenLabel;
4547
- NumberSlider sheenField;
5063
+ cNumberSlider sheenField;
45485064 JLabel subsurfaceLabel;
4549
- NumberSlider subsurfaceField;
5065
+ cNumberSlider subsurfaceField;
45505066 //JLabel bumpLabel;
45515067 //NumberSlider bumpField;
45525068 JLabel backlitLabel;
4553
- NumberSlider backlitField;
5069
+ cNumberSlider backlitField;
45545070 JLabel anisoLabel;
4555
- NumberSlider anisoField;
5071
+ cNumberSlider anisoField;
45565072 JLabel anisoVLabel;
4557
- NumberSlider anisoVField;
5073
+ cNumberSlider anisoVField;
45585074 JLabel cameraLabel;
4559
- NumberSlider cameraField;
5075
+ cNumberSlider cameraField;
45605076 JLabel selfshadowLabel;
4561
- NumberSlider selfshadowField;
5077
+ cNumberSlider selfshadowField;
45625078 JLabel shadowLabel;
4563
- NumberSlider shadowField;
5079
+ cNumberSlider shadowField;
45645080 JLabel textureLabel;
4565
- NumberSlider textureField;
5081
+ cNumberSlider textureField;
45665082 JLabel opacityLabel;
4567
- NumberSlider opacityField;
5083
+ cNumberSlider opacityField;
45685084 JLabel fakedepthLabel;
4569
- NumberSlider fakedepthField;
5085
+ cNumberSlider fakedepthField;
45705086 JLabel shadowbiasLabel;
4571
- NumberSlider shadowbiasField;
5087
+ cNumberSlider shadowbiasField;
45725088 JLabel bumpLabel;
4573
- NumberSlider bumpField;
5089
+ cNumberSlider bumpField;
45745090 JLabel noiseLabel;
4575
- NumberSlider noiseField;
5091
+ cNumberSlider noiseField;
45765092 JLabel powerLabel;
4577
- NumberSlider powerField;
5093
+ cNumberSlider powerField;
45785094 JLabel borderfadeLabel;
4579
- NumberSlider borderfadeField;
5095
+ cNumberSlider borderfadeField;
45805096 JLabel fogLabel;
4581
- NumberSlider fogField;
5097
+ cNumberSlider fogField;
45825098 JLabel opacityPowerLabel;
4583
- NumberSlider opacityPowerField;
4584
- JTree jTree;
5099
+ cNumberSlider opacityPowerField;
5100
+ cTree jTree;
45855101 //ObjectUI parent;
5102
+
5103
+ cNumberSlider normalpushField;
5104
+
5105
+ private MenuItem importGFDItem;
5106
+ private MenuItem importVRMLX3DItem;
5107
+ private MenuItem import3DSItem;
5108
+ private MenuItem importOBJItem;
45865109 }