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,19 +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");
12951477
1296
- AddOptions(optionsPanel, aConstraints);
1478
+ AddOptions(optionsPanel); //, aConstraints);
12971479
1298
- scenePanel.add(optionsPanel);
1480
+ tabbedPane.add(optionsPanel);
1481
+
1482
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12991483
1484
+ scenePanel.add(tabbedPane);
13001485
13011486 /*
13021487 cTree jTree = new cTree(null);
....@@ -1330,6 +1515,7 @@
13301515 //bigPanel.setSize(new Dimension(10,10));
13311516 //bigPanel.add(ctrlPanel);
13321517 //bigPanel.add(gridPanel);
1518
+ /**
13331519 bigThree = new JPanel();
13341520 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13351521 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1353,7 +1539,13 @@
13531539 // aConstraints.gridheight = 3;
13541540 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13551541 bigThree.add(XYZPanel, aWindowConstraints);
1542
+ /**/
13561543
1544
+ bigThree = new cGridBag();
1545
+ bigThree.addComponent(scenePanel);
1546
+ bigThree.addComponent(centralPanel);
1547
+ bigThree.addComponent(XYZPanel);
1548
+
13571549 // // SIDE EFFECT!!!
13581550 // aConstraints.gridx = 0;
13591551 // aConstraints.gridy = 0;
....@@ -1380,9 +1572,13 @@
13801572
13811573 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13821574
1383
- frame.setSize(1024, 768);
1384
- frame.show();
1575
+ frame.setSize(1280, 860);
1576
+
1577
+ frame.validate();
1578
+ frame.setVisible(true);
13851579
1580
+ cameraView.requestFocusInWindow();
1581
+
13861582 gridPanel.setDividerLocation(1.0);
13871583
13881584 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1396,7 +1592,7 @@
13961592 });
13971593 }
13981594
1399
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1595
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
14001596 {
14011597 }
14021598
....@@ -1411,260 +1607,173 @@
14111607 ctrlPanel.removeAll();
14121608 }
14131609
1414
- void SetupMaterial(JPanel ctrlPanel)
1610
+ void SetupMaterial(cGridBag panel)
14151611 {
1416
- aConstraints.weighty = 0;
1417
- //aConstraints.weightx = 1;
1418
- /*
1612
+ /*
14191613 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14201614 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1421
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1422
- aConstraints.gridx += 1;
14231615 */
14241616
1425
- aConstraints.gridwidth = 1;
1426
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1427
- aConstraints.gridx += 1;
1428
- aConstraints.weighty = 0;
1429
- 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");
14301621
14311622 /*
14321623 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1433
- aConstraints.gridx += 1;
1434
- aConstraints.weighty = 0;
1435
- aConstraints.gridwidth = 1;
14361624 */
14371625
1438
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1439
- 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
+ }
14401635
1441
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1442
-
1443
- aConstraints.gridx += 1;
1444
-
1445
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1446
-
1447
- aConstraints.gridx += 1;
1448
-
1449
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1450
-
1451
- aConstraints.gridx = 0;
1452
- aConstraints.gridy += 1;
1453
- aConstraints.weighty = 0;
1454
- aConstraints.gridwidth = 1;
1636
+ editBar.preferredHeight = 15;
1637
+
1638
+ panel.add(editBar);
1639
+
14551640 /**/
14561641 //aConstraints.weighty = 0;
14571642 ////aConstraints.weightx = 1;
14581643 //aConstraints.weighty = 1;
14591644 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14601645 //aConstraints.gridx += 1;
1461
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1462
- aConstraints.weighty = 0;
1463
- aConstraints.gridx = 0;
1464
- aConstraints.gridy += 1;
1465
- aConstraints.gridwidth = 1;
1646
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14661647
1467
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1468
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1469
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1470
- aConstraints.gridx += 1;
1471
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1472
- //aConstraints.weightx = 0;
1473
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1474
- aConstraints.gridx = 0;
1475
- aConstraints.gridy += 1;
1476
- 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);
14771656
1478
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1479
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1480
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1481
- aConstraints.gridx += 1;
1482
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1483
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1484
- aConstraints.gridx = 0;
1485
- aConstraints.gridy += 1;
1486
- 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);
14871662
1488
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1489
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1490
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1491
- aConstraints.gridx += 1;
1492
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1493
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1494
- aConstraints.gridx = 0;
1495
- aConstraints.gridy += 1;
1496
- 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);
14971668
1498
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1499
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1500
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1501
- aConstraints.gridx += 1;
1502
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1503
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1504
- aConstraints.gridx = 0;
1505
- aConstraints.gridy += 1;
1506
- 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);
15071674
1508
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1509
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1510
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1511
- aConstraints.gridx += 1;
1512
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1513
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1514
- aConstraints.gridx = 0;
1515
- aConstraints.gridy += 1;
1516
- 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);
15171680
1518
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1519
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1520
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1521
- aConstraints.gridx += 1;
1522
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1523
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1524
- aConstraints.gridx = 0;
1525
- aConstraints.gridy += 1;
1526
- 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);
15271686
1528
- //aConstraints.weighty = 1;
1529
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1530
- //aConstraints.gridx += 1;
1531
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1532
- aConstraints.weighty = 0;
1533
- aConstraints.gridx = 0;
1534
- aConstraints.gridy += 1;
1535
- 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);
15361700
1537
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1538
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1539
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1540
- aConstraints.gridx += 1;
1541
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1542
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1543
- aConstraints.gridx = 0;
1544
- aConstraints.gridy += 1;
1545
- 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);
15461706
1547
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1548
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1549
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1550
- aConstraints.gridx += 1;
1551
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1552
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1553
- aConstraints.gridx = 0;
1554
- aConstraints.gridy += 1;
1555
- 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);
15561712
1557
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1558
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1559
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1560
- aConstraints.gridx += 1;
1561
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1562
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1563
- aConstraints.gridx = 0;
1564
- aConstraints.gridy += 1;
1565
- 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);
15661718
1567
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1568
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1569
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1570
- aConstraints.gridx += 1;
1571
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1572
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1573
- aConstraints.gridx = 0;
1574
- aConstraints.gridy += 1;
1575
- 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);
15761724
1577
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1578
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1579
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1580
- aConstraints.gridx += 1;
1581
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1582
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1583
- aConstraints.gridx = 0;
1584
- aConstraints.gridy += 1;
1585
- 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);
15861730
1587
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1588
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1589
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1590
- aConstraints.gridx += 1;
1591
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1592
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1593
- aConstraints.gridx = 0;
1594
- aConstraints.gridy += 1;
1595
- 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);
15961736
1597
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1598
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1599
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1600
- aConstraints.gridx += 1;
1601
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1602
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1603
- aConstraints.gridx = 0;
1604
- aConstraints.gridy += 1;
1605
- 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);
16061744
1607
- //aConstraints.weighty = 1;
1608
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1609
- //aConstraints.gridx += 1;
1610
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1611
- aConstraints.weighty = 0;
1612
- aConstraints.gridx = 0;
1613
- aConstraints.gridy += 1;
1614
- 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);
16151750
1616
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1617
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1618
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1619
- aConstraints.gridx += 1;
1620
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1621
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1622
- aConstraints.gridx = 0;
1623
- aConstraints.gridy += 1;
1624
- 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);
16251756
1626
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1627
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1628
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1629
- aConstraints.gridx += 1;
1630
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1631
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1632
- aConstraints.gridx = 0;
1633
- aConstraints.gridy += 1;
1634
- 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);
16351762
1636
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1637
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1638
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1639
- aConstraints.gridx += 1;
1640
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1641
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1642
- aConstraints.gridx = 0;
1643
- aConstraints.gridy += 1;
1644
- 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);
16451768
1646
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1647
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1648
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1649
- aConstraints.gridx += 1;
1650
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1651
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1652
- aConstraints.gridx = 0;
1653
- aConstraints.gridy += 1;
1654
- 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);
16551774
1656
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1657
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1658
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1659
- aConstraints.gridx += 1;
1660
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1661
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1662
- aConstraints.gridx = 0;
1663
- aConstraints.gridy += 1;
1664
- aConstraints.gridwidth = 1;
1665
-
1666
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1667
- Return();
1775
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1776
+ //Return();
16681777 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16691778 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16701779 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1675,130 +1784,93 @@
16751784 // aConstraints.gridy += 1;
16761785 // aConstraints.gridwidth = 1;
16771786
1678
- //aConstraints.weighty = 1;
1679
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1680
- //aConstraints.gridx += 1;
1681
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1682
- aConstraints.weighty = 0;
1683
- aConstraints.gridx = 0;
1684
- aConstraints.gridy += 1;
1685
- aConstraints.gridwidth = 1;
16861787
1687
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1688
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1689
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1690
- aConstraints.gridx += 1;
1691
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1692
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1693
- aConstraints.gridx = 0;
1694
- aConstraints.gridy += 1;
1695
- 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);
16961795
1697
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1698
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1699
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1700
- aConstraints.gridx += 1;
1701
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1702
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1703
- aConstraints.gridx = 0;
1704
- aConstraints.gridy += 1;
1705
- 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);
17061801
1707
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1708
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1709
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1710
- aConstraints.gridx += 1;
1711
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1712
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1713
- aConstraints.gridx = 0;
1714
- aConstraints.gridy += 1;
1715
- 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);
17161807
1717
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1718
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1719
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1720
- aConstraints.gridx += 1;
1721
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1722
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1723
- aConstraints.gridx = 0;
1724
- aConstraints.gridy += 1;
1725
- aConstraints.gridwidth = 1;
1726
- 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);
17271813
1728
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1729
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1730
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1731
- aConstraints.gridx += 1;
1732
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1733
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1734
- aConstraints.gridx = 0;
1735
- aConstraints.gridy += 1;
1736
- 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);
17371819
1738
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1739
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1740
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1741
- aConstraints.gridx += 1;
1742
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1743
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1744
- aConstraints.gridx = 0;
1745
- aConstraints.gridy += 1;
1746
- 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);
17471827
1748
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1749
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1750
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1751
- aConstraints.gridx += 1;
1752
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1753
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1754
- aConstraints.gridx = 0;
1755
- aConstraints.gridy += 1;
1756
- 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);
17571833
1758
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1759
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1760
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1761
- aConstraints.gridx += 1;
1762
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1763
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1764
- aConstraints.gridx = 0;
1765
- aConstraints.gridy += 1;
1766
- 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);
17671839
1768
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1769
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1770
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1771
- aConstraints.gridx += 1;
1772
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1773
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1774
- aConstraints.gridx = 0;
1775
- aConstraints.gridy += 1;
1776
- 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);
17771845
1778
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1779
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1780
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1781
- aConstraints.gridx += 1;
1782
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1783
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1784
- aConstraints.gridx = 0;
1785
- aConstraints.gridy += 1;
1786
- 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);
17871851
1788
- //aConstraints.weighty = 1;
1789
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1790
- //aConstraints.gridx += 1;
1791
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1792
- 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);
17931857
1794
- aConstraints.gridx = 0;
1795
- aConstraints.gridy = 0;
1796
- 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);
17971869
17981870 SetMaterial(copy); // .GetMaterial());
17991871
1800
- colorField.addChangeListener(this);
1801
- modulationField.addChangeListener(this);
1872
+ //colorField.addChangeListener(this);
1873
+// modulationField.addChangeListener(this);
18021874 metalnessField.addChangeListener(this);
18031875 diffuseField.addChangeListener(this);
18041876 specularField.addChangeListener(this);
....@@ -1828,12 +1900,15 @@
18281900 opacityPowerField.addChangeListener(this);
18291901 /**/
18301902
1831
- resetSlidersButton.addActionListener(this);
18321903 clearMaterialButton.addActionListener(this);
18331904 createMaterialButton.addActionListener(this);
1834
-
1835
- propagateToggle.addItemListener(this);
1836
- multiplyToggle.addItemListener(this);
1905
+
1906
+ if (Globals.ADVANCED)
1907
+ {
1908
+ resetSlidersButton.addActionListener(this);
1909
+ propagateToggle.addItemListener(this);
1910
+ multiplyToggle.addItemListener(this);
1911
+ }
18371912 }
18381913
18391914 void DropFile(java.io.File[] files, boolean textures)
....@@ -2004,7 +2079,7 @@
20042079
20052080 //? flashIt = false;
20062081 CameraPane pane = (CameraPane) cameraView;
2007
- pane.clickStart(location.x, location.y, 0);
2082
+ pane.clickStart(location.x, location.y, 0, 0);
20082083 pane.clickEnd(location.x, location.y, 0, true);
20092084
20102085 if (group.selection.size() == 1)
....@@ -2053,6 +2128,7 @@
20532128 e2.printStackTrace();
20542129 }
20552130 }
2131
+
20562132 LoadJMEThread loadThread;
20572133
20582134 class LoadJMEThread extends Thread
....@@ -2110,6 +2186,7 @@
21102186 //LoadFile0(filename, converter);
21112187 }
21122188 }
2189
+
21132190 LoadOBJThread loadObjThread;
21142191
21152192 class LoadOBJThread extends Thread
....@@ -2188,19 +2265,19 @@
21882265
21892266 void LoadObjFile(String fullname)
21902267 {
2191
- /*
2268
+ System.out.println("Loading " + fullname);
2269
+ /**/
21922270 //lastFilename = fullname;
21932271 if(loadObjThread == null)
21942272 {
2195
- loadObjThread = new LoadOBJThread();
2196
- loadObjThread.start();
2273
+ loadObjThread = new LoadOBJThread();
2274
+ loadObjThread.start();
21972275 }
21982276
21992277 loadObjThread.add(fullname);
2200
- */
2278
+ /**/
22012279
2202
- System.out.println("Loading " + fullname);
2203
- makeSomething(new FileObject(fullname, true), true);
2280
+ //makeSomething(new FileObject(fullname, true), true);
22042281 }
22052282
22062283 void LoadGFDFile(String fullname)
....@@ -2461,11 +2538,11 @@
24612538
24622539 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24632540 {
2464
- if (GrafreeD.standAlone)
2541
+ if (Grafreed.standAlone)
24652542 {
24662543 /**/
24672544 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2468
- browser.show();
2545
+ browser.setVisible(true);
24692546 String filename = browser.getFile();
24702547 if (filename != null && filename.length() > 0)
24712548 {
....@@ -2610,6 +2687,7 @@
26102687 }
26112688 if (input == null)
26122689 {
2690
+ new Exception().printStackTrace();
26132691 System.exit(0);
26142692 }
26152693
....@@ -2816,6 +2894,8 @@
28162894
28172895 void SetMaterial(Object3D object)
28182896 {
2897
+ latestObject = object;
2898
+
28192899 cMaterial mat = object.material;
28202900
28212901 if (mat == null)
....@@ -2824,7 +2904,8 @@
28242904 return;
28252905 }
28262906
2827
- multiplyToggle.setSelected(mat.multiply);
2907
+ if (multiplyToggle != null)
2908
+ multiplyToggle.setSelected(mat.multiply);
28282909
28292910 assert (object.projectedVertices != null);
28302911
....@@ -3000,7 +3081,7 @@
30003081 cameraView.ToggleDL();
30013082 cameraView.repaint();
30023083 return;
3003
- } else if (event.getSource() == toggleTextureItem)
3084
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
30043085 {
30053086 cameraView.ToggleTexture();
30063087 // june 2013 copy.HardTouch();
....@@ -3039,9 +3120,9 @@
30393120 frame.validate();
30403121
30413122 return;
3042
- } else if (event.getSource() == toggleRandomItem)
3123
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
30433124 {
3044
- cameraView.ToggleRandom();
3125
+ cameraView.ToggleSwitch();
30453126 cameraView.repaint();
30463127 return;
30473128 } else if (event.getSource() == toggleHandleItem)
....@@ -3070,6 +3151,10 @@
30703151 {
30713152 copy.live ^= true;
30723153 return;
3154
+ } else if (event.getSource() == selectCB)
3155
+ {
3156
+ copy.dontselect ^= true;
3157
+ return;
30733158 } else if (event.getSource() == hideCB)
30743159 {
30753160 copy.hide ^= true;
....@@ -3084,6 +3169,7 @@
30843169 if (event.getSource() == randomCB)
30853170 {
30863171 copy.random ^= true;
3172
+ objEditor.refreshContents();
30873173 return;
30883174 }
30893175 if (event.getSource() == speedupCB)
....@@ -3107,8 +3193,9 @@
31073193
31083194 public void actionPerformed(ActionEvent event)
31093195 {
3196
+ Object source = event.getSource();
31103197 // SCRIPT DIALOG
3111
- if (event.getSource() == okbutton)
3198
+ if (source == okbutton)
31123199 {
31133200 textpanel.setVisible(false);
31143201 textpanel.remove(textarea);
....@@ -3120,7 +3207,7 @@
31203207 textarea = null;
31213208 textpanel = null;
31223209 }
3123
- if (event.getSource() == cancelbutton)
3210
+ if (source == cancelbutton)
31243211 {
31253212 textpanel.setVisible(false);
31263213 textpanel.remove(textarea);
....@@ -3132,50 +3219,50 @@
31323219 //applySelf();
31333220 //client.refreshEditWindow();
31343221 //refreshContents();
3135
- if (event.getSource() == nameField)
3222
+ if (source == nameField)
31363223 {
31373224 //System.out.println("ObjEditor " + event);
31383225 applySelf0(true);
31393226 //parent.applySelf();
31403227 objEditor.refreshContents();
3141
- } else if (event.getSource() == resetButton)
3228
+ } else if (source == resetButton)
31423229 {
31433230 CameraPane.fullreset = true;
31443231 copy.Reset(); // ResetMeshes();
31453232 copy.Touch();
31463233 objEditor.refreshContents();
3147
- } else if (event.getSource() == stepItem)
3234
+ } else if (source == stepItem)
31483235 {
31493236 //cameraView.ONESTEP = true;
31503237 Globals.ONESTEP = true;
31513238 cameraView.repaint();
31523239 return;
3153
- } else if (event.getSource() == stepButton)
3240
+ } else if (source == stepButton)
31543241 {
31553242 copy.Step();
31563243 copy.Touch();
31573244 objEditor.refreshContents();
3158
- } else if (event.getSource() == slowerButton)
3245
+ } else if (source == slowerButton)
31593246 {
31603247 copy.Slower();
31613248 copy.Touch();
31623249 objEditor.refreshContents();
3163
- } else if (event.getSource() == fasterButton)
3250
+ } else if (source == fasterButton)
31643251 {
31653252 copy.Faster();
31663253 copy.Touch();
31673254 objEditor.refreshContents();
3168
- } else if (event.getSource() == remarkButton)
3255
+ } else if (source == remarkButton)
31693256 {
31703257 copy.Remark();
31713258 copy.Touch();
31723259 objEditor.refreshContents();
3173
- } else if (event.getSource() == stepAllButton)
3260
+ } else if (source == stepAllButton)
31743261 {
31753262 copy.StepAll();
31763263 copy.Touch();
31773264 objEditor.refreshContents();
3178
- } else if (event.getSource() == resetAllButton)
3265
+ } else if (source == resetAllButton)
31793266 {
31803267 //CameraPane.fullreset = true;
31813268 copy.ResetAll(); // ResetMeshes();
....@@ -3208,53 +3295,75 @@
32083295 // Close();
32093296 // }
32103297 // else
3211
- if (event.getSource() == resetSlidersButton)
3298
+ if (source == resetSlidersButton)
32123299 {
32133300 ResetSliders();
3214
- } else if (event.getSource() == clearMaterialButton)
3301
+ } else if (source == clearMaterialButton)
32153302 {
32163303 ClearMaterial();
3217
- } else if (event.getSource() == createMaterialButton)
3304
+ } else if (source == createMaterialButton)
32183305 {
32193306 CreateMaterial();
3220
- } else if (event.getSource() == clearPanelButton)
3307
+ } else if (source == clearPanelButton)
32213308 {
32223309 copy.ClearUI();
32233310 refreshContents(true);
3224
- } /*
3225
- }
3226
-
3227
- public boolean action(Event event, Object arg)
3228
- {
3229
- */ 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)
32303336 {
32313337 Close();
32323338 //return true;
3233
- } else if (event.getSource() == loadItem)
3339
+ } else if (source == loadItem)
32343340 {
32353341 load();
32363342 //return true;
3237
- } else if (event.getSource() == saveItem)
3343
+ } else if (source == newItem)
3344
+ {
3345
+ New();
3346
+ } else if (source == saveItem)
32383347 {
32393348 save();
32403349 //return true;
3241
- } else if (event.getSource() == saveAsItem)
3350
+ } else if (source == saveAsItem)
32423351 {
32433352 saveAs();
32443353 //return true;
3245
- } else if (event.getSource() == reexportItem)
3354
+ } else if (source == reexportItem)
32463355 {
32473356 reexport();
32483357 //return true;
3249
- } else if (event.getSource() == exportAsItem)
3358
+ } else if (source == exportAsItem)
32503359 {
32513360 export();
32523361 //return true;
3253
- } else if (event.getSource() == povItem)
3362
+ } else if (source == povItem)
32543363 {
32553364 generatePOV();
32563365 //return true;
3257
- } else if (event.getSource() == zBufferItem)
3366
+ } else if (source == zBufferItem)
32583367 {
32593368 try
32603369 {
....@@ -3276,21 +3385,8 @@
32763385 cameraView.repaint();
32773386 //return true;
32783387 }
3279
- */ else if (event.getSource() == editCameraItem)
3280
- {
3281
- cameraView.ProtectCamera();
3282
- cameraView.repaint();
3283
- return;
3284
- } else if (event.getSource() == revertCameraItem)
3285
- {
3286
- cameraView.RevertCamera();
3287
- cameraView.repaint();
3288
- return;
3289
-// } else if (event.getSource() == textureButton)
3290
-// {
3291
-// return; // true;
3292
- } else // combos...
3293
- if (event.getSource() == texresMenu)
3388
+ */ else // combos...
3389
+ if (source == texresMenu)
32943390 {
32953391 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32963392 copy.texres = texresMenu.getSelectedIndex();
....@@ -3302,12 +3398,272 @@
33023398 }
33033399 }
33043400
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
+
33053661 void ToggleAnimation()
33063662 {
33073663 if (!Globals.ANIMATION)
33083664 {
33093665 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3310
- browser.show();
3666
+ browser.setVisible(true);
33113667 String filename = browser.getFile();
33123668 if (filename != null && filename.length() > 0)
33133669 {
....@@ -3317,8 +3673,8 @@
33173673
33183674 Globals.ANIMATION ^= true;
33193675
3320
- GrafreeD.wav.cursor = 0;
3321
- GrafreeD.wav.loop = 0;
3676
+ Grafreed.wav.cursor = 0;
3677
+ Grafreed.wav.loop = 0;
33223678 }
33233679 } else
33243680 {
....@@ -3368,7 +3724,7 @@
33683724 void CreateMaterial()
33693725 {
33703726 //copy.ClearMaterial(); // PATCH
3371
- copy.CreateMaterialS(multiplyToggle.isSelected());
3727
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33723728 if (copy.selection.size() > 0)
33733729 //SetMaterial(copy);
33743730 {
....@@ -3419,7 +3775,7 @@
34193775 assert false;
34203776 }
34213777
3422
- void EditSelection()
3778
+ void EditSelection(boolean newWindow)
34233779 {
34243780 }
34253781
....@@ -3427,11 +3783,11 @@
34273783 {
34283784 copy.ResetBlockLoop(); // temporary problem
34293785
3430
- boolean random = CameraPane.RANDOM;
3431
- CameraPane.RANDOM = false; // parse everything
3786
+ boolean random = CameraPane.SWITCH;
3787
+ CameraPane.SWITCH = false; // parse everything
34323788 copy.ResetDisplayList();
34333789 copy.HardTouch();
3434
- CameraPane.RANDOM = random;
3790
+ CameraPane.SWITCH = random;
34353791 }
34363792
34373793 // public void applySelf()
....@@ -3501,10 +3857,40 @@
35013857 current.fakedepth = (float) fakedepthField.getFloat();
35023858 current.shadowbias = (float) shadowbiasField.getFloat();
35033859
3504
- if (!NumberSlider.frozen)
3860
+ if (!cNumberSlider.frozen)
35053861 {
35063862 //System.out.println("Propagate = " + propagate);
35073863 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
+
35083894 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
35093895 {
35103896 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3549,6 +3935,7 @@
35493935 || e.getSource() == apertureField
35503936 || e.getSource() == shadowblurField)
35513937 {
3938
+ new Exception().printStackTrace();
35523939 System.exit(0);
35533940 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35543941 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3619,7 +4006,7 @@
36194006 }
36204007
36214008 if (normalpushField != null)
3622
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
4009
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36234010 }
36244011
36254012 void SnapObject()
....@@ -3874,7 +4261,7 @@
38744261
38754262 radioPanel.revalidate();
38764263 radioPanel.repaint();
3877
- ctrlPanel.revalidate(); // ? new
4264
+ ctrlPanel.validate(); // ? new
38784265 ctrlPanel.repaint();
38794266 }
38804267 }
....@@ -3883,6 +4270,8 @@
38834270
38844271 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38854272 {
4273
+ if (Globals.SAVEONMAKE) // && resetmodel)
4274
+ Save();
38864275 //Tween.set(thing, 0).target(1).start(tweenManager);
38874276 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38884277 // if (thing instanceof GenericJointDemo)
....@@ -3969,6 +4358,12 @@
39694358 {
39704359 ResetModel();
39714360 Select(thing.GetTreePath(), true, false); // unselect... false);
4361
+
4362
+ if (thing.Size() == 0)
4363
+ {
4364
+ //EditSelection(false);
4365
+ }
4366
+
39724367 refreshContents();
39734368 }
39744369
....@@ -4086,6 +4481,7 @@
40864481 }
40874482 }
40884483 }
4484
+
40894485 LoadGFDThread loadGFDThread;
40904486
40914487 void ReadGFD(String fullname, iCallBack cb)
....@@ -4105,8 +4501,10 @@
41054501
41064502 try
41074503 {
4504
+ // Try compressed version first.
41084505 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4109
- 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);
41104508
41114509 readobj = (Object3D) p.readObject();
41124510 istream.close();
....@@ -4114,7 +4512,20 @@
41144512 readobj.ResetDisplayList();
41154513 } catch (Exception e)
41164514 {
4117
- 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
+ }
41184529 }
41194530 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
41204531 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4160,6 +4571,12 @@
41604571
41614572 void LoadIt(Object obj)
41624573 {
4574
+ if (obj == null)
4575
+ {
4576
+ // Invalid file
4577
+ return;
4578
+ }
4579
+
41634580 System.out.println("Loaded " + obj);
41644581 //new Exception().printStackTrace();
41654582 Object3D readobj = (Object3D) obj;
....@@ -4169,6 +4586,8 @@
41694586
41704587 if (readobj != null)
41714588 {
4589
+ if (Globals.SAVEONMAKE)
4590
+ Save();
41724591 try
41734592 {
41744593 //readobj.deepCopySelf(copy);
....@@ -4231,7 +4650,7 @@
42314650
42324651 void load() // throws ClassNotFoundException
42334652 {
4234
- if (GrafreeD.standAlone)
4653
+ if (Grafreed.standAlone)
42354654 {
42364655 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42374656 browser.show();
....@@ -4318,11 +4737,13 @@
43184737 try
43194738 {
43204739 FileOutputStream ostream = new FileOutputStream(lastname);
4321
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4740
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4741
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43224742
43234743 p.writeObject(copy);
43244744 p.flush();
43254745
4746
+ zstream.close();
43264747 ostream.close();
43274748
43284749 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4332,11 +4753,12 @@
43324753 {
43334754 }
43344755 }
4756
+
43354757 String lastname;
43364758
43374759 void saveAs()
43384760 {
4339
- if (GrafreeD.standAlone)
4761
+ if (Grafreed.standAlone)
43404762 {
43414763 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43424764 browser.setVisible(true);
....@@ -4441,13 +4863,13 @@
44414863 try
44424864 {
44434865 FileOutputStream ostream = new FileOutputStream(filename);
4444
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4445
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4866
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4867
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44464868
44474869 Object3D objectparent = obj.parent;
44484870 obj.parent = null;
44494871
4450
- Object3D object = (Object3D) GrafreeD.clone(obj);
4872
+ Object3D object = (Object3D) Grafreed.clone(obj);
44514873
44524874 obj.parent = objectparent;
44534875
....@@ -4459,8 +4881,8 @@
44594881 p.writeObject(object);
44604882 p.flush();
44614883
4884
+ zstream.close();
44624885 ostream.close();
4463
- // zstream.close();
44644886
44654887 // group.selection.get(0).parent = parent;
44664888 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4481,7 +4903,7 @@
44814903 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44824904 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44834905 copy.generatePOV(buffer);
4484
- if (GrafreeD.standAlone)
4906
+ if (Grafreed.standAlone)
44854907 {
44864908 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44874909 browser.show();
....@@ -4507,7 +4929,8 @@
45074929 Object3D client;
45084930 Object3D copy;
45094931 MenuBar menuBar;
4510
- Menu windowMenu;
4932
+ Menu fileMenu;
4933
+ MenuItem newItem;
45114934 MenuItem loadItem;
45124935 MenuItem saveItem;
45134936 MenuItem saveAsItem;
....@@ -4515,13 +4938,11 @@
45154938 MenuItem reexportItem;
45164939 MenuItem povItem;
45174940 MenuItem closeItem;
4518
- Menu cameraMenu;
4941
+
45194942 CheckboxMenuItem zBufferItem;
45204943 //MenuItem normalLensItem;
4521
- MenuItem editCameraItem;
4522
- MenuItem revertCameraItem;
4523
- CheckboxMenuItem toggleLiveItem;
45244944 MenuItem stepItem;
4945
+ CheckboxMenuItem toggleLiveItem;
45254946 CheckboxMenuItem toggleFullScreenItem;
45264947 CheckboxMenuItem toggleTimelineItem;
45274948 CheckboxMenuItem toggleRenderItem;
....@@ -4530,28 +4951,41 @@
45304951 CheckboxMenuItem toggleFootContactItem;
45314952 CheckboxMenuItem toggleDLItem;
45324953 CheckboxMenuItem toggleTextureItem;
4533
- CheckboxMenuItem toggleRandomItem;
4954
+ CheckboxMenuItem toggleSwitchItem;
45344955 CheckboxMenuItem toggleRootItem;
45354956 CheckboxMenuItem animationItem;
45364957 CheckboxMenuItem toggleHandleItem;
45374958 CheckboxMenuItem togglePaintItem;
45384959 JSplitPane mainPanel;
45394960 JScrollPane scrollpane;
4961
+
45404962 JPanel toolbarPanel;
4541
- JPanel treePanel;
4963
+
4964
+ cGridBag treePanel;
4965
+
45424966 JPanel radioPanel;
45434967 ButtonGroup buttonGroup;
4544
- JPanel ctrlPanel;
4545
- JPanel materialPanel;
4968
+
4969
+ cGridBag toolboxPanel;
4970
+ cGridBag materialPanel;
4971
+ cGridBag ctrlPanel;
4972
+
45464973 JScrollPane infoPanel;
4547
- JPanel optionsPanel;
4974
+
4975
+ cGridBag optionsPanel;
4976
+
45484977 JTabbedPane objectPanel;
4549
- JPanel XYZPanel;
4978
+ boolean materialFlushed;
4979
+ Object3D latestObject;
4980
+
4981
+ cGridBag XYZPanel;
4982
+
45504983 JSplitPane gridPanel;
45514984 JSplitPane bigPanel;
4552
- JPanel bigThree;
4553
- JTabbedPane scenePanel;
4554
- JPanel centralPanel;
4985
+
4986
+ cGridBag bigThree;
4987
+ cGridBag scenePanel;
4988
+ cGridBag centralPanel;
45554989 JSplitPane cameraPanel;
45564990 JPanel timelinePanel;
45574991 JMenuBar timelineMenubar;
....@@ -4604,67 +5038,72 @@
46045038 // MATERIAL
46055039 JLabel materialLabel;
46065040 JLabel colorLabel;
4607
- NumberSlider colorField;
5041
+ cNumberSlider colorField;
46085042 JLabel modulationLabel;
4609
- NumberSlider modulationField;
5043
+ cNumberSlider modulationField;
46105044 JLabel metalnessLabel;
4611
- NumberSlider metalnessField;
5045
+ cNumberSlider metalnessField;
46125046 JLabel diffuseLabel;
4613
- NumberSlider diffuseField;
5047
+ cNumberSlider diffuseField;
46145048 JLabel specularLabel;
4615
- NumberSlider specularField;
5049
+ cNumberSlider specularField;
46165050 JLabel shininessLabel;
4617
- NumberSlider shininessField;
5051
+ cNumberSlider shininessField;
46185052 JLabel shiftLabel;
4619
- NumberSlider shiftField;
5053
+ cNumberSlider shiftField;
46205054 JLabel ambientLabel;
4621
- NumberSlider ambientField;
5055
+ cNumberSlider ambientField;
46225056 JLabel lightareaLabel;
4623
- NumberSlider lightareaField;
5057
+ cNumberSlider lightareaField;
46245058 JLabel diffusenessLabel;
4625
- NumberSlider diffusenessField;
5059
+ cNumberSlider diffusenessField;
46265060 JLabel velvetLabel;
4627
- NumberSlider velvetField;
5061
+ cNumberSlider velvetField;
46285062 JLabel sheenLabel;
4629
- NumberSlider sheenField;
5063
+ cNumberSlider sheenField;
46305064 JLabel subsurfaceLabel;
4631
- NumberSlider subsurfaceField;
5065
+ cNumberSlider subsurfaceField;
46325066 //JLabel bumpLabel;
46335067 //NumberSlider bumpField;
46345068 JLabel backlitLabel;
4635
- NumberSlider backlitField;
5069
+ cNumberSlider backlitField;
46365070 JLabel anisoLabel;
4637
- NumberSlider anisoField;
5071
+ cNumberSlider anisoField;
46385072 JLabel anisoVLabel;
4639
- NumberSlider anisoVField;
5073
+ cNumberSlider anisoVField;
46405074 JLabel cameraLabel;
4641
- NumberSlider cameraField;
5075
+ cNumberSlider cameraField;
46425076 JLabel selfshadowLabel;
4643
- NumberSlider selfshadowField;
5077
+ cNumberSlider selfshadowField;
46445078 JLabel shadowLabel;
4645
- NumberSlider shadowField;
5079
+ cNumberSlider shadowField;
46465080 JLabel textureLabel;
4647
- NumberSlider textureField;
5081
+ cNumberSlider textureField;
46485082 JLabel opacityLabel;
4649
- NumberSlider opacityField;
5083
+ cNumberSlider opacityField;
46505084 JLabel fakedepthLabel;
4651
- NumberSlider fakedepthField;
5085
+ cNumberSlider fakedepthField;
46525086 JLabel shadowbiasLabel;
4653
- NumberSlider shadowbiasField;
5087
+ cNumberSlider shadowbiasField;
46545088 JLabel bumpLabel;
4655
- NumberSlider bumpField;
5089
+ cNumberSlider bumpField;
46565090 JLabel noiseLabel;
4657
- NumberSlider noiseField;
5091
+ cNumberSlider noiseField;
46585092 JLabel powerLabel;
4659
- NumberSlider powerField;
5093
+ cNumberSlider powerField;
46605094 JLabel borderfadeLabel;
4661
- NumberSlider borderfadeField;
5095
+ cNumberSlider borderfadeField;
46625096 JLabel fogLabel;
4663
- NumberSlider fogField;
5097
+ cNumberSlider fogField;
46645098 JLabel opacityPowerLabel;
4665
- NumberSlider opacityPowerField;
4666
- JTree jTree;
5099
+ cNumberSlider opacityPowerField;
5100
+ cTree jTree;
46675101 //ObjectUI parent;
46685102
4669
- NumberSlider normalpushField;
5103
+ cNumberSlider normalpushField;
5104
+
5105
+ private MenuItem importGFDItem;
5106
+ private MenuItem importVRMLX3DItem;
5107
+ private MenuItem import3DSItem;
5108
+ private MenuItem importOBJItem;
46705109 }