Normand Briere
2019-06-24 47cd0f0a3870d843cb758535316060d30f15c811
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -19,6 +20,8 @@
1920 import //weka.core.
2021 matrix.Matrix;
2122
23
+import grafeme.ui.*;
24
+
2225 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2326 ActionListener, ChangeListener,
2427 InputMethodListener,
....@@ -31,6 +34,70 @@
3134 boolean timeline;
3235 boolean wasFullScreen;
3336
37
+ GroupEditor callee;
38
+ JFrame frame;
39
+
40
+ static ObjEditor theFrame;
41
+
42
+ cButton GetButton(String name, boolean border)
43
+ {
44
+ try
45
+ {
46
+ ImageIcon icon = GetIcon(name);
47
+ return new cButton(icon, border);
48
+ }
49
+ catch (Exception e)
50
+ {
51
+ return new cButton(name, border);
52
+ }
53
+ }
54
+
55
+ cToggleButton GetToggleButton(String name, boolean border)
56
+ {
57
+ try
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cToggleButton(icon, border);
61
+ }
62
+ catch (Exception e)
63
+ {
64
+ return new cToggleButton(name, border);
65
+ }
66
+ }
67
+
68
+ cCheckBox GetCheckBox(String name, boolean border)
69
+ {
70
+ try
71
+ {
72
+ ImageIcon icon = GetIcon(name);
73
+ return new cCheckBox(icon, border);
74
+ }
75
+ catch (Exception e)
76
+ {
77
+ return new cCheckBox(name, border);
78
+ }
79
+ }
80
+
81
+ private ImageIcon GetIcon(String name) throws IOException
82
+ {
83
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
84
+
85
+ if (image.getWidth() != 24 && image.getHeight() != 24)
86
+ {
87
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
88
+ Graphics2D g = resized.createGraphics();
89
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
90
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
91
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
92
+ g.dispose();
93
+
94
+ image = resized;
95
+ }
96
+
97
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
98
+ return icon;
99
+ }
100
+
34101 // SCRIPT
35102
36103 transient JFrame textpanel = null;
....@@ -121,47 +188,54 @@
121188 void keyPressed(int key, int modifiers)
122189 {
123190 System.out.println("KEY PRESSED");
124
- CameraPane.theRenderer.keyPressed(key, modifiers);
191
+ Globals.theRenderer.keyPressed(key, modifiers);
125192 }
126193 */
127194
128195 static GridBagConstraints aConstraints;
129196 static GridBagConstraints aWindowConstraints;
130
- GroupEditor callee;
131
- JFrame frame;
197
+
132198 static int GRIDWIDTH = 100; // 4;
133199
134200 public void closeUI()
135201 {
136202 //new Exception().printStackTrace();
137
- System.out.println("this = " + this);
138
- System.out.println("objEditor = " + objEditor);
203
+// System.out.println("this = " + this);
204
+// System.out.println("objEditor = " + objEditor);
139205 //nameField.removeActionListener(this);
140
- objEditor.ctrlPanel.remove(nameField);
206
+// objEditor.ctrlPanel.remove(nameField);
207
+
208
+ objEditor.ctrlPanel.remove(namePanel);
141209
142210 if (!GroupEditor.allparams)
143211 return;
144212
145
- objEditor.ctrlPanel.remove(liveCB);
146
- objEditor.ctrlPanel.remove(hideCB);
147
- objEditor.ctrlPanel.remove(markCB);
148
-
149
- objEditor.ctrlPanel.remove(randomCB);
150
- objEditor.ctrlPanel.remove(speedupCB);
151
- objEditor.ctrlPanel.remove(rewindCB);
152
-
153
- objEditor.ctrlPanel.remove(resetButton);
154
- objEditor.ctrlPanel.remove(stepButton);
155
-// objEditor.ctrlPanel.remove(stepAllButton);
156
-// objEditor.ctrlPanel.remove(resetAllButton);
157
- objEditor.ctrlPanel.remove(link2masterCB);
158
- //objEditor.ctrlPanel.remove(flipVCB);
159
- //objEditor.ctrlPanel.remove(texresMenu);
160
- objEditor.ctrlPanel.remove(slowerButton);
161
- objEditor.ctrlPanel.remove(fasterButton);
162
- objEditor.ctrlPanel.remove(remarkButton);
213
+// objEditor.ctrlPanel.remove(liveCB);
214
+// objEditor.ctrlPanel.remove(hideCB);
215
+// objEditor.ctrlPanel.remove(markCB);
216
+//
217
+// objEditor.ctrlPanel.remove(randomCB);
218
+// objEditor.ctrlPanel.remove(speedupCB);
219
+// objEditor.ctrlPanel.remove(rewindCB);
220
+//
221
+// objEditor.ctrlPanel.remove(resetButton);
222
+// objEditor.ctrlPanel.remove(stepButton);
223
+//// objEditor.ctrlPanel.remove(stepAllButton);
224
+//// objEditor.ctrlPanel.remove(resetAllButton);
225
+// objEditor.ctrlPanel.remove(link2masterCB);
226
+// //objEditor.ctrlPanel.remove(flipVCB);
227
+// //objEditor.ctrlPanel.remove(texresMenu);
228
+// objEditor.ctrlPanel.remove(slowerButton);
229
+// objEditor.ctrlPanel.remove(fasterButton);
230
+// objEditor.ctrlPanel.remove(remarkButton);
163231
164
- Remove(normalpushField);
232
+ objEditor.ctrlPanel.remove(setupPanel);
233
+ objEditor.ctrlPanel.remove(setupPanel2);
234
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
235
+ objEditor.ctrlPanel.remove(pushPanel);
236
+ //objEditor.ctrlPanel.remove(fillPanel);
237
+
238
+ //Remove(normalpushField);
165239 }
166240
167241 public ObjEditor GetEditor()
....@@ -232,6 +306,7 @@
232306 //localCopy.parent = null;
233307
234308 frame = new JFrame();
309
+ frame.setUndecorated(true);
235310 objEditor = this;
236311 this.callee = callee;
237312
....@@ -265,24 +340,40 @@
265340 void SetupMenu()
266341 {
267342 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..."));
343
+ menuBar.add(fileMenu = new Menu("File"));
344
+ fileMenu.add(newItem = new MenuItem("New"));
345
+ fileMenu.add(loadItem = new MenuItem("Open..."));
346
+
347
+ //oe.menuBar.add(menu = new Menu("Include"));
348
+ Menu menu = new Menu("Import");
349
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
350
+ importOBJItem.addActionListener(this);
351
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
352
+ import3DSItem.addActionListener(this);
353
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
354
+ importVRMLX3DItem.addActionListener(this);
355
+ menu.add("-");
356
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
357
+ importGFDItem.addActionListener(this);
358
+ fileMenu.add(menu);
359
+ fileMenu.add("-");
360
+
361
+ fileMenu.add(saveItem = new MenuItem("Save"));
362
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
273363 //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("-");
364
+ fileMenu.add("-");
365
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
366
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
367
+ fileMenu.add("-");
278368 if (client.parent != null)
279369 {
280
- windowMenu.add(closeItem = new MenuItem("Close"));
370
+ fileMenu.add(closeItem = new MenuItem("Close"));
281371 } else
282372 {
283
- windowMenu.add(closeItem = new MenuItem("Exit"));
373
+ fileMenu.add(closeItem = new MenuItem("Exit"));
284374 }
285375
376
+ newItem.addActionListener(this);
286377 loadItem.addActionListener(this);
287378 saveItem.addActionListener(this);
288379 saveAsItem.addActionListener(this);
....@@ -291,79 +382,38 @@
291382 //povItem.addActionListener(this);
292383 closeItem.addActionListener(this);
293384
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
-
349385 objectPanel = new JTabbedPane();
350386 toolbarPanel = new JPanel();
351387 toolbarPanel.setName("Toolbar");
352
- treePanel = new JPanel();
388
+ treePanel = new cGridBag();
353389 treePanel.setName("Tree");
354
- ctrlPanel = new JPanel(); // new GridBagLayout());
355
- ctrlPanel.setName("Edit");
356
- materialPanel = new JPanel();
390
+
391
+ editPanel = new cGridBag().setVertical(true);
392
+ editPanel.setName("Edit");
393
+
394
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
395
+
396
+ editCommandsPanel = new cGridBag();
397
+ editPanel.add(editCommandsPanel);
398
+ editPanel.add(ctrlPanel);
399
+
400
+ toolboxPanel = new cGridBag().setVertical(false);
401
+ toolboxPanel.setName("Toolbox");
402
+
403
+ materialPanel = new cGridBag().setVertical(true);
357404 materialPanel.setName("Material");
405
+
358406 /*JTextPane*/
359407 infoarea = createTextPane();
408
+ doc = infoarea.getStyledDocument();
409
+
360410 infoarea.setEditable(true);
361411 SetText();
362412 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
363413 // infoarea.setOpaque(false);
364414 // //infoarea.setForeground(textcolor);
365
- infoarea.setLineWrap(true);
366
- infoarea.setWrapStyleWord(true);
415
+// TEXTAREA infoarea.setLineWrap(true);
416
+// TEXTAREA infoarea.setWrapStyleWord(true);
367417 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
368418 infoPanel.setPreferredSize(new Dimension(50, 200));
369419 infoPanel.setName("Info");
....@@ -374,16 +424,16 @@
374424 mainPanel.setName("Main");
375425 mainPanel.setContinuousLayout(true);
376426 mainPanel.setOneTouchExpandable(true);
377
- mainPanel.setDividerLocation(1.0);
378427 mainPanel.setDividerSize(9);
379
- mainPanel.setResizeWeight(0);
428
+ mainPanel.setDividerLocation(0.5); //1.0);
429
+ mainPanel.setResizeWeight(0.5);
380430
381431 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
382432 //mainPanel.setLayout(new GridBagLayout());
383433 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
384
- treePanel.setLayout(new GridBagLayout());
385
- ctrlPanel.setLayout(new GridBagLayout());
386
- materialPanel.setLayout(new GridBagLayout());
434
+// treePanel.setLayout(new GridBagLayout());
435
+ //ctrlPanel.setLayout(new GridBagLayout());
436
+ //materialPanel.setLayout(new GridBagLayout());
387437
388438 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
389439 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -422,7 +472,7 @@
422472 static String newline = "\n";
423473 protected static final String buttonString = "JButton";
424474 StyledDocument doc;
425
- JTextArea infoarea;
475
+ JTextPane infoarea;
426476
427477 void ClearInfo()
428478 {
....@@ -445,10 +495,10 @@
445495 e.printStackTrace();
446496 }
447497
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();
498
+// String selection = infoarea.getText();
499
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
500
+// java.awt.datatransfer.Clipboard clipboard =
501
+// Toolkit.getDefaultToolkit().getSystemClipboard();
452502 //clipboard.setContents(data, data);
453503 }
454504
....@@ -471,13 +521,13 @@
471521 //SendInfo("Name:", "bold");
472522 if (sel.GetTextures() != null || debug)
473523 {
474
- si.SendInfo(sel.toString(), "bold");
524
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
475525 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
476526 if (sel.Size() > 0)
477527 {
478528 si.SendInfo("#children = " + sel.Size(), "regular");
479529 }
480
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
530
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
481531 if (debug)
482532 {
483533 try
....@@ -489,7 +539,10 @@
489539 }
490540
491541 if (full)
492
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
542
+ {
543
+ si.SendInfo(" BBox min: " + minima, "regular");
544
+ si.SendInfo(" BBox max: " + maxima, "regular");
545
+ }
493546
494547 if (sel.bRep != null)
495548 {
....@@ -516,7 +569,7 @@
516569 }
517570 if (sel.support != null)
518571 {
519
- si.SendInfo(" support: " + sel.support, "regular");
572
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
520573 }
521574 if (sel.scriptnode != null)
522575 {
....@@ -587,6 +640,9 @@
587640 {
588641 CameraPane.pointflow = (PointFlow) sel;
589642 }
643
+
644
+ si.SendInfo("_____________________", "regular");
645
+ si.SendInfo("", "regular");
590646 }
591647 }
592648
....@@ -602,68 +658,140 @@
602658 }
603659 }
604660
661
+static GraphicsDevice device = GraphicsEnvironment
662
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
663
+
664
+ Rectangle keeprect;
665
+ cRadio radio;
666
+
667
+cButton keepButton;
668
+ cButton twoButton; // Full 3D
669
+ cButton sixButton;
670
+ cButton threeButton;
671
+ cButton sevenButton;
672
+ cButton fourButton; // full panel
673
+ cButton oneButton; // full XYZ
674
+ //cButton currentLayout;
675
+
676
+ boolean maximized;
677
+
678
+ cButton fullscreenLayout;
679
+
680
+ void Minimize()
681
+ {
682
+ frame.setState(Frame.ICONIFIED);
683
+ }
684
+
685
+ void Maximize()
686
+ {
687
+ if (maximized)
688
+ {
689
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
690
+ }
691
+ else
692
+ {
693
+ keeprect = frame.getBounds();
694
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
695
+ Dimension rect2 = frame.getToolkit().getScreenSize();
696
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
697
+// frame.setState(Frame.MAXIMIZED_BOTH);
698
+ }
699
+
700
+ maximized ^= true;
701
+ }
702
+
605703 void ToggleFullScreen()
606704 {
607705 if (CameraPane.FULLSCREEN)
608706 {
609
- frame.getContentPane().remove(/*"Center",*/bigThree);
610
- framePanel.add(bigThree);
611
- frame.getContentPane().add(/*"Center",*/framePanel);
707
+ device.setFullScreenWindow(null);
708
+ //frame.setVisible(false);
709
+// frame.removeNotify();
710
+// frame.setUndecorated(false);
711
+// frame.addNotify();
712
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
713
+
714
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
715
+// X framePanel.add(bigThree);
716
+// X frame.getContentPane().add(/*"Center",*/framePanel);
717
+ framePanel.setDividerLocation(1);
718
+
719
+ //frame.setVisible(true);
720
+ radio.layout = keepButton;
721
+ //theFrame = null;
722
+ keepButton = null;
723
+ radio.layout.doClick();
724
+
612725 } else
613726 {
614
- frame.getContentPane().remove(/*"Center",*/framePanel);
615
- framePanel.remove(bigThree);
616
- frame.getContentPane().add(/*"Center",*/bigThree);
727
+ keepButton = radio.layout;
728
+ //keeprect = frame.getBounds();
729
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
730
+// frame.getToolkit().getScreenSize().height);
731
+ //frame.setVisible(false);
732
+ device.setFullScreenWindow(frame);
733
+// frame.removeNotify();
734
+// frame.setUndecorated(true);
735
+// frame.addNotify();
736
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
737
+// X framePanel.remove(bigThree);
738
+// X frame.getContentPane().add(/*"Center",*/bigThree);
739
+ framePanel.setDividerLocation(0);
740
+
741
+ radio.layout = fullscreenLayout;
742
+ radio.layout.doClick();
743
+ //frame.setVisible(true);
617744 }
745
+
618746 cameraView.ToggleFullScreen();
619747 }
620748
621
- private JTextArea createTextPane()
749
+ private JTextPane createTextPane()
622750 {
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
- };
751
+// TEXTAREA String[] initString =
752
+// {
753
+// "This is an editable JTextPane, ", //regular
754
+// "another ", //italic
755
+// "styled ", //bold
756
+// "text ", //small
757
+// "component, ", //large
758
+// "which supports embedded components..." + newline,//regular
759
+// " " + newline, //button
760
+// "...and embedded icons..." + newline, //regular
761
+// " ", //icon
762
+// newline + "JTextPane is a subclass of JEditorPane that "
763
+// + "uses a StyledEditorKit and StyledDocument, and provides "
764
+// + "cover methods for interacting with those objects."
765
+// };
766
+//
767
+// String[] initStyles =
768
+// {
769
+// "regular", "italic", "bold", "small", "large",
770
+// "regular", "button", "regular", "icon",
771
+// "regular"
772
+// };
773
+//
774
+// JTextPane textPane = new JTextPane();
775
+// textPane.setEditable(true);
776
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
777
+// addStylesToDocument(doc);
778
+//
779
+// try
780
+// {
781
+// for (int j = 0; j < 2; j++)
782
+// {
783
+// for (int i = 0; i < initString.length; i++)
784
+// {
785
+// doc.insertString(doc.getLength(), initString[i],
786
+// doc.getStyle(initStyles[i]));
787
+// }
788
+// }
789
+// } catch (BadLocationException ble)
790
+// {
791
+// System.err.println("Couldn't insert initial text into text pane.");
792
+// }
638793
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;
794
+ return new JTextPane(); // textPane;
667795 }
668796
669797 protected void addStylesToDocument(StyledDocument doc)
....@@ -716,7 +844,7 @@
716844 protected static ImageIcon createImageIcon(String path,
717845 String description)
718846 {
719
- java.net.URL imgURL = GrafreeD.class.getResource(path);
847
+ java.net.URL imgURL = Grafreed.class.getResource(path);
720848 if (imgURL != null)
721849 {
722850 return new ImageIcon(imgURL, description);
....@@ -748,6 +876,7 @@
748876 // NumberSlider vDivsField;
749877 // JCheckBox endcaps;
750878 JCheckBox liveCB;
879
+ JCheckBox selectCB;
751880 JCheckBox hideCB;
752881 JCheckBox link2masterCB;
753882 JCheckBox markCB;
....@@ -763,115 +892,87 @@
763892 JButton slowerButton;
764893 JButton fasterButton;
765894 JButton remarkButton;
895
+
896
+ cGridBag editPanel;
897
+ cGridBag editCommandsPanel;
898
+
899
+ cGridBag namePanel;
900
+ cGridBag setupPanel;
901
+ cGridBag setupPanel2;
902
+ cGridBag objectCommandsPanel;
903
+ cGridBag pushPanel;
904
+ cGridBag fillPanel;
766905
767
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
906
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
768907 {
769908 JCheckBox cb;
770909
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);
910
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
776911 cb.addItemListener(this);
777
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
778
- oe.aConstraints.gridwidth = 1;
779
- oe.aConstraints.gridx += 1;
780912
781913 return cb;
782914 }
783915
784
- cButton AddButton(ObjEditor oe, String label)
916
+ cButton AddButton(cGridBag panel, String label)
785917 {
786918 cButton cb;
787919
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);
920
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
793921 cb.addActionListener(this);
794
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
795
- oe.aConstraints.gridwidth = 1;
796
- oe.aConstraints.gridx += 1;
797922
798923 return cb;
799924 }
800925
801
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
926
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
802927 {
803928 JComboBox combo;
804929
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;
930
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808931 combo.addActionListener(this);
809932
810933 return combo;
811934 }
812935
813
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
936
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
814937 {
815
- NumberSlider combo;
938
+ cGridBag control = new cGridBag();
939
+
940
+ cNumberSlider combo;
816941
817942 JLabel jlabel = new JLabel(label);
818
-
819
- aConstraints.fill = GridBagConstraints.VERTICAL;
820943 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
-
944
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
945
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
830946 combo.setFloat(current);
831
-
832
- combo.label = jlabel;
833
-
834
- combo.addChangeListener(this);
835
-
836
- return combo;
947
+
948
+ panel.add(control);
949
+
950
+ return control;
837951 }
838952
839
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
953
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
840954 {
841
- NumberSlider combo;
955
+ cGridBag control = new cGridBag();
956
+
957
+ cNumberSlider combo;
842958
843959 JLabel jlabel = new JLabel(label);
844
-
845
- aConstraints.fill = GridBagConstraints.VERTICAL;
846960 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
-
961
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
962
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
856963 combo.setInteger(current);
857964
858
- combo.label = jlabel;
859
-
860
- combo.addChangeListener(this);
861
-
862
- return combo;
965
+ panel.add(control);
966
+
967
+ return control;
863968 }
864969
865
- JTextArea AddText(JPanel ctrlPanel, String name)
970
+ JTextArea AddText(cGridBag ctrlPanel, String name)
866971 {
867972 JTextArea text;
868973
869
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
870
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
871
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
974
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
872975 text.addCaretListener(this);
873
- aConstraints.gridx += 1;
874
- aConstraints.gridwidth = 1;
875976
876977 return text;
877978 }
....@@ -901,9 +1002,16 @@
9011002 objEditor.ctrlPanel.remove(j);
9021003 }
9031004
1005
+ void Remove(cNumberSlider j)
1006
+ {
1007
+ j.removeChangeListener(this);
1008
+ //objEditor.ctrlPanel.remove(j.label);
1009
+ objEditor.ctrlPanel.remove(j);
1010
+ }
1011
+
9041012 /*
9051013 */
906
- void Return() // ObjEditor oe)
1014
+ void Return0() // ObjEditor oe)
9071015 {
9081016 aConstraints.gridy += 1;
9091017 aConstraints.gridx = 0;
....@@ -958,37 +1066,76 @@
9581066
9591067 void SetupUI2(ObjEditor oe)
9601068 {
961
-// oe.aConstraints.weightx = 0;
962
-// oe.aConstraints.weighty = 0;
963
-// oe.aConstraints.gridx = 0;
964
-// oe.aConstraints.gridy = 0;
965
- SetupName(oe);
1069
+ //SetupName(oe);
1070
+
1071
+ namePanel = new cGridBag();
1072
+
1073
+ nameField = AddText(namePanel, copy.GetName());
1074
+ namePanel.add(nameField);
1075
+ oe.ctrlPanel.add(namePanel);
1076
+
1077
+ oe.ctrlPanel.Return();
9661078
9671079 if (!GroupEditor.allparams)
9681080 return;
9691081
970
- liveCB = AddCheckBox(oe, "Live", copy.live);
971
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
972
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1082
+ setupPanel = new cGridBag().setVertical(false);
1083
+
1084
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1085
+ liveCB.setToolTipText("Animate object");
1086
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1087
+ selectCB.setToolTipText("Make object selectable");
9731088 // 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");
1089
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1090
+ hideCB.setToolTipText("Hide object");
1091
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1092
+ markCB.setToolTipText("Set the animation target transform");
1093
+
1094
+ setupPanel2 = new cGridBag().setVertical(false);
1095
+
1096
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1097
+ rewindCB.setToolTipText("Rewind animation");
1098
+
1099
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1100
+ randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1101
+
1102
+ if (Globals.ADVANCED)
1103
+ {
1104
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1105
+ link2masterCB.setToolTipText("Attach to support");
1106
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1107
+ speedupCB.setToolTipText("Option motion capture");
1108
+ }
1109
+
1110
+ oe.ctrlPanel.add(setupPanel);
1111
+ oe.ctrlPanel.Return();
1112
+ oe.ctrlPanel.add(setupPanel2);
1113
+ oe.ctrlPanel.Return();
1114
+
1115
+ objectCommandsPanel = new cGridBag().setVertical(false);
1116
+
1117
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1118
+ resetButton.setToolTipText("Jump to frame zero");
1119
+ stepButton = AddButton(objectCommandsPanel, "Step");
1120
+ stepButton.setToolTipText("Step one frame");
9801121 // resetAllButton = AddButton(oe, "Reset All");
9811122 // stepAllButton = AddButton(oe, "Step All");
982
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9831123 // Return();
984
- slowerButton = AddButton(oe, "Slow");
985
- fasterButton = AddButton(oe, "Fast");
986
- remarkButton = AddButton(oe, "Rem");
1124
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1125
+ slowerButton.setToolTipText("Decrease animation speed");
1126
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1127
+ fasterButton.setToolTipText("Increase animation speed");
1128
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1129
+ remarkButton.setToolTipText("Set the current transform as the target");
9871130
988
- Return();
1131
+ oe.ctrlPanel.add(objectCommandsPanel);
1132
+ oe.ctrlPanel.Return();
9891133
990
- normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
991
- Return();
1134
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1135
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1136
+ //Return();
1137
+
1138
+ oe.ctrlPanel.Return();
9921139
9931140 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9941141 // ObjEditor.aConstraints.gridx += 1;
....@@ -1083,7 +1230,7 @@
10831230 oe.aConstraints.gridwidth = 1;
10841231 /**/
10851232 nameField = AddText(oe.ctrlPanel, copy.GetName());
1086
- Return();
1233
+ oe.ctrlPanel.Return();
10871234
10881235 //ctrlPanel.add(textureButton = new Button("Texture..."));
10891236 //textureButton.setEnabled(false);
....@@ -1185,11 +1332,25 @@
11851332 //JPanel worldPanel =
11861333 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11871334 //worldPanel.setName("World");
1188
- centralPanel = new JPanel(new BorderLayout());
1189
- timelinePanel = new JPanel(new BorderLayout());
1190
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1335
+ centralPanel = new cGridBag();
1336
+ centralPanel.preferredWidth = 20;
1337
+
1338
+ if (Globals.ADVANCED)
1339
+ {
1340
+ timelinePanel = new JPanel(new BorderLayout());
1341
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11911342
1343
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1344
+ cameraPanel.setContinuousLayout(true);
1345
+ cameraPanel.setOneTouchExpandable(true);
1346
+// cameraPanel.setDividerLocation(0.9);
1347
+// cameraPanel.setDividerSize(9);
1348
+ cameraPanel.setResizeWeight(1.0);
1349
+
1350
+ }
1351
+
11921352 centralPanel.add(cameraView);
1353
+ centralPanel.setFocusable(true);
11931354 //frame.setJMenuBar(timelineMenubar);
11941355 //centralPanel.add(timelinePanel);
11951356
....@@ -1208,12 +1369,13 @@
12081369 //frontView.object = copy;
12091370 //sideView.object = copy;
12101371
1211
- XYZPanel = new JPanel();
1212
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1372
+ XYZPanel = new cGridBag().setVertical(true);
1373
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12131374
1214
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1215
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1216
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1375
+ XYZPanel.preferredWidth = 5;
1376
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1377
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1378
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12171379
12181380 /*
12191381 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1250,11 +1412,13 @@
12501412
12511413 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12521414 //tmp.setName("Edit");
1415
+ objectPanel.add(toolboxPanel);
12531416 objectPanel.add(materialPanel);
1254
- JPanel north = new JPanel(new BorderLayout());
1255
- north.setName("Edit");
1256
- north.add(ctrlPanel, BorderLayout.NORTH);
1257
- objectPanel.add(north);
1417
+// JPanel north = new JPanel(new BorderLayout());
1418
+// north.setName("Edit");
1419
+// north.add(ctrlPanel, BorderLayout.NORTH);
1420
+// objectPanel.add(north);
1421
+ objectPanel.add(editPanel);
12581422 objectPanel.add(infoPanel);
12591423
12601424 /*
....@@ -1275,16 +1439,23 @@
12751439 scrollpane.setWheelScrollingEnabled(true);
12761440 scrollpane.addMouseWheelListener(this); // Default not fast enough
12771441
1278
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1279
- scenePanel.add(scrollpane);
1442
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1443
+ scenePanel.preferredWidth = 6;
1444
+
1445
+ JTabbedPane tabbedPane = new JTabbedPane();
1446
+ tabbedPane.add(scrollpane);
12801447
1281
- scenePanel.add(FSPane = new cFileSystemPane(this));
1448
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12821449
1283
- optionsPanel = new JPanel(new GridBagLayout());
1450
+ optionsPanel = new cGridBag().setVertical(true);
12841451
12851452 optionsPanel.setName("Options");
1286
- scenePanel.add(optionsPanel);
1287
-
1453
+
1454
+ AddOptions(optionsPanel); //, aConstraints);
1455
+
1456
+ tabbedPane.add(optionsPanel);
1457
+
1458
+ scenePanel.add(tabbedPane);
12881459
12891460 /*
12901461 cTree jTree = new cTree(null);
....@@ -1318,6 +1489,7 @@
13181489 //bigPanel.setSize(new Dimension(10,10));
13191490 //bigPanel.add(ctrlPanel);
13201491 //bigPanel.add(gridPanel);
1492
+ /**
13211493 bigThree = new JPanel();
13221494 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13231495 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1341,7 +1513,13 @@
13411513 // aConstraints.gridheight = 3;
13421514 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13431515 bigThree.add(XYZPanel, aWindowConstraints);
1516
+ /**/
13441517
1518
+ bigThree = new cGridBag();
1519
+ bigThree.addComponent(scenePanel);
1520
+ bigThree.addComponent(centralPanel);
1521
+ bigThree.addComponent(XYZPanel);
1522
+
13451523 // // SIDE EFFECT!!!
13461524 // aConstraints.gridx = 0;
13471525 // aConstraints.gridy = 0;
....@@ -1362,14 +1540,17 @@
13621540 //worldPane.add(bigPanel);
13631541 //worldPane.add(worldPanel);
13641542 /**/
1365
- frame.getContentPane().add(/*"Center",*/framePanel);
1543
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1544
+ frame.add(/*"Center",*/framePanel);
13661545 //frame.getContentPane().add(/*"Center",*/ worldPane);
13671546
13681547 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13691548
1370
- frame.setSize(1024, 768);
1371
- frame.show();
1549
+ frame.setSize(1280, 860);
1550
+ frame.setVisible(true);
13721551
1552
+ cameraView.requestFocusInWindow();
1553
+
13731554 gridPanel.setDividerLocation(1.0);
13741555
13751556 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1383,6 +1564,10 @@
13831564 });
13841565 }
13851566
1567
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1568
+ {
1569
+ }
1570
+
13861571 JTree GetTree()
13871572 {
13881573 return objEditor.jTree;
....@@ -1394,260 +1579,173 @@
13941579 ctrlPanel.removeAll();
13951580 }
13961581
1397
- void SetupMaterial(JPanel ctrlPanel)
1582
+ void SetupMaterial(cGridBag panel)
13981583 {
1399
- aConstraints.weighty = 0;
1400
- //aConstraints.weightx = 1;
1401
- /*
1584
+ /*
14021585 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14031586 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1404
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1405
- aConstraints.gridx += 1;
14061587 */
14071588
1408
- aConstraints.gridwidth = 1;
1409
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1410
- aConstraints.gridx += 1;
1411
- aConstraints.weighty = 0;
1412
- aConstraints.gridwidth = 1;
1589
+ cGridBag editBar = new cGridBag().setVertical(false);
1590
+
1591
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1592
+ createMaterialButton.setToolTipText("Create material");
14131593
14141594 /*
14151595 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1416
- aConstraints.gridx += 1;
1417
- aConstraints.weighty = 0;
1418
- aConstraints.gridwidth = 1;
14191596 */
14201597
1421
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1422
- aConstraints.gridx += 1;
1598
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1599
+ clearMaterialButton.setToolTipText("Clear material");
1600
+
1601
+ if (Globals.ADVANCED)
1602
+ {
1603
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1604
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1605
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1606
+ }
14231607
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;
1608
+ editBar.preferredHeight = 15;
1609
+
1610
+ panel.add(editBar);
1611
+
14381612 /**/
14391613 //aConstraints.weighty = 0;
14401614 ////aConstraints.weightx = 1;
14411615 //aConstraints.weighty = 1;
14421616 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14431617 //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;
1618
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14491619
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;
1620
+ cGridBag colorSection = new cGridBag().setVertical(true);
1621
+
1622
+ cGridBag color = new cGridBag();
1623
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1624
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1625
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1626
+ //colorField.preferredWidth = 200;
1627
+ colorSection.add(color);
14601628
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;
1629
+ cGridBag modulation = new cGridBag();
1630
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1631
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1632
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1633
+ colorSection.add(modulation);
14701634
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;
1635
+ cGridBag texture = new cGridBag();
1636
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1637
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1638
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1639
+ colorSection.add(texture);
14801640
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;
1641
+ cGridBag anisoU = new cGridBag();
1642
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1643
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1644
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1645
+ colorSection.add(anisoU);
14901646
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;
1647
+ cGridBag anisoV = new cGridBag();
1648
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1649
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1650
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1651
+ colorSection.add(anisoV);
15001652
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;
1653
+ cGridBag shadowbias = new cGridBag();
1654
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1655
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1656
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1657
+ colorSection.add(shadowbias);
15101658
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;
1659
+ panel.add(new JSeparator());
1660
+
1661
+ panel.add(colorSection);
1662
+
1663
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1664
+
1665
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1666
+
1667
+ cGridBag diffuse = new cGridBag();
1668
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1669
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1670
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1671
+ diffuseSection.add(diffuse);
15191672
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;
1673
+ cGridBag diffuseness = new cGridBag();
1674
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1675
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1676
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1677
+ diffuseSection.add(diffuseness);
15291678
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;
1679
+ cGridBag selfshadow = new cGridBag();
1680
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1681
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1683
+ diffuseSection.add(selfshadow);
15391684
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;
1685
+ cGridBag sheen = new cGridBag();
1686
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1687
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1689
+ diffuseSection.add(sheen);
15491690
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;
1691
+ cGridBag subsurface = new cGridBag();
1692
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1693
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1694
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1695
+ diffuseSection.add(subsurface);
15591696
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;
1697
+ cGridBag shadow = new cGridBag();
1698
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1699
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1700
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1701
+ diffuseSection.add(shadow);
15691702
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;
1703
+ cGridBag fakedepth = new cGridBag();
1704
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1705
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1706
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1707
+ diffuseSection.add(fakedepth);
15791708
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;
1709
+ panel.add(new JSeparator());
1710
+
1711
+ panel.add(diffuseSection);
1712
+
1713
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1714
+
1715
+ cGridBag specularSection = new cGridBag().setVertical(true);
15891716
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;
1717
+ cGridBag specular = new cGridBag();
1718
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1719
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1720
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1721
+ specularSection.add(specular);
15981722
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;
1723
+ cGridBag lightarea = new cGridBag();
1724
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1725
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1726
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1727
+ specularSection.add(lightarea);
16081728
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;
1729
+ cGridBag shininess = new cGridBag();
1730
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1731
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1732
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1733
+ specularSection.add(shininess);
16181734
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;
1735
+ cGridBag metalness = new cGridBag();
1736
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1737
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1738
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1739
+ specularSection.add(metalness);
16281740
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;
1741
+ cGridBag velvet = new cGridBag();
1742
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1743
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1744
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1745
+ specularSection.add(velvet);
16381746
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();
1747
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1748
+ //Return();
16511749 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16521750 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16531751 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1658,130 +1756,93 @@
16581756 // aConstraints.gridy += 1;
16591757 // aConstraints.gridwidth = 1;
16601758
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;
16691759
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;
1760
+ panel.add(new JSeparator());
1761
+
1762
+ panel.add(specularSection);
1763
+
1764
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1765
+
1766
+ cGridBag globalSection = new cGridBag().setVertical(true);
16791767
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;
1768
+ cGridBag camera = new cGridBag();
1769
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1770
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1771
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1772
+ globalSection.add(camera);
16891773
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;
1774
+ cGridBag ambient = new cGridBag();
1775
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1776
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1777
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1778
+ globalSection.add(ambient);
16991779
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;
1780
+ cGridBag backlit = new cGridBag();
1781
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1782
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1783
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1784
+ globalSection.add(backlit);
17101785
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;
1786
+ cGridBag opacity = new cGridBag();
1787
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1788
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1789
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1790
+ globalSection.add(opacity);
17201791
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;
1792
+ panel.add(new JSeparator());
1793
+
1794
+ panel.add(globalSection);
1795
+
1796
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1797
+
1798
+ cGridBag textureSection = new cGridBag().setVertical(true);
17301799
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;
1800
+ cGridBag bump = new cGridBag();
1801
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1802
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1803
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1804
+ textureSection.add(bump);
17401805
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;
1806
+ cGridBag noise = new cGridBag();
1807
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1808
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1809
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1810
+ textureSection.add(noise);
17501811
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;
1812
+ cGridBag power = new cGridBag();
1813
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1814
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1815
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1816
+ textureSection.add(power);
17601817
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;
1818
+ cGridBag borderfade = new cGridBag();
1819
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1820
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1821
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1822
+ textureSection.add(borderfade);
17701823
1771
- //aConstraints.weighty = 1;
1772
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1773
- //aConstraints.gridx += 1;
1774
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1775
- aConstraints.weighty = 0;
1824
+ cGridBag fog = new cGridBag();
1825
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1826
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1827
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1828
+ textureSection.add(fog);
17761829
1777
- aConstraints.gridx = 0;
1778
- aConstraints.gridy = 0;
1779
- aConstraints.gridwidth = 1;
1830
+ cGridBag opacityPower = new cGridBag();
1831
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1832
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1833
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1834
+ textureSection.add(opacityPower);
1835
+
1836
+ panel.add(new JSeparator());
1837
+
1838
+ panel.add(textureSection);
1839
+
1840
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17801841
17811842 SetMaterial(copy); // .GetMaterial());
17821843
1783
- colorField.addChangeListener(this);
1784
- modulationField.addChangeListener(this);
1844
+ //colorField.addChangeListener(this);
1845
+// modulationField.addChangeListener(this);
17851846 metalnessField.addChangeListener(this);
17861847 diffuseField.addChangeListener(this);
17871848 specularField.addChangeListener(this);
....@@ -1811,12 +1872,15 @@
18111872 opacityPowerField.addChangeListener(this);
18121873 /**/
18131874
1814
- resetSlidersButton.addActionListener(this);
18151875 clearMaterialButton.addActionListener(this);
18161876 createMaterialButton.addActionListener(this);
1817
-
1818
- propagateToggle.addItemListener(this);
1819
- multiplyToggle.addItemListener(this);
1877
+
1878
+ if (Globals.ADVANCED)
1879
+ {
1880
+ resetSlidersButton.addActionListener(this);
1881
+ propagateToggle.addItemListener(this);
1882
+ multiplyToggle.addItemListener(this);
1883
+ }
18201884 }
18211885
18221886 void DropFile(java.io.File[] files, boolean textures)
....@@ -1987,7 +2051,7 @@
19872051
19882052 //? flashIt = false;
19892053 CameraPane pane = (CameraPane) cameraView;
1990
- pane.clickStart(location.x, location.y, 0);
2054
+ pane.clickStart(location.x, location.y, 0, 0);
19912055 pane.clickEnd(location.x, location.y, 0, true);
19922056
19932057 if (group.selection.size() == 1)
....@@ -2036,6 +2100,7 @@
20362100 e2.printStackTrace();
20372101 }
20382102 }
2103
+
20392104 LoadJMEThread loadThread;
20402105
20412106 class LoadJMEThread extends Thread
....@@ -2093,6 +2158,7 @@
20932158 //LoadFile0(filename, converter);
20942159 }
20952160 }
2161
+
20962162 LoadOBJThread loadObjThread;
20972163
20982164 class LoadOBJThread extends Thread
....@@ -2171,19 +2237,19 @@
21712237
21722238 void LoadObjFile(String fullname)
21732239 {
2174
- /*
2240
+ System.out.println("Loading " + fullname);
2241
+ /**/
21752242 //lastFilename = fullname;
21762243 if(loadObjThread == null)
21772244 {
2178
- loadObjThread = new LoadOBJThread();
2179
- loadObjThread.start();
2245
+ loadObjThread = new LoadOBJThread();
2246
+ loadObjThread.start();
21802247 }
21812248
21822249 loadObjThread.add(fullname);
2183
- */
2250
+ /**/
21842251
2185
- System.out.println("Loading " + fullname);
2186
- makeSomething(new FileObject(fullname, true), true);
2252
+ //makeSomething(new FileObject(fullname, true), true);
21872253 }
21882254
21892255 void LoadGFDFile(String fullname)
....@@ -2444,11 +2510,11 @@
24442510
24452511 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24462512 {
2447
- if (GrafreeD.standAlone)
2513
+ if (Grafreed.standAlone)
24482514 {
24492515 /**/
24502516 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2451
- browser.show();
2517
+ browser.setVisible(true);
24522518 String filename = browser.getFile();
24532519 if (filename != null && filename.length() > 0)
24542520 {
....@@ -2593,6 +2659,7 @@
25932659 }
25942660 if (input == null)
25952661 {
2662
+ new Exception().printStackTrace();
25962663 System.exit(0);
25972664 }
25982665
....@@ -2807,7 +2874,8 @@
28072874 return;
28082875 }
28092876
2810
- multiplyToggle.setSelected(mat.multiply);
2877
+ if (multiplyToggle != null)
2878
+ multiplyToggle.setSelected(mat.multiply);
28112879
28122880 assert (object.projectedVertices != null);
28132881
....@@ -2996,7 +3064,8 @@
29963064 if (timeline)
29973065 {
29983066 centralPanel.remove(cameraView);
2999
- centralPanel.add(timelinePanel);
3067
+ cameraPanel.add(cameraView);
3068
+ centralPanel.add(cameraPanel);
30003069 frame.setJMenuBar(timelineMenubar);
30013070 wasFullScreen = CameraPane.FULLSCREEN;
30023071 if (!CameraPane.FULLSCREEN)
....@@ -3005,7 +3074,7 @@
30053074 }
30063075 else
30073076 {
3008
- centralPanel.remove(timelinePanel);
3077
+ centralPanel.remove(cameraPanel);
30093078 centralPanel.add(cameraView);
30103079 frame.setJMenuBar(null);
30113080 if (!wasFullScreen)
....@@ -3021,9 +3090,9 @@
30213090 frame.validate();
30223091
30233092 return;
3024
- } else if (event.getSource() == toggleRandomItem)
3093
+ } else if (event.getSource() == toggleSwitchItem)
30253094 {
3026
- cameraView.ToggleRandom();
3095
+ cameraView.ToggleSwitch();
30273096 cameraView.repaint();
30283097 return;
30293098 } else if (event.getSource() == toggleHandleItem)
....@@ -3052,6 +3121,10 @@
30523121 {
30533122 copy.live ^= true;
30543123 return;
3124
+ } else if (event.getSource() == selectCB)
3125
+ {
3126
+ copy.dontselect ^= true;
3127
+ return;
30553128 } else if (event.getSource() == hideCB)
30563129 {
30573130 copy.hide ^= true;
....@@ -3066,6 +3139,7 @@
30663139 if (event.getSource() == randomCB)
30673140 {
30683141 copy.random ^= true;
3142
+ objEditor.refreshContents();
30693143 return;
30703144 }
30713145 if (event.getSource() == speedupCB)
....@@ -3089,8 +3163,9 @@
30893163
30903164 public void actionPerformed(ActionEvent event)
30913165 {
3166
+ Object source = event.getSource();
30923167 // SCRIPT DIALOG
3093
- if (event.getSource() == okbutton)
3168
+ if (source == okbutton)
30943169 {
30953170 textpanel.setVisible(false);
30963171 textpanel.remove(textarea);
....@@ -3102,7 +3177,7 @@
31023177 textarea = null;
31033178 textpanel = null;
31043179 }
3105
- if (event.getSource() == cancelbutton)
3180
+ if (source == cancelbutton)
31063181 {
31073182 textpanel.setVisible(false);
31083183 textpanel.remove(textarea);
....@@ -3114,49 +3189,50 @@
31143189 //applySelf();
31153190 //client.refreshEditWindow();
31163191 //refreshContents();
3117
- if (event.getSource() == nameField)
3192
+ if (source == nameField)
31183193 {
31193194 //System.out.println("ObjEditor " + event);
31203195 applySelf0(true);
31213196 //parent.applySelf();
31223197 objEditor.refreshContents();
3123
- } else if (event.getSource() == resetButton)
3198
+ } else if (source == resetButton)
31243199 {
31253200 CameraPane.fullreset = true;
31263201 copy.Reset(); // ResetMeshes();
31273202 copy.Touch();
31283203 objEditor.refreshContents();
3129
- } else if (event.getSource() == stepItem)
3204
+ } else if (source == stepItem)
31303205 {
3131
- cameraView.ONESTEP = true;
3206
+ //cameraView.ONESTEP = true;
3207
+ Globals.ONESTEP = true;
31323208 cameraView.repaint();
31333209 return;
3134
- } else if (event.getSource() == stepButton)
3210
+ } else if (source == stepButton)
31353211 {
31363212 copy.Step();
31373213 copy.Touch();
31383214 objEditor.refreshContents();
3139
- } else if (event.getSource() == slowerButton)
3215
+ } else if (source == slowerButton)
31403216 {
31413217 copy.Slower();
31423218 copy.Touch();
31433219 objEditor.refreshContents();
3144
- } else if (event.getSource() == fasterButton)
3220
+ } else if (source == fasterButton)
31453221 {
31463222 copy.Faster();
31473223 copy.Touch();
31483224 objEditor.refreshContents();
3149
- } else if (event.getSource() == remarkButton)
3225
+ } else if (source == remarkButton)
31503226 {
31513227 copy.Remark();
31523228 copy.Touch();
31533229 objEditor.refreshContents();
3154
- } else if (event.getSource() == stepAllButton)
3230
+ } else if (source == stepAllButton)
31553231 {
31563232 copy.StepAll();
31573233 copy.Touch();
31583234 objEditor.refreshContents();
3159
- } else if (event.getSource() == resetAllButton)
3235
+ } else if (source == resetAllButton)
31603236 {
31613237 //CameraPane.fullreset = true;
31623238 copy.ResetAll(); // ResetMeshes();
....@@ -3189,53 +3265,75 @@
31893265 // Close();
31903266 // }
31913267 // else
3192
- if (event.getSource() == resetSlidersButton)
3268
+ if (source == resetSlidersButton)
31933269 {
31943270 ResetSliders();
3195
- } else if (event.getSource() == clearMaterialButton)
3271
+ } else if (source == clearMaterialButton)
31963272 {
31973273 ClearMaterial();
3198
- } else if (event.getSource() == createMaterialButton)
3274
+ } else if (source == createMaterialButton)
31993275 {
32003276 CreateMaterial();
3201
- } else if (event.getSource() == clearPanelButton)
3277
+ } else if (source == clearPanelButton)
32023278 {
32033279 copy.ClearUI();
32043280 refreshContents(true);
3205
- } /*
3206
- }
3207
-
3208
- public boolean action(Event event, Object arg)
3209
- {
3210
- */ else if (event.getSource() == closeItem)
3281
+ } else if (source == importGFDItem)
3282
+ {
3283
+ ImportGFD();
3284
+ } else
3285
+ if (source == importVRMLX3DItem)
3286
+ {
3287
+ ImportVRMLX3D();
3288
+ } else
3289
+ if (source == import3DSItem)
3290
+ {
3291
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3292
+ } else
3293
+ if (source == importOBJItem)
3294
+ {
3295
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3296
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3297
+ browser.setVisible(true);
3298
+ String filename = browser.getFile();
3299
+ if (filename != null && filename.length() > 0)
3300
+ {
3301
+ String fullname = browser.getDirectory() + filename;
3302
+ makeSomething(ReadOBJ(fullname), true);
3303
+ }
3304
+ } else
3305
+ if (source == closeItem)
32113306 {
32123307 Close();
32133308 //return true;
3214
- } else if (event.getSource() == loadItem)
3309
+ } else if (source == loadItem)
32153310 {
32163311 load();
32173312 //return true;
3218
- } else if (event.getSource() == saveItem)
3313
+ } else if (source == newItem)
3314
+ {
3315
+ New();
3316
+ } else if (source == saveItem)
32193317 {
32203318 save();
32213319 //return true;
3222
- } else if (event.getSource() == saveAsItem)
3320
+ } else if (source == saveAsItem)
32233321 {
32243322 saveAs();
32253323 //return true;
3226
- } else if (event.getSource() == reexportItem)
3324
+ } else if (source == reexportItem)
32273325 {
32283326 reexport();
32293327 //return true;
3230
- } else if (event.getSource() == exportAsItem)
3328
+ } else if (source == exportAsItem)
32313329 {
32323330 export();
32333331 //return true;
3234
- } else if (event.getSource() == povItem)
3332
+ } else if (source == povItem)
32353333 {
32363334 generatePOV();
32373335 //return true;
3238
- } else if (event.getSource() == zBufferItem)
3336
+ } else if (source == zBufferItem)
32393337 {
32403338 try
32413339 {
....@@ -3257,21 +3355,8 @@
32573355 cameraView.repaint();
32583356 //return true;
32593357 }
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)
3358
+ */ else // combos...
3359
+ if (source == texresMenu)
32753360 {
32763361 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32773362 copy.texres = texresMenu.getSelectedIndex();
....@@ -3283,27 +3368,287 @@
32833368 }
32843369 }
32853370
3286
- void ToggleAnimation()
3371
+ void New()
32873372 {
3288
- if (!CameraPane.ANIMATION)
3373
+ while (copy.Size() > 1)
32893374 {
3290
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3375
+ copy.remove(1);
3376
+ }
3377
+
3378
+ ResetModel();
3379
+ objEditor.refreshContents();
3380
+ }
3381
+
3382
+ static public byte[] Compress(Object3D o)
3383
+ {
3384
+ try
3385
+ {
3386
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3387
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3388
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3389
+
3390
+ Object3D parent = o.parent;
3391
+ o.parent = null;
3392
+
3393
+ out.writeObject(o);
3394
+
3395
+ o.parent = parent;
3396
+
3397
+ out.flush();
3398
+
3399
+ zstream.close();
3400
+ out.close();
3401
+
3402
+ return baos.toByteArray();
3403
+ } catch (Exception e)
3404
+ {
3405
+ System.err.println(e);
3406
+ return null;
3407
+ }
3408
+ }
3409
+
3410
+ static public Object Uncompress(byte[] bytes)
3411
+ {
3412
+ System.out.println("#bytes = " + bytes.length);
3413
+ try
3414
+ {
3415
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3416
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3417
+ ObjectInputStream in = new ObjectInputStream(istream);
3418
+ Object obj = in.readObject();
3419
+ in.close();
3420
+
3421
+ return obj;
3422
+ } catch (Exception e)
3423
+ {
3424
+ System.err.println(e);
3425
+ return null;
3426
+ }
3427
+ }
3428
+
3429
+ static public Object clone(Object o)
3430
+ {
3431
+ try
3432
+ {
3433
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3434
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3435
+
3436
+ out.writeObject(o);
3437
+
3438
+ out.flush();
3439
+ out.close();
3440
+
3441
+ byte[] bytes = baos.toByteArray();
3442
+
3443
+ System.out.println("clone = " + bytes.length);
3444
+
3445
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3446
+ ObjectInputStream in = new ObjectInputStream(bais);
3447
+ Object obj = in.readObject();
3448
+ in.close();
3449
+
3450
+ return obj;
3451
+ } catch (Exception e)
3452
+ {
3453
+ System.err.println(e);
3454
+ return null;
3455
+ }
3456
+ }
3457
+
3458
+ cRadio GetCurrentTab()
3459
+ {
3460
+ cRadio ab;
3461
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3462
+ {
3463
+ ab = (cRadio)e.nextElement();
3464
+ if(ab.GetObject() == copy)
3465
+ {
3466
+ return ab;
3467
+ }
3468
+ }
3469
+
3470
+ return null;
3471
+ }
3472
+
3473
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3474
+
3475
+ public void Save()
3476
+ {
3477
+ System.err.println("Save");
3478
+
3479
+ cRadio tab = GetCurrentTab();
3480
+
3481
+ boolean temp = CameraPane.SWITCH;
3482
+ CameraPane.SWITCH = false;
3483
+
3484
+ copy.ExtractBigData(hashtable);
3485
+
3486
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3487
+ tab.graphs[tab.undoindex++] = Compress(copy);
3488
+
3489
+ copy.RestoreBigData(hashtable);
3490
+
3491
+ CameraPane.SWITCH = temp;
3492
+
3493
+ //assert(hashtable.isEmpty());
3494
+
3495
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3496
+ {
3497
+ tab.graphs[i] = null;
3498
+ }
3499
+
3500
+ // test save
3501
+ if (false)
3502
+ {
3503
+ try
3504
+ {
3505
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3506
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3507
+
3508
+ p.writeObject(copy);
3509
+
3510
+ p.flush();
3511
+
3512
+ ostream.close();
3513
+ } catch (Exception e)
3514
+ {
3515
+ e.printStackTrace();
3516
+ }
3517
+ }
3518
+ }
3519
+
3520
+ void CopyChanged(Object3D obj)
3521
+ {
3522
+ boolean temp = CameraPane.SWITCH;
3523
+ CameraPane.SWITCH = false;
3524
+
3525
+ copy.ExtractBigData(hashtable);
3526
+
3527
+ copy.clear();
3528
+
3529
+ for (int i=0; i<obj.Size(); i++)
3530
+ {
3531
+ copy.add(obj.get(i));
3532
+ }
3533
+
3534
+ copy.RestoreBigData(hashtable);
3535
+
3536
+ CameraPane.SWITCH = temp;
3537
+
3538
+ //assert(hashtable.isEmpty());
3539
+
3540
+ copy.Touch();
3541
+
3542
+ ResetModel();
3543
+ copy.HardTouch(); // recompile?
3544
+
3545
+ cRadio ab;
3546
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3547
+ {
3548
+ ab = (cRadio)e.nextElement();
3549
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3550
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3551
+ if (test != null)
3552
+ {
3553
+ test.editWindow = ab.object.editWindow;
3554
+ ab.object = test;
3555
+ }
3556
+ }
3557
+
3558
+ refreshContents();
3559
+ }
3560
+
3561
+ public void Undo()
3562
+ {
3563
+ System.err.println("Undo");
3564
+
3565
+ cRadio tab = GetCurrentTab();
3566
+
3567
+ if (tab.undoindex == 0)
3568
+ {
3569
+ java.awt.Toolkit.getDefaultToolkit().beep();
3570
+ return;
3571
+ }
3572
+
3573
+ if (tab.graphs[tab.undoindex] == null)
3574
+ {
3575
+ Save();
3576
+ tab.undoindex -= 1;
3577
+ }
3578
+
3579
+ tab.undoindex -= 1;
3580
+
3581
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3582
+ }
3583
+
3584
+ public void Redo()
3585
+ {
3586
+ cRadio tab = GetCurrentTab();
3587
+
3588
+ if (tab.graphs[tab.undoindex + 1] == null)
3589
+ {
3590
+ java.awt.Toolkit.getDefaultToolkit().beep();
3591
+ return;
3592
+ }
3593
+
3594
+ tab.undoindex += 1;
3595
+
3596
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3597
+ }
3598
+
3599
+ void ImportGFD()
3600
+ {
3601
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32913602 browser.show();
32923603 String filename = browser.getFile();
32933604 if (filename != null && filename.length() > 0)
32943605 {
3295
- CameraPane.filename = browser.getDirectory() + filename;
3606
+ String fullname = browser.getDirectory() + filename;
3607
+
3608
+ //Object3D readobj =
3609
+ objEditor.ReadGFD(fullname, objEditor);
3610
+ //makeSomething(readobj);
3611
+ }
3612
+ }
3613
+
3614
+ void ImportVRMLX3D()
3615
+ {
3616
+ if (Grafreed.standAlone)
3617
+ {
3618
+ /**/
3619
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3620
+ browser.show();
3621
+ String filename = browser.getFile();
3622
+ if (filename != null && filename.length() > 0)
3623
+ {
3624
+ String fullname = browser.getDirectory() + filename;
3625
+ LoadVRMLX3D(fullname);
3626
+ }
3627
+ /**/
3628
+ }
3629
+ }
3630
+
3631
+ void ToggleAnimation()
3632
+ {
3633
+ if (!Globals.ANIMATION)
3634
+ {
3635
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3636
+ browser.setVisible(true);
3637
+ String filename = browser.getFile();
3638
+ if (filename != null && filename.length() > 0)
3639
+ {
3640
+ Globals.filename = browser.getDirectory() + filename;
32963641 //CameraPane.framecount = 0;
3297
- CameraPane.imagecount = 0;
3642
+ Globals.imagecount = 0;
32983643
3299
- CameraPane.ANIMATION ^= true;
3644
+ Globals.ANIMATION ^= true;
33003645
3301
- GrafreeD.wav.cursor = 0;
3302
- GrafreeD.wav.loop = 0;
3646
+ Grafreed.wav.cursor = 0;
3647
+ Grafreed.wav.loop = 0;
33033648 }
33043649 } else
33053650 {
3306
- CameraPane.ANIMATION ^= true;
3651
+ Globals.ANIMATION ^= true;
33073652 }
33083653 }
33093654
....@@ -3349,7 +3694,7 @@
33493694 void CreateMaterial()
33503695 {
33513696 //copy.ClearMaterial(); // PATCH
3352
- copy.CreateMaterialS(multiplyToggle.isSelected());
3697
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33533698 if (copy.selection.size() > 0)
33543699 //SetMaterial(copy);
33553700 {
....@@ -3400,7 +3745,7 @@
34003745 assert false;
34013746 }
34023747
3403
- void EditSelection()
3748
+ void EditSelection(boolean newWindow)
34043749 {
34053750 }
34063751
....@@ -3408,11 +3753,11 @@
34083753 {
34093754 copy.ResetBlockLoop(); // temporary problem
34103755
3411
- boolean random = CameraPane.RANDOM;
3412
- CameraPane.RANDOM = false; // parse everything
3756
+ boolean random = CameraPane.SWITCH;
3757
+ CameraPane.SWITCH = false; // parse everything
34133758 copy.ResetDisplayList();
34143759 copy.HardTouch();
3415
- CameraPane.RANDOM = random;
3760
+ CameraPane.SWITCH = random;
34163761 }
34173762
34183763 // public void applySelf()
....@@ -3482,10 +3827,40 @@
34823827 current.fakedepth = (float) fakedepthField.getFloat();
34833828 current.shadowbias = (float) shadowbiasField.getFloat();
34843829
3485
- if (!NumberSlider.frozen)
3830
+ if (!cNumberSlider.frozen)
34863831 {
34873832 //System.out.println("Propagate = " + propagate);
34883833 copy.UpdateMaterial(anchor, current, propagate);
3834
+
3835
+ if (copy.material != null)
3836
+ {
3837
+ cMaterial mat = copy.material;
3838
+
3839
+ colorField.SetToolTipValue((mat.color));
3840
+ modulationField.SetToolTipValue((mat.modulation));
3841
+ metalnessField.SetToolTipValue((mat.metalness));
3842
+ diffuseField.SetToolTipValue((mat.diffuse));
3843
+ specularField.SetToolTipValue((mat.specular));
3844
+ shininessField.SetToolTipValue((mat.shininess));
3845
+ shiftField.SetToolTipValue((mat.shift));
3846
+ ambientField.SetToolTipValue((mat.ambient));
3847
+ lightareaField.SetToolTipValue((mat.lightarea));
3848
+ diffusenessField.SetToolTipValue((mat.factor));
3849
+ velvetField.SetToolTipValue((mat.velvet));
3850
+ sheenField.SetToolTipValue((mat.sheen));
3851
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3852
+ backlitField.SetToolTipValue((mat.bump));
3853
+ anisoField.SetToolTipValue((mat.aniso));
3854
+ anisoVField.SetToolTipValue((mat.anisoV));
3855
+ cameraField.SetToolTipValue((mat.cameralight));
3856
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3857
+ shadowField.SetToolTipValue((mat.shadow));
3858
+ textureField.SetToolTipValue((mat.texture));
3859
+ opacityField.SetToolTipValue((mat.opacity));
3860
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3861
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3862
+ }
3863
+
34893864 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34903865 {
34913866 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3530,6 +3905,7 @@
35303905 || e.getSource() == apertureField
35313906 || e.getSource() == shadowblurField)
35323907 {
3908
+ new Exception().printStackTrace();
35333909 System.exit(0);
35343910 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35353911 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3600,7 +3976,7 @@
36003976 }
36013977
36023978 if (normalpushField != null)
3603
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
3979
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
36043980 }
36053981
36063982 void SnapObject()
....@@ -3855,7 +4231,7 @@
38554231
38564232 radioPanel.revalidate();
38574233 radioPanel.repaint();
3858
- ctrlPanel.revalidate(); // ? new
4234
+ ctrlPanel.validate(); // ? new
38594235 ctrlPanel.repaint();
38604236 }
38614237 }
....@@ -3864,6 +4240,8 @@
38644240
38654241 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38664242 {
4243
+ if (Globals.SAVEONMAKE) // && resetmodel)
4244
+ Save();
38674245 //Tween.set(thing, 0).target(1).start(tweenManager);
38684246 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38694247 // if (thing instanceof GenericJointDemo)
....@@ -3950,6 +4328,12 @@
39504328 {
39514329 ResetModel();
39524330 Select(thing.GetTreePath(), true, false); // unselect... false);
4331
+
4332
+ if (thing.Size() == 0)
4333
+ {
4334
+ //EditSelection(false);
4335
+ }
4336
+
39534337 refreshContents();
39544338 }
39554339
....@@ -4067,6 +4451,7 @@
40674451 }
40684452 }
40694453 }
4454
+
40704455 LoadGFDThread loadGFDThread;
40714456
40724457 void ReadGFD(String fullname, iCallBack cb)
....@@ -4086,8 +4471,10 @@
40864471
40874472 try
40884473 {
4474
+ // Try compressed version first.
40894475 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4090
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4476
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4477
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40914478
40924479 readobj = (Object3D) p.readObject();
40934480 istream.close();
....@@ -4095,7 +4482,20 @@
40954482 readobj.ResetDisplayList();
40964483 } catch (Exception e)
40974484 {
4098
- e.printStackTrace();
4485
+ //e.printStackTrace();
4486
+ try
4487
+ {
4488
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4489
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4490
+
4491
+ readobj = (Object3D) p.readObject();
4492
+ istream.close();
4493
+
4494
+ readobj.ResetDisplayList();
4495
+ } catch (Exception e2)
4496
+ {
4497
+ e2.printStackTrace();
4498
+ }
40994499 }
41004500 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
41014501 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4141,6 +4541,12 @@
41414541
41424542 void LoadIt(Object obj)
41434543 {
4544
+ if (obj == null)
4545
+ {
4546
+ // Invalid file
4547
+ return;
4548
+ }
4549
+
41444550 System.out.println("Loaded " + obj);
41454551 //new Exception().printStackTrace();
41464552 Object3D readobj = (Object3D) obj;
....@@ -4150,6 +4556,8 @@
41504556
41514557 if (readobj != null)
41524558 {
4559
+ if (Globals.SAVEONMAKE)
4560
+ Save();
41534561 try
41544562 {
41554563 //readobj.deepCopySelf(copy);
....@@ -4212,7 +4620,7 @@
42124620
42134621 void load() // throws ClassNotFoundException
42144622 {
4215
- if (GrafreeD.standAlone)
4623
+ if (Grafreed.standAlone)
42164624 {
42174625 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42184626 browser.show();
....@@ -4299,11 +4707,13 @@
42994707 try
43004708 {
43014709 FileOutputStream ostream = new FileOutputStream(lastname);
4302
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4710
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4711
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43034712
43044713 p.writeObject(copy);
43054714 p.flush();
43064715
4716
+ zstream.close();
43074717 ostream.close();
43084718
43094719 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4313,11 +4723,12 @@
43134723 {
43144724 }
43154725 }
4726
+
43164727 String lastname;
43174728
43184729 void saveAs()
43194730 {
4320
- if (GrafreeD.standAlone)
4731
+ if (Grafreed.standAlone)
43214732 {
43224733 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43234734 browser.setVisible(true);
....@@ -4422,13 +4833,13 @@
44224833 try
44234834 {
44244835 FileOutputStream ostream = new FileOutputStream(filename);
4425
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4426
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4836
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4837
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44274838
44284839 Object3D objectparent = obj.parent;
44294840 obj.parent = null;
44304841
4431
- Object3D object = (Object3D) GrafreeD.clone(obj);
4842
+ Object3D object = (Object3D) Grafreed.clone(obj);
44324843
44334844 obj.parent = objectparent;
44344845
....@@ -4440,8 +4851,8 @@
44404851 p.writeObject(object);
44414852 p.flush();
44424853
4854
+ zstream.close();
44434855 ostream.close();
4444
- // zstream.close();
44454856
44464857 // group.selection.get(0).parent = parent;
44474858 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4462,7 +4873,7 @@
44624873 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44634874 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44644875 copy.generatePOV(buffer);
4465
- if (GrafreeD.standAlone)
4876
+ if (Grafreed.standAlone)
44664877 {
44674878 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44684879 browser.show();
....@@ -4488,7 +4899,8 @@
44884899 Object3D client;
44894900 Object3D copy;
44904901 MenuBar menuBar;
4491
- Menu windowMenu;
4902
+ Menu fileMenu;
4903
+ MenuItem newItem;
44924904 MenuItem loadItem;
44934905 MenuItem saveItem;
44944906 MenuItem saveAsItem;
....@@ -4496,13 +4908,11 @@
44964908 MenuItem reexportItem;
44974909 MenuItem povItem;
44984910 MenuItem closeItem;
4499
- Menu cameraMenu;
4911
+
45004912 CheckboxMenuItem zBufferItem;
45014913 //MenuItem normalLensItem;
4502
- MenuItem editCameraItem;
4503
- MenuItem revertCameraItem;
4504
- CheckboxMenuItem toggleLiveItem;
45054914 MenuItem stepItem;
4915
+ CheckboxMenuItem toggleLiveItem;
45064916 CheckboxMenuItem toggleFullScreenItem;
45074917 CheckboxMenuItem toggleTimelineItem;
45084918 CheckboxMenuItem toggleRenderItem;
....@@ -4511,28 +4921,40 @@
45114921 CheckboxMenuItem toggleFootContactItem;
45124922 CheckboxMenuItem toggleDLItem;
45134923 CheckboxMenuItem toggleTextureItem;
4514
- CheckboxMenuItem toggleRandomItem;
4924
+ CheckboxMenuItem toggleSwitchItem;
45154925 CheckboxMenuItem toggleRootItem;
45164926 CheckboxMenuItem animationItem;
45174927 CheckboxMenuItem toggleHandleItem;
45184928 CheckboxMenuItem togglePaintItem;
45194929 JSplitPane mainPanel;
45204930 JScrollPane scrollpane;
4931
+
45214932 JPanel toolbarPanel;
4522
- JPanel treePanel;
4933
+
4934
+ cGridBag treePanel;
4935
+
45234936 JPanel radioPanel;
45244937 ButtonGroup buttonGroup;
4525
- JPanel ctrlPanel;
4526
- JPanel materialPanel;
4938
+
4939
+ cGridBag toolboxPanel;
4940
+ cGridBag materialPanel;
4941
+ cGridBag ctrlPanel;
4942
+
45274943 JScrollPane infoPanel;
4528
- JPanel optionsPanel;
4944
+
4945
+ cGridBag optionsPanel;
4946
+
45294947 JTabbedPane objectPanel;
4530
- JPanel XYZPanel;
4948
+
4949
+ cGridBag XYZPanel;
4950
+
45314951 JSplitPane gridPanel;
45324952 JSplitPane bigPanel;
4533
- JPanel bigThree;
4534
- JTabbedPane scenePanel;
4535
- JPanel centralPanel;
4953
+
4954
+ cGridBag bigThree;
4955
+ cGridBag scenePanel;
4956
+ cGridBag centralPanel;
4957
+ JSplitPane cameraPanel;
45364958 JPanel timelinePanel;
45374959 JMenuBar timelineMenubar;
45384960 JSplitPane framePanel;
....@@ -4584,67 +5006,72 @@
45845006 // MATERIAL
45855007 JLabel materialLabel;
45865008 JLabel colorLabel;
4587
- NumberSlider colorField;
5009
+ cNumberSlider colorField;
45885010 JLabel modulationLabel;
4589
- NumberSlider modulationField;
5011
+ cNumberSlider modulationField;
45905012 JLabel metalnessLabel;
4591
- NumberSlider metalnessField;
5013
+ cNumberSlider metalnessField;
45925014 JLabel diffuseLabel;
4593
- NumberSlider diffuseField;
5015
+ cNumberSlider diffuseField;
45945016 JLabel specularLabel;
4595
- NumberSlider specularField;
5017
+ cNumberSlider specularField;
45965018 JLabel shininessLabel;
4597
- NumberSlider shininessField;
5019
+ cNumberSlider shininessField;
45985020 JLabel shiftLabel;
4599
- NumberSlider shiftField;
5021
+ cNumberSlider shiftField;
46005022 JLabel ambientLabel;
4601
- NumberSlider ambientField;
5023
+ cNumberSlider ambientField;
46025024 JLabel lightareaLabel;
4603
- NumberSlider lightareaField;
5025
+ cNumberSlider lightareaField;
46045026 JLabel diffusenessLabel;
4605
- NumberSlider diffusenessField;
5027
+ cNumberSlider diffusenessField;
46065028 JLabel velvetLabel;
4607
- NumberSlider velvetField;
5029
+ cNumberSlider velvetField;
46085030 JLabel sheenLabel;
4609
- NumberSlider sheenField;
5031
+ cNumberSlider sheenField;
46105032 JLabel subsurfaceLabel;
4611
- NumberSlider subsurfaceField;
5033
+ cNumberSlider subsurfaceField;
46125034 //JLabel bumpLabel;
46135035 //NumberSlider bumpField;
46145036 JLabel backlitLabel;
4615
- NumberSlider backlitField;
5037
+ cNumberSlider backlitField;
46165038 JLabel anisoLabel;
4617
- NumberSlider anisoField;
5039
+ cNumberSlider anisoField;
46185040 JLabel anisoVLabel;
4619
- NumberSlider anisoVField;
5041
+ cNumberSlider anisoVField;
46205042 JLabel cameraLabel;
4621
- NumberSlider cameraField;
5043
+ cNumberSlider cameraField;
46225044 JLabel selfshadowLabel;
4623
- NumberSlider selfshadowField;
5045
+ cNumberSlider selfshadowField;
46245046 JLabel shadowLabel;
4625
- NumberSlider shadowField;
5047
+ cNumberSlider shadowField;
46265048 JLabel textureLabel;
4627
- NumberSlider textureField;
5049
+ cNumberSlider textureField;
46285050 JLabel opacityLabel;
4629
- NumberSlider opacityField;
5051
+ cNumberSlider opacityField;
46305052 JLabel fakedepthLabel;
4631
- NumberSlider fakedepthField;
5053
+ cNumberSlider fakedepthField;
46325054 JLabel shadowbiasLabel;
4633
- NumberSlider shadowbiasField;
5055
+ cNumberSlider shadowbiasField;
46345056 JLabel bumpLabel;
4635
- NumberSlider bumpField;
5057
+ cNumberSlider bumpField;
46365058 JLabel noiseLabel;
4637
- NumberSlider noiseField;
5059
+ cNumberSlider noiseField;
46385060 JLabel powerLabel;
4639
- NumberSlider powerField;
5061
+ cNumberSlider powerField;
46405062 JLabel borderfadeLabel;
4641
- NumberSlider borderfadeField;
5063
+ cNumberSlider borderfadeField;
46425064 JLabel fogLabel;
4643
- NumberSlider fogField;
5065
+ cNumberSlider fogField;
46445066 JLabel opacityPowerLabel;
4645
- NumberSlider opacityPowerField;
4646
- JTree jTree;
5067
+ cNumberSlider opacityPowerField;
5068
+ cTree jTree;
46475069 //ObjectUI parent;
46485070
4649
- NumberSlider normalpushField;
5071
+ cNumberSlider normalpushField;
5072
+
5073
+ private MenuItem importGFDItem;
5074
+ private MenuItem importVRMLX3DItem;
5075
+ private MenuItem import3DSItem;
5076
+ private MenuItem importOBJItem;
46505077 }