Normand Briere
2019-06-25 d2f456cf5280f59425084532bd2397ec625f7577
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -19,6 +20,8 @@
1920 import //weka.core.
2021 matrix.Matrix;
2122
23
+import grafeme.ui.*;
24
+
2225 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2326 ActionListener, ChangeListener,
2427 InputMethodListener,
....@@ -33,6 +36,67 @@
3336
3437 GroupEditor callee;
3538 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
+ }
36100
37101 // SCRIPT
38102
....@@ -136,34 +200,42 @@
136200 public void closeUI()
137201 {
138202 //new Exception().printStackTrace();
139
- System.out.println("this = " + this);
140
- System.out.println("objEditor = " + objEditor);
203
+// System.out.println("this = " + this);
204
+// System.out.println("objEditor = " + objEditor);
141205 //nameField.removeActionListener(this);
142
- objEditor.ctrlPanel.remove(nameField);
206
+// objEditor.ctrlPanel.remove(nameField);
207
+
208
+ objEditor.ctrlPanel.remove(namePanel);
143209
144210 if (!GroupEditor.allparams)
145211 return;
146212
147
- objEditor.ctrlPanel.remove(liveCB);
148
- objEditor.ctrlPanel.remove(hideCB);
149
- objEditor.ctrlPanel.remove(markCB);
150
-
151
- objEditor.ctrlPanel.remove(randomCB);
152
- objEditor.ctrlPanel.remove(speedupCB);
153
- objEditor.ctrlPanel.remove(rewindCB);
154
-
155
- objEditor.ctrlPanel.remove(resetButton);
156
- objEditor.ctrlPanel.remove(stepButton);
157
-// objEditor.ctrlPanel.remove(stepAllButton);
158
-// objEditor.ctrlPanel.remove(resetAllButton);
159
- objEditor.ctrlPanel.remove(link2masterCB);
160
- //objEditor.ctrlPanel.remove(flipVCB);
161
- //objEditor.ctrlPanel.remove(texresMenu);
162
- objEditor.ctrlPanel.remove(slowerButton);
163
- objEditor.ctrlPanel.remove(fasterButton);
164
- 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);
165231
166
- 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);
167239 }
168240
169241 public ObjEditor GetEditor()
....@@ -234,6 +306,7 @@
234306 //localCopy.parent = null;
235307
236308 frame = new JFrame();
309
+ frame.setUndecorated(true);
237310 objEditor = this;
238311 this.callee = callee;
239312
....@@ -267,24 +340,40 @@
267340 void SetupMenu()
268341 {
269342 frame.setMenuBar(menuBar = new MenuBar());
270
- menuBar.add(windowMenu = new Menu("File"));
271
- windowMenu.add(loadItem = new MenuItem("Load..."));
272
- windowMenu.add("-");
273
- windowMenu.add(saveItem = new MenuItem("Save"));
274
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
343
+ menuBar.add(fileMenu = new Menu("File"));
344
+ fileMenu.add(newItem = new MenuItem("New"));
345
+ fileMenu.add(loadItem = new MenuItem("Open..."));
346
+
347
+ //oe.menuBar.add(menu = new Menu("Include"));
348
+ Menu menu = new Menu("Import");
349
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
350
+ importOBJItem.addActionListener(this);
351
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
352
+ import3DSItem.addActionListener(this);
353
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
354
+ importVRMLX3DItem.addActionListener(this);
355
+ menu.add("-");
356
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
357
+ importGFDItem.addActionListener(this);
358
+ fileMenu.add(menu);
359
+ fileMenu.add("-");
360
+
361
+ fileMenu.add(saveItem = new MenuItem("Save"));
362
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
275363 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
276
- windowMenu.add("-");
277
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
278
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
279
- windowMenu.add("-");
364
+ fileMenu.add("-");
365
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
366
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
367
+ fileMenu.add("-");
280368 if (client.parent != null)
281369 {
282
- windowMenu.add(closeItem = new MenuItem("Close"));
370
+ fileMenu.add(closeItem = new MenuItem("Close"));
283371 } else
284372 {
285
- windowMenu.add(closeItem = new MenuItem("Exit"));
373
+ fileMenu.add(closeItem = new MenuItem("Exit"));
286374 }
287375
376
+ newItem.addActionListener(this);
288377 loadItem.addActionListener(this);
289378 saveItem.addActionListener(this);
290379 saveAsItem.addActionListener(this);
....@@ -293,79 +382,59 @@
293382 //povItem.addActionListener(this);
294383 closeItem.addActionListener(this);
295384
296
- menuBar.add(cameraMenu = new Menu("View"));
297
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
298
- //zBufferItem.addActionListener(this);
299
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
300
- //normalLensItem.addActionListener(this);
301
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
302
- revertCameraItem.addActionListener(this);
303
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
304
- toggleTimelineItem.addItemListener(this);
305
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
306
- toggleFullScreenItem.addItemListener(this);
307
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
308
- cameraMenu.add("-");
309
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
310
- toggleTextureItem.addItemListener(this);
311
- toggleTextureItem.setState(CameraPane.textureon);
312
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
313
- toggleLiveItem.addItemListener(this);
314
- toggleLiveItem.setState(Globals.isLIVE());
315
- cameraMenu.add(stepItem = new MenuItem("Step"));
316
- stepItem.addActionListener(this);
317
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
318
-// toggleDLItem.addItemListener(this);
319
-// toggleDLItem.setState(false);
320
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
321
- toggleRenderItem.addItemListener(this);
322
- toggleRenderItem.setState(!CameraPane.frozen);
323
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
324
- toggleDebugItem.addItemListener(this);
325
- toggleDebugItem.setState(CameraPane.DEBUG);
326
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
327
- toggleFrustumItem.addItemListener(this);
328
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
329
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
330
- toggleFootContactItem.addItemListener(this);
331
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
332
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
333
- toggleRandomItem.addItemListener(this);
334
- toggleRandomItem.setState(CameraPane.RANDOM);
335
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
336
- toggleHandleItem.addItemListener(this);
337
- toggleHandleItem.setState(CameraPane.HANDLES);
338
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
339
- togglePaintItem.addItemListener(this);
340
- togglePaintItem.setState(CameraPane.PAINTMODE);
341
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
342
-// toggleRootItem.addItemListener(this);
343
-// toggleRootItem.setState(false);
344
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
345
-// animationItem.addItemListener(this);
346
-// animationItem.setState(CameraPane.ANIMATION);
347
- cameraMenu.add("-");
348
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
349
- editCameraItem.addActionListener(this);
350
-
351385 objectPanel = new JTabbedPane();
386
+
387
+ ChangeListener changeListener = new ChangeListener()
388
+ {
389
+ public void stateChanged(ChangeEvent changeEvent)
390
+ {
391
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
392
+// {
393
+// if (latestObject != null)
394
+// {
395
+// refreshContents(true);
396
+// SetMaterial(latestObject);
397
+// }
398
+//
399
+// materialFlushed = true;
400
+// }
401
+
402
+ refreshContents(false); // To refresh Info tab
403
+ }
404
+ };
405
+ objectPanel.addChangeListener(changeListener);
406
+
352407 toolbarPanel = new JPanel();
353408 toolbarPanel.setName("Toolbar");
354
- treePanel = new JPanel();
409
+ treePanel = new cGridBag();
355410 treePanel.setName("Tree");
356
- ctrlPanel = new JPanel(); // new GridBagLayout());
357
- ctrlPanel.setName("Edit");
358
- materialPanel = new JPanel();
411
+
412
+ editPanel = new cGridBag().setVertical(true);
413
+ editPanel.setName("Edit");
414
+
415
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
416
+
417
+ editCommandsPanel = new cGridBag();
418
+ editPanel.add(editCommandsPanel);
419
+ editPanel.add(ctrlPanel);
420
+
421
+ toolboxPanel = new cGridBag().setVertical(false);
422
+ toolboxPanel.setName("Toolbox");
423
+
424
+ materialPanel = new cGridBag().setVertical(true);
359425 materialPanel.setName("Material");
426
+
360427 /*JTextPane*/
361428 infoarea = createTextPane();
429
+ doc = infoarea.getStyledDocument();
430
+
362431 infoarea.setEditable(true);
363432 SetText();
364433 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
365434 // infoarea.setOpaque(false);
366435 // //infoarea.setForeground(textcolor);
367
- infoarea.setLineWrap(true);
368
- infoarea.setWrapStyleWord(true);
436
+// TEXTAREA infoarea.setLineWrap(true);
437
+// TEXTAREA infoarea.setWrapStyleWord(true);
369438 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
370439 infoPanel.setPreferredSize(new Dimension(50, 200));
371440 infoPanel.setName("Info");
....@@ -376,16 +445,16 @@
376445 mainPanel.setName("Main");
377446 mainPanel.setContinuousLayout(true);
378447 mainPanel.setOneTouchExpandable(true);
379
- mainPanel.setDividerLocation(1.0);
380448 mainPanel.setDividerSize(9);
381
- mainPanel.setResizeWeight(0);
449
+ mainPanel.setDividerLocation(0.5); //1.0);
450
+ mainPanel.setResizeWeight(0.5);
382451
383452 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
384453 //mainPanel.setLayout(new GridBagLayout());
385454 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
386
- treePanel.setLayout(new GridBagLayout());
387
- ctrlPanel.setLayout(new GridBagLayout());
388
- materialPanel.setLayout(new GridBagLayout());
455
+// treePanel.setLayout(new GridBagLayout());
456
+ //ctrlPanel.setLayout(new GridBagLayout());
457
+ //materialPanel.setLayout(new GridBagLayout());
389458
390459 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
391460 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -424,7 +493,7 @@
424493 static String newline = "\n";
425494 protected static final String buttonString = "JButton";
426495 StyledDocument doc;
427
- JTextArea infoarea;
496
+ JTextPane infoarea;
428497
429498 void ClearInfo()
430499 {
....@@ -447,10 +516,10 @@
447516 e.printStackTrace();
448517 }
449518
450
- String selection = infoarea.getText();
451
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
452
- java.awt.datatransfer.Clipboard clipboard =
453
- Toolkit.getDefaultToolkit().getSystemClipboard();
519
+// String selection = infoarea.getText();
520
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
521
+// java.awt.datatransfer.Clipboard clipboard =
522
+// Toolkit.getDefaultToolkit().getSystemClipboard();
454523 //clipboard.setContents(data, data);
455524 }
456525
....@@ -473,13 +542,13 @@
473542 //SendInfo("Name:", "bold");
474543 if (sel.GetTextures() != null || debug)
475544 {
476
- si.SendInfo(sel.toString(), "bold");
545
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
477546 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
478547 if (sel.Size() > 0)
479548 {
480549 si.SendInfo("#children = " + sel.Size(), "regular");
481550 }
482
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
551
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
483552 if (debug)
484553 {
485554 try
....@@ -491,7 +560,10 @@
491560 }
492561
493562 if (full)
494
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
563
+ {
564
+ si.SendInfo(" BBox min: " + minima, "regular");
565
+ si.SendInfo(" BBox max: " + maxima, "regular");
566
+ }
495567
496568 if (sel.bRep != null)
497569 {
....@@ -518,7 +590,7 @@
518590 }
519591 if (sel.support != null)
520592 {
521
- si.SendInfo(" support: " + sel.support, "regular");
593
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
522594 }
523595 if (sel.scriptnode != null)
524596 {
....@@ -589,6 +661,9 @@
589661 {
590662 CameraPane.pointflow = (PointFlow) sel;
591663 }
664
+
665
+ si.SendInfo("_____________________", "regular");
666
+ si.SendInfo("", "regular");
592667 }
593668 }
594669
....@@ -604,68 +679,140 @@
604679 }
605680 }
606681
682
+static GraphicsDevice device = GraphicsEnvironment
683
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
684
+
685
+ Rectangle keeprect;
686
+ cRadio radio;
687
+
688
+cButton keepButton;
689
+ cButton twoButton; // Full 3D
690
+ cButton sixButton;
691
+ cButton threeButton;
692
+ cButton sevenButton;
693
+ cButton fourButton; // full panel
694
+ cButton oneButton; // full XYZ
695
+ //cButton currentLayout;
696
+
697
+ boolean maximized;
698
+
699
+ cButton fullscreenLayout;
700
+
701
+ void Minimize()
702
+ {
703
+ frame.setState(Frame.ICONIFIED);
704
+ }
705
+
706
+ void Maximize()
707
+ {
708
+ if (maximized)
709
+ {
710
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
711
+ }
712
+ else
713
+ {
714
+ keeprect = frame.getBounds();
715
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
716
+ Dimension rect2 = frame.getToolkit().getScreenSize();
717
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
718
+// frame.setState(Frame.MAXIMIZED_BOTH);
719
+ }
720
+
721
+ maximized ^= true;
722
+ }
723
+
607724 void ToggleFullScreen()
608725 {
609726 if (CameraPane.FULLSCREEN)
610727 {
611
- frame.getContentPane().remove(/*"Center",*/bigThree);
612
- framePanel.add(bigThree);
613
- frame.getContentPane().add(/*"Center",*/framePanel);
728
+ device.setFullScreenWindow(null);
729
+ //frame.setVisible(false);
730
+// frame.removeNotify();
731
+// frame.setUndecorated(false);
732
+// frame.addNotify();
733
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
734
+
735
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
736
+// X framePanel.add(bigThree);
737
+// X frame.getContentPane().add(/*"Center",*/framePanel);
738
+ framePanel.setDividerLocation(1);
739
+
740
+ //frame.setVisible(true);
741
+ radio.layout = keepButton;
742
+ //theFrame = null;
743
+ keepButton = null;
744
+ radio.layout.doClick();
745
+
614746 } else
615747 {
616
- frame.getContentPane().remove(/*"Center",*/framePanel);
617
- framePanel.remove(bigThree);
618
- frame.getContentPane().add(/*"Center",*/bigThree);
748
+ keepButton = radio.layout;
749
+ //keeprect = frame.getBounds();
750
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
751
+// frame.getToolkit().getScreenSize().height);
752
+ //frame.setVisible(false);
753
+ device.setFullScreenWindow(frame);
754
+// frame.removeNotify();
755
+// frame.setUndecorated(true);
756
+// frame.addNotify();
757
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
758
+// X framePanel.remove(bigThree);
759
+// X frame.getContentPane().add(/*"Center",*/bigThree);
760
+ framePanel.setDividerLocation(0);
761
+
762
+ radio.layout = fullscreenLayout;
763
+ radio.layout.doClick();
764
+ //frame.setVisible(true);
619765 }
766
+
620767 cameraView.ToggleFullScreen();
621768 }
622769
623
- private JTextArea createTextPane()
770
+ private JTextPane createTextPane()
624771 {
625
- String[] initString =
626
- {
627
- "This is an editable JTextPane, ", //regular
628
- "another ", //italic
629
- "styled ", //bold
630
- "text ", //small
631
- "component, ", //large
632
- "which supports embedded components..." + newline,//regular
633
- " " + newline, //button
634
- "...and embedded icons..." + newline, //regular
635
- " ", //icon
636
- newline + "JTextPane is a subclass of JEditorPane that "
637
- + "uses a StyledEditorKit and StyledDocument, and provides "
638
- + "cover methods for interacting with those objects."
639
- };
772
+// TEXTAREA String[] initString =
773
+// {
774
+// "This is an editable JTextPane, ", //regular
775
+// "another ", //italic
776
+// "styled ", //bold
777
+// "text ", //small
778
+// "component, ", //large
779
+// "which supports embedded components..." + newline,//regular
780
+// " " + newline, //button
781
+// "...and embedded icons..." + newline, //regular
782
+// " ", //icon
783
+// newline + "JTextPane is a subclass of JEditorPane that "
784
+// + "uses a StyledEditorKit and StyledDocument, and provides "
785
+// + "cover methods for interacting with those objects."
786
+// };
787
+//
788
+// String[] initStyles =
789
+// {
790
+// "regular", "italic", "bold", "small", "large",
791
+// "regular", "button", "regular", "icon",
792
+// "regular"
793
+// };
794
+//
795
+// JTextPane textPane = new JTextPane();
796
+// textPane.setEditable(true);
797
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
798
+// addStylesToDocument(doc);
799
+//
800
+// try
801
+// {
802
+// for (int j = 0; j < 2; j++)
803
+// {
804
+// for (int i = 0; i < initString.length; i++)
805
+// {
806
+// doc.insertString(doc.getLength(), initString[i],
807
+// doc.getStyle(initStyles[i]));
808
+// }
809
+// }
810
+// } catch (BadLocationException ble)
811
+// {
812
+// System.err.println("Couldn't insert initial text into text pane.");
813
+// }
640814
641
- String[] initStyles =
642
- {
643
- "regular", "italic", "bold", "small", "large",
644
- "regular", "button", "regular", "icon",
645
- "regular"
646
- };
647
-
648
- JTextPane textPane = new JTextPane();
649
- textPane.setEditable(true);
650
- /*StyledDocument*/ doc = textPane.getStyledDocument();
651
- addStylesToDocument(doc);
652
-
653
- try
654
- {
655
- for (int j = 0; j < 2; j++)
656
- {
657
- for (int i = 0; i < initString.length; i++)
658
- {
659
- doc.insertString(doc.getLength(), initString[i],
660
- doc.getStyle(initStyles[i]));
661
- }
662
- }
663
- } catch (BadLocationException ble)
664
- {
665
- System.err.println("Couldn't insert initial text into text pane.");
666
- }
667
-
668
- return new JTextArea(); // textPane;
815
+ return new JTextPane(); // textPane;
669816 }
670817
671818 protected void addStylesToDocument(StyledDocument doc)
....@@ -718,7 +865,7 @@
718865 protected static ImageIcon createImageIcon(String path,
719866 String description)
720867 {
721
- java.net.URL imgURL = GrafreeD.class.getResource(path);
868
+ java.net.URL imgURL = Grafreed.class.getResource(path);
722869 if (imgURL != null)
723870 {
724871 return new ImageIcon(imgURL, description);
....@@ -750,6 +897,7 @@
750897 // NumberSlider vDivsField;
751898 // JCheckBox endcaps;
752899 JCheckBox liveCB;
900
+ JCheckBox selectCB;
753901 JCheckBox hideCB;
754902 JCheckBox link2masterCB;
755903 JCheckBox markCB;
....@@ -757,7 +905,12 @@
757905 JCheckBox speedupCB;
758906 JCheckBox rewindCB;
759907 JCheckBox flipVCB;
908
+
909
+ cCheckBox toggleTextureCB;
910
+ cCheckBox toggleSwitchCB;
911
+
760912 JComboBox texresMenu;
913
+
761914 JButton resetButton;
762915 JButton stepButton;
763916 JButton stepAllButton;
....@@ -765,115 +918,87 @@
765918 JButton slowerButton;
766919 JButton fasterButton;
767920 JButton remarkButton;
921
+
922
+ cGridBag editPanel;
923
+ cGridBag editCommandsPanel;
924
+
925
+ cGridBag namePanel;
926
+ cGridBag setupPanel;
927
+ cGridBag setupPanel2;
928
+ cGridBag objectCommandsPanel;
929
+ cGridBag pushPanel;
930
+ cGridBag fillPanel;
768931
769
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
932
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
770933 {
771934 JCheckBox cb;
772935
773
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
774
- oe.aConstraints.gridwidth = 1; // 3;
775
-// oe.aConstraints.weightx = 1;
776
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
777
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
936
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
778937 cb.addItemListener(this);
779
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
780
- oe.aConstraints.gridwidth = 1;
781
- oe.aConstraints.gridx += 1;
782938
783939 return cb;
784940 }
785941
786
- cButton AddButton(ObjEditor oe, String label)
942
+ cButton AddButton(cGridBag panel, String label)
787943 {
788944 cButton cb;
789945
790
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
791
- oe.aConstraints.gridwidth = 1;
792
-// oe.aConstraints.weightx = 1;
793
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
794
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
946
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
795947 cb.addActionListener(this);
796
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
797
- oe.aConstraints.gridwidth = 1;
798
- oe.aConstraints.gridx += 1;
799948
800949 return cb;
801950 }
802951
803
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
952
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
804953 {
805954 JComboBox combo;
806955
807
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
808
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
809
- oe.aConstraints.gridx += 1;
956
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
810957 combo.addActionListener(this);
811958
812959 return combo;
813960 }
814961
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
962
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
816963 {
817
- NumberSlider combo;
964
+ cGridBag control = new cGridBag();
965
+
966
+ cNumberSlider combo;
818967
819968 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
822969 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
823
- aConstraints.gridwidth = 1;
824
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
825
- aConstraints.gridx += 1;
826
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
827
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
828
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
829
- aConstraints.gridx += 1;
830
- aConstraints.gridwidth = 1;
831
-
970
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
971
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
832972 combo.setFloat(current);
833
-
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
973
+
974
+ panel.add(control);
975
+
976
+ return control;
839977 }
840978
841
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
979
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
842980 {
843
- NumberSlider combo;
981
+ cGridBag control = new cGridBag();
982
+
983
+ cNumberSlider combo;
844984
845985 JLabel jlabel = new JLabel(label);
846
-
847
- aConstraints.fill = GridBagConstraints.VERTICAL;
848986 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
849
- aConstraints.gridwidth = 2;
850
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
851
- aConstraints.gridx += 1;
852
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
853
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
854
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
855
- aConstraints.gridx += 1;
856
- aConstraints.gridwidth = 1;
857
-
987
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
988
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
858989 combo.setInteger(current);
859990
860
- combo.label = jlabel;
861
-
862
- combo.addChangeListener(this);
863
-
864
- return combo;
991
+ panel.add(control);
992
+
993
+ return control;
865994 }
866995
867
- JTextArea AddText(JPanel ctrlPanel, String name)
996
+ JTextArea AddText(cGridBag ctrlPanel, String name)
868997 {
869998 JTextArea text;
870999
871
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
872
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
873
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1000
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8741001 text.addCaretListener(this);
875
- aConstraints.gridx += 1;
876
- aConstraints.gridwidth = 1;
8771002
8781003 return text;
8791004 }
....@@ -903,9 +1028,16 @@
9031028 objEditor.ctrlPanel.remove(j);
9041029 }
9051030
1031
+ void Remove(cNumberSlider j)
1032
+ {
1033
+ j.removeChangeListener(this);
1034
+ //objEditor.ctrlPanel.remove(j.label);
1035
+ objEditor.ctrlPanel.remove(j);
1036
+ }
1037
+
9061038 /*
9071039 */
908
- void Return() // ObjEditor oe)
1040
+ void Return0() // ObjEditor oe)
9091041 {
9101042 aConstraints.gridy += 1;
9111043 aConstraints.gridx = 0;
....@@ -960,37 +1092,76 @@
9601092
9611093 void SetupUI2(ObjEditor oe)
9621094 {
963
-// oe.aConstraints.weightx = 0;
964
-// oe.aConstraints.weighty = 0;
965
-// oe.aConstraints.gridx = 0;
966
-// oe.aConstraints.gridy = 0;
967
- SetupName(oe);
1095
+ //SetupName(oe);
1096
+
1097
+ namePanel = new cGridBag();
1098
+
1099
+ nameField = AddText(namePanel, copy.GetName());
1100
+ namePanel.add(nameField);
1101
+ oe.ctrlPanel.add(namePanel);
1102
+
1103
+ oe.ctrlPanel.Return();
9681104
9691105 if (!GroupEditor.allparams)
9701106 return;
9711107
972
- liveCB = AddCheckBox(oe, "Live", copy.live);
973
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
974
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1108
+ setupPanel = new cGridBag().setVertical(false);
1109
+
1110
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1111
+ liveCB.setToolTipText("Animate object");
1112
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1113
+ selectCB.setToolTipText("Make object selectable");
9751114 // Return();
976
- markCB = AddCheckBox(oe, "Mark", copy.marked);
977
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
978
- randomCB = AddCheckBox(oe, "Rand", copy.random);
979
- Return();
980
- resetButton = AddButton(oe, "Reset");
981
- stepButton = AddButton(oe, "Step");
1115
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1116
+ hideCB.setToolTipText("Hide object");
1117
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1118
+ markCB.setToolTipText("Set the animation target transform");
1119
+
1120
+ setupPanel2 = new cGridBag().setVertical(false);
1121
+
1122
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1123
+ rewindCB.setToolTipText("Rewind animation");
1124
+
1125
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1126
+ randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1127
+
1128
+ if (Globals.ADVANCED)
1129
+ {
1130
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1131
+ link2masterCB.setToolTipText("Attach to support");
1132
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1133
+ speedupCB.setToolTipText("Option motion capture");
1134
+ }
1135
+
1136
+ oe.ctrlPanel.add(setupPanel);
1137
+ oe.ctrlPanel.Return();
1138
+ oe.ctrlPanel.add(setupPanel2);
1139
+ oe.ctrlPanel.Return();
1140
+
1141
+ objectCommandsPanel = new cGridBag().setVertical(false);
1142
+
1143
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1144
+ resetButton.setToolTipText("Jump to frame zero");
1145
+ stepButton = AddButton(objectCommandsPanel, "Step");
1146
+ stepButton.setToolTipText("Step one frame");
9821147 // resetAllButton = AddButton(oe, "Reset All");
9831148 // stepAllButton = AddButton(oe, "Step All");
984
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9851149 // Return();
986
- slowerButton = AddButton(oe, "Slow");
987
- fasterButton = AddButton(oe, "Fast");
988
- remarkButton = AddButton(oe, "Rem");
1150
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1151
+ slowerButton.setToolTipText("Decrease animation speed");
1152
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1153
+ fasterButton.setToolTipText("Increase animation speed");
1154
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1155
+ remarkButton.setToolTipText("Set the current transform as the target");
9891156
990
- Return();
1157
+ oe.ctrlPanel.add(objectCommandsPanel);
1158
+ oe.ctrlPanel.Return();
9911159
992
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
993
- Return();
1160
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1161
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1162
+ //Return();
1163
+
1164
+ oe.ctrlPanel.Return();
9941165
9951166 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9961167 // ObjEditor.aConstraints.gridx += 1;
....@@ -1085,7 +1256,7 @@
10851256 oe.aConstraints.gridwidth = 1;
10861257 /**/
10871258 nameField = AddText(oe.ctrlPanel, copy.GetName());
1088
- Return();
1259
+ oe.ctrlPanel.Return();
10891260
10901261 //ctrlPanel.add(textureButton = new Button("Texture..."));
10911262 //textureButton.setEnabled(false);
....@@ -1187,9 +1358,13 @@
11871358 //JPanel worldPanel =
11881359 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11891360 //worldPanel.setName("World");
1190
- centralPanel = new JPanel(new BorderLayout());
1191
- timelinePanel = new JPanel(new BorderLayout());
1192
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1361
+ centralPanel = new cGridBag();
1362
+ centralPanel.preferredWidth = 20;
1363
+
1364
+ if (Globals.ADVANCED)
1365
+ {
1366
+ timelinePanel = new JPanel(new BorderLayout());
1367
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11931368
11941369 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
11951370 cameraPanel.setContinuousLayout(true);
....@@ -1198,7 +1373,10 @@
11981373 // cameraPanel.setDividerSize(9);
11991374 cameraPanel.setResizeWeight(1.0);
12001375
1376
+ }
1377
+
12011378 centralPanel.add(cameraView);
1379
+ centralPanel.setFocusable(true);
12021380 //frame.setJMenuBar(timelineMenubar);
12031381 //centralPanel.add(timelinePanel);
12041382
....@@ -1217,12 +1395,13 @@
12171395 //frontView.object = copy;
12181396 //sideView.object = copy;
12191397
1220
- XYZPanel = new JPanel();
1221
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1398
+ XYZPanel = new cGridBag().setVertical(true);
1399
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12221400
1223
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1224
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1225
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1401
+ XYZPanel.preferredWidth = 5;
1402
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1403
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1404
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12261405
12271406 /*
12281407 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1260,10 +1439,12 @@
12601439 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12611440 //tmp.setName("Edit");
12621441 objectPanel.add(materialPanel);
1263
- JPanel north = new JPanel(new BorderLayout());
1264
- north.setName("Edit");
1265
- north.add(ctrlPanel, BorderLayout.NORTH);
1266
- objectPanel.add(north);
1442
+ objectPanel.add(toolboxPanel);
1443
+// JPanel north = new JPanel(new BorderLayout());
1444
+// north.setName("Edit");
1445
+// north.add(ctrlPanel, BorderLayout.NORTH);
1446
+// objectPanel.add(north);
1447
+ objectPanel.add(editPanel);
12671448 objectPanel.add(infoPanel);
12681449
12691450 /*
....@@ -1284,16 +1465,23 @@
12841465 scrollpane.setWheelScrollingEnabled(true);
12851466 scrollpane.addMouseWheelListener(this); // Default not fast enough
12861467
1287
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1288
- scenePanel.add(scrollpane);
1468
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1469
+ scenePanel.preferredWidth = 6;
1470
+
1471
+ JTabbedPane tabbedPane = new JTabbedPane();
1472
+ tabbedPane.add(scrollpane);
12891473
1290
- scenePanel.add(FSPane = new cFileSystemPane(this));
1291
-
1292
- optionsPanel = new JPanel(new GridBagLayout());
1474
+ optionsPanel = new cGridBag().setVertical(false);
12931475
12941476 optionsPanel.setName("Options");
1295
- scenePanel.add(optionsPanel);
1477
+
1478
+ AddOptions(optionsPanel); //, aConstraints);
1479
+
1480
+ tabbedPane.add(optionsPanel);
1481
+
1482
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12961483
1484
+ scenePanel.add(tabbedPane);
12971485
12981486 /*
12991487 cTree jTree = new cTree(null);
....@@ -1327,6 +1515,7 @@
13271515 //bigPanel.setSize(new Dimension(10,10));
13281516 //bigPanel.add(ctrlPanel);
13291517 //bigPanel.add(gridPanel);
1518
+ /**
13301519 bigThree = new JPanel();
13311520 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13321521 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1350,7 +1539,13 @@
13501539 // aConstraints.gridheight = 3;
13511540 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13521541 bigThree.add(XYZPanel, aWindowConstraints);
1542
+ /**/
13531543
1544
+ bigThree = new cGridBag();
1545
+ bigThree.addComponent(scenePanel);
1546
+ bigThree.addComponent(centralPanel);
1547
+ bigThree.addComponent(XYZPanel);
1548
+
13541549 // // SIDE EFFECT!!!
13551550 // aConstraints.gridx = 0;
13561551 // aConstraints.gridy = 0;
....@@ -1377,9 +1572,13 @@
13771572
13781573 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13791574
1380
- frame.setSize(1024, 768);
1381
- frame.show();
1575
+ frame.setSize(1280, 860);
1576
+
1577
+ frame.validate();
1578
+ frame.setVisible(true);
13821579
1580
+ cameraView.requestFocusInWindow();
1581
+
13831582 gridPanel.setDividerLocation(1.0);
13841583
13851584 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1393,6 +1592,10 @@
13931592 });
13941593 }
13951594
1595
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1596
+ {
1597
+ }
1598
+
13961599 JTree GetTree()
13971600 {
13981601 return objEditor.jTree;
....@@ -1404,260 +1607,173 @@
14041607 ctrlPanel.removeAll();
14051608 }
14061609
1407
- void SetupMaterial(JPanel ctrlPanel)
1610
+ void SetupMaterial(cGridBag panel)
14081611 {
1409
- aConstraints.weighty = 0;
1410
- //aConstraints.weightx = 1;
1411
- /*
1612
+ /*
14121613 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14131614 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1414
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1415
- aConstraints.gridx += 1;
14161615 */
14171616
1418
- aConstraints.gridwidth = 1;
1419
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1420
- aConstraints.gridx += 1;
1421
- aConstraints.weighty = 0;
1422
- aConstraints.gridwidth = 1;
1617
+ cGridBag editBar = new cGridBag().setVertical(false);
1618
+
1619
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1620
+ createMaterialButton.setToolTipText("Create material");
14231621
14241622 /*
14251623 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1426
- aConstraints.gridx += 1;
1427
- aConstraints.weighty = 0;
1428
- aConstraints.gridwidth = 1;
14291624 */
14301625
1431
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1432
- aConstraints.gridx += 1;
1626
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1627
+ clearMaterialButton.setToolTipText("Clear material");
1628
+
1629
+ if (Globals.ADVANCED)
1630
+ {
1631
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1632
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1633
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1634
+ }
14331635
1434
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1435
-
1436
- aConstraints.gridx += 1;
1437
-
1438
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1439
-
1440
- aConstraints.gridx += 1;
1441
-
1442
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1443
-
1444
- aConstraints.gridx = 0;
1445
- aConstraints.gridy += 1;
1446
- aConstraints.weighty = 0;
1447
- aConstraints.gridwidth = 1;
1636
+ editBar.preferredHeight = 15;
1637
+
1638
+ panel.add(editBar);
1639
+
14481640 /**/
14491641 //aConstraints.weighty = 0;
14501642 ////aConstraints.weightx = 1;
14511643 //aConstraints.weighty = 1;
14521644 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14531645 //aConstraints.gridx += 1;
1454
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1455
- aConstraints.weighty = 0;
1456
- aConstraints.gridx = 0;
1457
- aConstraints.gridy += 1;
1458
- aConstraints.gridwidth = 1;
1646
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14591647
1460
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1461
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1462
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1463
- aConstraints.gridx += 1;
1464
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1465
- //aConstraints.weightx = 0;
1466
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1467
- aConstraints.gridx = 0;
1468
- aConstraints.gridy += 1;
1469
- aConstraints.gridwidth = 1;
1648
+ cGridBag colorSection = new cGridBag().setVertical(true);
1649
+
1650
+ cGridBag color = new cGridBag();
1651
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1652
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1653
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1654
+ //colorField.preferredWidth = 200;
1655
+ colorSection.add(color);
14701656
1471
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1472
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1473
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1474
- aConstraints.gridx += 1;
1475
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1476
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1477
- aConstraints.gridx = 0;
1478
- aConstraints.gridy += 1;
1479
- aConstraints.gridwidth = 1;
1657
+ cGridBag modulation = new cGridBag();
1658
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1659
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1660
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1661
+ colorSection.add(modulation);
14801662
1481
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1482
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1483
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1484
- aConstraints.gridx += 1;
1485
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1486
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1487
- aConstraints.gridx = 0;
1488
- aConstraints.gridy += 1;
1489
- aConstraints.gridwidth = 1;
1663
+ cGridBag texture = new cGridBag();
1664
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1665
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1666
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1667
+ colorSection.add(texture);
14901668
1491
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1492
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1493
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1494
- aConstraints.gridx += 1;
1495
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1496
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1497
- aConstraints.gridx = 0;
1498
- aConstraints.gridy += 1;
1499
- aConstraints.gridwidth = 1;
1669
+ cGridBag anisoU = new cGridBag();
1670
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1671
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1672
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1673
+ colorSection.add(anisoU);
15001674
1501
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1502
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1503
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1504
- aConstraints.gridx += 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1506
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1507
- aConstraints.gridx = 0;
1508
- aConstraints.gridy += 1;
1509
- aConstraints.gridwidth = 1;
1675
+ cGridBag anisoV = new cGridBag();
1676
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1677
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1678
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1679
+ colorSection.add(anisoV);
15101680
1511
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1512
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1513
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1514
- aConstraints.gridx += 1;
1515
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1516
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1517
- aConstraints.gridx = 0;
1518
- aConstraints.gridy += 1;
1519
- aConstraints.gridwidth = 1;
1681
+ cGridBag shadowbias = new cGridBag();
1682
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1683
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1684
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1685
+ colorSection.add(shadowbias);
15201686
1521
- //aConstraints.weighty = 1;
1522
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1523
- //aConstraints.gridx += 1;
1524
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1525
- aConstraints.weighty = 0;
1526
- aConstraints.gridx = 0;
1527
- aConstraints.gridy += 1;
1528
- aConstraints.gridwidth = 1;
1687
+ panel.add(new JSeparator());
1688
+
1689
+ panel.add(colorSection);
1690
+
1691
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1692
+
1693
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1694
+
1695
+ cGridBag diffuse = new cGridBag();
1696
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1697
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1699
+ diffuseSection.add(diffuse);
15291700
1530
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1531
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1533
- aConstraints.gridx += 1;
1534
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1535
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1536
- aConstraints.gridx = 0;
1537
- aConstraints.gridy += 1;
1538
- aConstraints.gridwidth = 1;
1701
+ cGridBag diffuseness = new cGridBag();
1702
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1703
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1704
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1705
+ diffuseSection.add(diffuseness);
15391706
1540
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1541
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1542
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1543
- aConstraints.gridx += 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1545
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1546
- aConstraints.gridx = 0;
1547
- aConstraints.gridy += 1;
1548
- aConstraints.gridwidth = 1;
1707
+ cGridBag selfshadow = new cGridBag();
1708
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1709
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1710
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1711
+ diffuseSection.add(selfshadow);
15491712
1550
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1551
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1552
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1553
- aConstraints.gridx += 1;
1554
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1555
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1556
- aConstraints.gridx = 0;
1557
- aConstraints.gridy += 1;
1558
- aConstraints.gridwidth = 1;
1713
+ cGridBag sheen = new cGridBag();
1714
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1715
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1716
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1717
+ diffuseSection.add(sheen);
15591718
1560
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1561
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1562
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1563
- aConstraints.gridx += 1;
1564
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1565
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1566
- aConstraints.gridx = 0;
1567
- aConstraints.gridy += 1;
1568
- aConstraints.gridwidth = 1;
1719
+ cGridBag subsurface = new cGridBag();
1720
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1721
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1722
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1723
+ diffuseSection.add(subsurface);
15691724
1570
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1571
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1572
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1573
- aConstraints.gridx += 1;
1574
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1575
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1576
- aConstraints.gridx = 0;
1577
- aConstraints.gridy += 1;
1578
- aConstraints.gridwidth = 1;
1725
+ cGridBag shadow = new cGridBag();
1726
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1727
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1728
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1729
+ diffuseSection.add(shadow);
15791730
1580
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1581
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1583
- aConstraints.gridx += 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1585
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1586
- aConstraints.gridx = 0;
1587
- aConstraints.gridy += 1;
1588
- aConstraints.gridwidth = 1;
1731
+ cGridBag fakedepth = new cGridBag();
1732
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1733
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1734
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1735
+ diffuseSection.add(fakedepth);
15891736
1590
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1591
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1592
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1593
- aConstraints.gridx += 1;
1594
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1595
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1596
- aConstraints.gridx = 0;
1597
- aConstraints.gridy += 1;
1598
- aConstraints.gridwidth = 1;
1737
+ panel.add(new JSeparator());
1738
+
1739
+ panel.add(diffuseSection);
1740
+
1741
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1742
+
1743
+ cGridBag specularSection = new cGridBag().setVertical(true);
15991744
1600
- //aConstraints.weighty = 1;
1601
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1602
- //aConstraints.gridx += 1;
1603
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1604
- aConstraints.weighty = 0;
1605
- aConstraints.gridx = 0;
1606
- aConstraints.gridy += 1;
1607
- aConstraints.gridwidth = 1;
1745
+ cGridBag specular = new cGridBag();
1746
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1747
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1748
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1749
+ specularSection.add(specular);
16081750
1609
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1610
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1612
- aConstraints.gridx += 1;
1613
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1614
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1615
- aConstraints.gridx = 0;
1616
- aConstraints.gridy += 1;
1617
- aConstraints.gridwidth = 1;
1751
+ cGridBag lightarea = new cGridBag();
1752
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1753
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1754
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1755
+ specularSection.add(lightarea);
16181756
1619
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1620
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1621
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1622
- aConstraints.gridx += 1;
1623
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1624
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1625
- aConstraints.gridx = 0;
1626
- aConstraints.gridy += 1;
1627
- aConstraints.gridwidth = 1;
1757
+ cGridBag shininess = new cGridBag();
1758
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1759
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1760
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1761
+ specularSection.add(shininess);
16281762
1629
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1630
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1632
- aConstraints.gridx += 1;
1633
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1634
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
1763
+ cGridBag metalness = new cGridBag();
1764
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1765
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1766
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1767
+ specularSection.add(metalness);
16381768
1639
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1640
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- aConstraints.gridwidth = 1;
1769
+ cGridBag velvet = new cGridBag();
1770
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1771
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1772
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1773
+ specularSection.add(velvet);
16481774
1649
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1650
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1652
- aConstraints.gridx += 1;
1653
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1654
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1655
- aConstraints.gridx = 0;
1656
- aConstraints.gridy += 1;
1657
- aConstraints.gridwidth = 1;
1658
-
1659
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1660
- Return();
1775
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1776
+ //Return();
16611777 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16621778 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16631779 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1668,130 +1784,93 @@
16681784 // aConstraints.gridy += 1;
16691785 // aConstraints.gridwidth = 1;
16701786
1671
- //aConstraints.weighty = 1;
1672
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1673
- //aConstraints.gridx += 1;
1674
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1675
- aConstraints.weighty = 0;
1676
- aConstraints.gridx = 0;
1677
- aConstraints.gridy += 1;
1678
- aConstraints.gridwidth = 1;
16791787
1680
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1681
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- aConstraints.gridwidth = 1;
1788
+ panel.add(new JSeparator());
1789
+
1790
+ panel.add(specularSection);
1791
+
1792
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1793
+
1794
+ cGridBag globalSection = new cGridBag().setVertical(true);
16891795
1690
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1691
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- aConstraints.gridwidth = 1;
1796
+ cGridBag camera = new cGridBag();
1797
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1798
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1799
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1800
+ globalSection.add(camera);
16991801
1700
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1701
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- aConstraints.gridwidth = 1;
1802
+ cGridBag ambient = new cGridBag();
1803
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1804
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1805
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1806
+ globalSection.add(ambient);
17091807
1710
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1711
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1712
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1713
- aConstraints.gridx += 1;
1714
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1715
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1716
- aConstraints.gridx = 0;
1717
- aConstraints.gridy += 1;
1718
- aConstraints.gridwidth = 1;
1719
- aConstraints.weighty = 0;
1808
+ cGridBag backlit = new cGridBag();
1809
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1810
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1811
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1812
+ globalSection.add(backlit);
17201813
1721
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1722
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1723
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1724
- aConstraints.gridx += 1;
1725
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1726
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1727
- aConstraints.gridx = 0;
1728
- aConstraints.gridy += 1;
1729
- aConstraints.gridwidth = 1;
1814
+ cGridBag opacity = new cGridBag();
1815
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1816
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1817
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1818
+ globalSection.add(opacity);
17301819
1731
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1732
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1733
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1734
- aConstraints.gridx += 1;
1735
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1736
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1737
- aConstraints.gridx = 0;
1738
- aConstraints.gridy += 1;
1739
- aConstraints.gridwidth = 1;
1820
+ panel.add(new JSeparator());
1821
+
1822
+ panel.add(globalSection);
1823
+
1824
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1825
+
1826
+ cGridBag textureSection = new cGridBag().setVertical(true);
17401827
1741
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1742
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1743
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1744
- aConstraints.gridx += 1;
1745
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1746
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1747
- aConstraints.gridx = 0;
1748
- aConstraints.gridy += 1;
1749
- aConstraints.gridwidth = 1;
1828
+ cGridBag bump = new cGridBag();
1829
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1830
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1831
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1832
+ textureSection.add(bump);
17501833
1751
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1752
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1753
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1754
- aConstraints.gridx += 1;
1755
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1756
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1757
- aConstraints.gridx = 0;
1758
- aConstraints.gridy += 1;
1759
- aConstraints.gridwidth = 1;
1834
+ cGridBag noise = new cGridBag();
1835
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1836
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1837
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1838
+ textureSection.add(noise);
17601839
1761
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1762
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1763
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1764
- aConstraints.gridx += 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1766
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1767
- aConstraints.gridx = 0;
1768
- aConstraints.gridy += 1;
1769
- aConstraints.gridwidth = 1;
1840
+ cGridBag power = new cGridBag();
1841
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1842
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1843
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1844
+ textureSection.add(power);
17701845
1771
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1772
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1773
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1774
- aConstraints.gridx += 1;
1775
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1776
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1777
- aConstraints.gridx = 0;
1778
- aConstraints.gridy += 1;
1779
- aConstraints.gridwidth = 1;
1846
+ cGridBag borderfade = new cGridBag();
1847
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1848
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1849
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1850
+ textureSection.add(borderfade);
17801851
1781
- //aConstraints.weighty = 1;
1782
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1783
- //aConstraints.gridx += 1;
1784
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1785
- aConstraints.weighty = 0;
1852
+ cGridBag fog = new cGridBag();
1853
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1854
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1855
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1856
+ textureSection.add(fog);
17861857
1787
- aConstraints.gridx = 0;
1788
- aConstraints.gridy = 0;
1789
- aConstraints.gridwidth = 1;
1858
+ cGridBag opacityPower = new cGridBag();
1859
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1860
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1861
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1862
+ textureSection.add(opacityPower);
1863
+
1864
+ panel.add(new JSeparator());
1865
+
1866
+ panel.add(textureSection);
1867
+
1868
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17901869
17911870 SetMaterial(copy); // .GetMaterial());
17921871
1793
- colorField.addChangeListener(this);
1794
- modulationField.addChangeListener(this);
1872
+ //colorField.addChangeListener(this);
1873
+// modulationField.addChangeListener(this);
17951874 metalnessField.addChangeListener(this);
17961875 diffuseField.addChangeListener(this);
17971876 specularField.addChangeListener(this);
....@@ -1821,12 +1900,15 @@
18211900 opacityPowerField.addChangeListener(this);
18221901 /**/
18231902
1824
- resetSlidersButton.addActionListener(this);
18251903 clearMaterialButton.addActionListener(this);
18261904 createMaterialButton.addActionListener(this);
1827
-
1828
- propagateToggle.addItemListener(this);
1829
- multiplyToggle.addItemListener(this);
1905
+
1906
+ if (Globals.ADVANCED)
1907
+ {
1908
+ resetSlidersButton.addActionListener(this);
1909
+ propagateToggle.addItemListener(this);
1910
+ multiplyToggle.addItemListener(this);
1911
+ }
18301912 }
18311913
18321914 void DropFile(java.io.File[] files, boolean textures)
....@@ -1997,7 +2079,7 @@
19972079
19982080 //? flashIt = false;
19992081 CameraPane pane = (CameraPane) cameraView;
2000
- pane.clickStart(location.x, location.y, 0);
2082
+ pane.clickStart(location.x, location.y, 0, 0);
20012083 pane.clickEnd(location.x, location.y, 0, true);
20022084
20032085 if (group.selection.size() == 1)
....@@ -2046,6 +2128,7 @@
20462128 e2.printStackTrace();
20472129 }
20482130 }
2131
+
20492132 LoadJMEThread loadThread;
20502133
20512134 class LoadJMEThread extends Thread
....@@ -2103,6 +2186,7 @@
21032186 //LoadFile0(filename, converter);
21042187 }
21052188 }
2189
+
21062190 LoadOBJThread loadObjThread;
21072191
21082192 class LoadOBJThread extends Thread
....@@ -2181,19 +2265,19 @@
21812265
21822266 void LoadObjFile(String fullname)
21832267 {
2184
- /*
2268
+ System.out.println("Loading " + fullname);
2269
+ /**/
21852270 //lastFilename = fullname;
21862271 if(loadObjThread == null)
21872272 {
2188
- loadObjThread = new LoadOBJThread();
2189
- loadObjThread.start();
2273
+ loadObjThread = new LoadOBJThread();
2274
+ loadObjThread.start();
21902275 }
21912276
21922277 loadObjThread.add(fullname);
2193
- */
2278
+ /**/
21942279
2195
- System.out.println("Loading " + fullname);
2196
- makeSomething(new FileObject(fullname, true), true);
2280
+ //makeSomething(new FileObject(fullname, true), true);
21972281 }
21982282
21992283 void LoadGFDFile(String fullname)
....@@ -2454,11 +2538,11 @@
24542538
24552539 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24562540 {
2457
- if (GrafreeD.standAlone)
2541
+ if (Grafreed.standAlone)
24582542 {
24592543 /**/
24602544 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2461
- browser.show();
2545
+ browser.setVisible(true);
24622546 String filename = browser.getFile();
24632547 if (filename != null && filename.length() > 0)
24642548 {
....@@ -2603,6 +2687,7 @@
26032687 }
26042688 if (input == null)
26052689 {
2690
+ new Exception().printStackTrace();
26062691 System.exit(0);
26072692 }
26082693
....@@ -2809,6 +2894,8 @@
28092894
28102895 void SetMaterial(Object3D object)
28112896 {
2897
+ latestObject = object;
2898
+
28122899 cMaterial mat = object.material;
28132900
28142901 if (mat == null)
....@@ -2817,7 +2904,8 @@
28172904 return;
28182905 }
28192906
2820
- multiplyToggle.setSelected(mat.multiply);
2907
+ if (multiplyToggle != null)
2908
+ multiplyToggle.setSelected(mat.multiply);
28212909
28222910 assert (object.projectedVertices != null);
28232911
....@@ -2993,7 +3081,7 @@
29933081 cameraView.ToggleDL();
29943082 cameraView.repaint();
29953083 return;
2996
- } else if (event.getSource() == toggleTextureItem)
3084
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29973085 {
29983086 cameraView.ToggleTexture();
29993087 // june 2013 copy.HardTouch();
....@@ -3032,9 +3120,9 @@
30323120 frame.validate();
30333121
30343122 return;
3035
- } else if (event.getSource() == toggleRandomItem)
3123
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
30363124 {
3037
- cameraView.ToggleRandom();
3125
+ cameraView.ToggleSwitch();
30383126 cameraView.repaint();
30393127 return;
30403128 } else if (event.getSource() == toggleHandleItem)
....@@ -3063,6 +3151,10 @@
30633151 {
30643152 copy.live ^= true;
30653153 return;
3154
+ } else if (event.getSource() == selectCB)
3155
+ {
3156
+ copy.dontselect ^= true;
3157
+ return;
30663158 } else if (event.getSource() == hideCB)
30673159 {
30683160 copy.hide ^= true;
....@@ -3077,6 +3169,7 @@
30773169 if (event.getSource() == randomCB)
30783170 {
30793171 copy.random ^= true;
3172
+ objEditor.refreshContents();
30803173 return;
30813174 }
30823175 if (event.getSource() == speedupCB)
....@@ -3100,8 +3193,9 @@
31003193
31013194 public void actionPerformed(ActionEvent event)
31023195 {
3196
+ Object source = event.getSource();
31033197 // SCRIPT DIALOG
3104
- if (event.getSource() == okbutton)
3198
+ if (source == okbutton)
31053199 {
31063200 textpanel.setVisible(false);
31073201 textpanel.remove(textarea);
....@@ -3113,7 +3207,7 @@
31133207 textarea = null;
31143208 textpanel = null;
31153209 }
3116
- if (event.getSource() == cancelbutton)
3210
+ if (source == cancelbutton)
31173211 {
31183212 textpanel.setVisible(false);
31193213 textpanel.remove(textarea);
....@@ -3125,50 +3219,50 @@
31253219 //applySelf();
31263220 //client.refreshEditWindow();
31273221 //refreshContents();
3128
- if (event.getSource() == nameField)
3222
+ if (source == nameField)
31293223 {
31303224 //System.out.println("ObjEditor " + event);
31313225 applySelf0(true);
31323226 //parent.applySelf();
31333227 objEditor.refreshContents();
3134
- } else if (event.getSource() == resetButton)
3228
+ } else if (source == resetButton)
31353229 {
31363230 CameraPane.fullreset = true;
31373231 copy.Reset(); // ResetMeshes();
31383232 copy.Touch();
31393233 objEditor.refreshContents();
3140
- } else if (event.getSource() == stepItem)
3234
+ } else if (source == stepItem)
31413235 {
31423236 //cameraView.ONESTEP = true;
31433237 Globals.ONESTEP = true;
31443238 cameraView.repaint();
31453239 return;
3146
- } else if (event.getSource() == stepButton)
3240
+ } else if (source == stepButton)
31473241 {
31483242 copy.Step();
31493243 copy.Touch();
31503244 objEditor.refreshContents();
3151
- } else if (event.getSource() == slowerButton)
3245
+ } else if (source == slowerButton)
31523246 {
31533247 copy.Slower();
31543248 copy.Touch();
31553249 objEditor.refreshContents();
3156
- } else if (event.getSource() == fasterButton)
3250
+ } else if (source == fasterButton)
31573251 {
31583252 copy.Faster();
31593253 copy.Touch();
31603254 objEditor.refreshContents();
3161
- } else if (event.getSource() == remarkButton)
3255
+ } else if (source == remarkButton)
31623256 {
31633257 copy.Remark();
31643258 copy.Touch();
31653259 objEditor.refreshContents();
3166
- } else if (event.getSource() == stepAllButton)
3260
+ } else if (source == stepAllButton)
31673261 {
31683262 copy.StepAll();
31693263 copy.Touch();
31703264 objEditor.refreshContents();
3171
- } else if (event.getSource() == resetAllButton)
3265
+ } else if (source == resetAllButton)
31723266 {
31733267 //CameraPane.fullreset = true;
31743268 copy.ResetAll(); // ResetMeshes();
....@@ -3201,53 +3295,75 @@
32013295 // Close();
32023296 // }
32033297 // else
3204
- if (event.getSource() == resetSlidersButton)
3298
+ if (source == resetSlidersButton)
32053299 {
32063300 ResetSliders();
3207
- } else if (event.getSource() == clearMaterialButton)
3301
+ } else if (source == clearMaterialButton)
32083302 {
32093303 ClearMaterial();
3210
- } else if (event.getSource() == createMaterialButton)
3304
+ } else if (source == createMaterialButton)
32113305 {
32123306 CreateMaterial();
3213
- } else if (event.getSource() == clearPanelButton)
3307
+ } else if (source == clearPanelButton)
32143308 {
32153309 copy.ClearUI();
32163310 refreshContents(true);
3217
- } /*
3218
- }
3219
-
3220
- public boolean action(Event event, Object arg)
3221
- {
3222
- */ else if (event.getSource() == closeItem)
3311
+ } else if (source == importGFDItem)
3312
+ {
3313
+ ImportGFD();
3314
+ } else
3315
+ if (source == importVRMLX3DItem)
3316
+ {
3317
+ ImportVRMLX3D();
3318
+ } else
3319
+ if (source == import3DSItem)
3320
+ {
3321
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3322
+ } else
3323
+ if (source == importOBJItem)
3324
+ {
3325
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3326
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3327
+ browser.setVisible(true);
3328
+ String filename = browser.getFile();
3329
+ if (filename != null && filename.length() > 0)
3330
+ {
3331
+ String fullname = browser.getDirectory() + filename;
3332
+ makeSomething(ReadOBJ(fullname), true);
3333
+ }
3334
+ } else
3335
+ if (source == closeItem)
32233336 {
32243337 Close();
32253338 //return true;
3226
- } else if (event.getSource() == loadItem)
3339
+ } else if (source == loadItem)
32273340 {
32283341 load();
32293342 //return true;
3230
- } else if (event.getSource() == saveItem)
3343
+ } else if (source == newItem)
3344
+ {
3345
+ New();
3346
+ } else if (source == saveItem)
32313347 {
32323348 save();
32333349 //return true;
3234
- } else if (event.getSource() == saveAsItem)
3350
+ } else if (source == saveAsItem)
32353351 {
32363352 saveAs();
32373353 //return true;
3238
- } else if (event.getSource() == reexportItem)
3354
+ } else if (source == reexportItem)
32393355 {
32403356 reexport();
32413357 //return true;
3242
- } else if (event.getSource() == exportAsItem)
3358
+ } else if (source == exportAsItem)
32433359 {
32443360 export();
32453361 //return true;
3246
- } else if (event.getSource() == povItem)
3362
+ } else if (source == povItem)
32473363 {
32483364 generatePOV();
32493365 //return true;
3250
- } else if (event.getSource() == zBufferItem)
3366
+ } else if (source == zBufferItem)
32513367 {
32523368 try
32533369 {
....@@ -3269,21 +3385,8 @@
32693385 cameraView.repaint();
32703386 //return true;
32713387 }
3272
- */ else if (event.getSource() == editCameraItem)
3273
- {
3274
- cameraView.ProtectCamera();
3275
- cameraView.repaint();
3276
- return;
3277
- } else if (event.getSource() == revertCameraItem)
3278
- {
3279
- cameraView.RevertCamera();
3280
- cameraView.repaint();
3281
- return;
3282
-// } else if (event.getSource() == textureButton)
3283
-// {
3284
-// return; // true;
3285
- } else // combos...
3286
- if (event.getSource() == texresMenu)
3388
+ */ else // combos...
3389
+ if (source == texresMenu)
32873390 {
32883391 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32893392 copy.texres = texresMenu.getSelectedIndex();
....@@ -3295,12 +3398,272 @@
32953398 }
32963399 }
32973400
3401
+ void New()
3402
+ {
3403
+ while (copy.Size() > 1)
3404
+ {
3405
+ copy.remove(1);
3406
+ }
3407
+
3408
+ ResetModel();
3409
+ objEditor.refreshContents();
3410
+ }
3411
+
3412
+ static public byte[] Compress(Object3D o)
3413
+ {
3414
+ try
3415
+ {
3416
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3417
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3418
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3419
+
3420
+ Object3D parent = o.parent;
3421
+ o.parent = null;
3422
+
3423
+ out.writeObject(o);
3424
+
3425
+ o.parent = parent;
3426
+
3427
+ out.flush();
3428
+
3429
+ zstream.close();
3430
+ out.close();
3431
+
3432
+ return baos.toByteArray();
3433
+ } catch (Exception e)
3434
+ {
3435
+ System.err.println(e);
3436
+ return null;
3437
+ }
3438
+ }
3439
+
3440
+ static public Object Uncompress(byte[] bytes)
3441
+ {
3442
+ System.out.println("#bytes = " + bytes.length);
3443
+ try
3444
+ {
3445
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3446
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3447
+ ObjectInputStream in = new ObjectInputStream(istream);
3448
+ Object obj = in.readObject();
3449
+ in.close();
3450
+
3451
+ return obj;
3452
+ } catch (Exception e)
3453
+ {
3454
+ System.err.println(e);
3455
+ return null;
3456
+ }
3457
+ }
3458
+
3459
+ static public Object clone(Object o)
3460
+ {
3461
+ try
3462
+ {
3463
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3464
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3465
+
3466
+ out.writeObject(o);
3467
+
3468
+ out.flush();
3469
+ out.close();
3470
+
3471
+ byte[] bytes = baos.toByteArray();
3472
+
3473
+ System.out.println("clone = " + bytes.length);
3474
+
3475
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3476
+ ObjectInputStream in = new ObjectInputStream(bais);
3477
+ Object obj = in.readObject();
3478
+ in.close();
3479
+
3480
+ return obj;
3481
+ } catch (Exception e)
3482
+ {
3483
+ System.err.println(e);
3484
+ return null;
3485
+ }
3486
+ }
3487
+
3488
+ cRadio GetCurrentTab()
3489
+ {
3490
+ cRadio ab;
3491
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3492
+ {
3493
+ ab = (cRadio)e.nextElement();
3494
+ if(ab.GetObject() == copy)
3495
+ {
3496
+ return ab;
3497
+ }
3498
+ }
3499
+
3500
+ return null;
3501
+ }
3502
+
3503
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3504
+
3505
+ public void Save()
3506
+ {
3507
+ System.err.println("Save");
3508
+
3509
+ cRadio tab = GetCurrentTab();
3510
+
3511
+ boolean temp = CameraPane.SWITCH;
3512
+ CameraPane.SWITCH = false;
3513
+
3514
+ copy.ExtractBigData(hashtable);
3515
+
3516
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3517
+ tab.graphs[tab.undoindex++] = Compress(copy);
3518
+
3519
+ copy.RestoreBigData(hashtable);
3520
+
3521
+ CameraPane.SWITCH = temp;
3522
+
3523
+ //assert(hashtable.isEmpty());
3524
+
3525
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3526
+ {
3527
+ tab.graphs[i] = null;
3528
+ }
3529
+
3530
+ // test save
3531
+ if (false)
3532
+ {
3533
+ try
3534
+ {
3535
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3536
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3537
+
3538
+ p.writeObject(copy);
3539
+
3540
+ p.flush();
3541
+
3542
+ ostream.close();
3543
+ } catch (Exception e)
3544
+ {
3545
+ e.printStackTrace();
3546
+ }
3547
+ }
3548
+ }
3549
+
3550
+ void CopyChanged(Object3D obj)
3551
+ {
3552
+ boolean temp = CameraPane.SWITCH;
3553
+ CameraPane.SWITCH = false;
3554
+
3555
+ copy.ExtractBigData(hashtable);
3556
+
3557
+ copy.clear();
3558
+
3559
+ for (int i=0; i<obj.Size(); i++)
3560
+ {
3561
+ copy.add(obj.get(i));
3562
+ }
3563
+
3564
+ copy.RestoreBigData(hashtable);
3565
+
3566
+ CameraPane.SWITCH = temp;
3567
+
3568
+ //assert(hashtable.isEmpty());
3569
+
3570
+ copy.Touch();
3571
+
3572
+ ResetModel();
3573
+ copy.HardTouch(); // recompile?
3574
+
3575
+ cRadio ab;
3576
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3577
+ {
3578
+ ab = (cRadio)e.nextElement();
3579
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3580
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3581
+ if (test != null)
3582
+ {
3583
+ test.editWindow = ab.object.editWindow;
3584
+ ab.object = test;
3585
+ }
3586
+ }
3587
+
3588
+ refreshContents();
3589
+ }
3590
+
3591
+ public void Undo()
3592
+ {
3593
+ System.err.println("Undo");
3594
+
3595
+ cRadio tab = GetCurrentTab();
3596
+
3597
+ if (tab.undoindex == 0)
3598
+ {
3599
+ java.awt.Toolkit.getDefaultToolkit().beep();
3600
+ return;
3601
+ }
3602
+
3603
+ if (tab.graphs[tab.undoindex] == null)
3604
+ {
3605
+ Save();
3606
+ tab.undoindex -= 1;
3607
+ }
3608
+
3609
+ tab.undoindex -= 1;
3610
+
3611
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3612
+ }
3613
+
3614
+ public void Redo()
3615
+ {
3616
+ cRadio tab = GetCurrentTab();
3617
+
3618
+ if (tab.graphs[tab.undoindex + 1] == null)
3619
+ {
3620
+ java.awt.Toolkit.getDefaultToolkit().beep();
3621
+ return;
3622
+ }
3623
+
3624
+ tab.undoindex += 1;
3625
+
3626
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3627
+ }
3628
+
3629
+ void ImportGFD()
3630
+ {
3631
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
3632
+ browser.show();
3633
+ String filename = browser.getFile();
3634
+ if (filename != null && filename.length() > 0)
3635
+ {
3636
+ String fullname = browser.getDirectory() + filename;
3637
+
3638
+ //Object3D readobj =
3639
+ objEditor.ReadGFD(fullname, objEditor);
3640
+ //makeSomething(readobj);
3641
+ }
3642
+ }
3643
+
3644
+ void ImportVRMLX3D()
3645
+ {
3646
+ if (Grafreed.standAlone)
3647
+ {
3648
+ /**/
3649
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3650
+ browser.show();
3651
+ String filename = browser.getFile();
3652
+ if (filename != null && filename.length() > 0)
3653
+ {
3654
+ String fullname = browser.getDirectory() + filename;
3655
+ LoadVRMLX3D(fullname);
3656
+ }
3657
+ /**/
3658
+ }
3659
+ }
3660
+
32983661 void ToggleAnimation()
32993662 {
33003663 if (!Globals.ANIMATION)
33013664 {
33023665 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3303
- browser.show();
3666
+ browser.setVisible(true);
33043667 String filename = browser.getFile();
33053668 if (filename != null && filename.length() > 0)
33063669 {
....@@ -3310,8 +3673,8 @@
33103673
33113674 Globals.ANIMATION ^= true;
33123675
3313
- GrafreeD.wav.cursor = 0;
3314
- GrafreeD.wav.loop = 0;
3676
+ Grafreed.wav.cursor = 0;
3677
+ Grafreed.wav.loop = 0;
33153678 }
33163679 } else
33173680 {
....@@ -3361,7 +3724,7 @@
33613724 void CreateMaterial()
33623725 {
33633726 //copy.ClearMaterial(); // PATCH
3364
- copy.CreateMaterialS(multiplyToggle.isSelected());
3727
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33653728 if (copy.selection.size() > 0)
33663729 //SetMaterial(copy);
33673730 {
....@@ -3412,7 +3775,7 @@
34123775 assert false;
34133776 }
34143777
3415
- void EditSelection()
3778
+ void EditSelection(boolean newWindow)
34163779 {
34173780 }
34183781
....@@ -3420,11 +3783,11 @@
34203783 {
34213784 copy.ResetBlockLoop(); // temporary problem
34223785
3423
- boolean random = CameraPane.RANDOM;
3424
- CameraPane.RANDOM = false; // parse everything
3786
+ boolean random = CameraPane.SWITCH;
3787
+ CameraPane.SWITCH = false; // parse everything
34253788 copy.ResetDisplayList();
34263789 copy.HardTouch();
3427
- CameraPane.RANDOM = random;
3790
+ CameraPane.SWITCH = random;
34283791 }
34293792
34303793 // public void applySelf()
....@@ -3494,10 +3857,40 @@
34943857 current.fakedepth = (float) fakedepthField.getFloat();
34953858 current.shadowbias = (float) shadowbiasField.getFloat();
34963859
3497
- if (!NumberSlider.frozen)
3860
+ if (!cNumberSlider.frozen)
34983861 {
34993862 //System.out.println("Propagate = " + propagate);
35003863 copy.UpdateMaterial(anchor, current, propagate);
3864
+
3865
+ if (copy.material != null)
3866
+ {
3867
+ cMaterial mat = copy.material;
3868
+
3869
+ colorField.SetToolTipValue((mat.color));
3870
+ modulationField.SetToolTipValue((mat.modulation));
3871
+ metalnessField.SetToolTipValue((mat.metalness));
3872
+ diffuseField.SetToolTipValue((mat.diffuse));
3873
+ specularField.SetToolTipValue((mat.specular));
3874
+ shininessField.SetToolTipValue((mat.shininess));
3875
+ shiftField.SetToolTipValue((mat.shift));
3876
+ ambientField.SetToolTipValue((mat.ambient));
3877
+ lightareaField.SetToolTipValue((mat.lightarea));
3878
+ diffusenessField.SetToolTipValue((mat.factor));
3879
+ velvetField.SetToolTipValue((mat.velvet));
3880
+ sheenField.SetToolTipValue((mat.sheen));
3881
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3882
+ backlitField.SetToolTipValue((mat.bump));
3883
+ anisoField.SetToolTipValue((mat.aniso));
3884
+ anisoVField.SetToolTipValue((mat.anisoV));
3885
+ cameraField.SetToolTipValue((mat.cameralight));
3886
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3887
+ shadowField.SetToolTipValue((mat.shadow));
3888
+ textureField.SetToolTipValue((mat.texture));
3889
+ opacityField.SetToolTipValue((mat.opacity));
3890
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3891
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3892
+ }
3893
+
35013894 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
35023895 {
35033896 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3542,6 +3935,7 @@
35423935 || e.getSource() == apertureField
35433936 || e.getSource() == shadowblurField)
35443937 {
3938
+ new Exception().printStackTrace();
35453939 System.exit(0);
35463940 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35473941 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3612,7 +4006,7 @@
36124006 }
36134007
36144008 if (normalpushField != null)
3615
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
4009
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36164010 }
36174011
36184012 void SnapObject()
....@@ -3867,7 +4261,7 @@
38674261
38684262 radioPanel.revalidate();
38694263 radioPanel.repaint();
3870
- ctrlPanel.revalidate(); // ? new
4264
+ ctrlPanel.validate(); // ? new
38714265 ctrlPanel.repaint();
38724266 }
38734267 }
....@@ -3876,6 +4270,8 @@
38764270
38774271 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38784272 {
4273
+ if (Globals.SAVEONMAKE) // && resetmodel)
4274
+ Save();
38794275 //Tween.set(thing, 0).target(1).start(tweenManager);
38804276 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38814277 // if (thing instanceof GenericJointDemo)
....@@ -3962,6 +4358,12 @@
39624358 {
39634359 ResetModel();
39644360 Select(thing.GetTreePath(), true, false); // unselect... false);
4361
+
4362
+ if (thing.Size() == 0)
4363
+ {
4364
+ //EditSelection(false);
4365
+ }
4366
+
39654367 refreshContents();
39664368 }
39674369
....@@ -4079,6 +4481,7 @@
40794481 }
40804482 }
40814483 }
4484
+
40824485 LoadGFDThread loadGFDThread;
40834486
40844487 void ReadGFD(String fullname, iCallBack cb)
....@@ -4098,8 +4501,10 @@
40984501
40994502 try
41004503 {
4504
+ // Try compressed version first.
41014505 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4102
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4506
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4507
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
41034508
41044509 readobj = (Object3D) p.readObject();
41054510 istream.close();
....@@ -4107,7 +4512,20 @@
41074512 readobj.ResetDisplayList();
41084513 } catch (Exception e)
41094514 {
4110
- e.printStackTrace();
4515
+ //e.printStackTrace();
4516
+ try
4517
+ {
4518
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4519
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4520
+
4521
+ readobj = (Object3D) p.readObject();
4522
+ istream.close();
4523
+
4524
+ readobj.ResetDisplayList();
4525
+ } catch (Exception e2)
4526
+ {
4527
+ e2.printStackTrace();
4528
+ }
41114529 }
41124530 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
41134531 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4153,6 +4571,12 @@
41534571
41544572 void LoadIt(Object obj)
41554573 {
4574
+ if (obj == null)
4575
+ {
4576
+ // Invalid file
4577
+ return;
4578
+ }
4579
+
41564580 System.out.println("Loaded " + obj);
41574581 //new Exception().printStackTrace();
41584582 Object3D readobj = (Object3D) obj;
....@@ -4162,6 +4586,8 @@
41624586
41634587 if (readobj != null)
41644588 {
4589
+ if (Globals.SAVEONMAKE)
4590
+ Save();
41654591 try
41664592 {
41674593 //readobj.deepCopySelf(copy);
....@@ -4224,7 +4650,7 @@
42244650
42254651 void load() // throws ClassNotFoundException
42264652 {
4227
- if (GrafreeD.standAlone)
4653
+ if (Grafreed.standAlone)
42284654 {
42294655 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42304656 browser.show();
....@@ -4311,11 +4737,13 @@
43114737 try
43124738 {
43134739 FileOutputStream ostream = new FileOutputStream(lastname);
4314
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4740
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4741
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43154742
43164743 p.writeObject(copy);
43174744 p.flush();
43184745
4746
+ zstream.close();
43194747 ostream.close();
43204748
43214749 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4325,11 +4753,12 @@
43254753 {
43264754 }
43274755 }
4756
+
43284757 String lastname;
43294758
43304759 void saveAs()
43314760 {
4332
- if (GrafreeD.standAlone)
4761
+ if (Grafreed.standAlone)
43334762 {
43344763 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43354764 browser.setVisible(true);
....@@ -4434,13 +4863,13 @@
44344863 try
44354864 {
44364865 FileOutputStream ostream = new FileOutputStream(filename);
4437
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4438
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4866
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4867
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44394868
44404869 Object3D objectparent = obj.parent;
44414870 obj.parent = null;
44424871
4443
- Object3D object = (Object3D) GrafreeD.clone(obj);
4872
+ Object3D object = (Object3D) Grafreed.clone(obj);
44444873
44454874 obj.parent = objectparent;
44464875
....@@ -4452,8 +4881,8 @@
44524881 p.writeObject(object);
44534882 p.flush();
44544883
4884
+ zstream.close();
44554885 ostream.close();
4456
- // zstream.close();
44574886
44584887 // group.selection.get(0).parent = parent;
44594888 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4474,7 +4903,7 @@
44744903 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44754904 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44764905 copy.generatePOV(buffer);
4477
- if (GrafreeD.standAlone)
4906
+ if (Grafreed.standAlone)
44784907 {
44794908 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44804909 browser.show();
....@@ -4500,7 +4929,8 @@
45004929 Object3D client;
45014930 Object3D copy;
45024931 MenuBar menuBar;
4503
- Menu windowMenu;
4932
+ Menu fileMenu;
4933
+ MenuItem newItem;
45044934 MenuItem loadItem;
45054935 MenuItem saveItem;
45064936 MenuItem saveAsItem;
....@@ -4508,13 +4938,11 @@
45084938 MenuItem reexportItem;
45094939 MenuItem povItem;
45104940 MenuItem closeItem;
4511
- Menu cameraMenu;
4941
+
45124942 CheckboxMenuItem zBufferItem;
45134943 //MenuItem normalLensItem;
4514
- MenuItem editCameraItem;
4515
- MenuItem revertCameraItem;
4516
- CheckboxMenuItem toggleLiveItem;
45174944 MenuItem stepItem;
4945
+ CheckboxMenuItem toggleLiveItem;
45184946 CheckboxMenuItem toggleFullScreenItem;
45194947 CheckboxMenuItem toggleTimelineItem;
45204948 CheckboxMenuItem toggleRenderItem;
....@@ -4523,28 +4951,41 @@
45234951 CheckboxMenuItem toggleFootContactItem;
45244952 CheckboxMenuItem toggleDLItem;
45254953 CheckboxMenuItem toggleTextureItem;
4526
- CheckboxMenuItem toggleRandomItem;
4954
+ CheckboxMenuItem toggleSwitchItem;
45274955 CheckboxMenuItem toggleRootItem;
45284956 CheckboxMenuItem animationItem;
45294957 CheckboxMenuItem toggleHandleItem;
45304958 CheckboxMenuItem togglePaintItem;
45314959 JSplitPane mainPanel;
45324960 JScrollPane scrollpane;
4961
+
45334962 JPanel toolbarPanel;
4534
- JPanel treePanel;
4963
+
4964
+ cGridBag treePanel;
4965
+
45354966 JPanel radioPanel;
45364967 ButtonGroup buttonGroup;
4537
- JPanel ctrlPanel;
4538
- JPanel materialPanel;
4968
+
4969
+ cGridBag toolboxPanel;
4970
+ cGridBag materialPanel;
4971
+ cGridBag ctrlPanel;
4972
+
45394973 JScrollPane infoPanel;
4540
- JPanel optionsPanel;
4974
+
4975
+ cGridBag optionsPanel;
4976
+
45414977 JTabbedPane objectPanel;
4542
- JPanel XYZPanel;
4978
+ boolean materialFlushed;
4979
+ Object3D latestObject;
4980
+
4981
+ cGridBag XYZPanel;
4982
+
45434983 JSplitPane gridPanel;
45444984 JSplitPane bigPanel;
4545
- JPanel bigThree;
4546
- JTabbedPane scenePanel;
4547
- JPanel centralPanel;
4985
+
4986
+ cGridBag bigThree;
4987
+ cGridBag scenePanel;
4988
+ cGridBag centralPanel;
45484989 JSplitPane cameraPanel;
45494990 JPanel timelinePanel;
45504991 JMenuBar timelineMenubar;
....@@ -4597,67 +5038,72 @@
45975038 // MATERIAL
45985039 JLabel materialLabel;
45995040 JLabel colorLabel;
4600
- NumberSlider colorField;
5041
+ cNumberSlider colorField;
46015042 JLabel modulationLabel;
4602
- NumberSlider modulationField;
5043
+ cNumberSlider modulationField;
46035044 JLabel metalnessLabel;
4604
- NumberSlider metalnessField;
5045
+ cNumberSlider metalnessField;
46055046 JLabel diffuseLabel;
4606
- NumberSlider diffuseField;
5047
+ cNumberSlider diffuseField;
46075048 JLabel specularLabel;
4608
- NumberSlider specularField;
5049
+ cNumberSlider specularField;
46095050 JLabel shininessLabel;
4610
- NumberSlider shininessField;
5051
+ cNumberSlider shininessField;
46115052 JLabel shiftLabel;
4612
- NumberSlider shiftField;
5053
+ cNumberSlider shiftField;
46135054 JLabel ambientLabel;
4614
- NumberSlider ambientField;
5055
+ cNumberSlider ambientField;
46155056 JLabel lightareaLabel;
4616
- NumberSlider lightareaField;
5057
+ cNumberSlider lightareaField;
46175058 JLabel diffusenessLabel;
4618
- NumberSlider diffusenessField;
5059
+ cNumberSlider diffusenessField;
46195060 JLabel velvetLabel;
4620
- NumberSlider velvetField;
5061
+ cNumberSlider velvetField;
46215062 JLabel sheenLabel;
4622
- NumberSlider sheenField;
5063
+ cNumberSlider sheenField;
46235064 JLabel subsurfaceLabel;
4624
- NumberSlider subsurfaceField;
5065
+ cNumberSlider subsurfaceField;
46255066 //JLabel bumpLabel;
46265067 //NumberSlider bumpField;
46275068 JLabel backlitLabel;
4628
- NumberSlider backlitField;
5069
+ cNumberSlider backlitField;
46295070 JLabel anisoLabel;
4630
- NumberSlider anisoField;
5071
+ cNumberSlider anisoField;
46315072 JLabel anisoVLabel;
4632
- NumberSlider anisoVField;
5073
+ cNumberSlider anisoVField;
46335074 JLabel cameraLabel;
4634
- NumberSlider cameraField;
5075
+ cNumberSlider cameraField;
46355076 JLabel selfshadowLabel;
4636
- NumberSlider selfshadowField;
5077
+ cNumberSlider selfshadowField;
46375078 JLabel shadowLabel;
4638
- NumberSlider shadowField;
5079
+ cNumberSlider shadowField;
46395080 JLabel textureLabel;
4640
- NumberSlider textureField;
5081
+ cNumberSlider textureField;
46415082 JLabel opacityLabel;
4642
- NumberSlider opacityField;
5083
+ cNumberSlider opacityField;
46435084 JLabel fakedepthLabel;
4644
- NumberSlider fakedepthField;
5085
+ cNumberSlider fakedepthField;
46455086 JLabel shadowbiasLabel;
4646
- NumberSlider shadowbiasField;
5087
+ cNumberSlider shadowbiasField;
46475088 JLabel bumpLabel;
4648
- NumberSlider bumpField;
5089
+ cNumberSlider bumpField;
46495090 JLabel noiseLabel;
4650
- NumberSlider noiseField;
5091
+ cNumberSlider noiseField;
46515092 JLabel powerLabel;
4652
- NumberSlider powerField;
5093
+ cNumberSlider powerField;
46535094 JLabel borderfadeLabel;
4654
- NumberSlider borderfadeField;
5095
+ cNumberSlider borderfadeField;
46555096 JLabel fogLabel;
4656
- NumberSlider fogField;
5097
+ cNumberSlider fogField;
46575098 JLabel opacityPowerLabel;
4658
- NumberSlider opacityPowerField;
4659
- JTree jTree;
5099
+ cNumberSlider opacityPowerField;
5100
+ cTree jTree;
46605101 //ObjectUI parent;
46615102
4662
- NumberSlider normalpushField;
5103
+ cNumberSlider normalpushField;
5104
+
5105
+ private MenuItem importGFDItem;
5106
+ private MenuItem importVRMLX3DItem;
5107
+ private MenuItem import3DSItem;
5108
+ private MenuItem importOBJItem;
46635109 }