Normand Briere
2019-06-25 d2f456cf5280f59425084532bd2397ec625f7577
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,79 +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(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullScreenItem.addItemListener(this);
297
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
298
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
299
- toggleTimelineItem.addItemListener(this);
300
- cameraMenu.add("-");
301
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
302
- toggleTextureItem.addItemListener(this);
303
- toggleTextureItem.setState(CameraPane.textureon);
304
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
305
- toggleLiveItem.addItemListener(this);
306
- toggleLiveItem.setState(CameraPane.isLIVE());
307
- cameraMenu.add(stepItem = new MenuItem("Step"));
308
- stepItem.addActionListener(this);
309
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
310
-// toggleDLItem.addItemListener(this);
311
-// toggleDLItem.setState(false);
312
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
313
- toggleRenderItem.addItemListener(this);
314
- toggleRenderItem.setState(!CameraPane.frozen);
315
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
316
- toggleDebugItem.addItemListener(this);
317
- toggleDebugItem.setState(CameraPane.DEBUG);
318
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
319
- toggleFrustumItem.addItemListener(this);
320
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
321
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
322
- toggleFootContactItem.addItemListener(this);
323
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
324
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
325
- toggleRandomItem.addItemListener(this);
326
- toggleRandomItem.setState(CameraPane.RANDOM);
327
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
328
- toggleHandleItem.addItemListener(this);
329
- toggleHandleItem.setState(CameraPane.HANDLES);
330
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
331
- togglePaintItem.addItemListener(this);
332
- togglePaintItem.setState(CameraPane.PAINTMODE);
333
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
334
-// toggleRootItem.addItemListener(this);
335
-// toggleRootItem.setState(false);
336
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
337
-// animationItem.addItemListener(this);
338
-// animationItem.setState(CameraPane.ANIMATION);
339
- cameraMenu.add("-");
340
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
341
- editCameraItem.addActionListener(this);
342
-
343385 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
+
344407 toolbarPanel = new JPanel();
345408 toolbarPanel.setName("Toolbar");
346
- treePanel = new JPanel();
409
+ treePanel = new cGridBag();
347410 treePanel.setName("Tree");
348
- ctrlPanel = new JPanel(); // new GridBagLayout());
349
- ctrlPanel.setName("Edit");
350
- 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);
351425 materialPanel.setName("Material");
426
+
352427 /*JTextPane*/
353428 infoarea = createTextPane();
429
+ doc = infoarea.getStyledDocument();
430
+
354431 infoarea.setEditable(true);
355432 SetText();
356433 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
357434 // infoarea.setOpaque(false);
358435 // //infoarea.setForeground(textcolor);
359
- infoarea.setLineWrap(true);
360
- infoarea.setWrapStyleWord(true);
436
+// TEXTAREA infoarea.setLineWrap(true);
437
+// TEXTAREA infoarea.setWrapStyleWord(true);
361438 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
362439 infoPanel.setPreferredSize(new Dimension(50, 200));
363440 infoPanel.setName("Info");
....@@ -368,16 +445,16 @@
368445 mainPanel.setName("Main");
369446 mainPanel.setContinuousLayout(true);
370447 mainPanel.setOneTouchExpandable(true);
371
- mainPanel.setDividerLocation(1.0);
372448 mainPanel.setDividerSize(9);
373
- mainPanel.setResizeWeight(0);
449
+ mainPanel.setDividerLocation(0.5); //1.0);
450
+ mainPanel.setResizeWeight(0.5);
374451
375452 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
376453 //mainPanel.setLayout(new GridBagLayout());
377454 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
378
- treePanel.setLayout(new GridBagLayout());
379
- ctrlPanel.setLayout(new GridBagLayout());
380
- materialPanel.setLayout(new GridBagLayout());
455
+// treePanel.setLayout(new GridBagLayout());
456
+ //ctrlPanel.setLayout(new GridBagLayout());
457
+ //materialPanel.setLayout(new GridBagLayout());
381458
382459 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
383460 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -416,7 +493,7 @@
416493 static String newline = "\n";
417494 protected static final String buttonString = "JButton";
418495 StyledDocument doc;
419
- JTextArea infoarea;
496
+ JTextPane infoarea;
420497
421498 void ClearInfo()
422499 {
....@@ -439,10 +516,10 @@
439516 e.printStackTrace();
440517 }
441518
442
- String selection = infoarea.getText();
443
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
444
- java.awt.datatransfer.Clipboard clipboard =
445
- 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();
446523 //clipboard.setContents(data, data);
447524 }
448525
....@@ -465,13 +542,13 @@
465542 //SendInfo("Name:", "bold");
466543 if (sel.GetTextures() != null || debug)
467544 {
468
- si.SendInfo(sel.toString(), "bold");
545
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
469546 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
470547 if (sel.Size() > 0)
471548 {
472549 si.SendInfo("#children = " + sel.Size(), "regular");
473550 }
474
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
551
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
475552 if (debug)
476553 {
477554 try
....@@ -483,7 +560,10 @@
483560 }
484561
485562 if (full)
486
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
563
+ {
564
+ si.SendInfo(" BBox min: " + minima, "regular");
565
+ si.SendInfo(" BBox max: " + maxima, "regular");
566
+ }
487567
488568 if (sel.bRep != null)
489569 {
....@@ -510,7 +590,7 @@
510590 }
511591 if (sel.support != null)
512592 {
513
- si.SendInfo(" support: " + sel.support, "regular");
593
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
514594 }
515595 if (sel.scriptnode != null)
516596 {
....@@ -581,6 +661,9 @@
581661 {
582662 CameraPane.pointflow = (PointFlow) sel;
583663 }
664
+
665
+ si.SendInfo("_____________________", "regular");
666
+ si.SendInfo("", "regular");
584667 }
585668 }
586669
....@@ -596,52 +679,140 @@
596679 }
597680 }
598681
599
- private JTextArea createTextPane()
600
- {
601
- String[] initString =
602
- {
603
- "This is an editable JTextPane, ", //regular
604
- "another ", //italic
605
- "styled ", //bold
606
- "text ", //small
607
- "component, ", //large
608
- "which supports embedded components..." + newline,//regular
609
- " " + newline, //button
610
- "...and embedded icons..." + newline, //regular
611
- " ", //icon
612
- newline + "JTextPane is a subclass of JEditorPane that "
613
- + "uses a StyledEditorKit and StyledDocument, and provides "
614
- + "cover methods for interacting with those objects."
615
- };
682
+static GraphicsDevice device = GraphicsEnvironment
683
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
616684
617
- String[] initStyles =
618
- {
619
- "regular", "italic", "bold", "small", "large",
620
- "regular", "button", "regular", "icon",
621
- "regular"
622
- };
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;
623700
624
- JTextPane textPane = new JTextPane();
625
- textPane.setEditable(true);
626
- /*StyledDocument*/ doc = textPane.getStyledDocument();
627
- addStylesToDocument(doc);
628
-
629
- try
701
+ void Minimize()
630702 {
631
- for (int j = 0; j < 2; j++)
703
+ frame.setState(Frame.ICONIFIED);
704
+ }
705
+
706
+ void Maximize()
707
+ {
708
+ if (maximized)
632709 {
633
- for (int i = 0; i < initString.length; i++)
634
- {
635
- doc.insertString(doc.getLength(), initString[i],
636
- doc.getStyle(initStyles[i]));
637
- }
710
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
638711 }
639
- } 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()
640725 {
641
- System.err.println("Couldn't insert initial text into text pane.");
726
+ if (CameraPane.FULLSCREEN)
727
+ {
728
+ device.setFullScreenWindow(null);
729
+ //frame.setVisible(false);
730
+// frame.removeNotify();
731
+// frame.setUndecorated(false);
732
+// frame.addNotify();
733
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
734
+
735
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
736
+// X framePanel.add(bigThree);
737
+// X frame.getContentPane().add(/*"Center",*/framePanel);
738
+ framePanel.setDividerLocation(1);
739
+
740
+ //frame.setVisible(true);
741
+ radio.layout = keepButton;
742
+ //theFrame = null;
743
+ keepButton = null;
744
+ radio.layout.doClick();
745
+
746
+ } else
747
+ {
748
+ keepButton = radio.layout;
749
+ //keeprect = frame.getBounds();
750
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
751
+// frame.getToolkit().getScreenSize().height);
752
+ //frame.setVisible(false);
753
+ device.setFullScreenWindow(frame);
754
+// frame.removeNotify();
755
+// frame.setUndecorated(true);
756
+// frame.addNotify();
757
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
758
+// X framePanel.remove(bigThree);
759
+// X frame.getContentPane().add(/*"Center",*/bigThree);
760
+ framePanel.setDividerLocation(0);
761
+
762
+ radio.layout = fullscreenLayout;
763
+ radio.layout.doClick();
764
+ //frame.setVisible(true);
765
+ }
766
+
767
+ cameraView.ToggleFullScreen();
642768 }
643769
644
- 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;
645816 }
646817
647818 protected void addStylesToDocument(StyledDocument doc)
....@@ -694,7 +865,7 @@
694865 protected static ImageIcon createImageIcon(String path,
695866 String description)
696867 {
697
- java.net.URL imgURL = GrafreeD.class.getResource(path);
868
+ java.net.URL imgURL = Grafreed.class.getResource(path);
698869 if (imgURL != null)
699870 {
700871 return new ImageIcon(imgURL, description);
....@@ -726,6 +897,7 @@
726897 // NumberSlider vDivsField;
727898 // JCheckBox endcaps;
728899 JCheckBox liveCB;
900
+ JCheckBox selectCB;
729901 JCheckBox hideCB;
730902 JCheckBox link2masterCB;
731903 JCheckBox markCB;
....@@ -733,7 +905,12 @@
733905 JCheckBox speedupCB;
734906 JCheckBox rewindCB;
735907 JCheckBox flipVCB;
908
+
909
+ cCheckBox toggleTextureCB;
910
+ cCheckBox toggleSwitchCB;
911
+
736912 JComboBox texresMenu;
913
+
737914 JButton resetButton;
738915 JButton stepButton;
739916 JButton stepAllButton;
....@@ -741,115 +918,87 @@
741918 JButton slowerButton;
742919 JButton fasterButton;
743920 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;
744931
745
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
932
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
746933 {
747934 JCheckBox cb;
748935
749
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
750
- oe.aConstraints.gridwidth = 1; // 3;
751
-// oe.aConstraints.weightx = 1;
752
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
753
- 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);
754937 cb.addItemListener(this);
755
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
756
- oe.aConstraints.gridwidth = 1;
757
- oe.aConstraints.gridx += 1;
758938
759939 return cb;
760940 }
761941
762
- cButton AddButton(ObjEditor oe, String label)
942
+ cButton AddButton(cGridBag panel, String label)
763943 {
764944 cButton cb;
765945
766
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
767
- oe.aConstraints.gridwidth = 1;
768
-// oe.aConstraints.weightx = 1;
769
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
770
- 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);
771947 cb.addActionListener(this);
772
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
773
- oe.aConstraints.gridwidth = 1;
774
- oe.aConstraints.gridx += 1;
775948
776949 return cb;
777950 }
778951
779
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
952
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
780953 {
781954 JComboBox combo;
782955
783
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
784
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
785
- oe.aConstraints.gridx += 1;
956
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
786957 combo.addActionListener(this);
787958
788959 return combo;
789960 }
790961
791
- 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)
792963 {
793
- NumberSlider combo;
964
+ cGridBag control = new cGridBag();
965
+
966
+ cNumberSlider combo;
794967
795968 JLabel jlabel = new JLabel(label);
796
-
797
- aConstraints.fill = GridBagConstraints.VERTICAL;
798969 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
799
- aConstraints.gridwidth = 2;
800
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
801
- aConstraints.gridx += 1;
802
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
803
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
804
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
805
- aConstraints.gridx += 1;
806
- aConstraints.gridwidth = 1;
807
-
970
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
971
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808972 combo.setFloat(current);
809
-
810
- combo.label = jlabel;
811
-
812
- combo.addChangeListener(this);
813
-
814
- return combo;
973
+
974
+ panel.add(control);
975
+
976
+ return control;
815977 }
816978
817
- 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)
818980 {
819
- NumberSlider combo;
981
+ cGridBag control = new cGridBag();
982
+
983
+ cNumberSlider combo;
820984
821985 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824986 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
825
- aConstraints.gridwidth = 2;
826
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
829
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
830
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
- aConstraints.gridx += 1;
832
- aConstraints.gridwidth = 1;
833
-
987
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
988
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834989 combo.setInteger(current);
835990
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
991
+ panel.add(control);
992
+
993
+ return control;
841994 }
842995
843
- JTextArea AddText(JPanel ctrlPanel, String name)
996
+ JTextArea AddText(cGridBag ctrlPanel, String name)
844997 {
845998 JTextArea text;
846999
847
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
848
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
849
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1000
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8501001 text.addCaretListener(this);
851
- aConstraints.gridx += 1;
852
- aConstraints.gridwidth = 1;
8531002
8541003 return text;
8551004 }
....@@ -879,9 +1028,16 @@
8791028 objEditor.ctrlPanel.remove(j);
8801029 }
8811030
1031
+ void Remove(cNumberSlider j)
1032
+ {
1033
+ j.removeChangeListener(this);
1034
+ //objEditor.ctrlPanel.remove(j.label);
1035
+ objEditor.ctrlPanel.remove(j);
1036
+ }
1037
+
8821038 /*
8831039 */
884
- void Return() // ObjEditor oe)
1040
+ void Return0() // ObjEditor oe)
8851041 {
8861042 aConstraints.gridy += 1;
8871043 aConstraints.gridx = 0;
....@@ -936,35 +1092,77 @@
9361092
9371093 void SetupUI2(ObjEditor oe)
9381094 {
939
-// oe.aConstraints.weightx = 0;
940
-// oe.aConstraints.weighty = 0;
941
-// oe.aConstraints.gridx = 0;
942
-// oe.aConstraints.gridy = 0;
943
- 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();
9441104
9451105 if (!GroupEditor.allparams)
9461106 return;
9471107
948
- liveCB = AddCheckBox(oe, "Live", copy.live);
949
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
950
- 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");
9511114 // Return();
952
- markCB = AddCheckBox(oe, "Mark", copy.marked);
953
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
954
- randomCB = AddCheckBox(oe, "Rand", copy.random);
955
- Return();
956
- resetButton = AddButton(oe, "Reset");
957
- 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");
9581147 // resetAllButton = AddButton(oe, "Reset All");
9591148 // stepAllButton = AddButton(oe, "Step All");
960
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9611149 // Return();
962
- slowerButton = AddButton(oe, "Slow");
963
- fasterButton = AddButton(oe, "Fast");
964
- 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");
9651156
966
- Return();
1157
+ oe.ctrlPanel.add(objectCommandsPanel);
1158
+ oe.ctrlPanel.Return();
9671159
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
+
9681166 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9691167 // ObjEditor.aConstraints.gridx += 1;
9701168
....@@ -1058,7 +1256,7 @@
10581256 oe.aConstraints.gridwidth = 1;
10591257 /**/
10601258 nameField = AddText(oe.ctrlPanel, copy.GetName());
1061
- Return();
1259
+ oe.ctrlPanel.Return();
10621260
10631261 //ctrlPanel.add(textureButton = new Button("Texture..."));
10641262 //textureButton.setEnabled(false);
....@@ -1160,11 +1358,25 @@
11601358 //JPanel worldPanel =
11611359 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11621360 //worldPanel.setName("World");
1163
- centralPanel = new JPanel(new BorderLayout());
1164
- timelinePanel = new JPanel(new BorderLayout());
1165
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
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);
11661368
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
+
11671378 centralPanel.add(cameraView);
1379
+ centralPanel.setFocusable(true);
11681380 //frame.setJMenuBar(timelineMenubar);
11691381 //centralPanel.add(timelinePanel);
11701382
....@@ -1183,12 +1395,13 @@
11831395 //frontView.object = copy;
11841396 //sideView.object = copy;
11851397
1186
- XYZPanel = new JPanel();
1187
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1398
+ XYZPanel = new cGridBag().setVertical(true);
1399
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11881400
1189
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1190
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1191
- 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);
11921405
11931406 /*
11941407 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1226,10 +1439,12 @@
12261439 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12271440 //tmp.setName("Edit");
12281441 objectPanel.add(materialPanel);
1229
- JPanel north = new JPanel(new BorderLayout());
1230
- north.setName("Edit");
1231
- north.add(ctrlPanel, BorderLayout.NORTH);
1232
- 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);
12331448 objectPanel.add(infoPanel);
12341449
12351450 /*
....@@ -1250,16 +1465,23 @@
12501465 scrollpane.setWheelScrollingEnabled(true);
12511466 scrollpane.addMouseWheelListener(this); // Default not fast enough
12521467
1253
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1254
- scenePanel.add(scrollpane);
1468
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1469
+ scenePanel.preferredWidth = 6;
1470
+
1471
+ JTabbedPane tabbedPane = new JTabbedPane();
1472
+ tabbedPane.add(scrollpane);
12551473
1256
- scenePanel.add(FSPane = new cFileSystemPane(this));
1257
-
1258
- optionsPanel = new JPanel(new GridBagLayout());
1474
+ optionsPanel = new cGridBag().setVertical(false);
12591475
12601476 optionsPanel.setName("Options");
1261
- scenePanel.add(optionsPanel);
1477
+
1478
+ AddOptions(optionsPanel); //, aConstraints);
1479
+
1480
+ tabbedPane.add(optionsPanel);
1481
+
1482
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12621483
1484
+ scenePanel.add(tabbedPane);
12631485
12641486 /*
12651487 cTree jTree = new cTree(null);
....@@ -1293,6 +1515,7 @@
12931515 //bigPanel.setSize(new Dimension(10,10));
12941516 //bigPanel.add(ctrlPanel);
12951517 //bigPanel.add(gridPanel);
1518
+ /**
12961519 bigThree = new JPanel();
12971520 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12981521 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1316,7 +1539,13 @@
13161539 // aConstraints.gridheight = 3;
13171540 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13181541 bigThree.add(XYZPanel, aWindowConstraints);
1542
+ /**/
13191543
1544
+ bigThree = new cGridBag();
1545
+ bigThree.addComponent(scenePanel);
1546
+ bigThree.addComponent(centralPanel);
1547
+ bigThree.addComponent(XYZPanel);
1548
+
13201549 // // SIDE EFFECT!!!
13211550 // aConstraints.gridx = 0;
13221551 // aConstraints.gridy = 0;
....@@ -1337,14 +1566,19 @@
13371566 //worldPane.add(bigPanel);
13381567 //worldPane.add(worldPanel);
13391568 /**/
1340
- frame.getContentPane().add(/*"Center",*/framePanel);
1569
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1570
+ frame.add(/*"Center",*/framePanel);
13411571 //frame.getContentPane().add(/*"Center",*/ worldPane);
13421572
13431573 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13441574
1345
- frame.setSize(1024, 768);
1346
- frame.show();
1575
+ frame.setSize(1280, 860);
1576
+
1577
+ frame.validate();
1578
+ frame.setVisible(true);
13471579
1580
+ cameraView.requestFocusInWindow();
1581
+
13481582 gridPanel.setDividerLocation(1.0);
13491583
13501584 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1358,6 +1592,10 @@
13581592 });
13591593 }
13601594
1595
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1596
+ {
1597
+ }
1598
+
13611599 JTree GetTree()
13621600 {
13631601 return objEditor.jTree;
....@@ -1369,260 +1607,173 @@
13691607 ctrlPanel.removeAll();
13701608 }
13711609
1372
- void SetupMaterial(JPanel ctrlPanel)
1610
+ void SetupMaterial(cGridBag panel)
13731611 {
1374
- aConstraints.weighty = 0;
1375
- //aConstraints.weightx = 1;
1376
- /*
1612
+ /*
13771613 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13781614 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1379
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1380
- aConstraints.gridx += 1;
13811615 */
13821616
1383
- aConstraints.gridwidth = 1;
1384
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- 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");
13881621
13891622 /*
13901623 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1391
- aConstraints.gridx += 1;
1392
- aConstraints.weighty = 0;
1393
- aConstraints.gridwidth = 1;
13941624 */
13951625
1396
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1397
- 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
+ }
13981635
1399
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1400
-
1401
- aConstraints.gridx += 1;
1402
-
1403
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1404
-
1405
- aConstraints.gridx += 1;
1406
-
1407
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1408
-
1409
- aConstraints.gridx = 0;
1410
- aConstraints.gridy += 1;
1411
- aConstraints.weighty = 0;
1412
- aConstraints.gridwidth = 1;
1636
+ editBar.preferredHeight = 15;
1637
+
1638
+ panel.add(editBar);
1639
+
14131640 /**/
14141641 //aConstraints.weighty = 0;
14151642 ////aConstraints.weightx = 1;
14161643 //aConstraints.weighty = 1;
14171644 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14181645 //aConstraints.gridx += 1;
1419
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1420
- aConstraints.weighty = 0;
1421
- aConstraints.gridx = 0;
1422
- aConstraints.gridy += 1;
1423
- aConstraints.gridwidth = 1;
1646
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14241647
1425
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1426
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1427
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1428
- aConstraints.gridx += 1;
1429
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1430
- //aConstraints.weightx = 0;
1431
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1432
- aConstraints.gridx = 0;
1433
- aConstraints.gridy += 1;
1434
- 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);
14351656
1436
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1437
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1438
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1439
- aConstraints.gridx += 1;
1440
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1441
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1442
- aConstraints.gridx = 0;
1443
- aConstraints.gridy += 1;
1444
- 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);
14451662
1446
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1447
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1448
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1449
- aConstraints.gridx += 1;
1450
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1451
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1452
- aConstraints.gridx = 0;
1453
- aConstraints.gridy += 1;
1454
- 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);
14551668
1456
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1457
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1458
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1459
- aConstraints.gridx += 1;
1460
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1461
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1462
- aConstraints.gridx = 0;
1463
- aConstraints.gridy += 1;
1464
- 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);
14651674
1466
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1467
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1468
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1469
- aConstraints.gridx += 1;
1470
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1471
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1472
- aConstraints.gridx = 0;
1473
- aConstraints.gridy += 1;
1474
- 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);
14751680
1476
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1477
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1479
- aConstraints.gridx += 1;
1480
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1481
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1482
- aConstraints.gridx = 0;
1483
- aConstraints.gridy += 1;
1484
- 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);
14851686
1486
- //aConstraints.weighty = 1;
1487
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1488
- //aConstraints.gridx += 1;
1489
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1490
- aConstraints.weighty = 0;
1491
- aConstraints.gridx = 0;
1492
- aConstraints.gridy += 1;
1493
- 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);
14941700
1495
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1496
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1497
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1498
- aConstraints.gridx += 1;
1499
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1500
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1501
- aConstraints.gridx = 0;
1502
- aConstraints.gridy += 1;
1503
- 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);
15041706
1505
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1506
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1507
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1508
- aConstraints.gridx += 1;
1509
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1510
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1511
- aConstraints.gridx = 0;
1512
- aConstraints.gridy += 1;
1513
- 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);
15141712
1515
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1516
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1517
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1518
- aConstraints.gridx += 1;
1519
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1520
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1521
- aConstraints.gridx = 0;
1522
- aConstraints.gridy += 1;
1523
- 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);
15241718
1525
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1526
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1527
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1528
- aConstraints.gridx += 1;
1529
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1530
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1531
- aConstraints.gridx = 0;
1532
- aConstraints.gridy += 1;
1533
- 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);
15341724
1535
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1536
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1537
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1538
- aConstraints.gridx += 1;
1539
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1540
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1541
- aConstraints.gridx = 0;
1542
- aConstraints.gridy += 1;
1543
- 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);
15441730
1545
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1546
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1547
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1548
- aConstraints.gridx += 1;
1549
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1550
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1551
- aConstraints.gridx = 0;
1552
- aConstraints.gridy += 1;
1553
- 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);
15541736
1555
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1556
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1557
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1558
- aConstraints.gridx += 1;
1559
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1560
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1561
- aConstraints.gridx = 0;
1562
- aConstraints.gridy += 1;
1563
- 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);
15641744
1565
- //aConstraints.weighty = 1;
1566
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1567
- //aConstraints.gridx += 1;
1568
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1569
- aConstraints.weighty = 0;
1570
- aConstraints.gridx = 0;
1571
- aConstraints.gridy += 1;
1572
- 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);
15731750
1574
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1575
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1576
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1577
- aConstraints.gridx += 1;
1578
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1579
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1580
- aConstraints.gridx = 0;
1581
- aConstraints.gridy += 1;
1582
- 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);
15831756
1584
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1585
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1586
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1587
- aConstraints.gridx += 1;
1588
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1589
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1590
- aConstraints.gridx = 0;
1591
- aConstraints.gridy += 1;
1592
- 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);
15931762
1594
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1595
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1596
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1597
- aConstraints.gridx += 1;
1598
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1599
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1600
- aConstraints.gridx = 0;
1601
- aConstraints.gridy += 1;
1602
- 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);
16031768
1604
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1605
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1606
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1607
- aConstraints.gridx += 1;
1608
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1609
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1610
- aConstraints.gridx = 0;
1611
- aConstraints.gridy += 1;
1612
- 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);
16131774
1614
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1615
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1616
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1617
- aConstraints.gridx += 1;
1618
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1619
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1620
- aConstraints.gridx = 0;
1621
- aConstraints.gridy += 1;
1622
- aConstraints.gridwidth = 1;
1623
-
1624
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1625
- Return();
1775
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1776
+ //Return();
16261777 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16271778 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16281779 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1633,130 +1784,93 @@
16331784 // aConstraints.gridy += 1;
16341785 // aConstraints.gridwidth = 1;
16351786
1636
- //aConstraints.weighty = 1;
1637
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1638
- //aConstraints.gridx += 1;
1639
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1640
- aConstraints.weighty = 0;
1641
- aConstraints.gridx = 0;
1642
- aConstraints.gridy += 1;
1643
- aConstraints.gridwidth = 1;
16441787
1645
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1646
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1647
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1648
- aConstraints.gridx += 1;
1649
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1650
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1651
- aConstraints.gridx = 0;
1652
- aConstraints.gridy += 1;
1653
- 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);
16541795
1655
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1656
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1658
- aConstraints.gridx += 1;
1659
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1660
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1661
- aConstraints.gridx = 0;
1662
- aConstraints.gridy += 1;
1663
- 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);
16641801
1665
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1666
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1667
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1668
- aConstraints.gridx += 1;
1669
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1670
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1671
- aConstraints.gridx = 0;
1672
- aConstraints.gridy += 1;
1673
- 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);
16741807
1675
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1676
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1678
- aConstraints.gridx += 1;
1679
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1680
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1681
- aConstraints.gridx = 0;
1682
- aConstraints.gridy += 1;
1683
- aConstraints.gridwidth = 1;
1684
- 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);
16851813
1686
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1687
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1689
- aConstraints.gridx += 1;
1690
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1691
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1692
- aConstraints.gridx = 0;
1693
- aConstraints.gridy += 1;
1694
- 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);
16951819
1696
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1697
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1699
- aConstraints.gridx += 1;
1700
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1701
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1702
- aConstraints.gridx = 0;
1703
- aConstraints.gridy += 1;
1704
- 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);
17051827
1706
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1707
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1709
- aConstraints.gridx += 1;
1710
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1711
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1712
- aConstraints.gridx = 0;
1713
- aConstraints.gridy += 1;
1714
- 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);
17151833
1716
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1717
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1718
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1719
- aConstraints.gridx += 1;
1720
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1721
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1722
- aConstraints.gridx = 0;
1723
- aConstraints.gridy += 1;
1724
- 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);
17251839
1726
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1727
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1728
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1729
- aConstraints.gridx += 1;
1730
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1731
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1732
- aConstraints.gridx = 0;
1733
- aConstraints.gridy += 1;
1734
- 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);
17351845
1736
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1737
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1738
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1739
- aConstraints.gridx += 1;
1740
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1741
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1742
- aConstraints.gridx = 0;
1743
- aConstraints.gridy += 1;
1744
- 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);
17451851
1746
- //aConstraints.weighty = 1;
1747
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1748
- //aConstraints.gridx += 1;
1749
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1750
- 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);
17511857
1752
- aConstraints.gridx = 0;
1753
- aConstraints.gridy = 0;
1754
- 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);
17551869
17561870 SetMaterial(copy); // .GetMaterial());
17571871
1758
- colorField.addChangeListener(this);
1759
- modulationField.addChangeListener(this);
1872
+ //colorField.addChangeListener(this);
1873
+// modulationField.addChangeListener(this);
17601874 metalnessField.addChangeListener(this);
17611875 diffuseField.addChangeListener(this);
17621876 specularField.addChangeListener(this);
....@@ -1786,12 +1900,15 @@
17861900 opacityPowerField.addChangeListener(this);
17871901 /**/
17881902
1789
- resetSlidersButton.addActionListener(this);
17901903 clearMaterialButton.addActionListener(this);
17911904 createMaterialButton.addActionListener(this);
1792
-
1793
- propagateToggle.addItemListener(this);
1794
- multiplyToggle.addItemListener(this);
1905
+
1906
+ if (Globals.ADVANCED)
1907
+ {
1908
+ resetSlidersButton.addActionListener(this);
1909
+ propagateToggle.addItemListener(this);
1910
+ multiplyToggle.addItemListener(this);
1911
+ }
17951912 }
17961913
17971914 void DropFile(java.io.File[] files, boolean textures)
....@@ -1962,7 +2079,7 @@
19622079
19632080 //? flashIt = false;
19642081 CameraPane pane = (CameraPane) cameraView;
1965
- pane.clickStart(location.x, location.y, 0);
2082
+ pane.clickStart(location.x, location.y, 0, 0);
19662083 pane.clickEnd(location.x, location.y, 0, true);
19672084
19682085 if (group.selection.size() == 1)
....@@ -2011,6 +2128,7 @@
20112128 e2.printStackTrace();
20122129 }
20132130 }
2131
+
20142132 LoadJMEThread loadThread;
20152133
20162134 class LoadJMEThread extends Thread
....@@ -2068,6 +2186,7 @@
20682186 //LoadFile0(filename, converter);
20692187 }
20702188 }
2189
+
20712190 LoadOBJThread loadObjThread;
20722191
20732192 class LoadOBJThread extends Thread
....@@ -2146,19 +2265,19 @@
21462265
21472266 void LoadObjFile(String fullname)
21482267 {
2149
- /*
2268
+ System.out.println("Loading " + fullname);
2269
+ /**/
21502270 //lastFilename = fullname;
21512271 if(loadObjThread == null)
21522272 {
2153
- loadObjThread = new LoadOBJThread();
2154
- loadObjThread.start();
2273
+ loadObjThread = new LoadOBJThread();
2274
+ loadObjThread.start();
21552275 }
21562276
21572277 loadObjThread.add(fullname);
2158
- */
2278
+ /**/
21592279
2160
- System.out.println("Loading " + fullname);
2161
- makeSomething(new FileObject(fullname, true), true);
2280
+ //makeSomething(new FileObject(fullname, true), true);
21622281 }
21632282
21642283 void LoadGFDFile(String fullname)
....@@ -2419,11 +2538,11 @@
24192538
24202539 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24212540 {
2422
- if (GrafreeD.standAlone)
2541
+ if (Grafreed.standAlone)
24232542 {
24242543 /**/
24252544 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2426
- browser.show();
2545
+ browser.setVisible(true);
24272546 String filename = browser.getFile();
24282547 if (filename != null && filename.length() > 0)
24292548 {
....@@ -2568,6 +2687,7 @@
25682687 }
25692688 if (input == null)
25702689 {
2690
+ new Exception().printStackTrace();
25712691 System.exit(0);
25722692 }
25732693
....@@ -2774,6 +2894,8 @@
27742894
27752895 void SetMaterial(Object3D object)
27762896 {
2897
+ latestObject = object;
2898
+
27772899 cMaterial mat = object.material;
27782900
27792901 if (mat == null)
....@@ -2782,7 +2904,8 @@
27822904 return;
27832905 }
27842906
2785
- multiplyToggle.setSelected(mat.multiply);
2907
+ if (multiplyToggle != null)
2908
+ multiplyToggle.setSelected(mat.multiply);
27862909
27872910 assert (object.projectedVertices != null);
27882911
....@@ -2958,7 +3081,7 @@
29583081 cameraView.ToggleDL();
29593082 cameraView.repaint();
29603083 return;
2961
- } else if (event.getSource() == toggleTextureItem)
3084
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29623085 {
29633086 cameraView.ToggleTexture();
29643087 // june 2013 copy.HardTouch();
....@@ -2966,42 +3089,40 @@
29663089 return;
29673090 } else if (event.getSource() == toggleTimelineItem)
29683091 {
2969
- copy.timeline ^= true;
3092
+ timeline ^= true;
29703093
2971
- if (copy.timeline)
3094
+ if (timeline)
29723095 {
29733096 centralPanel.remove(cameraView);
2974
- centralPanel.add(timelinePanel);
3097
+ cameraPanel.add(cameraView);
3098
+ centralPanel.add(cameraPanel);
29753099 frame.setJMenuBar(timelineMenubar);
3100
+ wasFullScreen = CameraPane.FULLSCREEN;
3101
+ if (!CameraPane.FULLSCREEN)
3102
+ ToggleFullScreen();
3103
+ toggleFullScreenItem.setEnabled(false);
29763104 }
29773105 else
29783106 {
2979
- centralPanel.remove(timelinePanel);
3107
+ centralPanel.remove(cameraPanel);
29803108 centralPanel.add(cameraView);
29813109 frame.setJMenuBar(null);
3110
+ if (!wasFullScreen)
3111
+ ToggleFullScreen();
3112
+ toggleFullScreenItem.setEnabled(true);
29823113 }
29833114
29843115 frame.validate();
29853116 return;
29863117 } else if (event.getSource() == toggleFullScreenItem)
29873118 {
2988
- if (CameraPane.FULLSCREEN)
2989
- {
2990
- frame.getContentPane().remove(/*"Center",*/bigThree);
2991
- framePanel.add(bigThree);
2992
- frame.getContentPane().add(/*"Center",*/framePanel);
2993
- } else
2994
- {
2995
- frame.getContentPane().remove(/*"Center",*/framePanel);
2996
- frame.getContentPane().add(/*"Center",*/bigThree);
2997
- }
3119
+ ToggleFullScreen();
29983120 frame.validate();
2999
- cameraView.ToggleFullScreen();
30003121
30013122 return;
3002
- } else if (event.getSource() == toggleRandomItem)
3123
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
30033124 {
3004
- cameraView.ToggleRandom();
3125
+ cameraView.ToggleSwitch();
30053126 cameraView.repaint();
30063127 return;
30073128 } else if (event.getSource() == toggleHandleItem)
....@@ -3030,6 +3151,10 @@
30303151 {
30313152 copy.live ^= true;
30323153 return;
3154
+ } else if (event.getSource() == selectCB)
3155
+ {
3156
+ copy.dontselect ^= true;
3157
+ return;
30333158 } else if (event.getSource() == hideCB)
30343159 {
30353160 copy.hide ^= true;
....@@ -3044,6 +3169,7 @@
30443169 if (event.getSource() == randomCB)
30453170 {
30463171 copy.random ^= true;
3172
+ objEditor.refreshContents();
30473173 return;
30483174 }
30493175 if (event.getSource() == speedupCB)
....@@ -3067,8 +3193,9 @@
30673193
30683194 public void actionPerformed(ActionEvent event)
30693195 {
3196
+ Object source = event.getSource();
30703197 // SCRIPT DIALOG
3071
- if (event.getSource() == okbutton)
3198
+ if (source == okbutton)
30723199 {
30733200 textpanel.setVisible(false);
30743201 textpanel.remove(textarea);
....@@ -3080,7 +3207,7 @@
30803207 textarea = null;
30813208 textpanel = null;
30823209 }
3083
- if (event.getSource() == cancelbutton)
3210
+ if (source == cancelbutton)
30843211 {
30853212 textpanel.setVisible(false);
30863213 textpanel.remove(textarea);
....@@ -3092,49 +3219,50 @@
30923219 //applySelf();
30933220 //client.refreshEditWindow();
30943221 //refreshContents();
3095
- if (event.getSource() == nameField)
3222
+ if (source == nameField)
30963223 {
30973224 //System.out.println("ObjEditor " + event);
30983225 applySelf0(true);
30993226 //parent.applySelf();
31003227 objEditor.refreshContents();
3101
- } else if (event.getSource() == resetButton)
3228
+ } else if (source == resetButton)
31023229 {
31033230 CameraPane.fullreset = true;
31043231 copy.Reset(); // ResetMeshes();
31053232 copy.Touch();
31063233 objEditor.refreshContents();
3107
- } else if (event.getSource() == stepItem)
3234
+ } else if (source == stepItem)
31083235 {
3109
- cameraView.ONESTEP = true;
3236
+ //cameraView.ONESTEP = true;
3237
+ Globals.ONESTEP = true;
31103238 cameraView.repaint();
31113239 return;
3112
- } else if (event.getSource() == stepButton)
3240
+ } else if (source == stepButton)
31133241 {
31143242 copy.Step();
31153243 copy.Touch();
31163244 objEditor.refreshContents();
3117
- } else if (event.getSource() == slowerButton)
3245
+ } else if (source == slowerButton)
31183246 {
31193247 copy.Slower();
31203248 copy.Touch();
31213249 objEditor.refreshContents();
3122
- } else if (event.getSource() == fasterButton)
3250
+ } else if (source == fasterButton)
31233251 {
31243252 copy.Faster();
31253253 copy.Touch();
31263254 objEditor.refreshContents();
3127
- } else if (event.getSource() == remarkButton)
3255
+ } else if (source == remarkButton)
31283256 {
31293257 copy.Remark();
31303258 copy.Touch();
31313259 objEditor.refreshContents();
3132
- } else if (event.getSource() == stepAllButton)
3260
+ } else if (source == stepAllButton)
31333261 {
31343262 copy.StepAll();
31353263 copy.Touch();
31363264 objEditor.refreshContents();
3137
- } else if (event.getSource() == resetAllButton)
3265
+ } else if (source == resetAllButton)
31383266 {
31393267 //CameraPane.fullreset = true;
31403268 copy.ResetAll(); // ResetMeshes();
....@@ -3167,53 +3295,75 @@
31673295 // Close();
31683296 // }
31693297 // else
3170
- if (event.getSource() == resetSlidersButton)
3298
+ if (source == resetSlidersButton)
31713299 {
31723300 ResetSliders();
3173
- } else if (event.getSource() == clearMaterialButton)
3301
+ } else if (source == clearMaterialButton)
31743302 {
31753303 ClearMaterial();
3176
- } else if (event.getSource() == createMaterialButton)
3304
+ } else if (source == createMaterialButton)
31773305 {
31783306 CreateMaterial();
3179
- } else if (event.getSource() == clearPanelButton)
3307
+ } else if (source == clearPanelButton)
31803308 {
31813309 copy.ClearUI();
31823310 refreshContents(true);
3183
- } /*
3184
- }
3185
-
3186
- public boolean action(Event event, Object arg)
3187
- {
3188
- */ 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)
31893336 {
31903337 Close();
31913338 //return true;
3192
- } else if (event.getSource() == loadItem)
3339
+ } else if (source == loadItem)
31933340 {
31943341 load();
31953342 //return true;
3196
- } else if (event.getSource() == saveItem)
3343
+ } else if (source == newItem)
3344
+ {
3345
+ New();
3346
+ } else if (source == saveItem)
31973347 {
31983348 save();
31993349 //return true;
3200
- } else if (event.getSource() == saveAsItem)
3350
+ } else if (source == saveAsItem)
32013351 {
32023352 saveAs();
32033353 //return true;
3204
- } else if (event.getSource() == reexportItem)
3354
+ } else if (source == reexportItem)
32053355 {
32063356 reexport();
32073357 //return true;
3208
- } else if (event.getSource() == exportAsItem)
3358
+ } else if (source == exportAsItem)
32093359 {
32103360 export();
32113361 //return true;
3212
- } else if (event.getSource() == povItem)
3362
+ } else if (source == povItem)
32133363 {
32143364 generatePOV();
32153365 //return true;
3216
- } else if (event.getSource() == zBufferItem)
3366
+ } else if (source == zBufferItem)
32173367 {
32183368 try
32193369 {
....@@ -3235,21 +3385,8 @@
32353385 cameraView.repaint();
32363386 //return true;
32373387 }
3238
- */ else if (event.getSource() == editCameraItem)
3239
- {
3240
- cameraView.ProtectCamera();
3241
- cameraView.repaint();
3242
- return;
3243
- } else if (event.getSource() == revertCameraItem)
3244
- {
3245
- cameraView.RevertCamera();
3246
- cameraView.repaint();
3247
- return;
3248
-// } else if (event.getSource() == textureButton)
3249
-// {
3250
-// return; // true;
3251
- } else // combos...
3252
- if (event.getSource() == texresMenu)
3388
+ */ else // combos...
3389
+ if (source == texresMenu)
32533390 {
32543391 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32553392 copy.texres = texresMenu.getSelectedIndex();
....@@ -3261,27 +3398,287 @@
32613398 }
32623399 }
32633400
3264
- void ToggleAnimation()
3401
+ void New()
32653402 {
3266
- if (!CameraPane.ANIMATION)
3403
+ while (copy.Size() > 1)
32673404 {
3268
- 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);
32693632 browser.show();
32703633 String filename = browser.getFile();
32713634 if (filename != null && filename.length() > 0)
32723635 {
3273
- 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;
32743671 //CameraPane.framecount = 0;
3275
- CameraPane.imagecount = 0;
3672
+ Globals.imagecount = 0;
32763673
3277
- CameraPane.ANIMATION ^= true;
3674
+ Globals.ANIMATION ^= true;
32783675
3279
- GrafreeD.wav.cursor = 0;
3280
- GrafreeD.wav.loop = 0;
3676
+ Grafreed.wav.cursor = 0;
3677
+ Grafreed.wav.loop = 0;
32813678 }
32823679 } else
32833680 {
3284
- CameraPane.ANIMATION ^= true;
3681
+ Globals.ANIMATION ^= true;
32853682 }
32863683 }
32873684
....@@ -3327,7 +3724,7 @@
33273724 void CreateMaterial()
33283725 {
33293726 //copy.ClearMaterial(); // PATCH
3330
- copy.CreateMaterialS(multiplyToggle.isSelected());
3727
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33313728 if (copy.selection.size() > 0)
33323729 //SetMaterial(copy);
33333730 {
....@@ -3378,7 +3775,7 @@
33783775 assert false;
33793776 }
33803777
3381
- void EditSelection()
3778
+ void EditSelection(boolean newWindow)
33823779 {
33833780 }
33843781
....@@ -3386,11 +3783,11 @@
33863783 {
33873784 copy.ResetBlockLoop(); // temporary problem
33883785
3389
- boolean random = CameraPane.RANDOM;
3390
- CameraPane.RANDOM = false; // parse everything
3786
+ boolean random = CameraPane.SWITCH;
3787
+ CameraPane.SWITCH = false; // parse everything
33913788 copy.ResetDisplayList();
33923789 copy.HardTouch();
3393
- CameraPane.RANDOM = random;
3790
+ CameraPane.SWITCH = random;
33943791 }
33953792
33963793 // public void applySelf()
....@@ -3460,10 +3857,40 @@
34603857 current.fakedepth = (float) fakedepthField.getFloat();
34613858 current.shadowbias = (float) shadowbiasField.getFloat();
34623859
3463
- if (!NumberSlider.frozen)
3860
+ if (!cNumberSlider.frozen)
34643861 {
34653862 //System.out.println("Propagate = " + propagate);
34663863 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
+
34673894 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34683895 {
34693896 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3508,6 +3935,7 @@
35083935 || e.getSource() == apertureField
35093936 || e.getSource() == shadowblurField)
35103937 {
3938
+ new Exception().printStackTrace();
35113939 System.exit(0);
35123940 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35133941 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3534,7 +3962,13 @@
35343962 //System.out.println("PARENT = " + parent);
35353963 //if (parent != null)
35363964 // parent.applySelf();
3537
- refreshContents();
3965
+ if (e.getSource() == normalpushField)
3966
+ {
3967
+ objEditor.refreshContents();
3968
+ //Refresh();
3969
+ }
3970
+ else
3971
+ refreshContents();
35383972 // ??? client.refreshEditWindow();
35393973 }
35403974 //else
....@@ -3546,7 +3980,7 @@
35463980 //group.name = nameField.getText();
35473981 //objEditor.applySelf();
35483982
3549
- assert (objEditor == this);
3983
+ // OCT2018: assert (objEditor == this);
35503984 if (copy.selection == null || copy.selection.size() == 0)
35513985 //super.applySelf()
35523986 ; else
....@@ -3570,12 +4004,18 @@
35704004 objEditor.copy = keep;
35714005 }
35724006 }
4007
+
4008
+ if (normalpushField != null)
4009
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35734010 }
35744011
35754012 void SnapObject()
35764013 {
3577
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3578
- SnapObject(obj);
4014
+ if (copy.selection.size() > 0)
4015
+ {
4016
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
4017
+ SnapObject(obj);
4018
+ }
35794019 }
35804020
35814021 void SnapObject(Object3D obj)
....@@ -3821,7 +4261,7 @@
38214261
38224262 radioPanel.revalidate();
38234263 radioPanel.repaint();
3824
- ctrlPanel.revalidate(); // ? new
4264
+ ctrlPanel.validate(); // ? new
38254265 ctrlPanel.repaint();
38264266 }
38274267 }
....@@ -3830,6 +4270,8 @@
38304270
38314271 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38324272 {
4273
+ if (Globals.SAVEONMAKE) // && resetmodel)
4274
+ Save();
38334275 //Tween.set(thing, 0).target(1).start(tweenManager);
38344276 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38354277 // if (thing instanceof GenericJointDemo)
....@@ -3916,6 +4358,12 @@
39164358 {
39174359 ResetModel();
39184360 Select(thing.GetTreePath(), true, false); // unselect... false);
4361
+
4362
+ if (thing.Size() == 0)
4363
+ {
4364
+ //EditSelection(false);
4365
+ }
4366
+
39194367 refreshContents();
39204368 }
39214369
....@@ -4033,6 +4481,7 @@
40334481 }
40344482 }
40354483 }
4484
+
40364485 LoadGFDThread loadGFDThread;
40374486
40384487 void ReadGFD(String fullname, iCallBack cb)
....@@ -4052,8 +4501,10 @@
40524501
40534502 try
40544503 {
4504
+ // Try compressed version first.
40554505 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4056
- 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);
40574508
40584509 readobj = (Object3D) p.readObject();
40594510 istream.close();
....@@ -4061,7 +4512,20 @@
40614512 readobj.ResetDisplayList();
40624513 } catch (Exception e)
40634514 {
4064
- 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
+ }
40654529 }
40664530 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40674531 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4107,6 +4571,12 @@
41074571
41084572 void LoadIt(Object obj)
41094573 {
4574
+ if (obj == null)
4575
+ {
4576
+ // Invalid file
4577
+ return;
4578
+ }
4579
+
41104580 System.out.println("Loaded " + obj);
41114581 //new Exception().printStackTrace();
41124582 Object3D readobj = (Object3D) obj;
....@@ -4116,6 +4586,8 @@
41164586
41174587 if (readobj != null)
41184588 {
4589
+ if (Globals.SAVEONMAKE)
4590
+ Save();
41194591 try
41204592 {
41214593 //readobj.deepCopySelf(copy);
....@@ -4178,7 +4650,7 @@
41784650
41794651 void load() // throws ClassNotFoundException
41804652 {
4181
- if (GrafreeD.standAlone)
4653
+ if (Grafreed.standAlone)
41824654 {
41834655 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
41844656 browser.show();
....@@ -4265,11 +4737,13 @@
42654737 try
42664738 {
42674739 FileOutputStream ostream = new FileOutputStream(lastname);
4268
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4740
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4741
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42694742
42704743 p.writeObject(copy);
42714744 p.flush();
42724745
4746
+ zstream.close();
42734747 ostream.close();
42744748
42754749 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4279,11 +4753,12 @@
42794753 {
42804754 }
42814755 }
4756
+
42824757 String lastname;
42834758
42844759 void saveAs()
42854760 {
4286
- if (GrafreeD.standAlone)
4761
+ if (Grafreed.standAlone)
42874762 {
42884763 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42894764 browser.setVisible(true);
....@@ -4388,13 +4863,13 @@
43884863 try
43894864 {
43904865 FileOutputStream ostream = new FileOutputStream(filename);
4391
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4392
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4866
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4867
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43934868
43944869 Object3D objectparent = obj.parent;
43954870 obj.parent = null;
43964871
4397
- Object3D object = (Object3D) GrafreeD.clone(obj);
4872
+ Object3D object = (Object3D) Grafreed.clone(obj);
43984873
43994874 obj.parent = objectparent;
44004875
....@@ -4406,8 +4881,8 @@
44064881 p.writeObject(object);
44074882 p.flush();
44084883
4884
+ zstream.close();
44094885 ostream.close();
4410
- // zstream.close();
44114886
44124887 // group.selection.get(0).parent = parent;
44134888 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4428,7 +4903,7 @@
44284903 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44294904 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44304905 copy.generatePOV(buffer);
4431
- if (GrafreeD.standAlone)
4906
+ if (Grafreed.standAlone)
44324907 {
44334908 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44344909 browser.show();
....@@ -4454,7 +4929,8 @@
44544929 Object3D client;
44554930 Object3D copy;
44564931 MenuBar menuBar;
4457
- Menu windowMenu;
4932
+ Menu fileMenu;
4933
+ MenuItem newItem;
44584934 MenuItem loadItem;
44594935 MenuItem saveItem;
44604936 MenuItem saveAsItem;
....@@ -4462,13 +4938,11 @@
44624938 MenuItem reexportItem;
44634939 MenuItem povItem;
44644940 MenuItem closeItem;
4465
- Menu cameraMenu;
4941
+
44664942 CheckboxMenuItem zBufferItem;
44674943 //MenuItem normalLensItem;
4468
- MenuItem editCameraItem;
4469
- MenuItem revertCameraItem;
4470
- CheckboxMenuItem toggleLiveItem;
44714944 MenuItem stepItem;
4945
+ CheckboxMenuItem toggleLiveItem;
44724946 CheckboxMenuItem toggleFullScreenItem;
44734947 CheckboxMenuItem toggleTimelineItem;
44744948 CheckboxMenuItem toggleRenderItem;
....@@ -4477,28 +4951,42 @@
44774951 CheckboxMenuItem toggleFootContactItem;
44784952 CheckboxMenuItem toggleDLItem;
44794953 CheckboxMenuItem toggleTextureItem;
4480
- CheckboxMenuItem toggleRandomItem;
4954
+ CheckboxMenuItem toggleSwitchItem;
44814955 CheckboxMenuItem toggleRootItem;
44824956 CheckboxMenuItem animationItem;
44834957 CheckboxMenuItem toggleHandleItem;
44844958 CheckboxMenuItem togglePaintItem;
44854959 JSplitPane mainPanel;
44864960 JScrollPane scrollpane;
4961
+
44874962 JPanel toolbarPanel;
4488
- JPanel treePanel;
4963
+
4964
+ cGridBag treePanel;
4965
+
44894966 JPanel radioPanel;
44904967 ButtonGroup buttonGroup;
4491
- JPanel ctrlPanel;
4492
- JPanel materialPanel;
4968
+
4969
+ cGridBag toolboxPanel;
4970
+ cGridBag materialPanel;
4971
+ cGridBag ctrlPanel;
4972
+
44934973 JScrollPane infoPanel;
4494
- JPanel optionsPanel;
4974
+
4975
+ cGridBag optionsPanel;
4976
+
44954977 JTabbedPane objectPanel;
4496
- JPanel XYZPanel;
4978
+ boolean materialFlushed;
4979
+ Object3D latestObject;
4980
+
4981
+ cGridBag XYZPanel;
4982
+
44974983 JSplitPane gridPanel;
44984984 JSplitPane bigPanel;
4499
- JPanel bigThree;
4500
- JTabbedPane scenePanel;
4501
- JPanel centralPanel;
4985
+
4986
+ cGridBag bigThree;
4987
+ cGridBag scenePanel;
4988
+ cGridBag centralPanel;
4989
+ JSplitPane cameraPanel;
45024990 JPanel timelinePanel;
45034991 JMenuBar timelineMenubar;
45044992 JSplitPane framePanel;
....@@ -4550,65 +5038,72 @@
45505038 // MATERIAL
45515039 JLabel materialLabel;
45525040 JLabel colorLabel;
4553
- NumberSlider colorField;
5041
+ cNumberSlider colorField;
45545042 JLabel modulationLabel;
4555
- NumberSlider modulationField;
5043
+ cNumberSlider modulationField;
45565044 JLabel metalnessLabel;
4557
- NumberSlider metalnessField;
5045
+ cNumberSlider metalnessField;
45585046 JLabel diffuseLabel;
4559
- NumberSlider diffuseField;
5047
+ cNumberSlider diffuseField;
45605048 JLabel specularLabel;
4561
- NumberSlider specularField;
5049
+ cNumberSlider specularField;
45625050 JLabel shininessLabel;
4563
- NumberSlider shininessField;
5051
+ cNumberSlider shininessField;
45645052 JLabel shiftLabel;
4565
- NumberSlider shiftField;
5053
+ cNumberSlider shiftField;
45665054 JLabel ambientLabel;
4567
- NumberSlider ambientField;
5055
+ cNumberSlider ambientField;
45685056 JLabel lightareaLabel;
4569
- NumberSlider lightareaField;
5057
+ cNumberSlider lightareaField;
45705058 JLabel diffusenessLabel;
4571
- NumberSlider diffusenessField;
5059
+ cNumberSlider diffusenessField;
45725060 JLabel velvetLabel;
4573
- NumberSlider velvetField;
5061
+ cNumberSlider velvetField;
45745062 JLabel sheenLabel;
4575
- NumberSlider sheenField;
5063
+ cNumberSlider sheenField;
45765064 JLabel subsurfaceLabel;
4577
- NumberSlider subsurfaceField;
5065
+ cNumberSlider subsurfaceField;
45785066 //JLabel bumpLabel;
45795067 //NumberSlider bumpField;
45805068 JLabel backlitLabel;
4581
- NumberSlider backlitField;
5069
+ cNumberSlider backlitField;
45825070 JLabel anisoLabel;
4583
- NumberSlider anisoField;
5071
+ cNumberSlider anisoField;
45845072 JLabel anisoVLabel;
4585
- NumberSlider anisoVField;
5073
+ cNumberSlider anisoVField;
45865074 JLabel cameraLabel;
4587
- NumberSlider cameraField;
5075
+ cNumberSlider cameraField;
45885076 JLabel selfshadowLabel;
4589
- NumberSlider selfshadowField;
5077
+ cNumberSlider selfshadowField;
45905078 JLabel shadowLabel;
4591
- NumberSlider shadowField;
5079
+ cNumberSlider shadowField;
45925080 JLabel textureLabel;
4593
- NumberSlider textureField;
5081
+ cNumberSlider textureField;
45945082 JLabel opacityLabel;
4595
- NumberSlider opacityField;
5083
+ cNumberSlider opacityField;
45965084 JLabel fakedepthLabel;
4597
- NumberSlider fakedepthField;
5085
+ cNumberSlider fakedepthField;
45985086 JLabel shadowbiasLabel;
4599
- NumberSlider shadowbiasField;
5087
+ cNumberSlider shadowbiasField;
46005088 JLabel bumpLabel;
4601
- NumberSlider bumpField;
5089
+ cNumberSlider bumpField;
46025090 JLabel noiseLabel;
4603
- NumberSlider noiseField;
5091
+ cNumberSlider noiseField;
46045092 JLabel powerLabel;
4605
- NumberSlider powerField;
5093
+ cNumberSlider powerField;
46065094 JLabel borderfadeLabel;
4607
- NumberSlider borderfadeField;
5095
+ cNumberSlider borderfadeField;
46085096 JLabel fogLabel;
4609
- NumberSlider fogField;
5097
+ cNumberSlider fogField;
46105098 JLabel opacityPowerLabel;
4611
- NumberSlider opacityPowerField;
4612
- JTree jTree;
5099
+ cNumberSlider opacityPowerField;
5100
+ cTree jTree;
46135101 //ObjectUI parent;
5102
+
5103
+ cNumberSlider normalpushField;
5104
+
5105
+ private MenuItem importGFDItem;
5106
+ private MenuItem importVRMLX3DItem;
5107
+ private MenuItem import3DSItem;
5108
+ private MenuItem importOBJItem;
46145109 }