Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -19,6 +20,8 @@
1920 import //weka.core.
2021 matrix.Matrix;
2122
23
+import grafeme.ui.*;
24
+
2225 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2326 ActionListener, ChangeListener,
2427 InputMethodListener,
....@@ -31,6 +34,70 @@
3134 boolean timeline;
3235 boolean wasFullScreen;
3336
37
+ GroupEditor callee;
38
+ JFrame frame;
39
+
40
+ static ObjEditor theFrame;
41
+
42
+ cButton GetButton(String name, boolean border)
43
+ {
44
+ try
45
+ {
46
+ ImageIcon icon = GetIcon(name);
47
+ return new cButton(icon, border);
48
+ }
49
+ catch (Exception e)
50
+ {
51
+ return new cButton(name, border);
52
+ }
53
+ }
54
+
55
+ cToggleButton GetToggleButton(String name, boolean border)
56
+ {
57
+ try
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cToggleButton(icon, border);
61
+ }
62
+ catch (Exception e)
63
+ {
64
+ return new cToggleButton(name, border);
65
+ }
66
+ }
67
+
68
+ cCheckBox GetCheckBox(String name, boolean border)
69
+ {
70
+ try
71
+ {
72
+ ImageIcon icon = GetIcon(name);
73
+ return new cCheckBox(icon, border);
74
+ }
75
+ catch (Exception e)
76
+ {
77
+ return new cCheckBox(name, border);
78
+ }
79
+ }
80
+
81
+ private ImageIcon GetIcon(String name) throws IOException
82
+ {
83
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
84
+
85
+ if (image.getWidth() != 24 && image.getHeight() != 24)
86
+ {
87
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
88
+ Graphics2D g = resized.createGraphics();
89
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
90
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
91
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
92
+ g.dispose();
93
+
94
+ image = resized;
95
+ }
96
+
97
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
98
+ return icon;
99
+ }
100
+
34101 // SCRIPT
35102
36103 transient JFrame textpanel = null;
....@@ -121,47 +188,54 @@
121188 void keyPressed(int key, int modifiers)
122189 {
123190 System.out.println("KEY PRESSED");
124
- CameraPane.theRenderer.keyPressed(key, modifiers);
191
+ Globals.theRenderer.keyPressed(key, modifiers);
125192 }
126193 */
127194
128195 static GridBagConstraints aConstraints;
129196 static GridBagConstraints aWindowConstraints;
130
- GroupEditor callee;
131
- JFrame frame;
197
+
132198 static int GRIDWIDTH = 100; // 4;
133199
134200 public void closeUI()
135201 {
136202 //new Exception().printStackTrace();
137
- System.out.println("this = " + this);
138
- System.out.println("objEditor = " + objEditor);
203
+// System.out.println("this = " + this);
204
+// System.out.println("objEditor = " + objEditor);
139205 //nameField.removeActionListener(this);
140
- objEditor.ctrlPanel.remove(nameField);
206
+// objEditor.ctrlPanel.remove(nameField);
141207
142
- if (!GroupEditor.allparams)
208
+ objEditor.ctrlPanel.remove(namePanel);
209
+
210
+ if (!allparams)
143211 return;
144212
145
- objEditor.ctrlPanel.remove(liveCB);
146
- objEditor.ctrlPanel.remove(hideCB);
147
- objEditor.ctrlPanel.remove(markCB);
148
-
149
- objEditor.ctrlPanel.remove(randomCB);
150
- objEditor.ctrlPanel.remove(speedupCB);
151
- objEditor.ctrlPanel.remove(rewindCB);
152
-
153
- objEditor.ctrlPanel.remove(resetButton);
154
- objEditor.ctrlPanel.remove(stepButton);
155
-// objEditor.ctrlPanel.remove(stepAllButton);
156
-// objEditor.ctrlPanel.remove(resetAllButton);
157
- objEditor.ctrlPanel.remove(link2masterCB);
158
- //objEditor.ctrlPanel.remove(flipVCB);
159
- //objEditor.ctrlPanel.remove(texresMenu);
160
- objEditor.ctrlPanel.remove(slowerButton);
161
- objEditor.ctrlPanel.remove(fasterButton);
162
- objEditor.ctrlPanel.remove(remarkButton);
213
+// objEditor.ctrlPanel.remove(liveCB);
214
+// objEditor.ctrlPanel.remove(hideCB);
215
+// objEditor.ctrlPanel.remove(markCB);
216
+//
217
+// objEditor.ctrlPanel.remove(randomCB);
218
+// objEditor.ctrlPanel.remove(speedupCB);
219
+// objEditor.ctrlPanel.remove(rewindCB);
220
+//
221
+// objEditor.ctrlPanel.remove(resetButton);
222
+// objEditor.ctrlPanel.remove(stepButton);
223
+//// objEditor.ctrlPanel.remove(stepAllButton);
224
+//// objEditor.ctrlPanel.remove(resetAllButton);
225
+// objEditor.ctrlPanel.remove(link2masterCB);
226
+// //objEditor.ctrlPanel.remove(flipVCB);
227
+// //objEditor.ctrlPanel.remove(texresMenu);
228
+// objEditor.ctrlPanel.remove(slowerButton);
229
+// objEditor.ctrlPanel.remove(fasterButton);
230
+// objEditor.ctrlPanel.remove(remarkButton);
163231
164
- Remove(normalpushField);
232
+ objEditor.ctrlPanel.remove(setupPanel);
233
+ objEditor.ctrlPanel.remove(setupPanel2);
234
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
235
+ objEditor.ctrlPanel.remove(pushPanel);
236
+ //objEditor.ctrlPanel.remove(fillPanel);
237
+
238
+ //Remove(normalpushField);
165239 }
166240
167241 public ObjEditor GetEditor()
....@@ -232,6 +306,7 @@
232306 //localCopy.parent = null;
233307
234308 frame = new JFrame();
309
+ frame.setUndecorated(true);
235310 objEditor = this;
236311 this.callee = callee;
237312
....@@ -262,27 +337,48 @@
262337 return frame.action(event, obj);
263338 }
264339
340
+ // Cannot work without static
341
+ static boolean allparams = true;
342
+
343
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
344
+
265345 void SetupMenu()
266346 {
267347 frame.setMenuBar(menuBar = new MenuBar());
268
- menuBar.add(windowMenu = new Menu("File"));
269
- windowMenu.add(loadItem = new MenuItem("Load..."));
270
- windowMenu.add("-");
271
- windowMenu.add(saveItem = new MenuItem("Save"));
272
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
348
+ menuBar.add(fileMenu = new Menu("File"));
349
+ fileMenu.add(newItem = new MenuItem("New"));
350
+ fileMenu.add(loadItem = new MenuItem("Open..."));
351
+
352
+ //oe.menuBar.add(menu = new Menu("Include"));
353
+ Menu menu = new Menu("Import");
354
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
355
+ importOBJItem.addActionListener(this);
356
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
357
+ import3DSItem.addActionListener(this);
358
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
359
+ importVRMLX3DItem.addActionListener(this);
360
+ menu.add("-");
361
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
362
+ importGFDItem.addActionListener(this);
363
+ fileMenu.add(menu);
364
+ fileMenu.add("-");
365
+
366
+ fileMenu.add(saveItem = new MenuItem("Save"));
367
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
273368 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
274
- windowMenu.add("-");
275
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
276
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
277
- windowMenu.add("-");
369
+ fileMenu.add("-");
370
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
371
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
372
+ fileMenu.add("-");
278373 if (client.parent != null)
279374 {
280
- windowMenu.add(closeItem = new MenuItem("Close"));
375
+ fileMenu.add(closeItem = new MenuItem("Close"));
281376 } else
282377 {
283
- windowMenu.add(closeItem = new MenuItem("Exit"));
378
+ fileMenu.add(closeItem = new MenuItem("Exit"));
284379 }
285380
381
+ newItem.addActionListener(this);
286382 loadItem.addActionListener(this);
287383 saveItem.addActionListener(this);
288384 saveAsItem.addActionListener(this);
....@@ -291,79 +387,64 @@
291387 //povItem.addActionListener(this);
292388 closeItem.addActionListener(this);
293389
294
- menuBar.add(cameraMenu = new Menu("View"));
295
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
296
- //zBufferItem.addActionListener(this);
297
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
298
- //normalLensItem.addActionListener(this);
299
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
300
- revertCameraItem.addActionListener(this);
301
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
302
- toggleTimelineItem.addItemListener(this);
303
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
304
- toggleFullScreenItem.addItemListener(this);
305
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
306
- cameraMenu.add("-");
307
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
308
- toggleTextureItem.addItemListener(this);
309
- toggleTextureItem.setState(CameraPane.textureon);
310
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
311
- toggleLiveItem.addItemListener(this);
312
- toggleLiveItem.setState(CameraPane.isLIVE());
313
- cameraMenu.add(stepItem = new MenuItem("Step"));
314
- stepItem.addActionListener(this);
315
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
316
-// toggleDLItem.addItemListener(this);
317
-// toggleDLItem.setState(false);
318
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
319
- toggleRenderItem.addItemListener(this);
320
- toggleRenderItem.setState(!CameraPane.frozen);
321
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
322
- toggleDebugItem.addItemListener(this);
323
- toggleDebugItem.setState(CameraPane.DEBUG);
324
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
325
- toggleFrustumItem.addItemListener(this);
326
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
327
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
328
- toggleFootContactItem.addItemListener(this);
329
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
330
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
331
- toggleRandomItem.addItemListener(this);
332
- toggleRandomItem.setState(CameraPane.RANDOM);
333
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
334
- toggleHandleItem.addItemListener(this);
335
- toggleHandleItem.setState(CameraPane.HANDLES);
336
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
337
- togglePaintItem.addItemListener(this);
338
- togglePaintItem.setState(CameraPane.PAINTMODE);
339
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
340
-// toggleRootItem.addItemListener(this);
341
-// toggleRootItem.setState(false);
342
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
343
-// animationItem.addItemListener(this);
344
-// animationItem.setState(CameraPane.ANIMATION);
345
- cameraMenu.add("-");
346
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
347
- editCameraItem.addActionListener(this);
348
-
349390 objectPanel = new JTabbedPane();
391
+
392
+ ChangeListener changeListener = new ChangeListener()
393
+ {
394
+ public void stateChanged(ChangeEvent changeEvent)
395
+ {
396
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
397
+// {
398
+// if (latestObject != null)
399
+// {
400
+// refreshContents(true);
401
+// SetMaterial(latestObject);
402
+// }
403
+//
404
+// materialFlushed = true;
405
+// }
406
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
407
+// {
408
+// if (listUI.size() == 0)
409
+// EditSelection(false);
410
+// }
411
+
412
+ refreshContents(false); // To refresh Info tab
413
+ }
414
+ };
415
+ objectPanel.addChangeListener(changeListener);
416
+
350417 toolbarPanel = new JPanel();
351418 toolbarPanel.setName("Toolbar");
352
- treePanel = new JPanel();
419
+ treePanel = new cGridBag();
353420 treePanel.setName("Tree");
354
- ctrlPanel = new JPanel(); // new GridBagLayout());
355
- ctrlPanel.setName("Edit");
356
- materialPanel = new JPanel();
421
+
422
+ editPanel = new cGridBag().setVertical(true);
423
+ editPanel.setName("Edit");
424
+
425
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
426
+
427
+ editCommandsPanel = new cGridBag();
428
+ editPanel.add(editCommandsPanel);
429
+ editPanel.add(ctrlPanel);
430
+
431
+ toolboxPanel = new cGridBag().setVertical(false);
432
+ toolboxPanel.setName("Toolbox");
433
+
434
+ materialPanel = new cGridBag().setVertical(true);
357435 materialPanel.setName("Material");
436
+
358437 /*JTextPane*/
359438 infoarea = createTextPane();
439
+ doc = infoarea.getStyledDocument();
440
+
360441 infoarea.setEditable(true);
361442 SetText();
362443 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
363444 // infoarea.setOpaque(false);
364445 // //infoarea.setForeground(textcolor);
365
- infoarea.setLineWrap(true);
366
- infoarea.setWrapStyleWord(true);
446
+// TEXTAREA infoarea.setLineWrap(true);
447
+// TEXTAREA infoarea.setWrapStyleWord(true);
367448 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
368449 infoPanel.setPreferredSize(new Dimension(50, 200));
369450 infoPanel.setName("Info");
....@@ -374,16 +455,16 @@
374455 mainPanel.setName("Main");
375456 mainPanel.setContinuousLayout(true);
376457 mainPanel.setOneTouchExpandable(true);
377
- mainPanel.setDividerLocation(1.0);
378458 mainPanel.setDividerSize(9);
379
- mainPanel.setResizeWeight(0);
459
+ mainPanel.setDividerLocation(0.5); //1.0);
460
+ mainPanel.setResizeWeight(0.5);
380461
381462 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
382463 //mainPanel.setLayout(new GridBagLayout());
383464 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
384
- treePanel.setLayout(new GridBagLayout());
385
- ctrlPanel.setLayout(new GridBagLayout());
386
- materialPanel.setLayout(new GridBagLayout());
465
+// treePanel.setLayout(new GridBagLayout());
466
+ //ctrlPanel.setLayout(new GridBagLayout());
467
+ //materialPanel.setLayout(new GridBagLayout());
387468
388469 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
389470 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -422,7 +503,7 @@
422503 static String newline = "\n";
423504 protected static final String buttonString = "JButton";
424505 StyledDocument doc;
425
- JTextArea infoarea;
506
+ JTextPane infoarea;
426507
427508 void ClearInfo()
428509 {
....@@ -445,10 +526,10 @@
445526 e.printStackTrace();
446527 }
447528
448
- String selection = infoarea.getText();
449
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
450
- java.awt.datatransfer.Clipboard clipboard =
451
- Toolkit.getDefaultToolkit().getSystemClipboard();
529
+// String selection = infoarea.getText();
530
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
531
+// java.awt.datatransfer.Clipboard clipboard =
532
+// Toolkit.getDefaultToolkit().getSystemClipboard();
452533 //clipboard.setContents(data, data);
453534 }
454535
....@@ -471,13 +552,13 @@
471552 //SendInfo("Name:", "bold");
472553 if (sel.GetTextures() != null || debug)
473554 {
474
- si.SendInfo(sel.toString(), "bold");
555
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
475556 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
476557 if (sel.Size() > 0)
477558 {
478559 si.SendInfo("#children = " + sel.Size(), "regular");
479560 }
480
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
561
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
481562 if (debug)
482563 {
483564 try
....@@ -489,7 +570,10 @@
489570 }
490571
491572 if (full)
492
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
573
+ {
574
+ si.SendInfo(" BBox min: " + minima, "regular");
575
+ si.SendInfo(" BBox max: " + maxima, "regular");
576
+ }
493577
494578 if (sel.bRep != null)
495579 {
....@@ -516,7 +600,7 @@
516600 }
517601 if (sel.support != null)
518602 {
519
- si.SendInfo(" support: " + sel.support, "regular");
603
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
520604 }
521605 if (sel.scriptnode != null)
522606 {
....@@ -587,6 +671,9 @@
587671 {
588672 CameraPane.pointflow = (PointFlow) sel;
589673 }
674
+
675
+ si.SendInfo("_____________________", "regular");
676
+ si.SendInfo("", "regular");
590677 }
591678 }
592679
....@@ -602,68 +689,140 @@
602689 }
603690 }
604691
692
+static GraphicsDevice device = GraphicsEnvironment
693
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
694
+
695
+ Rectangle keeprect;
696
+ cRadio radio;
697
+
698
+cButton keepButton;
699
+ cButton twoButton; // Full 3D
700
+ cButton sixButton;
701
+ cButton threeButton;
702
+ cButton sevenButton;
703
+ cButton fourButton; // full panel
704
+ cButton oneButton; // full XYZ
705
+ //cButton currentLayout;
706
+
707
+ boolean maximized;
708
+
709
+ cButton fullscreenLayout;
710
+
711
+ void Minimize()
712
+ {
713
+ frame.setState(Frame.ICONIFIED);
714
+ }
715
+
716
+ void Maximize()
717
+ {
718
+ if (maximized)
719
+ {
720
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
721
+ }
722
+ else
723
+ {
724
+ keeprect = frame.getBounds();
725
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
726
+ Dimension rect2 = frame.getToolkit().getScreenSize();
727
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
728
+// frame.setState(Frame.MAXIMIZED_BOTH);
729
+ }
730
+
731
+ maximized ^= true;
732
+ }
733
+
605734 void ToggleFullScreen()
606735 {
607
- if (CameraPane.FULLSCREEN)
736
+ cameraView.ToggleFullScreen();
737
+
738
+ if (!CameraPane.FULLSCREEN)
608739 {
609
- frame.getContentPane().remove(/*"Center",*/bigThree);
610
- framePanel.add(bigThree);
611
- frame.getContentPane().add(/*"Center",*/framePanel);
740
+ device.setFullScreenWindow(null);
741
+ //frame.setVisible(false);
742
+// frame.removeNotify();
743
+// frame.setUndecorated(false);
744
+// frame.addNotify();
745
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
746
+
747
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
748
+// X framePanel.add(bigThree);
749
+// X frame.getContentPane().add(/*"Center",*/framePanel);
750
+ framePanel.setDividerLocation(1);
751
+
752
+ //frame.setVisible(true);
753
+ radio.layout = keepButton;
754
+ //theFrame = null;
755
+ keepButton = null;
756
+ radio.layout.doClick();
757
+
612758 } else
613759 {
614
- frame.getContentPane().remove(/*"Center",*/framePanel);
615
- framePanel.remove(bigThree);
616
- frame.getContentPane().add(/*"Center",*/bigThree);
760
+ keepButton = radio.layout;
761
+ //keeprect = frame.getBounds();
762
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
763
+// frame.getToolkit().getScreenSize().height);
764
+ //frame.setVisible(false);
765
+ device.setFullScreenWindow(frame);
766
+// frame.removeNotify();
767
+// frame.setUndecorated(true);
768
+// frame.addNotify();
769
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
770
+// X framePanel.remove(bigThree);
771
+// X frame.getContentPane().add(/*"Center",*/bigThree);
772
+ framePanel.setDividerLocation(0);
773
+
774
+ radio.layout = fullscreenLayout;
775
+ radio.layout.doClick();
776
+ //frame.setVisible(true);
617777 }
618
- cameraView.ToggleFullScreen();
619778 }
620779
621
- private JTextArea createTextPane()
780
+ private JTextPane createTextPane()
622781 {
623
- String[] initString =
624
- {
625
- "This is an editable JTextPane, ", //regular
626
- "another ", //italic
627
- "styled ", //bold
628
- "text ", //small
629
- "component, ", //large
630
- "which supports embedded components..." + newline,//regular
631
- " " + newline, //button
632
- "...and embedded icons..." + newline, //regular
633
- " ", //icon
634
- newline + "JTextPane is a subclass of JEditorPane that "
635
- + "uses a StyledEditorKit and StyledDocument, and provides "
636
- + "cover methods for interacting with those objects."
637
- };
782
+// TEXTAREA String[] initString =
783
+// {
784
+// "This is an editable JTextPane, ", //regular
785
+// "another ", //italic
786
+// "styled ", //bold
787
+// "text ", //small
788
+// "component, ", //large
789
+// "which supports embedded components..." + newline,//regular
790
+// " " + newline, //button
791
+// "...and embedded icons..." + newline, //regular
792
+// " ", //icon
793
+// newline + "JTextPane is a subclass of JEditorPane that "
794
+// + "uses a StyledEditorKit and StyledDocument, and provides "
795
+// + "cover methods for interacting with those objects."
796
+// };
797
+//
798
+// String[] initStyles =
799
+// {
800
+// "regular", "italic", "bold", "small", "large",
801
+// "regular", "button", "regular", "icon",
802
+// "regular"
803
+// };
804
+//
805
+// JTextPane textPane = new JTextPane();
806
+// textPane.setEditable(true);
807
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
808
+// addStylesToDocument(doc);
809
+//
810
+// try
811
+// {
812
+// for (int j = 0; j < 2; j++)
813
+// {
814
+// for (int i = 0; i < initString.length; i++)
815
+// {
816
+// doc.insertString(doc.getLength(), initString[i],
817
+// doc.getStyle(initStyles[i]));
818
+// }
819
+// }
820
+// } catch (BadLocationException ble)
821
+// {
822
+// System.err.println("Couldn't insert initial text into text pane.");
823
+// }
638824
639
- String[] initStyles =
640
- {
641
- "regular", "italic", "bold", "small", "large",
642
- "regular", "button", "regular", "icon",
643
- "regular"
644
- };
645
-
646
- JTextPane textPane = new JTextPane();
647
- textPane.setEditable(true);
648
- /*StyledDocument*/ doc = textPane.getStyledDocument();
649
- addStylesToDocument(doc);
650
-
651
- try
652
- {
653
- for (int j = 0; j < 2; j++)
654
- {
655
- for (int i = 0; i < initString.length; i++)
656
- {
657
- doc.insertString(doc.getLength(), initString[i],
658
- doc.getStyle(initStyles[i]));
659
- }
660
- }
661
- } catch (BadLocationException ble)
662
- {
663
- System.err.println("Couldn't insert initial text into text pane.");
664
- }
665
-
666
- return new JTextArea(); // textPane;
825
+ return new JTextPane(); // textPane;
667826 }
668827
669828 protected void addStylesToDocument(StyledDocument doc)
....@@ -716,7 +875,7 @@
716875 protected static ImageIcon createImageIcon(String path,
717876 String description)
718877 {
719
- java.net.URL imgURL = GrafreeD.class.getResource(path);
878
+ java.net.URL imgURL = Grafreed.class.getResource(path);
720879 if (imgURL != null)
721880 {
722881 return new ImageIcon(imgURL, description);
....@@ -748,6 +907,7 @@
748907 // NumberSlider vDivsField;
749908 // JCheckBox endcaps;
750909 JCheckBox liveCB;
910
+ JCheckBox selectCB;
751911 JCheckBox hideCB;
752912 JCheckBox link2masterCB;
753913 JCheckBox markCB;
....@@ -755,7 +915,12 @@
755915 JCheckBox speedupCB;
756916 JCheckBox rewindCB;
757917 JCheckBox flipVCB;
918
+
919
+ cCheckBox toggleTextureCB;
920
+ cCheckBox toggleSwitchCB;
921
+
758922 JComboBox texresMenu;
923
+
759924 JButton resetButton;
760925 JButton stepButton;
761926 JButton stepAllButton;
....@@ -763,115 +928,87 @@
763928 JButton slowerButton;
764929 JButton fasterButton;
765930 JButton remarkButton;
931
+
932
+ cGridBag editPanel;
933
+ cGridBag editCommandsPanel;
934
+
935
+ cGridBag namePanel;
936
+ cGridBag setupPanel;
937
+ cGridBag setupPanel2;
938
+ cGridBag objectCommandsPanel;
939
+ cGridBag pushPanel;
940
+ cGridBag fillPanel;
766941
767
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
942
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
768943 {
769944 JCheckBox cb;
770945
771
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
772
- oe.aConstraints.gridwidth = 1; // 3;
773
-// oe.aConstraints.weightx = 1;
774
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
775
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
946
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
776947 cb.addItemListener(this);
777
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
778
- oe.aConstraints.gridwidth = 1;
779
- oe.aConstraints.gridx += 1;
780948
781949 return cb;
782950 }
783951
784
- cButton AddButton(ObjEditor oe, String label)
952
+ cButton AddButton(cGridBag panel, String label)
785953 {
786954 cButton cb;
787955
788
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
789
- oe.aConstraints.gridwidth = 1;
790
-// oe.aConstraints.weightx = 1;
791
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
792
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
956
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
793957 cb.addActionListener(this);
794
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
795
- oe.aConstraints.gridwidth = 1;
796
- oe.aConstraints.gridx += 1;
797958
798959 return cb;
799960 }
800961
801
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
962
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
802963 {
803964 JComboBox combo;
804965
805
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
806
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
807
- oe.aConstraints.gridx += 1;
966
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808967 combo.addActionListener(this);
809968
810969 return combo;
811970 }
812971
813
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
972
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
814973 {
815
- NumberSlider combo;
974
+ cGridBag control = new cGridBag();
975
+
976
+ cNumberSlider combo;
816977
817978 JLabel jlabel = new JLabel(label);
818
-
819
- aConstraints.fill = GridBagConstraints.VERTICAL;
820979 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
821
- aConstraints.gridwidth = 1;
822
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
823
- aConstraints.gridx += 1;
824
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
825
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
826
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.gridwidth = 1;
829
-
980
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
981
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830982 combo.setFloat(current);
831
-
832
- combo.label = jlabel;
833
-
834
- combo.addChangeListener(this);
835
-
836
- return combo;
983
+
984
+ panel.add(control);
985
+
986
+ return control;
837987 }
838988
839
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
989
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
840990 {
841
- NumberSlider combo;
991
+ cGridBag control = new cGridBag();
992
+
993
+ cNumberSlider combo;
842994
843995 JLabel jlabel = new JLabel(label);
844
-
845
- aConstraints.fill = GridBagConstraints.VERTICAL;
846996 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
847
- aConstraints.gridwidth = 2;
848
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
- aConstraints.gridx += 1;
850
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
851
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
852
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
853
- aConstraints.gridx += 1;
854
- aConstraints.gridwidth = 1;
855
-
997
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
998
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
856999 combo.setInteger(current);
8571000
858
- combo.label = jlabel;
859
-
860
- combo.addChangeListener(this);
861
-
862
- return combo;
1001
+ panel.add(control);
1002
+
1003
+ return control;
8631004 }
8641005
865
- JTextArea AddText(JPanel ctrlPanel, String name)
1006
+ JTextArea AddText(cGridBag ctrlPanel, String name)
8661007 {
8671008 JTextArea text;
8681009
869
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
870
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
871
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1010
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8721011 text.addCaretListener(this);
873
- aConstraints.gridx += 1;
874
- aConstraints.gridwidth = 1;
8751012
8761013 return text;
8771014 }
....@@ -901,9 +1038,16 @@
9011038 objEditor.ctrlPanel.remove(j);
9021039 }
9031040
1041
+ void Remove(cNumberSlider j)
1042
+ {
1043
+ j.removeChangeListener(this);
1044
+ //objEditor.ctrlPanel.remove(j.label);
1045
+ objEditor.ctrlPanel.remove(j);
1046
+ }
1047
+
9041048 /*
9051049 */
906
- void Return() // ObjEditor oe)
1050
+ void Return0() // ObjEditor oe)
9071051 {
9081052 aConstraints.gridy += 1;
9091053 aConstraints.gridx = 0;
....@@ -958,37 +1102,76 @@
9581102
9591103 void SetupUI2(ObjEditor oe)
9601104 {
961
-// oe.aConstraints.weightx = 0;
962
-// oe.aConstraints.weighty = 0;
963
-// oe.aConstraints.gridx = 0;
964
-// oe.aConstraints.gridy = 0;
965
- SetupName(oe);
1105
+ //SetupName(oe);
9661106
967
- if (!GroupEditor.allparams)
1107
+ namePanel = new cGridBag();
1108
+
1109
+ nameField = AddText(namePanel, copy.GetName());
1110
+ namePanel.add(nameField);
1111
+ oe.ctrlPanel.add(namePanel);
1112
+
1113
+ oe.ctrlPanel.Return();
1114
+
1115
+ if (!allparams)
9681116 return;
9691117
970
- liveCB = AddCheckBox(oe, "Live", copy.live);
971
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
972
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1118
+ setupPanel = new cGridBag().setVertical(false);
1119
+
1120
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1121
+ liveCB.setToolTipText("Animate object");
1122
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1123
+ selectCB.setToolTipText("Make object selectable");
9731124 // Return();
974
- markCB = AddCheckBox(oe, "Mark", copy.marked);
975
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
976
- randomCB = AddCheckBox(oe, "Rand", copy.random);
977
- Return();
978
- resetButton = AddButton(oe, "Reset");
979
- stepButton = AddButton(oe, "Step");
1125
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1126
+ hideCB.setToolTipText("Hide object");
1127
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1128
+ markCB.setToolTipText("Set the animation target transform");
1129
+
1130
+ setupPanel2 = new cGridBag().setVertical(false);
1131
+
1132
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1133
+ rewindCB.setToolTipText("Rewind animation");
1134
+
1135
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1136
+ randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1137
+
1138
+ if (Globals.ADVANCED)
1139
+ {
1140
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1141
+ link2masterCB.setToolTipText("Attach to support");
1142
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1143
+ speedupCB.setToolTipText("Option motion capture");
1144
+ }
1145
+
1146
+ oe.ctrlPanel.add(setupPanel);
1147
+ oe.ctrlPanel.Return();
1148
+ oe.ctrlPanel.add(setupPanel2);
1149
+ oe.ctrlPanel.Return();
1150
+
1151
+ objectCommandsPanel = new cGridBag().setVertical(false);
1152
+
1153
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1154
+ resetButton.setToolTipText("Jump to frame zero");
1155
+ stepButton = AddButton(objectCommandsPanel, "Step");
1156
+ stepButton.setToolTipText("Step one frame");
9801157 // resetAllButton = AddButton(oe, "Reset All");
9811158 // stepAllButton = AddButton(oe, "Step All");
982
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9831159 // Return();
984
- slowerButton = AddButton(oe, "Slow");
985
- fasterButton = AddButton(oe, "Fast");
986
- remarkButton = AddButton(oe, "Rem");
1160
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1161
+ slowerButton.setToolTipText("Decrease animation speed");
1162
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1163
+ fasterButton.setToolTipText("Increase animation speed");
1164
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1165
+ remarkButton.setToolTipText("Set the current transform as the target");
9871166
988
- Return();
1167
+ oe.ctrlPanel.add(objectCommandsPanel);
1168
+ oe.ctrlPanel.Return();
9891169
990
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
991
- Return();
1170
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1171
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1172
+ //Return();
1173
+
1174
+ oe.ctrlPanel.Return();
9921175
9931176 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9941177 // ObjEditor.aConstraints.gridx += 1;
....@@ -1083,7 +1266,7 @@
10831266 oe.aConstraints.gridwidth = 1;
10841267 /**/
10851268 nameField = AddText(oe.ctrlPanel, copy.GetName());
1086
- Return();
1269
+ oe.ctrlPanel.Return();
10871270
10881271 //ctrlPanel.add(textureButton = new Button("Texture..."));
10891272 //textureButton.setEnabled(false);
....@@ -1185,9 +1368,13 @@
11851368 //JPanel worldPanel =
11861369 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11871370 //worldPanel.setName("World");
1188
- centralPanel = new JPanel(new BorderLayout());
1189
- timelinePanel = new JPanel(new BorderLayout());
1190
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1371
+ centralPanel = new cGridBag();
1372
+ centralPanel.preferredWidth = 20;
1373
+
1374
+ if (Globals.ADVANCED)
1375
+ {
1376
+ timelinePanel = new JPanel(new BorderLayout());
1377
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11911378
11921379 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
11931380 cameraPanel.setContinuousLayout(true);
....@@ -1196,7 +1383,10 @@
11961383 // cameraPanel.setDividerSize(9);
11971384 cameraPanel.setResizeWeight(1.0);
11981385
1386
+ }
1387
+
11991388 centralPanel.add(cameraView);
1389
+ centralPanel.setFocusable(true);
12001390 //frame.setJMenuBar(timelineMenubar);
12011391 //centralPanel.add(timelinePanel);
12021392
....@@ -1215,12 +1405,13 @@
12151405 //frontView.object = copy;
12161406 //sideView.object = copy;
12171407
1218
- XYZPanel = new JPanel();
1219
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1408
+ XYZPanel = new cGridBag().setVertical(true);
1409
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12201410
1221
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1222
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1223
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1411
+ XYZPanel.preferredWidth = 5;
1412
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1413
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1414
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12241415
12251416 /*
12261417 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1258,11 +1449,13 @@
12581449 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12591450 //tmp.setName("Edit");
12601451 objectPanel.add(materialPanel);
1261
- JPanel north = new JPanel(new BorderLayout());
1262
- north.setName("Edit");
1263
- north.add(ctrlPanel, BorderLayout.NORTH);
1264
- objectPanel.add(north);
1452
+// JPanel north = new JPanel(new BorderLayout());
1453
+// north.setName("Edit");
1454
+// north.add(ctrlPanel, BorderLayout.NORTH);
1455
+// objectPanel.add(north);
1456
+ objectPanel.add(editPanel);
12651457 objectPanel.add(infoPanel);
1458
+ objectPanel.add(toolboxPanel);
12661459
12671460 /*
12681461 aConstraints.gridx = 0;
....@@ -1271,7 +1464,7 @@
12711464 aConstraints.gridy += 1;
12721465 aConstraints.gridwidth = 1;
12731466 mainPanel.add(objectPanel, aConstraints);
1274
- */
1467
+ */
12751468
12761469 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12771470 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1282,16 +1475,23 @@
12821475 scrollpane.setWheelScrollingEnabled(true);
12831476 scrollpane.addMouseWheelListener(this); // Default not fast enough
12841477
1285
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1286
- scenePanel.add(scrollpane);
1478
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1479
+ scenePanel.preferredWidth = 6;
1480
+
1481
+ JTabbedPane tabbedPane = new JTabbedPane();
1482
+ tabbedPane.add(scrollpane);
12871483
1288
- scenePanel.add(FSPane = new cFileSystemPane(this));
1289
-
1290
- optionsPanel = new JPanel(new GridBagLayout());
1484
+ optionsPanel = new cGridBag().setVertical(false);
12911485
12921486 optionsPanel.setName("Options");
1293
- scenePanel.add(optionsPanel);
1487
+
1488
+ AddOptions(optionsPanel); //, aConstraints);
1489
+
1490
+ tabbedPane.add(optionsPanel);
1491
+
1492
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12941493
1494
+ scenePanel.add(tabbedPane);
12951495
12961496 /*
12971497 cTree jTree = new cTree(null);
....@@ -1325,6 +1525,7 @@
13251525 //bigPanel.setSize(new Dimension(10,10));
13261526 //bigPanel.add(ctrlPanel);
13271527 //bigPanel.add(gridPanel);
1528
+ /**
13281529 bigThree = new JPanel();
13291530 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13301531 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1348,7 +1549,13 @@
13481549 // aConstraints.gridheight = 3;
13491550 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13501551 bigThree.add(XYZPanel, aWindowConstraints);
1552
+ /**/
13511553
1554
+ bigThree = new cGridBag();
1555
+ bigThree.addComponent(scenePanel);
1556
+ bigThree.addComponent(centralPanel);
1557
+ bigThree.addComponent(XYZPanel);
1558
+
13521559 // // SIDE EFFECT!!!
13531560 // aConstraints.gridx = 0;
13541561 // aConstraints.gridy = 0;
....@@ -1369,14 +1576,19 @@
13691576 //worldPane.add(bigPanel);
13701577 //worldPane.add(worldPanel);
13711578 /**/
1372
- frame.getContentPane().add(/*"Center",*/framePanel);
1579
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1580
+ frame.add(/*"Center",*/framePanel);
13731581 //frame.getContentPane().add(/*"Center",*/ worldPane);
13741582
13751583 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13761584
1377
- frame.setSize(1024, 768);
1378
- frame.show();
1585
+ frame.setSize(1280, 860);
1586
+
1587
+ frame.validate();
1588
+ frame.setVisible(true);
13791589
1590
+ cameraView.requestFocusInWindow();
1591
+
13801592 gridPanel.setDividerLocation(1.0);
13811593
13821594 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1390,6 +1602,10 @@
13901602 });
13911603 }
13921604
1605
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1606
+ {
1607
+ }
1608
+
13931609 JTree GetTree()
13941610 {
13951611 return objEditor.jTree;
....@@ -1401,260 +1617,173 @@
14011617 ctrlPanel.removeAll();
14021618 }
14031619
1404
- void SetupMaterial(JPanel ctrlPanel)
1620
+ void SetupMaterial(cGridBag panel)
14051621 {
1406
- aConstraints.weighty = 0;
1407
- //aConstraints.weightx = 1;
1408
- /*
1622
+ /*
14091623 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14101624 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1411
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1412
- aConstraints.gridx += 1;
14131625 */
14141626
1415
- aConstraints.gridwidth = 1;
1416
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1417
- aConstraints.gridx += 1;
1418
- aConstraints.weighty = 0;
1419
- aConstraints.gridwidth = 1;
1627
+ cGridBag editBar = new cGridBag().setVertical(false);
1628
+
1629
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1630
+ createMaterialButton.setToolTipText("Create material");
14201631
14211632 /*
14221633 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1423
- aConstraints.gridx += 1;
1424
- aConstraints.weighty = 0;
1425
- aConstraints.gridwidth = 1;
14261634 */
14271635
1428
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1429
- aConstraints.gridx += 1;
1636
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1637
+ clearMaterialButton.setToolTipText("Clear material");
1638
+
1639
+ if (Globals.ADVANCED)
1640
+ {
1641
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1642
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1643
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1644
+ }
14301645
1431
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1432
-
1433
- aConstraints.gridx += 1;
1434
-
1435
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1436
-
1437
- aConstraints.gridx += 1;
1438
-
1439
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1440
-
1441
- aConstraints.gridx = 0;
1442
- aConstraints.gridy += 1;
1443
- aConstraints.weighty = 0;
1444
- aConstraints.gridwidth = 1;
1646
+ editBar.preferredHeight = 15;
1647
+
1648
+ panel.add(editBar);
1649
+
14451650 /**/
14461651 //aConstraints.weighty = 0;
14471652 ////aConstraints.weightx = 1;
14481653 //aConstraints.weighty = 1;
14491654 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14501655 //aConstraints.gridx += 1;
1451
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1452
- aConstraints.weighty = 0;
1453
- aConstraints.gridx = 0;
1454
- aConstraints.gridy += 1;
1455
- aConstraints.gridwidth = 1;
1656
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14561657
1457
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1458
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1459
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1460
- aConstraints.gridx += 1;
1461
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1462
- //aConstraints.weightx = 0;
1463
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1464
- aConstraints.gridx = 0;
1465
- aConstraints.gridy += 1;
1466
- aConstraints.gridwidth = 1;
1658
+ cGridBag colorSection = new cGridBag().setVertical(true);
1659
+
1660
+ cGridBag color = new cGridBag();
1661
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1662
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1663
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1664
+ //colorField.preferredWidth = 200;
1665
+ colorSection.add(color);
14671666
1468
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1469
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1470
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1471
- aConstraints.gridx += 1;
1472
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1473
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1474
- aConstraints.gridx = 0;
1475
- aConstraints.gridy += 1;
1476
- aConstraints.gridwidth = 1;
1667
+ cGridBag modulation = new cGridBag();
1668
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1669
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1670
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1671
+ colorSection.add(modulation);
14771672
1478
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1479
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1480
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1481
- aConstraints.gridx += 1;
1482
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1483
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1484
- aConstraints.gridx = 0;
1485
- aConstraints.gridy += 1;
1486
- aConstraints.gridwidth = 1;
1673
+ cGridBag texture = new cGridBag();
1674
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1675
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1676
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1677
+ colorSection.add(texture);
14871678
1488
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1489
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1490
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1491
- aConstraints.gridx += 1;
1492
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1493
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1494
- aConstraints.gridx = 0;
1495
- aConstraints.gridy += 1;
1496
- aConstraints.gridwidth = 1;
1679
+ cGridBag anisoU = new cGridBag();
1680
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1681
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1683
+ colorSection.add(anisoU);
14971684
1498
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1499
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1500
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1501
- aConstraints.gridx += 1;
1502
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1503
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1504
- aConstraints.gridx = 0;
1505
- aConstraints.gridy += 1;
1506
- aConstraints.gridwidth = 1;
1685
+ cGridBag anisoV = new cGridBag();
1686
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1687
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1689
+ colorSection.add(anisoV);
15071690
1508
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1509
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1510
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1511
- aConstraints.gridx += 1;
1512
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1513
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1514
- aConstraints.gridx = 0;
1515
- aConstraints.gridy += 1;
1516
- aConstraints.gridwidth = 1;
1691
+ cGridBag shadowbias = new cGridBag();
1692
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1693
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1694
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1695
+ colorSection.add(shadowbias);
15171696
1518
- //aConstraints.weighty = 1;
1519
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1520
- //aConstraints.gridx += 1;
1521
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1522
- aConstraints.weighty = 0;
1523
- aConstraints.gridx = 0;
1524
- aConstraints.gridy += 1;
1525
- aConstraints.gridwidth = 1;
1697
+ panel.add(new JSeparator());
1698
+
1699
+ panel.add(colorSection);
1700
+
1701
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1702
+
1703
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1704
+
1705
+ cGridBag diffuse = new cGridBag();
1706
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1707
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1709
+ diffuseSection.add(diffuse);
15261710
1527
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1528
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1529
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1530
- aConstraints.gridx += 1;
1531
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1532
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1533
- aConstraints.gridx = 0;
1534
- aConstraints.gridy += 1;
1535
- aConstraints.gridwidth = 1;
1711
+ cGridBag diffuseness = new cGridBag();
1712
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1713
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1714
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1715
+ diffuseSection.add(diffuseness);
15361716
1537
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1538
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1539
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1540
- aConstraints.gridx += 1;
1541
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1542
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1543
- aConstraints.gridx = 0;
1544
- aConstraints.gridy += 1;
1545
- aConstraints.gridwidth = 1;
1717
+ cGridBag selfshadow = new cGridBag();
1718
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1719
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1720
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1721
+ diffuseSection.add(selfshadow);
15461722
1547
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1548
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1549
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1550
- aConstraints.gridx += 1;
1551
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1552
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1553
- aConstraints.gridx = 0;
1554
- aConstraints.gridy += 1;
1555
- aConstraints.gridwidth = 1;
1723
+ cGridBag sheen = new cGridBag();
1724
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1725
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1726
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1727
+ diffuseSection.add(sheen);
15561728
1557
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1558
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1559
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1560
- aConstraints.gridx += 1;
1561
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1562
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1563
- aConstraints.gridx = 0;
1564
- aConstraints.gridy += 1;
1565
- aConstraints.gridwidth = 1;
1729
+ cGridBag subsurface = new cGridBag();
1730
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1731
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1732
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1733
+ diffuseSection.add(subsurface);
15661734
1567
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1568
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1569
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1570
- aConstraints.gridx += 1;
1571
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1572
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1573
- aConstraints.gridx = 0;
1574
- aConstraints.gridy += 1;
1575
- aConstraints.gridwidth = 1;
1735
+ cGridBag shadow = new cGridBag();
1736
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1737
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1738
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1739
+ diffuseSection.add(shadow);
15761740
1577
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1578
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1579
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1580
- aConstraints.gridx += 1;
1581
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1582
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1583
- aConstraints.gridx = 0;
1584
- aConstraints.gridy += 1;
1585
- aConstraints.gridwidth = 1;
1741
+ cGridBag fakedepth = new cGridBag();
1742
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1743
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1744
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1745
+ diffuseSection.add(fakedepth);
15861746
1587
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1588
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1589
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1590
- aConstraints.gridx += 1;
1591
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1592
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1593
- aConstraints.gridx = 0;
1594
- aConstraints.gridy += 1;
1595
- aConstraints.gridwidth = 1;
1747
+ panel.add(new JSeparator());
1748
+
1749
+ panel.add(diffuseSection);
1750
+
1751
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1752
+
1753
+ cGridBag specularSection = new cGridBag().setVertical(true);
15961754
1597
- //aConstraints.weighty = 1;
1598
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1599
- //aConstraints.gridx += 1;
1600
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1601
- aConstraints.weighty = 0;
1602
- aConstraints.gridx = 0;
1603
- aConstraints.gridy += 1;
1604
- aConstraints.gridwidth = 1;
1755
+ cGridBag specular = new cGridBag();
1756
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1757
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1758
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1759
+ specularSection.add(specular);
16051760
1606
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1607
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1608
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1609
- aConstraints.gridx += 1;
1610
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1611
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1612
- aConstraints.gridx = 0;
1613
- aConstraints.gridy += 1;
1614
- aConstraints.gridwidth = 1;
1761
+ cGridBag lightarea = new cGridBag();
1762
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1763
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1764
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1765
+ specularSection.add(lightarea);
16151766
1616
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1617
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1618
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1619
- aConstraints.gridx += 1;
1620
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1621
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1622
- aConstraints.gridx = 0;
1623
- aConstraints.gridy += 1;
1624
- aConstraints.gridwidth = 1;
1767
+ cGridBag shininess = new cGridBag();
1768
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1769
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1770
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1771
+ specularSection.add(shininess);
16251772
1626
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1627
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1628
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1629
- aConstraints.gridx += 1;
1630
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1631
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1632
- aConstraints.gridx = 0;
1633
- aConstraints.gridy += 1;
1634
- aConstraints.gridwidth = 1;
1773
+ cGridBag metalness = new cGridBag();
1774
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1775
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1776
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1777
+ specularSection.add(metalness);
16351778
1636
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1637
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1638
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1639
- aConstraints.gridx += 1;
1640
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1641
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1642
- aConstraints.gridx = 0;
1643
- aConstraints.gridy += 1;
1644
- aConstraints.gridwidth = 1;
1779
+ cGridBag velvet = new cGridBag();
1780
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1781
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1782
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1783
+ specularSection.add(velvet);
16451784
1646
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1647
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1648
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1649
- aConstraints.gridx += 1;
1650
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1651
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1652
- aConstraints.gridx = 0;
1653
- aConstraints.gridy += 1;
1654
- aConstraints.gridwidth = 1;
1655
-
1656
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1657
- Return();
1785
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1786
+ //Return();
16581787 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16591788 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16601789 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1665,130 +1794,93 @@
16651794 // aConstraints.gridy += 1;
16661795 // aConstraints.gridwidth = 1;
16671796
1668
- //aConstraints.weighty = 1;
1669
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1670
- //aConstraints.gridx += 1;
1671
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1672
- aConstraints.weighty = 0;
1673
- aConstraints.gridx = 0;
1674
- aConstraints.gridy += 1;
1675
- aConstraints.gridwidth = 1;
16761797
1677
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1678
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1679
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1680
- aConstraints.gridx += 1;
1681
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1682
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1683
- aConstraints.gridx = 0;
1684
- aConstraints.gridy += 1;
1685
- aConstraints.gridwidth = 1;
1798
+ panel.add(new JSeparator());
1799
+
1800
+ panel.add(specularSection);
1801
+
1802
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1803
+
1804
+ cGridBag globalSection = new cGridBag().setVertical(true);
16861805
1687
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1688
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1689
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1690
- aConstraints.gridx += 1;
1691
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1692
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1693
- aConstraints.gridx = 0;
1694
- aConstraints.gridy += 1;
1695
- aConstraints.gridwidth = 1;
1806
+ cGridBag camera = new cGridBag();
1807
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1808
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1809
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1810
+ globalSection.add(camera);
16961811
1697
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1698
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1699
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1700
- aConstraints.gridx += 1;
1701
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1702
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1703
- aConstraints.gridx = 0;
1704
- aConstraints.gridy += 1;
1705
- aConstraints.gridwidth = 1;
1812
+ cGridBag ambient = new cGridBag();
1813
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1814
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1815
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1816
+ globalSection.add(ambient);
17061817
1707
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1708
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1709
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1710
- aConstraints.gridx += 1;
1711
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1712
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1713
- aConstraints.gridx = 0;
1714
- aConstraints.gridy += 1;
1715
- aConstraints.gridwidth = 1;
1716
- aConstraints.weighty = 0;
1818
+ cGridBag backlit = new cGridBag();
1819
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1820
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1821
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1822
+ globalSection.add(backlit);
17171823
1718
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1719
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1720
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1721
- aConstraints.gridx += 1;
1722
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1723
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1724
- aConstraints.gridx = 0;
1725
- aConstraints.gridy += 1;
1726
- aConstraints.gridwidth = 1;
1824
+ cGridBag opacity = new cGridBag();
1825
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1826
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1827
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1828
+ globalSection.add(opacity);
17271829
1728
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1729
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1730
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1731
- aConstraints.gridx += 1;
1732
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1733
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1734
- aConstraints.gridx = 0;
1735
- aConstraints.gridy += 1;
1736
- aConstraints.gridwidth = 1;
1830
+ panel.add(new JSeparator());
1831
+
1832
+ panel.add(globalSection);
1833
+
1834
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1835
+
1836
+ cGridBag textureSection = new cGridBag().setVertical(true);
17371837
1738
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1739
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1740
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1741
- aConstraints.gridx += 1;
1742
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1743
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1744
- aConstraints.gridx = 0;
1745
- aConstraints.gridy += 1;
1746
- aConstraints.gridwidth = 1;
1838
+ cGridBag bump = new cGridBag();
1839
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1840
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1841
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1842
+ textureSection.add(bump);
17471843
1748
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1749
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1750
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1751
- aConstraints.gridx += 1;
1752
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1753
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1754
- aConstraints.gridx = 0;
1755
- aConstraints.gridy += 1;
1756
- aConstraints.gridwidth = 1;
1844
+ cGridBag noise = new cGridBag();
1845
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1846
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1847
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1848
+ textureSection.add(noise);
17571849
1758
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1759
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1760
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1761
- aConstraints.gridx += 1;
1762
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1763
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1764
- aConstraints.gridx = 0;
1765
- aConstraints.gridy += 1;
1766
- aConstraints.gridwidth = 1;
1850
+ cGridBag power = new cGridBag();
1851
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1852
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1853
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1854
+ textureSection.add(power);
17671855
1768
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1769
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1770
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1771
- aConstraints.gridx += 1;
1772
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1773
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1774
- aConstraints.gridx = 0;
1775
- aConstraints.gridy += 1;
1776
- aConstraints.gridwidth = 1;
1856
+ cGridBag borderfade = new cGridBag();
1857
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1858
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1859
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1860
+ textureSection.add(borderfade);
17771861
1778
- //aConstraints.weighty = 1;
1779
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1780
- //aConstraints.gridx += 1;
1781
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1782
- aConstraints.weighty = 0;
1862
+ cGridBag fog = new cGridBag();
1863
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1864
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1865
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1866
+ textureSection.add(fog);
17831867
1784
- aConstraints.gridx = 0;
1785
- aConstraints.gridy = 0;
1786
- aConstraints.gridwidth = 1;
1868
+ cGridBag opacityPower = new cGridBag();
1869
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1870
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1871
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1872
+ textureSection.add(opacityPower);
1873
+
1874
+ panel.add(new JSeparator());
1875
+
1876
+ panel.add(textureSection);
1877
+
1878
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17871879
17881880 SetMaterial(copy); // .GetMaterial());
17891881
1790
- colorField.addChangeListener(this);
1791
- modulationField.addChangeListener(this);
1882
+ //colorField.addChangeListener(this);
1883
+// modulationField.addChangeListener(this);
17921884 metalnessField.addChangeListener(this);
17931885 diffuseField.addChangeListener(this);
17941886 specularField.addChangeListener(this);
....@@ -1818,12 +1910,15 @@
18181910 opacityPowerField.addChangeListener(this);
18191911 /**/
18201912
1821
- resetSlidersButton.addActionListener(this);
18221913 clearMaterialButton.addActionListener(this);
18231914 createMaterialButton.addActionListener(this);
1824
-
1825
- propagateToggle.addItemListener(this);
1826
- multiplyToggle.addItemListener(this);
1915
+
1916
+ if (Globals.ADVANCED)
1917
+ {
1918
+ resetSlidersButton.addActionListener(this);
1919
+ propagateToggle.addItemListener(this);
1920
+ multiplyToggle.addItemListener(this);
1921
+ }
18271922 }
18281923
18291924 void DropFile(java.io.File[] files, boolean textures)
....@@ -1994,7 +2089,7 @@
19942089
19952090 //? flashIt = false;
19962091 CameraPane pane = (CameraPane) cameraView;
1997
- pane.clickStart(location.x, location.y, 0);
2092
+ pane.clickStart(location.x, location.y, 0, 0);
19982093 pane.clickEnd(location.x, location.y, 0, true);
19992094
20002095 if (group.selection.size() == 1)
....@@ -2043,6 +2138,7 @@
20432138 e2.printStackTrace();
20442139 }
20452140 }
2141
+
20462142 LoadJMEThread loadThread;
20472143
20482144 class LoadJMEThread extends Thread
....@@ -2100,6 +2196,7 @@
21002196 //LoadFile0(filename, converter);
21012197 }
21022198 }
2199
+
21032200 LoadOBJThread loadObjThread;
21042201
21052202 class LoadOBJThread extends Thread
....@@ -2178,19 +2275,19 @@
21782275
21792276 void LoadObjFile(String fullname)
21802277 {
2181
- /*
2278
+ System.out.println("Loading " + fullname);
2279
+ /**/
21822280 //lastFilename = fullname;
21832281 if(loadObjThread == null)
21842282 {
2185
- loadObjThread = new LoadOBJThread();
2186
- loadObjThread.start();
2283
+ loadObjThread = new LoadOBJThread();
2284
+ loadObjThread.start();
21872285 }
21882286
21892287 loadObjThread.add(fullname);
2190
- */
2288
+ /**/
21912289
2192
- System.out.println("Loading " + fullname);
2193
- makeSomething(new FileObject(fullname, true), true);
2290
+ //makeSomething(new FileObject(fullname, true), true);
21942291 }
21952292
21962293 void LoadGFDFile(String fullname)
....@@ -2451,11 +2548,11 @@
24512548
24522549 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24532550 {
2454
- if (GrafreeD.standAlone)
2551
+ if (Grafreed.standAlone)
24552552 {
24562553 /**/
24572554 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2458
- browser.show();
2555
+ browser.setVisible(true);
24592556 String filename = browser.getFile();
24602557 if (filename != null && filename.length() > 0)
24612558 {
....@@ -2600,6 +2697,7 @@
26002697 }
26012698 if (input == null)
26022699 {
2700
+ new Exception().printStackTrace();
26032701 System.exit(0);
26042702 }
26052703
....@@ -2806,6 +2904,8 @@
28062904
28072905 void SetMaterial(Object3D object)
28082906 {
2907
+ latestObject = object;
2908
+
28092909 cMaterial mat = object.material;
28102910
28112911 if (mat == null)
....@@ -2814,7 +2914,8 @@
28142914 return;
28152915 }
28162916
2817
- multiplyToggle.setSelected(mat.multiply);
2917
+ if (multiplyToggle != null)
2918
+ multiplyToggle.setSelected(mat.multiply);
28182919
28192920 assert (object.projectedVertices != null);
28202921
....@@ -2990,7 +3091,7 @@
29903091 cameraView.ToggleDL();
29913092 cameraView.repaint();
29923093 return;
2993
- } else if (event.getSource() == toggleTextureItem)
3094
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29943095 {
29953096 cameraView.ToggleTexture();
29963097 // june 2013 copy.HardTouch();
....@@ -3029,9 +3130,9 @@
30293130 frame.validate();
30303131
30313132 return;
3032
- } else if (event.getSource() == toggleRandomItem)
3133
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
30333134 {
3034
- cameraView.ToggleRandom();
3135
+ cameraView.ToggleSwitch();
30353136 cameraView.repaint();
30363137 return;
30373138 } else if (event.getSource() == toggleHandleItem)
....@@ -3060,6 +3161,10 @@
30603161 {
30613162 copy.live ^= true;
30623163 return;
3164
+ } else if (event.getSource() == selectCB)
3165
+ {
3166
+ copy.dontselect ^= true;
3167
+ return;
30633168 } else if (event.getSource() == hideCB)
30643169 {
30653170 copy.hide ^= true;
....@@ -3074,6 +3179,7 @@
30743179 if (event.getSource() == randomCB)
30753180 {
30763181 copy.random ^= true;
3182
+ objEditor.refreshContents();
30773183 return;
30783184 }
30793185 if (event.getSource() == speedupCB)
....@@ -3097,8 +3203,9 @@
30973203
30983204 public void actionPerformed(ActionEvent event)
30993205 {
3206
+ Object source = event.getSource();
31003207 // SCRIPT DIALOG
3101
- if (event.getSource() == okbutton)
3208
+ if (source == okbutton)
31023209 {
31033210 textpanel.setVisible(false);
31043211 textpanel.remove(textarea);
....@@ -3110,7 +3217,7 @@
31103217 textarea = null;
31113218 textpanel = null;
31123219 }
3113
- if (event.getSource() == cancelbutton)
3220
+ if (source == cancelbutton)
31143221 {
31153222 textpanel.setVisible(false);
31163223 textpanel.remove(textarea);
....@@ -3122,49 +3229,50 @@
31223229 //applySelf();
31233230 //client.refreshEditWindow();
31243231 //refreshContents();
3125
- if (event.getSource() == nameField)
3232
+ if (source == nameField)
31263233 {
31273234 //System.out.println("ObjEditor " + event);
31283235 applySelf0(true);
31293236 //parent.applySelf();
31303237 objEditor.refreshContents();
3131
- } else if (event.getSource() == resetButton)
3238
+ } else if (source == resetButton)
31323239 {
31333240 CameraPane.fullreset = true;
31343241 copy.Reset(); // ResetMeshes();
31353242 copy.Touch();
31363243 objEditor.refreshContents();
3137
- } else if (event.getSource() == stepItem)
3244
+ } else if (source == stepItem)
31383245 {
3139
- cameraView.ONESTEP = true;
3246
+ //cameraView.ONESTEP = true;
3247
+ Globals.ONESTEP = true;
31403248 cameraView.repaint();
31413249 return;
3142
- } else if (event.getSource() == stepButton)
3250
+ } else if (source == stepButton)
31433251 {
31443252 copy.Step();
31453253 copy.Touch();
31463254 objEditor.refreshContents();
3147
- } else if (event.getSource() == slowerButton)
3255
+ } else if (source == slowerButton)
31483256 {
31493257 copy.Slower();
31503258 copy.Touch();
31513259 objEditor.refreshContents();
3152
- } else if (event.getSource() == fasterButton)
3260
+ } else if (source == fasterButton)
31533261 {
31543262 copy.Faster();
31553263 copy.Touch();
31563264 objEditor.refreshContents();
3157
- } else if (event.getSource() == remarkButton)
3265
+ } else if (source == remarkButton)
31583266 {
31593267 copy.Remark();
31603268 copy.Touch();
31613269 objEditor.refreshContents();
3162
- } else if (event.getSource() == stepAllButton)
3270
+ } else if (source == stepAllButton)
31633271 {
31643272 copy.StepAll();
31653273 copy.Touch();
31663274 objEditor.refreshContents();
3167
- } else if (event.getSource() == resetAllButton)
3275
+ } else if (source == resetAllButton)
31683276 {
31693277 //CameraPane.fullreset = true;
31703278 copy.ResetAll(); // ResetMeshes();
....@@ -3197,53 +3305,75 @@
31973305 // Close();
31983306 // }
31993307 // else
3200
- if (event.getSource() == resetSlidersButton)
3308
+ if (source == resetSlidersButton)
32013309 {
32023310 ResetSliders();
3203
- } else if (event.getSource() == clearMaterialButton)
3311
+ } else if (source == clearMaterialButton)
32043312 {
32053313 ClearMaterial();
3206
- } else if (event.getSource() == createMaterialButton)
3314
+ } else if (source == createMaterialButton)
32073315 {
32083316 CreateMaterial();
3209
- } else if (event.getSource() == clearPanelButton)
3317
+ } else if (source == clearPanelButton)
32103318 {
32113319 copy.ClearUI();
32123320 refreshContents(true);
3213
- } /*
3214
- }
3215
-
3216
- public boolean action(Event event, Object arg)
3217
- {
3218
- */ else if (event.getSource() == closeItem)
3321
+ } else if (source == importGFDItem)
3322
+ {
3323
+ ImportGFD();
3324
+ } else
3325
+ if (source == importVRMLX3DItem)
3326
+ {
3327
+ ImportVRMLX3D();
3328
+ } else
3329
+ if (source == import3DSItem)
3330
+ {
3331
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3332
+ } else
3333
+ if (source == importOBJItem)
3334
+ {
3335
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3336
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3337
+ browser.setVisible(true);
3338
+ String filename = browser.getFile();
3339
+ if (filename != null && filename.length() > 0)
3340
+ {
3341
+ String fullname = browser.getDirectory() + filename;
3342
+ makeSomething(ReadOBJ(fullname), true);
3343
+ }
3344
+ } else
3345
+ if (source == closeItem)
32193346 {
32203347 Close();
32213348 //return true;
3222
- } else if (event.getSource() == loadItem)
3349
+ } else if (source == loadItem)
32233350 {
32243351 load();
32253352 //return true;
3226
- } else if (event.getSource() == saveItem)
3353
+ } else if (source == newItem)
3354
+ {
3355
+ New();
3356
+ } else if (source == saveItem)
32273357 {
32283358 save();
32293359 //return true;
3230
- } else if (event.getSource() == saveAsItem)
3360
+ } else if (source == saveAsItem)
32313361 {
32323362 saveAs();
32333363 //return true;
3234
- } else if (event.getSource() == reexportItem)
3364
+ } else if (source == reexportItem)
32353365 {
32363366 reexport();
32373367 //return true;
3238
- } else if (event.getSource() == exportAsItem)
3368
+ } else if (source == exportAsItem)
32393369 {
32403370 export();
32413371 //return true;
3242
- } else if (event.getSource() == povItem)
3372
+ } else if (source == povItem)
32433373 {
32443374 generatePOV();
32453375 //return true;
3246
- } else if (event.getSource() == zBufferItem)
3376
+ } else if (source == zBufferItem)
32473377 {
32483378 try
32493379 {
....@@ -3265,21 +3395,8 @@
32653395 cameraView.repaint();
32663396 //return true;
32673397 }
3268
- */ else if (event.getSource() == editCameraItem)
3269
- {
3270
- cameraView.ProtectCamera();
3271
- cameraView.repaint();
3272
- return;
3273
- } else if (event.getSource() == revertCameraItem)
3274
- {
3275
- cameraView.RevertCamera();
3276
- cameraView.repaint();
3277
- return;
3278
-// } else if (event.getSource() == textureButton)
3279
-// {
3280
-// return; // true;
3281
- } else // combos...
3282
- if (event.getSource() == texresMenu)
3398
+ */ else // combos...
3399
+ if (source == texresMenu)
32833400 {
32843401 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32853402 copy.texres = texresMenu.getSelectedIndex();
....@@ -3291,27 +3408,302 @@
32913408 }
32923409 }
32933410
3294
- void ToggleAnimation()
3411
+ void New()
32953412 {
3296
- if (!CameraPane.ANIMATION)
3413
+ while (copy.Size() > 1)
32973414 {
3298
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3415
+ copy.remove(1);
3416
+ }
3417
+
3418
+ ResetModel();
3419
+ objEditor.refreshContents();
3420
+ }
3421
+
3422
+ static public byte[] Compress(Object3D o)
3423
+ {
3424
+ try
3425
+ {
3426
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3427
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3428
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3429
+
3430
+ Object3D parent = o.parent;
3431
+ o.parent = null;
3432
+
3433
+ out.writeObject(o);
3434
+
3435
+ o.parent = parent;
3436
+
3437
+ out.flush();
3438
+
3439
+ zstream.close();
3440
+ out.close();
3441
+
3442
+ return baos.toByteArray();
3443
+ } catch (Exception e)
3444
+ {
3445
+ System.err.println(e);
3446
+ return null;
3447
+ }
3448
+ }
3449
+
3450
+ static public Object Uncompress(byte[] bytes)
3451
+ {
3452
+ System.out.println("#bytes = " + bytes.length);
3453
+ try
3454
+ {
3455
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3456
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3457
+ ObjectInputStream in = new ObjectInputStream(istream);
3458
+ Object obj = in.readObject();
3459
+ in.close();
3460
+
3461
+ return obj;
3462
+ } catch (Exception e)
3463
+ {
3464
+ System.err.println(e);
3465
+ return null;
3466
+ }
3467
+ }
3468
+
3469
+ static public Object clone(Object o)
3470
+ {
3471
+ try
3472
+ {
3473
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3474
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3475
+
3476
+ out.writeObject(o);
3477
+
3478
+ out.flush();
3479
+ out.close();
3480
+
3481
+ byte[] bytes = baos.toByteArray();
3482
+
3483
+ System.out.println("clone = " + bytes.length);
3484
+
3485
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3486
+ ObjectInputStream in = new ObjectInputStream(bais);
3487
+ Object obj = in.readObject();
3488
+ in.close();
3489
+
3490
+ return obj;
3491
+ } catch (Exception e)
3492
+ {
3493
+ System.err.println(e);
3494
+ return null;
3495
+ }
3496
+ }
3497
+
3498
+ cRadio GetCurrentTab()
3499
+ {
3500
+ cRadio ab;
3501
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3502
+ {
3503
+ ab = (cRadio)e.nextElement();
3504
+ if(ab.GetObject() == copy)
3505
+ {
3506
+ return ab;
3507
+ }
3508
+ }
3509
+
3510
+ return null;
3511
+ }
3512
+
3513
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3514
+
3515
+ public void Save()
3516
+ {
3517
+ System.err.println("Save");
3518
+
3519
+ cRadio tab = GetCurrentTab();
3520
+
3521
+ boolean temp = CameraPane.SWITCH;
3522
+ CameraPane.SWITCH = false;
3523
+
3524
+ copy.ExtractBigData(hashtable);
3525
+
3526
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3527
+ tab.graphs[tab.undoindex++] = Compress(copy);
3528
+
3529
+ copy.RestoreBigData(hashtable);
3530
+
3531
+ CameraPane.SWITCH = temp;
3532
+
3533
+ //assert(hashtable.isEmpty());
3534
+
3535
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3536
+ {
3537
+ tab.graphs[i] = null;
3538
+ }
3539
+
3540
+ SetUndoStates();
3541
+
3542
+ // test save
3543
+ if (false)
3544
+ {
3545
+ try
3546
+ {
3547
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3548
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3549
+
3550
+ p.writeObject(copy);
3551
+
3552
+ p.flush();
3553
+
3554
+ ostream.close();
3555
+ } catch (Exception e)
3556
+ {
3557
+ e.printStackTrace();
3558
+ }
3559
+ }
3560
+ }
3561
+
3562
+ void CopyChanged(Object3D obj)
3563
+ {
3564
+ SetUndoStates();
3565
+
3566
+ boolean temp = CameraPane.SWITCH;
3567
+ CameraPane.SWITCH = false;
3568
+
3569
+ copy.ExtractBigData(hashtable);
3570
+
3571
+ copy.clear();
3572
+
3573
+ for (int i=0; i<obj.Size(); i++)
3574
+ {
3575
+ copy.add(obj.get(i));
3576
+ }
3577
+
3578
+ copy.RestoreBigData(hashtable);
3579
+
3580
+ CameraPane.SWITCH = temp;
3581
+
3582
+ //assert(hashtable.isEmpty());
3583
+
3584
+ copy.Touch();
3585
+
3586
+ ResetModel();
3587
+ copy.HardTouch(); // recompile?
3588
+
3589
+ cRadio ab;
3590
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3591
+ {
3592
+ ab = (cRadio)e.nextElement();
3593
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3594
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3595
+ if (test != null)
3596
+ {
3597
+ test.editWindow = ab.object.editWindow;
3598
+ ab.object = test;
3599
+ }
3600
+ }
3601
+
3602
+ refreshContents();
3603
+ }
3604
+
3605
+ cButton undoButton;
3606
+ cButton redoButton;
3607
+
3608
+ void SetUndoStates()
3609
+ {
3610
+ cRadio tab = GetCurrentTab();
3611
+
3612
+ undoButton.setEnabled(tab.undoindex > 0);
3613
+ redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null);
3614
+ }
3615
+
3616
+ public void Undo()
3617
+ {
3618
+ System.err.println("Undo");
3619
+
3620
+ cRadio tab = GetCurrentTab();
3621
+
3622
+ if (tab.undoindex == 0)
3623
+ {
3624
+ java.awt.Toolkit.getDefaultToolkit().beep();
3625
+ return;
3626
+ }
3627
+
3628
+ if (tab.graphs[tab.undoindex] == null)
3629
+ {
3630
+ Save();
3631
+ tab.undoindex -= 1;
3632
+ }
3633
+
3634
+ tab.undoindex -= 1;
3635
+
3636
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3637
+ }
3638
+
3639
+ public void Redo()
3640
+ {
3641
+ cRadio tab = GetCurrentTab();
3642
+
3643
+ if (tab.graphs[tab.undoindex + 1] == null)
3644
+ {
3645
+ java.awt.Toolkit.getDefaultToolkit().beep();
3646
+ return;
3647
+ }
3648
+
3649
+ tab.undoindex += 1;
3650
+
3651
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3652
+ }
3653
+
3654
+ void ImportGFD()
3655
+ {
3656
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32993657 browser.show();
33003658 String filename = browser.getFile();
33013659 if (filename != null && filename.length() > 0)
33023660 {
3303
- CameraPane.filename = browser.getDirectory() + filename;
3661
+ String fullname = browser.getDirectory() + filename;
3662
+
3663
+ //Object3D readobj =
3664
+ objEditor.ReadGFD(fullname, objEditor);
3665
+ //makeSomething(readobj);
3666
+ }
3667
+ }
3668
+
3669
+ void ImportVRMLX3D()
3670
+ {
3671
+ if (Grafreed.standAlone)
3672
+ {
3673
+ /**/
3674
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3675
+ browser.show();
3676
+ String filename = browser.getFile();
3677
+ if (filename != null && filename.length() > 0)
3678
+ {
3679
+ String fullname = browser.getDirectory() + filename;
3680
+ LoadVRMLX3D(fullname);
3681
+ }
3682
+ /**/
3683
+ }
3684
+ }
3685
+
3686
+ void ToggleAnimation()
3687
+ {
3688
+ if (!Globals.ANIMATION)
3689
+ {
3690
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3691
+ browser.setVisible(true);
3692
+ String filename = browser.getFile();
3693
+ if (filename != null && filename.length() > 0)
3694
+ {
3695
+ Globals.filename = browser.getDirectory() + filename;
33043696 //CameraPane.framecount = 0;
3305
- CameraPane.imagecount = 0;
3697
+ Globals.imagecount = 0;
33063698
3307
- CameraPane.ANIMATION ^= true;
3699
+ Globals.ANIMATION ^= true;
33083700
3309
- GrafreeD.wav.cursor = 0;
3310
- GrafreeD.wav.loop = 0;
3701
+ Grafreed.wav.cursor = 0;
3702
+ Grafreed.wav.loop = 0;
33113703 }
33123704 } else
33133705 {
3314
- CameraPane.ANIMATION ^= true;
3706
+ Globals.ANIMATION ^= true;
33153707 }
33163708 }
33173709
....@@ -3357,7 +3749,7 @@
33573749 void CreateMaterial()
33583750 {
33593751 //copy.ClearMaterial(); // PATCH
3360
- copy.CreateMaterialS(multiplyToggle.isSelected());
3752
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33613753 if (copy.selection.size() > 0)
33623754 //SetMaterial(copy);
33633755 {
....@@ -3408,7 +3800,7 @@
34083800 assert false;
34093801 }
34103802
3411
- void EditSelection()
3803
+ void EditSelection(boolean newWindow)
34123804 {
34133805 }
34143806
....@@ -3416,11 +3808,11 @@
34163808 {
34173809 copy.ResetBlockLoop(); // temporary problem
34183810
3419
- boolean random = CameraPane.RANDOM;
3420
- CameraPane.RANDOM = false; // parse everything
3811
+ boolean random = CameraPane.SWITCH;
3812
+ CameraPane.SWITCH = false; // parse everything
34213813 copy.ResetDisplayList();
34223814 copy.HardTouch();
3423
- CameraPane.RANDOM = random;
3815
+ CameraPane.SWITCH = random;
34243816 }
34253817
34263818 // public void applySelf()
....@@ -3490,10 +3882,40 @@
34903882 current.fakedepth = (float) fakedepthField.getFloat();
34913883 current.shadowbias = (float) shadowbiasField.getFloat();
34923884
3493
- if (!NumberSlider.frozen)
3885
+ if (!cNumberSlider.frozen)
34943886 {
34953887 //System.out.println("Propagate = " + propagate);
34963888 copy.UpdateMaterial(anchor, current, propagate);
3889
+
3890
+ if (copy.material != null)
3891
+ {
3892
+ cMaterial mat = copy.material;
3893
+
3894
+ colorField.SetToolTipValue((mat.color));
3895
+ modulationField.SetToolTipValue((mat.modulation));
3896
+ metalnessField.SetToolTipValue((mat.metalness));
3897
+ diffuseField.SetToolTipValue((mat.diffuse));
3898
+ specularField.SetToolTipValue((mat.specular));
3899
+ shininessField.SetToolTipValue((mat.shininess));
3900
+ shiftField.SetToolTipValue((mat.shift));
3901
+ ambientField.SetToolTipValue((mat.ambient));
3902
+ lightareaField.SetToolTipValue((mat.lightarea));
3903
+ diffusenessField.SetToolTipValue((mat.factor));
3904
+ velvetField.SetToolTipValue((mat.velvet));
3905
+ sheenField.SetToolTipValue((mat.sheen));
3906
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3907
+ backlitField.SetToolTipValue((mat.bump));
3908
+ anisoField.SetToolTipValue((mat.aniso));
3909
+ anisoVField.SetToolTipValue((mat.anisoV));
3910
+ cameraField.SetToolTipValue((mat.cameralight));
3911
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3912
+ shadowField.SetToolTipValue((mat.shadow));
3913
+ textureField.SetToolTipValue((mat.texture));
3914
+ opacityField.SetToolTipValue((mat.opacity));
3915
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3916
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3917
+ }
3918
+
34973919 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34983920 {
34993921 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3538,6 +3960,7 @@
35383960 || e.getSource() == apertureField
35393961 || e.getSource() == shadowblurField)
35403962 {
3963
+ new Exception().printStackTrace();
35413964 System.exit(0);
35423965 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35433966 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3608,7 +4031,7 @@
36084031 }
36094032
36104033 if (normalpushField != null)
3611
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
4034
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36124035 }
36134036
36144037 void SnapObject()
....@@ -3863,7 +4286,7 @@
38634286
38644287 radioPanel.revalidate();
38654288 radioPanel.repaint();
3866
- ctrlPanel.revalidate(); // ? new
4289
+ ctrlPanel.validate(); // ? new
38674290 ctrlPanel.repaint();
38684291 }
38694292 }
....@@ -3872,6 +4295,8 @@
38724295
38734296 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38744297 {
4298
+ if (Globals.SAVEONMAKE) // && resetmodel)
4299
+ Save();
38754300 //Tween.set(thing, 0).target(1).start(tweenManager);
38764301 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38774302 // if (thing instanceof GenericJointDemo)
....@@ -3958,6 +4383,12 @@
39584383 {
39594384 ResetModel();
39604385 Select(thing.GetTreePath(), true, false); // unselect... false);
4386
+
4387
+ if (thing.Size() == 0)
4388
+ {
4389
+ //EditSelection(false);
4390
+ }
4391
+
39614392 refreshContents();
39624393 }
39634394
....@@ -4075,6 +4506,7 @@
40754506 }
40764507 }
40774508 }
4509
+
40784510 LoadGFDThread loadGFDThread;
40794511
40804512 void ReadGFD(String fullname, iCallBack cb)
....@@ -4094,8 +4526,10 @@
40944526
40954527 try
40964528 {
4529
+ // Try compressed version first.
40974530 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4098
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4531
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4532
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40994533
41004534 readobj = (Object3D) p.readObject();
41014535 istream.close();
....@@ -4103,7 +4537,20 @@
41034537 readobj.ResetDisplayList();
41044538 } catch (Exception e)
41054539 {
4106
- e.printStackTrace();
4540
+ //e.printStackTrace();
4541
+ try
4542
+ {
4543
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4544
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4545
+
4546
+ readobj = (Object3D) p.readObject();
4547
+ istream.close();
4548
+
4549
+ readobj.ResetDisplayList();
4550
+ } catch (Exception e2)
4551
+ {
4552
+ e2.printStackTrace();
4553
+ }
41074554 }
41084555 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
41094556 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4149,6 +4596,12 @@
41494596
41504597 void LoadIt(Object obj)
41514598 {
4599
+ if (obj == null)
4600
+ {
4601
+ // Invalid file
4602
+ return;
4603
+ }
4604
+
41524605 System.out.println("Loaded " + obj);
41534606 //new Exception().printStackTrace();
41544607 Object3D readobj = (Object3D) obj;
....@@ -4158,6 +4611,8 @@
41584611
41594612 if (readobj != null)
41604613 {
4614
+ if (Globals.SAVEONMAKE)
4615
+ Save();
41614616 try
41624617 {
41634618 //readobj.deepCopySelf(copy);
....@@ -4220,7 +4675,7 @@
42204675
42214676 void load() // throws ClassNotFoundException
42224677 {
4223
- if (GrafreeD.standAlone)
4678
+ if (Grafreed.standAlone)
42244679 {
42254680 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42264681 browser.show();
....@@ -4307,11 +4762,13 @@
43074762 try
43084763 {
43094764 FileOutputStream ostream = new FileOutputStream(lastname);
4310
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4765
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4766
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43114767
43124768 p.writeObject(copy);
43134769 p.flush();
43144770
4771
+ zstream.close();
43154772 ostream.close();
43164773
43174774 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4321,17 +4778,20 @@
43214778 {
43224779 }
43234780 }
4781
+
43244782 String lastname;
43254783
43264784 void saveAs()
43274785 {
4328
- if (GrafreeD.standAlone)
4786
+ if (Grafreed.standAlone)
43294787 {
43304788 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43314789 browser.setVisible(true);
43324790 String filename = browser.getFile();
43334791 if (filename != null && filename.length() > 0)
43344792 {
4793
+ if (!filename.endsWith(".gfd"))
4794
+ filename += ".gfd";
43354795 lastname = browser.getDirectory() + filename;
43364796 save();
43374797 }
....@@ -4430,13 +4890,13 @@
44304890 try
44314891 {
44324892 FileOutputStream ostream = new FileOutputStream(filename);
4433
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4434
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4893
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4894
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44354895
44364896 Object3D objectparent = obj.parent;
44374897 obj.parent = null;
44384898
4439
- Object3D object = (Object3D) GrafreeD.clone(obj);
4899
+ Object3D object = (Object3D) Grafreed.clone(obj);
44404900
44414901 obj.parent = objectparent;
44424902
....@@ -4448,8 +4908,8 @@
44484908 p.writeObject(object);
44494909 p.flush();
44504910
4911
+ zstream.close();
44514912 ostream.close();
4452
- // zstream.close();
44534913
44544914 // group.selection.get(0).parent = parent;
44554915 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4470,7 +4930,7 @@
44704930 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44714931 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44724932 copy.generatePOV(buffer);
4473
- if (GrafreeD.standAlone)
4933
+ if (Grafreed.standAlone)
44744934 {
44754935 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44764936 browser.show();
....@@ -4496,7 +4956,8 @@
44964956 Object3D client;
44974957 Object3D copy;
44984958 MenuBar menuBar;
4499
- Menu windowMenu;
4959
+ Menu fileMenu;
4960
+ MenuItem newItem;
45004961 MenuItem loadItem;
45014962 MenuItem saveItem;
45024963 MenuItem saveAsItem;
....@@ -4504,13 +4965,11 @@
45044965 MenuItem reexportItem;
45054966 MenuItem povItem;
45064967 MenuItem closeItem;
4507
- Menu cameraMenu;
4968
+
45084969 CheckboxMenuItem zBufferItem;
45094970 //MenuItem normalLensItem;
4510
- MenuItem editCameraItem;
4511
- MenuItem revertCameraItem;
4512
- CheckboxMenuItem toggleLiveItem;
45134971 MenuItem stepItem;
4972
+ CheckboxMenuItem toggleLiveItem;
45144973 CheckboxMenuItem toggleFullScreenItem;
45154974 CheckboxMenuItem toggleTimelineItem;
45164975 CheckboxMenuItem toggleRenderItem;
....@@ -4519,28 +4978,41 @@
45194978 CheckboxMenuItem toggleFootContactItem;
45204979 CheckboxMenuItem toggleDLItem;
45214980 CheckboxMenuItem toggleTextureItem;
4522
- CheckboxMenuItem toggleRandomItem;
4981
+ CheckboxMenuItem toggleSwitchItem;
45234982 CheckboxMenuItem toggleRootItem;
45244983 CheckboxMenuItem animationItem;
45254984 CheckboxMenuItem toggleHandleItem;
45264985 CheckboxMenuItem togglePaintItem;
45274986 JSplitPane mainPanel;
45284987 JScrollPane scrollpane;
4988
+
45294989 JPanel toolbarPanel;
4530
- JPanel treePanel;
4990
+
4991
+ cGridBag treePanel;
4992
+
45314993 JPanel radioPanel;
45324994 ButtonGroup buttonGroup;
4533
- JPanel ctrlPanel;
4534
- JPanel materialPanel;
4995
+
4996
+ cGridBag toolboxPanel;
4997
+ cGridBag materialPanel;
4998
+ cGridBag ctrlPanel;
4999
+
45355000 JScrollPane infoPanel;
4536
- JPanel optionsPanel;
5001
+
5002
+ cGridBag optionsPanel;
5003
+
45375004 JTabbedPane objectPanel;
4538
- JPanel XYZPanel;
5005
+ boolean materialFlushed;
5006
+ Object3D latestObject;
5007
+
5008
+ cGridBag XYZPanel;
5009
+
45395010 JSplitPane gridPanel;
45405011 JSplitPane bigPanel;
4541
- JPanel bigThree;
4542
- JTabbedPane scenePanel;
4543
- JPanel centralPanel;
5012
+
5013
+ cGridBag bigThree;
5014
+ cGridBag scenePanel;
5015
+ cGridBag centralPanel;
45445016 JSplitPane cameraPanel;
45455017 JPanel timelinePanel;
45465018 JMenuBar timelineMenubar;
....@@ -4593,67 +5065,72 @@
45935065 // MATERIAL
45945066 JLabel materialLabel;
45955067 JLabel colorLabel;
4596
- NumberSlider colorField;
5068
+ cNumberSlider colorField;
45975069 JLabel modulationLabel;
4598
- NumberSlider modulationField;
5070
+ cNumberSlider modulationField;
45995071 JLabel metalnessLabel;
4600
- NumberSlider metalnessField;
5072
+ cNumberSlider metalnessField;
46015073 JLabel diffuseLabel;
4602
- NumberSlider diffuseField;
5074
+ cNumberSlider diffuseField;
46035075 JLabel specularLabel;
4604
- NumberSlider specularField;
5076
+ cNumberSlider specularField;
46055077 JLabel shininessLabel;
4606
- NumberSlider shininessField;
5078
+ cNumberSlider shininessField;
46075079 JLabel shiftLabel;
4608
- NumberSlider shiftField;
5080
+ cNumberSlider shiftField;
46095081 JLabel ambientLabel;
4610
- NumberSlider ambientField;
5082
+ cNumberSlider ambientField;
46115083 JLabel lightareaLabel;
4612
- NumberSlider lightareaField;
5084
+ cNumberSlider lightareaField;
46135085 JLabel diffusenessLabel;
4614
- NumberSlider diffusenessField;
5086
+ cNumberSlider diffusenessField;
46155087 JLabel velvetLabel;
4616
- NumberSlider velvetField;
5088
+ cNumberSlider velvetField;
46175089 JLabel sheenLabel;
4618
- NumberSlider sheenField;
5090
+ cNumberSlider sheenField;
46195091 JLabel subsurfaceLabel;
4620
- NumberSlider subsurfaceField;
5092
+ cNumberSlider subsurfaceField;
46215093 //JLabel bumpLabel;
46225094 //NumberSlider bumpField;
46235095 JLabel backlitLabel;
4624
- NumberSlider backlitField;
5096
+ cNumberSlider backlitField;
46255097 JLabel anisoLabel;
4626
- NumberSlider anisoField;
5098
+ cNumberSlider anisoField;
46275099 JLabel anisoVLabel;
4628
- NumberSlider anisoVField;
5100
+ cNumberSlider anisoVField;
46295101 JLabel cameraLabel;
4630
- NumberSlider cameraField;
5102
+ cNumberSlider cameraField;
46315103 JLabel selfshadowLabel;
4632
- NumberSlider selfshadowField;
5104
+ cNumberSlider selfshadowField;
46335105 JLabel shadowLabel;
4634
- NumberSlider shadowField;
5106
+ cNumberSlider shadowField;
46355107 JLabel textureLabel;
4636
- NumberSlider textureField;
5108
+ cNumberSlider textureField;
46375109 JLabel opacityLabel;
4638
- NumberSlider opacityField;
5110
+ cNumberSlider opacityField;
46395111 JLabel fakedepthLabel;
4640
- NumberSlider fakedepthField;
5112
+ cNumberSlider fakedepthField;
46415113 JLabel shadowbiasLabel;
4642
- NumberSlider shadowbiasField;
5114
+ cNumberSlider shadowbiasField;
46435115 JLabel bumpLabel;
4644
- NumberSlider bumpField;
5116
+ cNumberSlider bumpField;
46455117 JLabel noiseLabel;
4646
- NumberSlider noiseField;
5118
+ cNumberSlider noiseField;
46475119 JLabel powerLabel;
4648
- NumberSlider powerField;
5120
+ cNumberSlider powerField;
46495121 JLabel borderfadeLabel;
4650
- NumberSlider borderfadeField;
5122
+ cNumberSlider borderfadeField;
46515123 JLabel fogLabel;
4652
- NumberSlider fogField;
5124
+ cNumberSlider fogField;
46535125 JLabel opacityPowerLabel;
4654
- NumberSlider opacityPowerField;
4655
- JTree jTree;
5126
+ cNumberSlider opacityPowerField;
5127
+ cTree jTree;
46565128 //ObjectUI parent;
46575129
4658
- NumberSlider normalpushField;
5130
+ cNumberSlider normalpushField;
5131
+
5132
+ private MenuItem importGFDItem;
5133
+ private MenuItem importVRMLX3DItem;
5134
+ private MenuItem import3DSItem;
5135
+ private MenuItem importOBJItem;
46595136 }