Normand Briere
2019-06-24 914255f70cf047897212839cbf3a6722703f4457
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -19,6 +20,8 @@
1920 import //weka.core.
2021 matrix.Matrix;
2122
23
+import grafeme.ui.*;
24
+
2225 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2326 ActionListener, ChangeListener,
2427 InputMethodListener,
....@@ -31,6 +34,57 @@
3134 boolean timeline;
3235 boolean wasFullScreen;
3336
37
+ GroupEditor callee;
38
+ JFrame frame;
39
+
40
+ static ObjEditor theFrame;
41
+
42
+ cButton GetButton(String name, boolean border)
43
+ {
44
+ try
45
+ {
46
+ ImageIcon icon = GetIcon(name);
47
+ return new cButton(icon, border);
48
+ }
49
+ catch (Exception e)
50
+ {
51
+ return new cButton(name, border);
52
+ }
53
+ }
54
+
55
+ cCheckBox GetCheckBox(String name, boolean border)
56
+ {
57
+ try
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cCheckBox(icon, border);
61
+ }
62
+ catch (Exception e)
63
+ {
64
+ return new cCheckBox(name, border);
65
+ }
66
+ }
67
+
68
+ private ImageIcon GetIcon(String name) throws IOException
69
+ {
70
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
71
+
72
+ if (image.getWidth() != 24 && image.getHeight() != 24)
73
+ {
74
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
75
+ Graphics2D g = resized.createGraphics();
76
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
77
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
78
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
79
+ g.dispose();
80
+
81
+ image = resized;
82
+ }
83
+
84
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
85
+ return icon;
86
+ }
87
+
3488 // SCRIPT
3589
3690 transient JFrame textpanel = null;
....@@ -121,47 +175,54 @@
121175 void keyPressed(int key, int modifiers)
122176 {
123177 System.out.println("KEY PRESSED");
124
- CameraPane.theRenderer.keyPressed(key, modifiers);
178
+ Globals.theRenderer.keyPressed(key, modifiers);
125179 }
126180 */
127181
128182 static GridBagConstraints aConstraints;
129183 static GridBagConstraints aWindowConstraints;
130
- GroupEditor callee;
131
- JFrame frame;
184
+
132185 static int GRIDWIDTH = 100; // 4;
133186
134187 public void closeUI()
135188 {
136189 //new Exception().printStackTrace();
137
- System.out.println("this = " + this);
138
- System.out.println("objEditor = " + objEditor);
190
+// System.out.println("this = " + this);
191
+// System.out.println("objEditor = " + objEditor);
139192 //nameField.removeActionListener(this);
140
- objEditor.ctrlPanel.remove(nameField);
193
+// objEditor.ctrlPanel.remove(nameField);
194
+
195
+ objEditor.ctrlPanel.remove(namePanel);
141196
142197 if (!GroupEditor.allparams)
143198 return;
144199
145
- objEditor.ctrlPanel.remove(liveCB);
146
- objEditor.ctrlPanel.remove(hideCB);
147
- objEditor.ctrlPanel.remove(markCB);
148
-
149
- objEditor.ctrlPanel.remove(randomCB);
150
- objEditor.ctrlPanel.remove(speedupCB);
151
- objEditor.ctrlPanel.remove(rewindCB);
152
-
153
- objEditor.ctrlPanel.remove(resetButton);
154
- objEditor.ctrlPanel.remove(stepButton);
155
-// objEditor.ctrlPanel.remove(stepAllButton);
156
-// objEditor.ctrlPanel.remove(resetAllButton);
157
- objEditor.ctrlPanel.remove(link2masterCB);
158
- //objEditor.ctrlPanel.remove(flipVCB);
159
- //objEditor.ctrlPanel.remove(texresMenu);
160
- objEditor.ctrlPanel.remove(slowerButton);
161
- objEditor.ctrlPanel.remove(fasterButton);
162
- objEditor.ctrlPanel.remove(remarkButton);
200
+// objEditor.ctrlPanel.remove(liveCB);
201
+// objEditor.ctrlPanel.remove(hideCB);
202
+// objEditor.ctrlPanel.remove(markCB);
203
+//
204
+// objEditor.ctrlPanel.remove(randomCB);
205
+// objEditor.ctrlPanel.remove(speedupCB);
206
+// objEditor.ctrlPanel.remove(rewindCB);
207
+//
208
+// objEditor.ctrlPanel.remove(resetButton);
209
+// objEditor.ctrlPanel.remove(stepButton);
210
+//// objEditor.ctrlPanel.remove(stepAllButton);
211
+//// objEditor.ctrlPanel.remove(resetAllButton);
212
+// objEditor.ctrlPanel.remove(link2masterCB);
213
+// //objEditor.ctrlPanel.remove(flipVCB);
214
+// //objEditor.ctrlPanel.remove(texresMenu);
215
+// objEditor.ctrlPanel.remove(slowerButton);
216
+// objEditor.ctrlPanel.remove(fasterButton);
217
+// objEditor.ctrlPanel.remove(remarkButton);
163218
164
- Remove(normalpushField);
219
+ objEditor.ctrlPanel.remove(setupPanel);
220
+ objEditor.ctrlPanel.remove(setupPanel2);
221
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
222
+ objEditor.ctrlPanel.remove(pushPanel);
223
+ //objEditor.ctrlPanel.remove(fillPanel);
224
+
225
+ //Remove(normalpushField);
165226 }
166227
167228 public ObjEditor GetEditor()
....@@ -232,6 +293,7 @@
232293 //localCopy.parent = null;
233294
234295 frame = new JFrame();
296
+ frame.setUndecorated(true);
235297 objEditor = this;
236298 this.callee = callee;
237299
....@@ -265,24 +327,40 @@
265327 void SetupMenu()
266328 {
267329 frame.setMenuBar(menuBar = new MenuBar());
268
- menuBar.add(windowMenu = new Menu("File"));
269
- windowMenu.add(loadItem = new MenuItem("Load..."));
270
- windowMenu.add("-");
271
- windowMenu.add(saveItem = new MenuItem("Save"));
272
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
330
+ menuBar.add(fileMenu = new Menu("File"));
331
+ fileMenu.add(newItem = new MenuItem("New"));
332
+ fileMenu.add(loadItem = new MenuItem("Open..."));
333
+
334
+ //oe.menuBar.add(menu = new Menu("Include"));
335
+ Menu menu = new Menu("Import");
336
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
337
+ importOBJItem.addActionListener(this);
338
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
339
+ import3DSItem.addActionListener(this);
340
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
341
+ importVRMLX3DItem.addActionListener(this);
342
+ menu.add("-");
343
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
344
+ importGFDItem.addActionListener(this);
345
+ fileMenu.add(menu);
346
+ fileMenu.add("-");
347
+
348
+ fileMenu.add(saveItem = new MenuItem("Save"));
349
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
273350 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
274
- windowMenu.add("-");
275
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
276
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
277
- windowMenu.add("-");
351
+ fileMenu.add("-");
352
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
353
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
354
+ fileMenu.add("-");
278355 if (client.parent != null)
279356 {
280
- windowMenu.add(closeItem = new MenuItem("Close"));
357
+ fileMenu.add(closeItem = new MenuItem("Close"));
281358 } else
282359 {
283
- windowMenu.add(closeItem = new MenuItem("Exit"));
360
+ fileMenu.add(closeItem = new MenuItem("Exit"));
284361 }
285362
363
+ newItem.addActionListener(this);
286364 loadItem.addActionListener(this);
287365 saveItem.addActionListener(this);
288366 saveAsItem.addActionListener(this);
....@@ -291,79 +369,35 @@
291369 //povItem.addActionListener(this);
292370 closeItem.addActionListener(this);
293371
294
- menuBar.add(cameraMenu = new Menu("View"));
295
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
296
- //zBufferItem.addActionListener(this);
297
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
298
- //normalLensItem.addActionListener(this);
299
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
300
- revertCameraItem.addActionListener(this);
301
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
302
- toggleTimelineItem.addItemListener(this);
303
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
304
- toggleFullScreenItem.addItemListener(this);
305
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
306
- cameraMenu.add("-");
307
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
308
- toggleTextureItem.addItemListener(this);
309
- toggleTextureItem.setState(CameraPane.textureon);
310
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
311
- toggleLiveItem.addItemListener(this);
312
- toggleLiveItem.setState(CameraPane.isLIVE());
313
- cameraMenu.add(stepItem = new MenuItem("Step"));
314
- stepItem.addActionListener(this);
315
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
316
-// toggleDLItem.addItemListener(this);
317
-// toggleDLItem.setState(false);
318
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
319
- toggleRenderItem.addItemListener(this);
320
- toggleRenderItem.setState(!CameraPane.frozen);
321
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
322
- toggleDebugItem.addItemListener(this);
323
- toggleDebugItem.setState(CameraPane.DEBUG);
324
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
325
- toggleFrustumItem.addItemListener(this);
326
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
327
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
328
- toggleFootContactItem.addItemListener(this);
329
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
330
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
331
- toggleRandomItem.addItemListener(this);
332
- toggleRandomItem.setState(CameraPane.RANDOM);
333
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
334
- toggleHandleItem.addItemListener(this);
335
- toggleHandleItem.setState(CameraPane.HANDLES);
336
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
337
- togglePaintItem.addItemListener(this);
338
- togglePaintItem.setState(CameraPane.PAINTMODE);
339
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
340
-// toggleRootItem.addItemListener(this);
341
-// toggleRootItem.setState(false);
342
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
343
-// animationItem.addItemListener(this);
344
-// animationItem.setState(CameraPane.ANIMATION);
345
- cameraMenu.add("-");
346
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
347
- editCameraItem.addActionListener(this);
348
-
349372 objectPanel = new JTabbedPane();
350373 toolbarPanel = new JPanel();
351374 toolbarPanel.setName("Toolbar");
352
- treePanel = new JPanel();
375
+ treePanel = new cGridBag();
353376 treePanel.setName("Tree");
354
- ctrlPanel = new JPanel(); // new GridBagLayout());
355
- ctrlPanel.setName("Edit");
356
- materialPanel = new JPanel();
377
+
378
+ editPanel = new cGridBag().setVertical(true);
379
+ editPanel.setName("Edit");
380
+
381
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
382
+
383
+ editCommandsPanel = new cGridBag();
384
+ editPanel.add(editCommandsPanel);
385
+ editPanel.add(ctrlPanel);
386
+
387
+ materialPanel = new cGridBag().setVertical(true);
388
+
357389 materialPanel.setName("Material");
358390 /*JTextPane*/
359391 infoarea = createTextPane();
392
+ doc = infoarea.getStyledDocument();
393
+
360394 infoarea.setEditable(true);
361395 SetText();
362396 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
363397 // infoarea.setOpaque(false);
364398 // //infoarea.setForeground(textcolor);
365
- infoarea.setLineWrap(true);
366
- infoarea.setWrapStyleWord(true);
399
+// TEXTAREA infoarea.setLineWrap(true);
400
+// TEXTAREA infoarea.setWrapStyleWord(true);
367401 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
368402 infoPanel.setPreferredSize(new Dimension(50, 200));
369403 infoPanel.setName("Info");
....@@ -374,16 +408,16 @@
374408 mainPanel.setName("Main");
375409 mainPanel.setContinuousLayout(true);
376410 mainPanel.setOneTouchExpandable(true);
377
- mainPanel.setDividerLocation(1.0);
378411 mainPanel.setDividerSize(9);
379
- mainPanel.setResizeWeight(0);
412
+ mainPanel.setDividerLocation(0.5); //1.0);
413
+ mainPanel.setResizeWeight(0.5);
380414
381415 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
382416 //mainPanel.setLayout(new GridBagLayout());
383417 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
384
- treePanel.setLayout(new GridBagLayout());
385
- ctrlPanel.setLayout(new GridBagLayout());
386
- materialPanel.setLayout(new GridBagLayout());
418
+// treePanel.setLayout(new GridBagLayout());
419
+ //ctrlPanel.setLayout(new GridBagLayout());
420
+ //materialPanel.setLayout(new GridBagLayout());
387421
388422 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
389423 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -422,7 +456,7 @@
422456 static String newline = "\n";
423457 protected static final String buttonString = "JButton";
424458 StyledDocument doc;
425
- JTextArea infoarea;
459
+ JTextPane infoarea;
426460
427461 void ClearInfo()
428462 {
....@@ -445,10 +479,10 @@
445479 e.printStackTrace();
446480 }
447481
448
- String selection = infoarea.getText();
449
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
450
- java.awt.datatransfer.Clipboard clipboard =
451
- Toolkit.getDefaultToolkit().getSystemClipboard();
482
+// String selection = infoarea.getText();
483
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
484
+// java.awt.datatransfer.Clipboard clipboard =
485
+// Toolkit.getDefaultToolkit().getSystemClipboard();
452486 //clipboard.setContents(data, data);
453487 }
454488
....@@ -471,13 +505,13 @@
471505 //SendInfo("Name:", "bold");
472506 if (sel.GetTextures() != null || debug)
473507 {
474
- si.SendInfo(sel.toString(), "bold");
508
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
475509 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
476510 if (sel.Size() > 0)
477511 {
478512 si.SendInfo("#children = " + sel.Size(), "regular");
479513 }
480
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
514
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
481515 if (debug)
482516 {
483517 try
....@@ -489,7 +523,10 @@
489523 }
490524
491525 if (full)
492
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
526
+ {
527
+ si.SendInfo(" BBox min: " + minima, "regular");
528
+ si.SendInfo(" BBox max: " + maxima, "regular");
529
+ }
493530
494531 if (sel.bRep != null)
495532 {
....@@ -516,7 +553,7 @@
516553 }
517554 if (sel.support != null)
518555 {
519
- si.SendInfo(" support: " + sel.support, "regular");
556
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
520557 }
521558 if (sel.scriptnode != null)
522559 {
....@@ -587,6 +624,9 @@
587624 {
588625 CameraPane.pointflow = (PointFlow) sel;
589626 }
627
+
628
+ si.SendInfo("_____________________", "regular");
629
+ si.SendInfo("", "regular");
590630 }
591631 }
592632
....@@ -602,68 +642,138 @@
602642 }
603643 }
604644
645
+static GraphicsDevice device = GraphicsEnvironment
646
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
647
+
648
+ Rectangle keeprect;
649
+ cRadio radio;
650
+
651
+cButton keepButton;
652
+ cButton twoButton; // Full 3D
653
+ cButton sixButton;
654
+ cButton threeButton;
655
+ cButton sevenButton;
656
+ cButton fourButton; // full panel
657
+ cButton oneButton; // full XYZ
658
+ //cButton currentLayout;
659
+
660
+ boolean maximized;
661
+
662
+ void Minimize()
663
+ {
664
+ frame.setState(Frame.ICONIFIED);
665
+ }
666
+
667
+ void Maximize()
668
+ {
669
+ if (maximized)
670
+ {
671
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
672
+ }
673
+ else
674
+ {
675
+ keeprect = frame.getBounds();
676
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
677
+ Dimension rect2 = frame.getToolkit().getScreenSize();
678
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
679
+// frame.setState(Frame.MAXIMIZED_BOTH);
680
+ }
681
+
682
+ maximized ^= true;
683
+ }
684
+
605685 void ToggleFullScreen()
606686 {
607687 if (CameraPane.FULLSCREEN)
608688 {
609
- frame.getContentPane().remove(/*"Center",*/bigThree);
610
- framePanel.add(bigThree);
611
- frame.getContentPane().add(/*"Center",*/framePanel);
689
+ device.setFullScreenWindow(null);
690
+ //frame.setVisible(false);
691
+// frame.removeNotify();
692
+// frame.setUndecorated(false);
693
+// frame.addNotify();
694
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
695
+
696
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
697
+// X framePanel.add(bigThree);
698
+// X frame.getContentPane().add(/*"Center",*/framePanel);
699
+ framePanel.setDividerLocation(1);
700
+
701
+ //frame.setVisible(true);
702
+ radio.layout = keepButton;
703
+ //theFrame = null;
704
+ keepButton = null;
705
+ radio.layout.doClick();
706
+
612707 } else
613708 {
614
- frame.getContentPane().remove(/*"Center",*/framePanel);
615
- framePanel.remove(bigThree);
616
- frame.getContentPane().add(/*"Center",*/bigThree);
709
+ keepButton = radio.layout;
710
+ //keeprect = frame.getBounds();
711
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
712
+// frame.getToolkit().getScreenSize().height);
713
+ //frame.setVisible(false);
714
+ device.setFullScreenWindow(frame);
715
+// frame.removeNotify();
716
+// frame.setUndecorated(true);
717
+// frame.addNotify();
718
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
719
+// X framePanel.remove(bigThree);
720
+// X frame.getContentPane().add(/*"Center",*/bigThree);
721
+ framePanel.setDividerLocation(0);
722
+
723
+ radio.layout = twoButton;
724
+ radio.layout.doClick();
725
+ //frame.setVisible(true);
617726 }
727
+
618728 cameraView.ToggleFullScreen();
619729 }
620730
621
- private JTextArea createTextPane()
731
+ private JTextPane createTextPane()
622732 {
623
- String[] initString =
624
- {
625
- "This is an editable JTextPane, ", //regular
626
- "another ", //italic
627
- "styled ", //bold
628
- "text ", //small
629
- "component, ", //large
630
- "which supports embedded components..." + newline,//regular
631
- " " + newline, //button
632
- "...and embedded icons..." + newline, //regular
633
- " ", //icon
634
- newline + "JTextPane is a subclass of JEditorPane that "
635
- + "uses a StyledEditorKit and StyledDocument, and provides "
636
- + "cover methods for interacting with those objects."
637
- };
733
+// TEXTAREA String[] initString =
734
+// {
735
+// "This is an editable JTextPane, ", //regular
736
+// "another ", //italic
737
+// "styled ", //bold
738
+// "text ", //small
739
+// "component, ", //large
740
+// "which supports embedded components..." + newline,//regular
741
+// " " + newline, //button
742
+// "...and embedded icons..." + newline, //regular
743
+// " ", //icon
744
+// newline + "JTextPane is a subclass of JEditorPane that "
745
+// + "uses a StyledEditorKit and StyledDocument, and provides "
746
+// + "cover methods for interacting with those objects."
747
+// };
748
+//
749
+// String[] initStyles =
750
+// {
751
+// "regular", "italic", "bold", "small", "large",
752
+// "regular", "button", "regular", "icon",
753
+// "regular"
754
+// };
755
+//
756
+// JTextPane textPane = new JTextPane();
757
+// textPane.setEditable(true);
758
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
759
+// addStylesToDocument(doc);
760
+//
761
+// try
762
+// {
763
+// for (int j = 0; j < 2; j++)
764
+// {
765
+// for (int i = 0; i < initString.length; i++)
766
+// {
767
+// doc.insertString(doc.getLength(), initString[i],
768
+// doc.getStyle(initStyles[i]));
769
+// }
770
+// }
771
+// } catch (BadLocationException ble)
772
+// {
773
+// System.err.println("Couldn't insert initial text into text pane.");
774
+// }
638775
639
- String[] initStyles =
640
- {
641
- "regular", "italic", "bold", "small", "large",
642
- "regular", "button", "regular", "icon",
643
- "regular"
644
- };
645
-
646
- JTextPane textPane = new JTextPane();
647
- textPane.setEditable(true);
648
- /*StyledDocument*/ doc = textPane.getStyledDocument();
649
- addStylesToDocument(doc);
650
-
651
- try
652
- {
653
- for (int j = 0; j < 2; j++)
654
- {
655
- for (int i = 0; i < initString.length; i++)
656
- {
657
- doc.insertString(doc.getLength(), initString[i],
658
- doc.getStyle(initStyles[i]));
659
- }
660
- }
661
- } catch (BadLocationException ble)
662
- {
663
- System.err.println("Couldn't insert initial text into text pane.");
664
- }
665
-
666
- return new JTextArea(); // textPane;
776
+ return new JTextPane(); // textPane;
667777 }
668778
669779 protected void addStylesToDocument(StyledDocument doc)
....@@ -716,7 +826,7 @@
716826 protected static ImageIcon createImageIcon(String path,
717827 String description)
718828 {
719
- java.net.URL imgURL = GrafreeD.class.getResource(path);
829
+ java.net.URL imgURL = Grafreed.class.getResource(path);
720830 if (imgURL != null)
721831 {
722832 return new ImageIcon(imgURL, description);
....@@ -748,6 +858,7 @@
748858 // NumberSlider vDivsField;
749859 // JCheckBox endcaps;
750860 JCheckBox liveCB;
861
+ JCheckBox selectCB;
751862 JCheckBox hideCB;
752863 JCheckBox link2masterCB;
753864 JCheckBox markCB;
....@@ -763,115 +874,87 @@
763874 JButton slowerButton;
764875 JButton fasterButton;
765876 JButton remarkButton;
877
+
878
+ cGridBag editPanel;
879
+ cGridBag editCommandsPanel;
880
+
881
+ cGridBag namePanel;
882
+ cGridBag setupPanel;
883
+ cGridBag setupPanel2;
884
+ cGridBag objectCommandsPanel;
885
+ cGridBag pushPanel;
886
+ cGridBag fillPanel;
766887
767
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
888
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
768889 {
769890 JCheckBox cb;
770891
771
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
772
- oe.aConstraints.gridwidth = 1; // 3;
773
-// oe.aConstraints.weightx = 1;
774
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
775
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
892
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
776893 cb.addItemListener(this);
777
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
778
- oe.aConstraints.gridwidth = 1;
779
- oe.aConstraints.gridx += 1;
780894
781895 return cb;
782896 }
783897
784
- cButton AddButton(ObjEditor oe, String label)
898
+ cButton AddButton(cGridBag panel, String label)
785899 {
786900 cButton cb;
787901
788
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
789
- oe.aConstraints.gridwidth = 1;
790
-// oe.aConstraints.weightx = 1;
791
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
792
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
902
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
793903 cb.addActionListener(this);
794
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
795
- oe.aConstraints.gridwidth = 1;
796
- oe.aConstraints.gridx += 1;
797904
798905 return cb;
799906 }
800907
801
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
908
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
802909 {
803910 JComboBox combo;
804911
805
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
806
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
807
- oe.aConstraints.gridx += 1;
912
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808913 combo.addActionListener(this);
809914
810915 return combo;
811916 }
812917
813
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
918
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
814919 {
815
- NumberSlider combo;
920
+ cGridBag control = new cGridBag();
921
+
922
+ cNumberSlider combo;
816923
817924 JLabel jlabel = new JLabel(label);
818
-
819
- aConstraints.fill = GridBagConstraints.VERTICAL;
820925 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
821
- aConstraints.gridwidth = 1;
822
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
823
- aConstraints.gridx += 1;
824
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
825
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
826
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.gridwidth = 1;
829
-
926
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
927
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830928 combo.setFloat(current);
831
-
832
- combo.label = jlabel;
833
-
834
- combo.addChangeListener(this);
835
-
836
- return combo;
929
+
930
+ panel.add(control);
931
+
932
+ return control;
837933 }
838934
839
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
935
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
840936 {
841
- NumberSlider combo;
937
+ cGridBag control = new cGridBag();
938
+
939
+ cNumberSlider combo;
842940
843941 JLabel jlabel = new JLabel(label);
844
-
845
- aConstraints.fill = GridBagConstraints.VERTICAL;
846942 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
847
- aConstraints.gridwidth = 2;
848
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
- aConstraints.gridx += 1;
850
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
851
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
852
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
853
- aConstraints.gridx += 1;
854
- aConstraints.gridwidth = 1;
855
-
943
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
944
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
856945 combo.setInteger(current);
857946
858
- combo.label = jlabel;
859
-
860
- combo.addChangeListener(this);
861
-
862
- return combo;
947
+ panel.add(control);
948
+
949
+ return control;
863950 }
864951
865
- JTextArea AddText(JPanel ctrlPanel, String name)
952
+ JTextArea AddText(cGridBag ctrlPanel, String name)
866953 {
867954 JTextArea text;
868955
869
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
870
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
871
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
956
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
872957 text.addCaretListener(this);
873
- aConstraints.gridx += 1;
874
- aConstraints.gridwidth = 1;
875958
876959 return text;
877960 }
....@@ -901,9 +984,16 @@
901984 objEditor.ctrlPanel.remove(j);
902985 }
903986
987
+ void Remove(cNumberSlider j)
988
+ {
989
+ j.removeChangeListener(this);
990
+ //objEditor.ctrlPanel.remove(j.label);
991
+ objEditor.ctrlPanel.remove(j);
992
+ }
993
+
904994 /*
905995 */
906
- void Return() // ObjEditor oe)
996
+ void Return0() // ObjEditor oe)
907997 {
908998 aConstraints.gridy += 1;
909999 aConstraints.gridx = 0;
....@@ -958,37 +1048,76 @@
9581048
9591049 void SetupUI2(ObjEditor oe)
9601050 {
961
-// oe.aConstraints.weightx = 0;
962
-// oe.aConstraints.weighty = 0;
963
-// oe.aConstraints.gridx = 0;
964
-// oe.aConstraints.gridy = 0;
965
- SetupName(oe);
1051
+ //SetupName(oe);
1052
+
1053
+ namePanel = new cGridBag();
1054
+
1055
+ nameField = AddText(namePanel, copy.GetName());
1056
+ namePanel.add(nameField);
1057
+ oe.ctrlPanel.add(namePanel);
1058
+
1059
+ oe.ctrlPanel.Return();
9661060
9671061 if (!GroupEditor.allparams)
9681062 return;
9691063
970
- liveCB = AddCheckBox(oe, "Live", copy.live);
971
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
972
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1064
+ setupPanel = new cGridBag().setVertical(false);
1065
+
1066
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1067
+ liveCB.setToolTipText("Animate object");
1068
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1069
+ selectCB.setToolTipText("Make object selectable");
9731070 // Return();
974
- markCB = AddCheckBox(oe, "Mark", copy.marked);
975
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
976
- randomCB = AddCheckBox(oe, "Rand", copy.random);
977
- Return();
978
- resetButton = AddButton(oe, "Reset");
979
- stepButton = AddButton(oe, "Step");
1071
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1072
+ hideCB.setToolTipText("Hide object");
1073
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1074
+ markCB.setToolTipText("Set the animation target transform");
1075
+
1076
+ setupPanel2 = new cGridBag().setVertical(false);
1077
+
1078
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1079
+ rewindCB.setToolTipText("Rewind animation");
1080
+
1081
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1082
+ randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1083
+
1084
+ if (Globals.ADVANCED)
1085
+ {
1086
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1087
+ link2masterCB.setToolTipText("Attach to support");
1088
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1089
+ speedupCB.setToolTipText("Option motion capture");
1090
+ }
1091
+
1092
+ oe.ctrlPanel.add(setupPanel);
1093
+ oe.ctrlPanel.Return();
1094
+ oe.ctrlPanel.add(setupPanel2);
1095
+ oe.ctrlPanel.Return();
1096
+
1097
+ objectCommandsPanel = new cGridBag().setVertical(false);
1098
+
1099
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1100
+ resetButton.setToolTipText("Jump to frame zero");
1101
+ stepButton = AddButton(objectCommandsPanel, "Step");
1102
+ stepButton.setToolTipText("Step one frame");
9801103 // resetAllButton = AddButton(oe, "Reset All");
9811104 // stepAllButton = AddButton(oe, "Step All");
982
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9831105 // Return();
984
- slowerButton = AddButton(oe, "Slow");
985
- fasterButton = AddButton(oe, "Fast");
986
- remarkButton = AddButton(oe, "Rem");
1106
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1107
+ slowerButton.setToolTipText("Decrease animation speed");
1108
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1109
+ fasterButton.setToolTipText("Increase animation speed");
1110
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1111
+ remarkButton.setToolTipText("Set the current transform as the target");
9871112
988
- Return();
1113
+ oe.ctrlPanel.add(objectCommandsPanel);
1114
+ oe.ctrlPanel.Return();
9891115
990
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
991
- Return();
1116
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1117
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1118
+ //Return();
1119
+
1120
+ oe.ctrlPanel.Return();
9921121
9931122 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9941123 // ObjEditor.aConstraints.gridx += 1;
....@@ -1083,7 +1212,7 @@
10831212 oe.aConstraints.gridwidth = 1;
10841213 /**/
10851214 nameField = AddText(oe.ctrlPanel, copy.GetName());
1086
- Return();
1215
+ oe.ctrlPanel.Return();
10871216
10881217 //ctrlPanel.add(textureButton = new Button("Texture..."));
10891218 //textureButton.setEnabled(false);
....@@ -1185,11 +1314,25 @@
11851314 //JPanel worldPanel =
11861315 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11871316 //worldPanel.setName("World");
1188
- centralPanel = new JPanel(new BorderLayout());
1189
- timelinePanel = new JPanel(new BorderLayout());
1190
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1317
+ centralPanel = new cGridBag();
1318
+ centralPanel.preferredWidth = 20;
1319
+
1320
+ if (Globals.ADVANCED)
1321
+ {
1322
+ timelinePanel = new JPanel(new BorderLayout());
1323
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11911324
1325
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1326
+ cameraPanel.setContinuousLayout(true);
1327
+ cameraPanel.setOneTouchExpandable(true);
1328
+// cameraPanel.setDividerLocation(0.9);
1329
+// cameraPanel.setDividerSize(9);
1330
+ cameraPanel.setResizeWeight(1.0);
1331
+
1332
+ }
1333
+
11921334 centralPanel.add(cameraView);
1335
+ centralPanel.setFocusable(true);
11931336 //frame.setJMenuBar(timelineMenubar);
11941337 //centralPanel.add(timelinePanel);
11951338
....@@ -1208,12 +1351,13 @@
12081351 //frontView.object = copy;
12091352 //sideView.object = copy;
12101353
1211
- XYZPanel = new JPanel();
1212
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1354
+ XYZPanel = new cGridBag().setVertical(true);
1355
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12131356
1214
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1215
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1216
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1357
+ XYZPanel.preferredWidth = 5;
1358
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1359
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1360
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12171361
12181362 /*
12191363 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1251,10 +1395,11 @@
12511395 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12521396 //tmp.setName("Edit");
12531397 objectPanel.add(materialPanel);
1254
- JPanel north = new JPanel(new BorderLayout());
1255
- north.setName("Edit");
1256
- north.add(ctrlPanel, BorderLayout.NORTH);
1257
- objectPanel.add(north);
1398
+// JPanel north = new JPanel(new BorderLayout());
1399
+// north.setName("Edit");
1400
+// north.add(ctrlPanel, BorderLayout.NORTH);
1401
+// objectPanel.add(north);
1402
+ objectPanel.add(editPanel);
12581403 objectPanel.add(infoPanel);
12591404
12601405 /*
....@@ -1275,16 +1420,23 @@
12751420 scrollpane.setWheelScrollingEnabled(true);
12761421 scrollpane.addMouseWheelListener(this); // Default not fast enough
12771422
1278
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1279
- scenePanel.add(scrollpane);
1423
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1424
+ scenePanel.preferredWidth = 6;
1425
+
1426
+ JTabbedPane tabbedPane = new JTabbedPane();
1427
+ tabbedPane.add(scrollpane);
12801428
1281
- scenePanel.add(FSPane = new cFileSystemPane(this));
1429
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12821430
1283
- optionsPanel = new JPanel(new GridBagLayout());
1431
+ optionsPanel = new cGridBag().setVertical(true);
12841432
12851433 optionsPanel.setName("Options");
1286
- scenePanel.add(optionsPanel);
1287
-
1434
+
1435
+ AddOptions(optionsPanel); //, aConstraints);
1436
+
1437
+ tabbedPane.add(optionsPanel);
1438
+
1439
+ scenePanel.add(tabbedPane);
12881440
12891441 /*
12901442 cTree jTree = new cTree(null);
....@@ -1318,6 +1470,7 @@
13181470 //bigPanel.setSize(new Dimension(10,10));
13191471 //bigPanel.add(ctrlPanel);
13201472 //bigPanel.add(gridPanel);
1473
+ /**
13211474 bigThree = new JPanel();
13221475 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13231476 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1341,7 +1494,13 @@
13411494 // aConstraints.gridheight = 3;
13421495 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13431496 bigThree.add(XYZPanel, aWindowConstraints);
1497
+ /**/
13441498
1499
+ bigThree = new cGridBag();
1500
+ bigThree.addComponent(scenePanel);
1501
+ bigThree.addComponent(centralPanel);
1502
+ bigThree.addComponent(XYZPanel);
1503
+
13451504 // // SIDE EFFECT!!!
13461505 // aConstraints.gridx = 0;
13471506 // aConstraints.gridy = 0;
....@@ -1362,14 +1521,17 @@
13621521 //worldPane.add(bigPanel);
13631522 //worldPane.add(worldPanel);
13641523 /**/
1365
- frame.getContentPane().add(/*"Center",*/framePanel);
1524
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1525
+ frame.add(/*"Center",*/framePanel);
13661526 //frame.getContentPane().add(/*"Center",*/ worldPane);
13671527
13681528 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13691529
1370
- frame.setSize(1024, 768);
1371
- frame.show();
1530
+ frame.setSize(1280, 860);
1531
+ frame.setVisible(true);
13721532
1533
+ cameraView.requestFocusInWindow();
1534
+
13731535 gridPanel.setDividerLocation(1.0);
13741536
13751537 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1383,6 +1545,10 @@
13831545 });
13841546 }
13851547
1548
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1549
+ {
1550
+ }
1551
+
13861552 JTree GetTree()
13871553 {
13881554 return objEditor.jTree;
....@@ -1394,260 +1560,173 @@
13941560 ctrlPanel.removeAll();
13951561 }
13961562
1397
- void SetupMaterial(JPanel ctrlPanel)
1563
+ void SetupMaterial(cGridBag panel)
13981564 {
1399
- aConstraints.weighty = 0;
1400
- //aConstraints.weightx = 1;
1401
- /*
1565
+ /*
14021566 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14031567 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1404
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1405
- aConstraints.gridx += 1;
14061568 */
14071569
1408
- aConstraints.gridwidth = 1;
1409
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1410
- aConstraints.gridx += 1;
1411
- aConstraints.weighty = 0;
1412
- aConstraints.gridwidth = 1;
1570
+ cGridBag editBar = new cGridBag().setVertical(false);
1571
+
1572
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1573
+ createMaterialButton.setToolTipText("Create material");
14131574
14141575 /*
14151576 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1416
- aConstraints.gridx += 1;
1417
- aConstraints.weighty = 0;
1418
- aConstraints.gridwidth = 1;
14191577 */
14201578
1421
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1422
- aConstraints.gridx += 1;
1579
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1580
+ clearMaterialButton.setToolTipText("Clear material");
1581
+
1582
+ if (Globals.ADVANCED)
1583
+ {
1584
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1585
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1586
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1587
+ }
14231588
1424
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1425
-
1426
- aConstraints.gridx += 1;
1427
-
1428
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1429
-
1430
- aConstraints.gridx += 1;
1431
-
1432
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1433
-
1434
- aConstraints.gridx = 0;
1435
- aConstraints.gridy += 1;
1436
- aConstraints.weighty = 0;
1437
- aConstraints.gridwidth = 1;
1589
+ editBar.preferredHeight = 15;
1590
+
1591
+ panel.add(editBar);
1592
+
14381593 /**/
14391594 //aConstraints.weighty = 0;
14401595 ////aConstraints.weightx = 1;
14411596 //aConstraints.weighty = 1;
14421597 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14431598 //aConstraints.gridx += 1;
1444
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1445
- aConstraints.weighty = 0;
1446
- aConstraints.gridx = 0;
1447
- aConstraints.gridy += 1;
1448
- aConstraints.gridwidth = 1;
1599
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14491600
1450
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1451
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1452
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1453
- aConstraints.gridx += 1;
1454
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1455
- //aConstraints.weightx = 0;
1456
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1457
- aConstraints.gridx = 0;
1458
- aConstraints.gridy += 1;
1459
- aConstraints.gridwidth = 1;
1601
+ cGridBag colorSection = new cGridBag().setVertical(true);
1602
+
1603
+ cGridBag color = new cGridBag();
1604
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1605
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1606
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1607
+ //colorField.preferredWidth = 200;
1608
+ colorSection.add(color);
14601609
1461
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1462
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1463
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1464
- aConstraints.gridx += 1;
1465
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1466
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1467
- aConstraints.gridx = 0;
1468
- aConstraints.gridy += 1;
1469
- aConstraints.gridwidth = 1;
1610
+ cGridBag modulation = new cGridBag();
1611
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1612
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1613
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1614
+ colorSection.add(modulation);
14701615
1471
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1472
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1473
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1474
- aConstraints.gridx += 1;
1475
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1476
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1477
- aConstraints.gridx = 0;
1478
- aConstraints.gridy += 1;
1479
- aConstraints.gridwidth = 1;
1616
+ cGridBag texture = new cGridBag();
1617
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1618
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1619
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1620
+ colorSection.add(texture);
14801621
1481
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1482
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1483
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1484
- aConstraints.gridx += 1;
1485
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1486
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1487
- aConstraints.gridx = 0;
1488
- aConstraints.gridy += 1;
1489
- aConstraints.gridwidth = 1;
1622
+ cGridBag anisoU = new cGridBag();
1623
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1624
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1625
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1626
+ colorSection.add(anisoU);
14901627
1491
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1492
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1493
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1494
- aConstraints.gridx += 1;
1495
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1496
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1497
- aConstraints.gridx = 0;
1498
- aConstraints.gridy += 1;
1499
- aConstraints.gridwidth = 1;
1628
+ cGridBag anisoV = new cGridBag();
1629
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1630
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1632
+ colorSection.add(anisoV);
15001633
1501
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1502
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1503
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1504
- aConstraints.gridx += 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1506
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1507
- aConstraints.gridx = 0;
1508
- aConstraints.gridy += 1;
1509
- aConstraints.gridwidth = 1;
1634
+ cGridBag shadowbias = new cGridBag();
1635
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1636
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1637
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1638
+ colorSection.add(shadowbias);
15101639
1511
- //aConstraints.weighty = 1;
1512
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1513
- //aConstraints.gridx += 1;
1514
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1515
- aConstraints.weighty = 0;
1516
- aConstraints.gridx = 0;
1517
- aConstraints.gridy += 1;
1518
- aConstraints.gridwidth = 1;
1640
+ panel.add(new JSeparator());
1641
+
1642
+ panel.add(colorSection);
1643
+
1644
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1645
+
1646
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1647
+
1648
+ cGridBag diffuse = new cGridBag();
1649
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1650
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1652
+ diffuseSection.add(diffuse);
15191653
1520
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1521
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1522
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1523
- aConstraints.gridx += 1;
1524
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1525
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1526
- aConstraints.gridx = 0;
1527
- aConstraints.gridy += 1;
1528
- aConstraints.gridwidth = 1;
1654
+ cGridBag diffuseness = new cGridBag();
1655
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1656
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1658
+ diffuseSection.add(diffuseness);
15291659
1530
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1531
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1532
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1533
- aConstraints.gridx += 1;
1534
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1535
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1536
- aConstraints.gridx = 0;
1537
- aConstraints.gridy += 1;
1538
- aConstraints.gridwidth = 1;
1660
+ cGridBag selfshadow = new cGridBag();
1661
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1662
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1663
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1664
+ diffuseSection.add(selfshadow);
15391665
1540
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1541
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1542
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1543
- aConstraints.gridx += 1;
1544
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1545
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1546
- aConstraints.gridx = 0;
1547
- aConstraints.gridy += 1;
1548
- aConstraints.gridwidth = 1;
1666
+ cGridBag sheen = new cGridBag();
1667
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1668
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1669
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1670
+ diffuseSection.add(sheen);
15491671
1550
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1551
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1552
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1553
- aConstraints.gridx += 1;
1554
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1555
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1556
- aConstraints.gridx = 0;
1557
- aConstraints.gridy += 1;
1558
- aConstraints.gridwidth = 1;
1672
+ cGridBag subsurface = new cGridBag();
1673
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1674
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1675
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1676
+ diffuseSection.add(subsurface);
15591677
1560
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1561
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1562
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1563
- aConstraints.gridx += 1;
1564
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1565
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1566
- aConstraints.gridx = 0;
1567
- aConstraints.gridy += 1;
1568
- aConstraints.gridwidth = 1;
1678
+ cGridBag shadow = new cGridBag();
1679
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1680
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1681
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1682
+ diffuseSection.add(shadow);
15691683
1570
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1571
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1572
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1573
- aConstraints.gridx += 1;
1574
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1575
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1576
- aConstraints.gridx = 0;
1577
- aConstraints.gridy += 1;
1578
- aConstraints.gridwidth = 1;
1684
+ cGridBag fakedepth = new cGridBag();
1685
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1686
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1687
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1688
+ diffuseSection.add(fakedepth);
15791689
1580
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1581
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1582
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1583
- aConstraints.gridx += 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1585
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1586
- aConstraints.gridx = 0;
1587
- aConstraints.gridy += 1;
1588
- aConstraints.gridwidth = 1;
1690
+ panel.add(new JSeparator());
1691
+
1692
+ panel.add(diffuseSection);
1693
+
1694
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1695
+
1696
+ cGridBag specularSection = new cGridBag().setVertical(true);
15891697
1590
- //aConstraints.weighty = 1;
1591
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1592
- //aConstraints.gridx += 1;
1593
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1594
- aConstraints.weighty = 0;
1595
- aConstraints.gridx = 0;
1596
- aConstraints.gridy += 1;
1597
- aConstraints.gridwidth = 1;
1698
+ cGridBag specular = new cGridBag();
1699
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1700
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1701
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1702
+ specularSection.add(specular);
15981703
1599
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1600
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1601
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1602
- aConstraints.gridx += 1;
1603
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1604
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1605
- aConstraints.gridx = 0;
1606
- aConstraints.gridy += 1;
1607
- aConstraints.gridwidth = 1;
1704
+ cGridBag lightarea = new cGridBag();
1705
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1706
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1707
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1708
+ specularSection.add(lightarea);
16081709
1609
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1610
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1611
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1612
- aConstraints.gridx += 1;
1613
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1614
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1615
- aConstraints.gridx = 0;
1616
- aConstraints.gridy += 1;
1617
- aConstraints.gridwidth = 1;
1710
+ cGridBag shininess = new cGridBag();
1711
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1712
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1713
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1714
+ specularSection.add(shininess);
16181715
1619
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1620
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1621
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1622
- aConstraints.gridx += 1;
1623
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1624
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1625
- aConstraints.gridx = 0;
1626
- aConstraints.gridy += 1;
1627
- aConstraints.gridwidth = 1;
1716
+ cGridBag metalness = new cGridBag();
1717
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1718
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1719
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1720
+ specularSection.add(metalness);
16281721
1629
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1630
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1632
- aConstraints.gridx += 1;
1633
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1634
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
1722
+ cGridBag velvet = new cGridBag();
1723
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1724
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1725
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1726
+ specularSection.add(velvet);
16381727
1639
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1640
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- aConstraints.gridwidth = 1;
1648
-
1649
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1650
- Return();
1728
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1729
+ //Return();
16511730 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16521731 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16531732 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1658,130 +1737,93 @@
16581737 // aConstraints.gridy += 1;
16591738 // aConstraints.gridwidth = 1;
16601739
1661
- //aConstraints.weighty = 1;
1662
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1663
- //aConstraints.gridx += 1;
1664
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1665
- aConstraints.weighty = 0;
1666
- aConstraints.gridx = 0;
1667
- aConstraints.gridy += 1;
1668
- aConstraints.gridwidth = 1;
16691740
1670
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1671
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1672
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1673
- aConstraints.gridx += 1;
1674
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1675
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1676
- aConstraints.gridx = 0;
1677
- aConstraints.gridy += 1;
1678
- aConstraints.gridwidth = 1;
1741
+ panel.add(new JSeparator());
1742
+
1743
+ panel.add(specularSection);
1744
+
1745
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1746
+
1747
+ cGridBag globalSection = new cGridBag().setVertical(true);
16791748
1680
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1681
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- aConstraints.gridwidth = 1;
1749
+ cGridBag camera = new cGridBag();
1750
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1751
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1752
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1753
+ globalSection.add(camera);
16891754
1690
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1691
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- aConstraints.gridwidth = 1;
1755
+ cGridBag ambient = new cGridBag();
1756
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1757
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1758
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1759
+ globalSection.add(ambient);
16991760
1700
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1701
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- aConstraints.gridwidth = 1;
1709
- aConstraints.weighty = 0;
1761
+ cGridBag backlit = new cGridBag();
1762
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1763
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1764
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1765
+ globalSection.add(backlit);
17101766
1711
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1712
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1713
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1714
- aConstraints.gridx += 1;
1715
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1716
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1717
- aConstraints.gridx = 0;
1718
- aConstraints.gridy += 1;
1719
- aConstraints.gridwidth = 1;
1767
+ cGridBag opacity = new cGridBag();
1768
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1769
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1770
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1771
+ globalSection.add(opacity);
17201772
1721
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1722
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1723
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1724
- aConstraints.gridx += 1;
1725
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1726
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1727
- aConstraints.gridx = 0;
1728
- aConstraints.gridy += 1;
1729
- aConstraints.gridwidth = 1;
1773
+ panel.add(new JSeparator());
1774
+
1775
+ panel.add(globalSection);
1776
+
1777
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1778
+
1779
+ cGridBag textureSection = new cGridBag().setVertical(true);
17301780
1731
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1732
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1733
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1734
- aConstraints.gridx += 1;
1735
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1736
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1737
- aConstraints.gridx = 0;
1738
- aConstraints.gridy += 1;
1739
- aConstraints.gridwidth = 1;
1781
+ cGridBag bump = new cGridBag();
1782
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1783
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1784
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1785
+ textureSection.add(bump);
17401786
1741
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1742
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1743
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1744
- aConstraints.gridx += 1;
1745
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1746
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1747
- aConstraints.gridx = 0;
1748
- aConstraints.gridy += 1;
1749
- aConstraints.gridwidth = 1;
1787
+ cGridBag noise = new cGridBag();
1788
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1789
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1790
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1791
+ textureSection.add(noise);
17501792
1751
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1752
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1753
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1754
- aConstraints.gridx += 1;
1755
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1756
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1757
- aConstraints.gridx = 0;
1758
- aConstraints.gridy += 1;
1759
- aConstraints.gridwidth = 1;
1793
+ cGridBag power = new cGridBag();
1794
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1795
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1796
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1797
+ textureSection.add(power);
17601798
1761
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1762
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1763
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1764
- aConstraints.gridx += 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1766
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1767
- aConstraints.gridx = 0;
1768
- aConstraints.gridy += 1;
1769
- aConstraints.gridwidth = 1;
1799
+ cGridBag borderfade = new cGridBag();
1800
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1801
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1802
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1803
+ textureSection.add(borderfade);
17701804
1771
- //aConstraints.weighty = 1;
1772
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1773
- //aConstraints.gridx += 1;
1774
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1775
- aConstraints.weighty = 0;
1805
+ cGridBag fog = new cGridBag();
1806
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1807
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1808
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1809
+ textureSection.add(fog);
17761810
1777
- aConstraints.gridx = 0;
1778
- aConstraints.gridy = 0;
1779
- aConstraints.gridwidth = 1;
1811
+ cGridBag opacityPower = new cGridBag();
1812
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1813
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1814
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1815
+ textureSection.add(opacityPower);
1816
+
1817
+ panel.add(new JSeparator());
1818
+
1819
+ panel.add(textureSection);
1820
+
1821
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17801822
17811823 SetMaterial(copy); // .GetMaterial());
17821824
1783
- colorField.addChangeListener(this);
1784
- modulationField.addChangeListener(this);
1825
+ //colorField.addChangeListener(this);
1826
+// modulationField.addChangeListener(this);
17851827 metalnessField.addChangeListener(this);
17861828 diffuseField.addChangeListener(this);
17871829 specularField.addChangeListener(this);
....@@ -1811,12 +1853,15 @@
18111853 opacityPowerField.addChangeListener(this);
18121854 /**/
18131855
1814
- resetSlidersButton.addActionListener(this);
18151856 clearMaterialButton.addActionListener(this);
18161857 createMaterialButton.addActionListener(this);
1817
-
1818
- propagateToggle.addItemListener(this);
1819
- multiplyToggle.addItemListener(this);
1858
+
1859
+ if (Globals.ADVANCED)
1860
+ {
1861
+ resetSlidersButton.addActionListener(this);
1862
+ propagateToggle.addItemListener(this);
1863
+ multiplyToggle.addItemListener(this);
1864
+ }
18201865 }
18211866
18221867 void DropFile(java.io.File[] files, boolean textures)
....@@ -1987,7 +2032,7 @@
19872032
19882033 //? flashIt = false;
19892034 CameraPane pane = (CameraPane) cameraView;
1990
- pane.clickStart(location.x, location.y, 0);
2035
+ pane.clickStart(location.x, location.y, 0, 0);
19912036 pane.clickEnd(location.x, location.y, 0, true);
19922037
19932038 if (group.selection.size() == 1)
....@@ -2036,6 +2081,7 @@
20362081 e2.printStackTrace();
20372082 }
20382083 }
2084
+
20392085 LoadJMEThread loadThread;
20402086
20412087 class LoadJMEThread extends Thread
....@@ -2093,6 +2139,7 @@
20932139 //LoadFile0(filename, converter);
20942140 }
20952141 }
2142
+
20962143 LoadOBJThread loadObjThread;
20972144
20982145 class LoadOBJThread extends Thread
....@@ -2171,19 +2218,19 @@
21712218
21722219 void LoadObjFile(String fullname)
21732220 {
2174
- /*
2221
+ System.out.println("Loading " + fullname);
2222
+ /**/
21752223 //lastFilename = fullname;
21762224 if(loadObjThread == null)
21772225 {
2178
- loadObjThread = new LoadOBJThread();
2179
- loadObjThread.start();
2226
+ loadObjThread = new LoadOBJThread();
2227
+ loadObjThread.start();
21802228 }
21812229
21822230 loadObjThread.add(fullname);
2183
- */
2231
+ /**/
21842232
2185
- System.out.println("Loading " + fullname);
2186
- makeSomething(new FileObject(fullname, true), true);
2233
+ //makeSomething(new FileObject(fullname, true), true);
21872234 }
21882235
21892236 void LoadGFDFile(String fullname)
....@@ -2444,11 +2491,11 @@
24442491
24452492 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24462493 {
2447
- if (GrafreeD.standAlone)
2494
+ if (Grafreed.standAlone)
24482495 {
24492496 /**/
24502497 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2451
- browser.show();
2498
+ browser.setVisible(true);
24522499 String filename = browser.getFile();
24532500 if (filename != null && filename.length() > 0)
24542501 {
....@@ -2593,6 +2640,7 @@
25932640 }
25942641 if (input == null)
25952642 {
2643
+ new Exception().printStackTrace();
25962644 System.exit(0);
25972645 }
25982646
....@@ -2807,7 +2855,8 @@
28072855 return;
28082856 }
28092857
2810
- multiplyToggle.setSelected(mat.multiply);
2858
+ if (multiplyToggle != null)
2859
+ multiplyToggle.setSelected(mat.multiply);
28112860
28122861 assert (object.projectedVertices != null);
28132862
....@@ -2996,7 +3045,8 @@
29963045 if (timeline)
29973046 {
29983047 centralPanel.remove(cameraView);
2999
- centralPanel.add(timelinePanel);
3048
+ cameraPanel.add(cameraView);
3049
+ centralPanel.add(cameraPanel);
30003050 frame.setJMenuBar(timelineMenubar);
30013051 wasFullScreen = CameraPane.FULLSCREEN;
30023052 if (!CameraPane.FULLSCREEN)
....@@ -3005,7 +3055,7 @@
30053055 }
30063056 else
30073057 {
3008
- centralPanel.remove(timelinePanel);
3058
+ centralPanel.remove(cameraPanel);
30093059 centralPanel.add(cameraView);
30103060 frame.setJMenuBar(null);
30113061 if (!wasFullScreen)
....@@ -3021,9 +3071,9 @@
30213071 frame.validate();
30223072
30233073 return;
3024
- } else if (event.getSource() == toggleRandomItem)
3074
+ } else if (event.getSource() == toggleSwitchItem)
30253075 {
3026
- cameraView.ToggleRandom();
3076
+ cameraView.ToggleSwitch();
30273077 cameraView.repaint();
30283078 return;
30293079 } else if (event.getSource() == toggleHandleItem)
....@@ -3052,6 +3102,10 @@
30523102 {
30533103 copy.live ^= true;
30543104 return;
3105
+ } else if (event.getSource() == selectCB)
3106
+ {
3107
+ copy.dontselect ^= true;
3108
+ return;
30553109 } else if (event.getSource() == hideCB)
30563110 {
30573111 copy.hide ^= true;
....@@ -3066,6 +3120,7 @@
30663120 if (event.getSource() == randomCB)
30673121 {
30683122 copy.random ^= true;
3123
+ objEditor.refreshContents();
30693124 return;
30703125 }
30713126 if (event.getSource() == speedupCB)
....@@ -3089,8 +3144,9 @@
30893144
30903145 public void actionPerformed(ActionEvent event)
30913146 {
3147
+ Object source = event.getSource();
30923148 // SCRIPT DIALOG
3093
- if (event.getSource() == okbutton)
3149
+ if (source == okbutton)
30943150 {
30953151 textpanel.setVisible(false);
30963152 textpanel.remove(textarea);
....@@ -3102,7 +3158,7 @@
31023158 textarea = null;
31033159 textpanel = null;
31043160 }
3105
- if (event.getSource() == cancelbutton)
3161
+ if (source == cancelbutton)
31063162 {
31073163 textpanel.setVisible(false);
31083164 textpanel.remove(textarea);
....@@ -3114,49 +3170,50 @@
31143170 //applySelf();
31153171 //client.refreshEditWindow();
31163172 //refreshContents();
3117
- if (event.getSource() == nameField)
3173
+ if (source == nameField)
31183174 {
31193175 //System.out.println("ObjEditor " + event);
31203176 applySelf0(true);
31213177 //parent.applySelf();
31223178 objEditor.refreshContents();
3123
- } else if (event.getSource() == resetButton)
3179
+ } else if (source == resetButton)
31243180 {
31253181 CameraPane.fullreset = true;
31263182 copy.Reset(); // ResetMeshes();
31273183 copy.Touch();
31283184 objEditor.refreshContents();
3129
- } else if (event.getSource() == stepItem)
3185
+ } else if (source == stepItem)
31303186 {
3131
- cameraView.ONESTEP = true;
3187
+ //cameraView.ONESTEP = true;
3188
+ Globals.ONESTEP = true;
31323189 cameraView.repaint();
31333190 return;
3134
- } else if (event.getSource() == stepButton)
3191
+ } else if (source == stepButton)
31353192 {
31363193 copy.Step();
31373194 copy.Touch();
31383195 objEditor.refreshContents();
3139
- } else if (event.getSource() == slowerButton)
3196
+ } else if (source == slowerButton)
31403197 {
31413198 copy.Slower();
31423199 copy.Touch();
31433200 objEditor.refreshContents();
3144
- } else if (event.getSource() == fasterButton)
3201
+ } else if (source == fasterButton)
31453202 {
31463203 copy.Faster();
31473204 copy.Touch();
31483205 objEditor.refreshContents();
3149
- } else if (event.getSource() == remarkButton)
3206
+ } else if (source == remarkButton)
31503207 {
31513208 copy.Remark();
31523209 copy.Touch();
31533210 objEditor.refreshContents();
3154
- } else if (event.getSource() == stepAllButton)
3211
+ } else if (source == stepAllButton)
31553212 {
31563213 copy.StepAll();
31573214 copy.Touch();
31583215 objEditor.refreshContents();
3159
- } else if (event.getSource() == resetAllButton)
3216
+ } else if (source == resetAllButton)
31603217 {
31613218 //CameraPane.fullreset = true;
31623219 copy.ResetAll(); // ResetMeshes();
....@@ -3189,53 +3246,75 @@
31893246 // Close();
31903247 // }
31913248 // else
3192
- if (event.getSource() == resetSlidersButton)
3249
+ if (source == resetSlidersButton)
31933250 {
31943251 ResetSliders();
3195
- } else if (event.getSource() == clearMaterialButton)
3252
+ } else if (source == clearMaterialButton)
31963253 {
31973254 ClearMaterial();
3198
- } else if (event.getSource() == createMaterialButton)
3255
+ } else if (source == createMaterialButton)
31993256 {
32003257 CreateMaterial();
3201
- } else if (event.getSource() == clearPanelButton)
3258
+ } else if (source == clearPanelButton)
32023259 {
32033260 copy.ClearUI();
32043261 refreshContents(true);
3205
- } /*
3206
- }
3207
-
3208
- public boolean action(Event event, Object arg)
3209
- {
3210
- */ else if (event.getSource() == closeItem)
3262
+ } else if (source == importGFDItem)
3263
+ {
3264
+ ImportGFD();
3265
+ } else
3266
+ if (source == importVRMLX3DItem)
3267
+ {
3268
+ ImportVRMLX3D();
3269
+ } else
3270
+ if (source == import3DSItem)
3271
+ {
3272
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3273
+ } else
3274
+ if (source == importOBJItem)
3275
+ {
3276
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3277
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3278
+ browser.setVisible(true);
3279
+ String filename = browser.getFile();
3280
+ if (filename != null && filename.length() > 0)
3281
+ {
3282
+ String fullname = browser.getDirectory() + filename;
3283
+ makeSomething(ReadOBJ(fullname), true);
3284
+ }
3285
+ } else
3286
+ if (source == closeItem)
32113287 {
32123288 Close();
32133289 //return true;
3214
- } else if (event.getSource() == loadItem)
3290
+ } else if (source == loadItem)
32153291 {
32163292 load();
32173293 //return true;
3218
- } else if (event.getSource() == saveItem)
3294
+ } else if (source == newItem)
3295
+ {
3296
+ New();
3297
+ } else if (source == saveItem)
32193298 {
32203299 save();
32213300 //return true;
3222
- } else if (event.getSource() == saveAsItem)
3301
+ } else if (source == saveAsItem)
32233302 {
32243303 saveAs();
32253304 //return true;
3226
- } else if (event.getSource() == reexportItem)
3305
+ } else if (source == reexportItem)
32273306 {
32283307 reexport();
32293308 //return true;
3230
- } else if (event.getSource() == exportAsItem)
3309
+ } else if (source == exportAsItem)
32313310 {
32323311 export();
32333312 //return true;
3234
- } else if (event.getSource() == povItem)
3313
+ } else if (source == povItem)
32353314 {
32363315 generatePOV();
32373316 //return true;
3238
- } else if (event.getSource() == zBufferItem)
3317
+ } else if (source == zBufferItem)
32393318 {
32403319 try
32413320 {
....@@ -3257,21 +3336,8 @@
32573336 cameraView.repaint();
32583337 //return true;
32593338 }
3260
- */ else if (event.getSource() == editCameraItem)
3261
- {
3262
- cameraView.ProtectCamera();
3263
- cameraView.repaint();
3264
- return;
3265
- } else if (event.getSource() == revertCameraItem)
3266
- {
3267
- cameraView.RevertCamera();
3268
- cameraView.repaint();
3269
- return;
3270
-// } else if (event.getSource() == textureButton)
3271
-// {
3272
-// return; // true;
3273
- } else // combos...
3274
- if (event.getSource() == texresMenu)
3339
+ */ else // combos...
3340
+ if (source == texresMenu)
32753341 {
32763342 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32773343 copy.texres = texresMenu.getSelectedIndex();
....@@ -3283,27 +3349,287 @@
32833349 }
32843350 }
32853351
3286
- void ToggleAnimation()
3352
+ void New()
32873353 {
3288
- if (!CameraPane.ANIMATION)
3354
+ while (copy.Size() > 1)
32893355 {
3290
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3356
+ copy.remove(1);
3357
+ }
3358
+
3359
+ ResetModel();
3360
+ objEditor.refreshContents();
3361
+ }
3362
+
3363
+ static public byte[] Compress(Object3D o)
3364
+ {
3365
+ try
3366
+ {
3367
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3368
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3369
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3370
+
3371
+ Object3D parent = o.parent;
3372
+ o.parent = null;
3373
+
3374
+ out.writeObject(o);
3375
+
3376
+ o.parent = parent;
3377
+
3378
+ out.flush();
3379
+
3380
+ zstream.close();
3381
+ out.close();
3382
+
3383
+ return baos.toByteArray();
3384
+ } catch (Exception e)
3385
+ {
3386
+ System.err.println(e);
3387
+ return null;
3388
+ }
3389
+ }
3390
+
3391
+ static public Object Uncompress(byte[] bytes)
3392
+ {
3393
+ System.out.println("#bytes = " + bytes.length);
3394
+ try
3395
+ {
3396
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3397
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3398
+ ObjectInputStream in = new ObjectInputStream(istream);
3399
+ Object obj = in.readObject();
3400
+ in.close();
3401
+
3402
+ return obj;
3403
+ } catch (Exception e)
3404
+ {
3405
+ System.err.println(e);
3406
+ return null;
3407
+ }
3408
+ }
3409
+
3410
+ static public Object clone(Object o)
3411
+ {
3412
+ try
3413
+ {
3414
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3415
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3416
+
3417
+ out.writeObject(o);
3418
+
3419
+ out.flush();
3420
+ out.close();
3421
+
3422
+ byte[] bytes = baos.toByteArray();
3423
+
3424
+ System.out.println("clone = " + bytes.length);
3425
+
3426
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3427
+ ObjectInputStream in = new ObjectInputStream(bais);
3428
+ Object obj = in.readObject();
3429
+ in.close();
3430
+
3431
+ return obj;
3432
+ } catch (Exception e)
3433
+ {
3434
+ System.err.println(e);
3435
+ return null;
3436
+ }
3437
+ }
3438
+
3439
+ cRadio GetCurrentTab()
3440
+ {
3441
+ cRadio ab;
3442
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3443
+ {
3444
+ ab = (cRadio)e.nextElement();
3445
+ if(ab.GetObject() == copy)
3446
+ {
3447
+ return ab;
3448
+ }
3449
+ }
3450
+
3451
+ return null;
3452
+ }
3453
+
3454
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3455
+
3456
+ public void Save()
3457
+ {
3458
+ System.err.println("Save");
3459
+
3460
+ cRadio tab = GetCurrentTab();
3461
+
3462
+ boolean temp = CameraPane.SWITCH;
3463
+ CameraPane.SWITCH = false;
3464
+
3465
+ copy.ExtractBigData(hashtable);
3466
+
3467
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3468
+ tab.graphs[tab.undoindex++] = Compress(copy);
3469
+
3470
+ copy.RestoreBigData(hashtable);
3471
+
3472
+ CameraPane.SWITCH = temp;
3473
+
3474
+ //assert(hashtable.isEmpty());
3475
+
3476
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3477
+ {
3478
+ tab.graphs[i] = null;
3479
+ }
3480
+
3481
+ // test save
3482
+ if (false)
3483
+ {
3484
+ try
3485
+ {
3486
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3487
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3488
+
3489
+ p.writeObject(copy);
3490
+
3491
+ p.flush();
3492
+
3493
+ ostream.close();
3494
+ } catch (Exception e)
3495
+ {
3496
+ e.printStackTrace();
3497
+ }
3498
+ }
3499
+ }
3500
+
3501
+ void CopyChanged(Object3D obj)
3502
+ {
3503
+ boolean temp = CameraPane.SWITCH;
3504
+ CameraPane.SWITCH = false;
3505
+
3506
+ copy.ExtractBigData(hashtable);
3507
+
3508
+ copy.clear();
3509
+
3510
+ for (int i=0; i<obj.Size(); i++)
3511
+ {
3512
+ copy.add(obj.get(i));
3513
+ }
3514
+
3515
+ copy.RestoreBigData(hashtable);
3516
+
3517
+ CameraPane.SWITCH = temp;
3518
+
3519
+ //assert(hashtable.isEmpty());
3520
+
3521
+ copy.Touch();
3522
+
3523
+ ResetModel();
3524
+ copy.HardTouch(); // recompile?
3525
+
3526
+ cRadio ab;
3527
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3528
+ {
3529
+ ab = (cRadio)e.nextElement();
3530
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3531
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3532
+ if (test != null)
3533
+ {
3534
+ test.editWindow = ab.object.editWindow;
3535
+ ab.object = test;
3536
+ }
3537
+ }
3538
+
3539
+ refreshContents();
3540
+ }
3541
+
3542
+ public void Undo()
3543
+ {
3544
+ System.err.println("Undo");
3545
+
3546
+ cRadio tab = GetCurrentTab();
3547
+
3548
+ if (tab.undoindex == 0)
3549
+ {
3550
+ java.awt.Toolkit.getDefaultToolkit().beep();
3551
+ return;
3552
+ }
3553
+
3554
+ if (tab.graphs[tab.undoindex] == null)
3555
+ {
3556
+ Save();
3557
+ tab.undoindex -= 1;
3558
+ }
3559
+
3560
+ tab.undoindex -= 1;
3561
+
3562
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3563
+ }
3564
+
3565
+ public void Redo()
3566
+ {
3567
+ cRadio tab = GetCurrentTab();
3568
+
3569
+ if (tab.graphs[tab.undoindex + 1] == null)
3570
+ {
3571
+ java.awt.Toolkit.getDefaultToolkit().beep();
3572
+ return;
3573
+ }
3574
+
3575
+ tab.undoindex += 1;
3576
+
3577
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3578
+ }
3579
+
3580
+ void ImportGFD()
3581
+ {
3582
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32913583 browser.show();
32923584 String filename = browser.getFile();
32933585 if (filename != null && filename.length() > 0)
32943586 {
3295
- CameraPane.filename = browser.getDirectory() + filename;
3587
+ String fullname = browser.getDirectory() + filename;
3588
+
3589
+ //Object3D readobj =
3590
+ objEditor.ReadGFD(fullname, objEditor);
3591
+ //makeSomething(readobj);
3592
+ }
3593
+ }
3594
+
3595
+ void ImportVRMLX3D()
3596
+ {
3597
+ if (Grafreed.standAlone)
3598
+ {
3599
+ /**/
3600
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3601
+ browser.show();
3602
+ String filename = browser.getFile();
3603
+ if (filename != null && filename.length() > 0)
3604
+ {
3605
+ String fullname = browser.getDirectory() + filename;
3606
+ LoadVRMLX3D(fullname);
3607
+ }
3608
+ /**/
3609
+ }
3610
+ }
3611
+
3612
+ void ToggleAnimation()
3613
+ {
3614
+ if (!Globals.ANIMATION)
3615
+ {
3616
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3617
+ browser.setVisible(true);
3618
+ String filename = browser.getFile();
3619
+ if (filename != null && filename.length() > 0)
3620
+ {
3621
+ Globals.filename = browser.getDirectory() + filename;
32963622 //CameraPane.framecount = 0;
3297
- CameraPane.imagecount = 0;
3623
+ Globals.imagecount = 0;
32983624
3299
- CameraPane.ANIMATION ^= true;
3625
+ Globals.ANIMATION ^= true;
33003626
3301
- GrafreeD.wav.cursor = 0;
3302
- GrafreeD.wav.loop = 0;
3627
+ Grafreed.wav.cursor = 0;
3628
+ Grafreed.wav.loop = 0;
33033629 }
33043630 } else
33053631 {
3306
- CameraPane.ANIMATION ^= true;
3632
+ Globals.ANIMATION ^= true;
33073633 }
33083634 }
33093635
....@@ -3349,7 +3675,7 @@
33493675 void CreateMaterial()
33503676 {
33513677 //copy.ClearMaterial(); // PATCH
3352
- copy.CreateMaterialS(multiplyToggle.isSelected());
3678
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33533679 if (copy.selection.size() > 0)
33543680 //SetMaterial(copy);
33553681 {
....@@ -3408,11 +3734,11 @@
34083734 {
34093735 copy.ResetBlockLoop(); // temporary problem
34103736
3411
- boolean random = CameraPane.RANDOM;
3412
- CameraPane.RANDOM = false; // parse everything
3737
+ boolean random = CameraPane.SWITCH;
3738
+ CameraPane.SWITCH = false; // parse everything
34133739 copy.ResetDisplayList();
34143740 copy.HardTouch();
3415
- CameraPane.RANDOM = random;
3741
+ CameraPane.SWITCH = random;
34163742 }
34173743
34183744 // public void applySelf()
....@@ -3482,10 +3808,40 @@
34823808 current.fakedepth = (float) fakedepthField.getFloat();
34833809 current.shadowbias = (float) shadowbiasField.getFloat();
34843810
3485
- if (!NumberSlider.frozen)
3811
+ if (!cNumberSlider.frozen)
34863812 {
34873813 //System.out.println("Propagate = " + propagate);
34883814 copy.UpdateMaterial(anchor, current, propagate);
3815
+
3816
+ if (copy.material != null)
3817
+ {
3818
+ cMaterial mat = copy.material;
3819
+
3820
+ colorField.SetToolTipValue((mat.color));
3821
+ modulationField.SetToolTipValue((mat.modulation));
3822
+ metalnessField.SetToolTipValue((mat.metalness));
3823
+ diffuseField.SetToolTipValue((mat.diffuse));
3824
+ specularField.SetToolTipValue((mat.specular));
3825
+ shininessField.SetToolTipValue((mat.shininess));
3826
+ shiftField.SetToolTipValue((mat.shift));
3827
+ ambientField.SetToolTipValue((mat.ambient));
3828
+ lightareaField.SetToolTipValue((mat.lightarea));
3829
+ diffusenessField.SetToolTipValue((mat.factor));
3830
+ velvetField.SetToolTipValue((mat.velvet));
3831
+ sheenField.SetToolTipValue((mat.sheen));
3832
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3833
+ backlitField.SetToolTipValue((mat.bump));
3834
+ anisoField.SetToolTipValue((mat.aniso));
3835
+ anisoVField.SetToolTipValue((mat.anisoV));
3836
+ cameraField.SetToolTipValue((mat.cameralight));
3837
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3838
+ shadowField.SetToolTipValue((mat.shadow));
3839
+ textureField.SetToolTipValue((mat.texture));
3840
+ opacityField.SetToolTipValue((mat.opacity));
3841
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3842
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3843
+ }
3844
+
34893845 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34903846 {
34913847 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3530,6 +3886,7 @@
35303886 || e.getSource() == apertureField
35313887 || e.getSource() == shadowblurField)
35323888 {
3889
+ new Exception().printStackTrace();
35333890 System.exit(0);
35343891 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35353892 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3600,7 +3957,7 @@
36003957 }
36013958
36023959 if (normalpushField != null)
3603
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
3960
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36043961 }
36053962
36063963 void SnapObject()
....@@ -3855,7 +4212,7 @@
38554212
38564213 radioPanel.revalidate();
38574214 radioPanel.repaint();
3858
- ctrlPanel.revalidate(); // ? new
4215
+ ctrlPanel.validate(); // ? new
38594216 ctrlPanel.repaint();
38604217 }
38614218 }
....@@ -3864,6 +4221,8 @@
38644221
38654222 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38664223 {
4224
+ if (Globals.SAVEONMAKE)
4225
+ Save();
38674226 //Tween.set(thing, 0).target(1).start(tweenManager);
38684227 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38694228 // if (thing instanceof GenericJointDemo)
....@@ -4067,6 +4426,7 @@
40674426 }
40684427 }
40694428 }
4429
+
40704430 LoadGFDThread loadGFDThread;
40714431
40724432 void ReadGFD(String fullname, iCallBack cb)
....@@ -4086,8 +4446,10 @@
40864446
40874447 try
40884448 {
4449
+ // Try compressed version first.
40894450 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4090
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4451
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4452
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40914453
40924454 readobj = (Object3D) p.readObject();
40934455 istream.close();
....@@ -4095,7 +4457,20 @@
40954457 readobj.ResetDisplayList();
40964458 } catch (Exception e)
40974459 {
4098
- e.printStackTrace();
4460
+ //e.printStackTrace();
4461
+ try
4462
+ {
4463
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4464
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4465
+
4466
+ readobj = (Object3D) p.readObject();
4467
+ istream.close();
4468
+
4469
+ readobj.ResetDisplayList();
4470
+ } catch (Exception e2)
4471
+ {
4472
+ e2.printStackTrace();
4473
+ }
40994474 }
41004475 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
41014476 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4141,6 +4516,12 @@
41414516
41424517 void LoadIt(Object obj)
41434518 {
4519
+ if (obj == null)
4520
+ {
4521
+ // Invalid file
4522
+ return;
4523
+ }
4524
+
41444525 System.out.println("Loaded " + obj);
41454526 //new Exception().printStackTrace();
41464527 Object3D readobj = (Object3D) obj;
....@@ -4150,6 +4531,8 @@
41504531
41514532 if (readobj != null)
41524533 {
4534
+ if (Globals.SAVEONMAKE)
4535
+ Save();
41534536 try
41544537 {
41554538 //readobj.deepCopySelf(copy);
....@@ -4212,7 +4595,7 @@
42124595
42134596 void load() // throws ClassNotFoundException
42144597 {
4215
- if (GrafreeD.standAlone)
4598
+ if (Grafreed.standAlone)
42164599 {
42174600 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42184601 browser.show();
....@@ -4299,11 +4682,13 @@
42994682 try
43004683 {
43014684 FileOutputStream ostream = new FileOutputStream(lastname);
4302
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4685
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4686
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43034687
43044688 p.writeObject(copy);
43054689 p.flush();
43064690
4691
+ zstream.close();
43074692 ostream.close();
43084693
43094694 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4313,11 +4698,12 @@
43134698 {
43144699 }
43154700 }
4701
+
43164702 String lastname;
43174703
43184704 void saveAs()
43194705 {
4320
- if (GrafreeD.standAlone)
4706
+ if (Grafreed.standAlone)
43214707 {
43224708 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43234709 browser.setVisible(true);
....@@ -4422,13 +4808,13 @@
44224808 try
44234809 {
44244810 FileOutputStream ostream = new FileOutputStream(filename);
4425
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4426
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4811
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4812
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44274813
44284814 Object3D objectparent = obj.parent;
44294815 obj.parent = null;
44304816
4431
- Object3D object = (Object3D) GrafreeD.clone(obj);
4817
+ Object3D object = (Object3D) Grafreed.clone(obj);
44324818
44334819 obj.parent = objectparent;
44344820
....@@ -4440,8 +4826,8 @@
44404826 p.writeObject(object);
44414827 p.flush();
44424828
4829
+ zstream.close();
44434830 ostream.close();
4444
- // zstream.close();
44454831
44464832 // group.selection.get(0).parent = parent;
44474833 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4462,7 +4848,7 @@
44624848 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44634849 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44644850 copy.generatePOV(buffer);
4465
- if (GrafreeD.standAlone)
4851
+ if (Grafreed.standAlone)
44664852 {
44674853 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44684854 browser.show();
....@@ -4488,7 +4874,8 @@
44884874 Object3D client;
44894875 Object3D copy;
44904876 MenuBar menuBar;
4491
- Menu windowMenu;
4877
+ Menu fileMenu;
4878
+ MenuItem newItem;
44924879 MenuItem loadItem;
44934880 MenuItem saveItem;
44944881 MenuItem saveAsItem;
....@@ -4496,13 +4883,11 @@
44964883 MenuItem reexportItem;
44974884 MenuItem povItem;
44984885 MenuItem closeItem;
4499
- Menu cameraMenu;
4886
+
45004887 CheckboxMenuItem zBufferItem;
45014888 //MenuItem normalLensItem;
4502
- MenuItem editCameraItem;
4503
- MenuItem revertCameraItem;
4504
- CheckboxMenuItem toggleLiveItem;
45054889 MenuItem stepItem;
4890
+ CheckboxMenuItem toggleLiveItem;
45064891 CheckboxMenuItem toggleFullScreenItem;
45074892 CheckboxMenuItem toggleTimelineItem;
45084893 CheckboxMenuItem toggleRenderItem;
....@@ -4511,7 +4896,7 @@
45114896 CheckboxMenuItem toggleFootContactItem;
45124897 CheckboxMenuItem toggleDLItem;
45134898 CheckboxMenuItem toggleTextureItem;
4514
- CheckboxMenuItem toggleRandomItem;
4899
+ CheckboxMenuItem toggleSwitchItem;
45154900 CheckboxMenuItem toggleRootItem;
45164901 CheckboxMenuItem animationItem;
45174902 CheckboxMenuItem toggleHandleItem;
....@@ -4519,20 +4904,21 @@
45194904 JSplitPane mainPanel;
45204905 JScrollPane scrollpane;
45214906 JPanel toolbarPanel;
4522
- JPanel treePanel;
4907
+ cGridBag treePanel;
45234908 JPanel radioPanel;
45244909 ButtonGroup buttonGroup;
4525
- JPanel ctrlPanel;
4526
- JPanel materialPanel;
4910
+ cGridBag ctrlPanel;
4911
+ cGridBag materialPanel;
45274912 JScrollPane infoPanel;
4528
- JPanel optionsPanel;
4913
+ cGridBag optionsPanel;
45294914 JTabbedPane objectPanel;
4530
- JPanel XYZPanel;
4915
+ cGridBag XYZPanel;
45314916 JSplitPane gridPanel;
45324917 JSplitPane bigPanel;
4533
- JPanel bigThree;
4534
- JTabbedPane scenePanel;
4535
- JPanel centralPanel;
4918
+ cGridBag bigThree;
4919
+ cGridBag scenePanel;
4920
+ cGridBag centralPanel;
4921
+ JSplitPane cameraPanel;
45364922 JPanel timelinePanel;
45374923 JMenuBar timelineMenubar;
45384924 JSplitPane framePanel;
....@@ -4584,67 +4970,72 @@
45844970 // MATERIAL
45854971 JLabel materialLabel;
45864972 JLabel colorLabel;
4587
- NumberSlider colorField;
4973
+ cNumberSlider colorField;
45884974 JLabel modulationLabel;
4589
- NumberSlider modulationField;
4975
+ cNumberSlider modulationField;
45904976 JLabel metalnessLabel;
4591
- NumberSlider metalnessField;
4977
+ cNumberSlider metalnessField;
45924978 JLabel diffuseLabel;
4593
- NumberSlider diffuseField;
4979
+ cNumberSlider diffuseField;
45944980 JLabel specularLabel;
4595
- NumberSlider specularField;
4981
+ cNumberSlider specularField;
45964982 JLabel shininessLabel;
4597
- NumberSlider shininessField;
4983
+ cNumberSlider shininessField;
45984984 JLabel shiftLabel;
4599
- NumberSlider shiftField;
4985
+ cNumberSlider shiftField;
46004986 JLabel ambientLabel;
4601
- NumberSlider ambientField;
4987
+ cNumberSlider ambientField;
46024988 JLabel lightareaLabel;
4603
- NumberSlider lightareaField;
4989
+ cNumberSlider lightareaField;
46044990 JLabel diffusenessLabel;
4605
- NumberSlider diffusenessField;
4991
+ cNumberSlider diffusenessField;
46064992 JLabel velvetLabel;
4607
- NumberSlider velvetField;
4993
+ cNumberSlider velvetField;
46084994 JLabel sheenLabel;
4609
- NumberSlider sheenField;
4995
+ cNumberSlider sheenField;
46104996 JLabel subsurfaceLabel;
4611
- NumberSlider subsurfaceField;
4997
+ cNumberSlider subsurfaceField;
46124998 //JLabel bumpLabel;
46134999 //NumberSlider bumpField;
46145000 JLabel backlitLabel;
4615
- NumberSlider backlitField;
5001
+ cNumberSlider backlitField;
46165002 JLabel anisoLabel;
4617
- NumberSlider anisoField;
5003
+ cNumberSlider anisoField;
46185004 JLabel anisoVLabel;
4619
- NumberSlider anisoVField;
5005
+ cNumberSlider anisoVField;
46205006 JLabel cameraLabel;
4621
- NumberSlider cameraField;
5007
+ cNumberSlider cameraField;
46225008 JLabel selfshadowLabel;
4623
- NumberSlider selfshadowField;
5009
+ cNumberSlider selfshadowField;
46245010 JLabel shadowLabel;
4625
- NumberSlider shadowField;
5011
+ cNumberSlider shadowField;
46265012 JLabel textureLabel;
4627
- NumberSlider textureField;
5013
+ cNumberSlider textureField;
46285014 JLabel opacityLabel;
4629
- NumberSlider opacityField;
5015
+ cNumberSlider opacityField;
46305016 JLabel fakedepthLabel;
4631
- NumberSlider fakedepthField;
5017
+ cNumberSlider fakedepthField;
46325018 JLabel shadowbiasLabel;
4633
- NumberSlider shadowbiasField;
5019
+ cNumberSlider shadowbiasField;
46345020 JLabel bumpLabel;
4635
- NumberSlider bumpField;
5021
+ cNumberSlider bumpField;
46365022 JLabel noiseLabel;
4637
- NumberSlider noiseField;
5023
+ cNumberSlider noiseField;
46385024 JLabel powerLabel;
4639
- NumberSlider powerField;
5025
+ cNumberSlider powerField;
46405026 JLabel borderfadeLabel;
4641
- NumberSlider borderfadeField;
5027
+ cNumberSlider borderfadeField;
46425028 JLabel fogLabel;
4643
- NumberSlider fogField;
5029
+ cNumberSlider fogField;
46445030 JLabel opacityPowerLabel;
4645
- NumberSlider opacityPowerField;
5031
+ cNumberSlider opacityPowerField;
46465032 JTree jTree;
46475033 //ObjectUI parent;
46485034
4649
- NumberSlider normalpushField;
5035
+ cNumberSlider normalpushField;
5036
+
5037
+ private MenuItem importGFDItem;
5038
+ private MenuItem importVRMLX3DItem;
5039
+ private MenuItem import3DSItem;
5040
+ private MenuItem importOBJItem;
46505041 }