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,51 +188,62 @@
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);
231
+
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);
163239 }
164240
165241 public ObjEditor GetEditor()
166242 {
167243 return objEditor; //.GetEditor();
168244 }
245
+
246
+ // Sometimes myself, sometimes my callee's.
169247 ObjEditor objEditor;
170248
171249 /*
....@@ -228,6 +306,7 @@
228306 //localCopy.parent = null;
229307
230308 frame = new JFrame();
309
+ frame.setUndecorated(true);
231310 objEditor = this;
232311 this.callee = callee;
233312
....@@ -261,24 +340,40 @@
261340 void SetupMenu()
262341 {
263342 frame.setMenuBar(menuBar = new MenuBar());
264
- menuBar.add(windowMenu = new Menu("File"));
265
- windowMenu.add(loadItem = new MenuItem("Load..."));
266
- windowMenu.add("-");
267
- windowMenu.add(saveItem = new MenuItem("Save"));
268
- 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..."));
269363 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
270
- windowMenu.add("-");
271
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
272
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
273
- windowMenu.add("-");
364
+ fileMenu.add("-");
365
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
366
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
367
+ fileMenu.add("-");
274368 if (client.parent != null)
275369 {
276
- windowMenu.add(closeItem = new MenuItem("Close"));
370
+ fileMenu.add(closeItem = new MenuItem("Close"));
277371 } else
278372 {
279
- windowMenu.add(closeItem = new MenuItem("Exit"));
373
+ fileMenu.add(closeItem = new MenuItem("Exit"));
280374 }
281375
376
+ newItem.addActionListener(this);
282377 loadItem.addActionListener(this);
283378 saveItem.addActionListener(this);
284379 saveAsItem.addActionListener(this);
....@@ -287,79 +382,38 @@
287382 //povItem.addActionListener(this);
288383 closeItem.addActionListener(this);
289384
290
- menuBar.add(cameraMenu = new Menu("View"));
291
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
292
- //zBufferItem.addActionListener(this);
293
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
294
- //normalLensItem.addActionListener(this);
295
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
296
- revertCameraItem.addActionListener(this);
297
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
298
- toggleTimelineItem.addItemListener(this);
299
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
300
- toggleFullScreenItem.addItemListener(this);
301
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
302
- cameraMenu.add("-");
303
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
304
- toggleTextureItem.addItemListener(this);
305
- toggleTextureItem.setState(CameraPane.textureon);
306
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
307
- toggleLiveItem.addItemListener(this);
308
- toggleLiveItem.setState(CameraPane.isLIVE());
309
- cameraMenu.add(stepItem = new MenuItem("Step"));
310
- stepItem.addActionListener(this);
311
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
312
-// toggleDLItem.addItemListener(this);
313
-// toggleDLItem.setState(false);
314
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
315
- toggleRenderItem.addItemListener(this);
316
- toggleRenderItem.setState(!CameraPane.frozen);
317
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
318
- toggleDebugItem.addItemListener(this);
319
- toggleDebugItem.setState(CameraPane.DEBUG);
320
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
321
- toggleFrustumItem.addItemListener(this);
322
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
323
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
324
- toggleFootContactItem.addItemListener(this);
325
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
326
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
327
- toggleRandomItem.addItemListener(this);
328
- toggleRandomItem.setState(CameraPane.RANDOM);
329
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
330
- toggleHandleItem.addItemListener(this);
331
- toggleHandleItem.setState(CameraPane.HANDLES);
332
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
333
- togglePaintItem.addItemListener(this);
334
- togglePaintItem.setState(CameraPane.PAINTMODE);
335
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
336
-// toggleRootItem.addItemListener(this);
337
-// toggleRootItem.setState(false);
338
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
339
-// animationItem.addItemListener(this);
340
-// animationItem.setState(CameraPane.ANIMATION);
341
- cameraMenu.add("-");
342
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
343
- editCameraItem.addActionListener(this);
344
-
345385 objectPanel = new JTabbedPane();
346386 toolbarPanel = new JPanel();
347387 toolbarPanel.setName("Toolbar");
348
- treePanel = new JPanel();
388
+ treePanel = new cGridBag();
349389 treePanel.setName("Tree");
350
- ctrlPanel = new JPanel(); // new GridBagLayout());
351
- ctrlPanel.setName("Edit");
352
- 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);
353404 materialPanel.setName("Material");
405
+
354406 /*JTextPane*/
355407 infoarea = createTextPane();
408
+ doc = infoarea.getStyledDocument();
409
+
356410 infoarea.setEditable(true);
357411 SetText();
358412 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
359413 // infoarea.setOpaque(false);
360414 // //infoarea.setForeground(textcolor);
361
- infoarea.setLineWrap(true);
362
- infoarea.setWrapStyleWord(true);
415
+// TEXTAREA infoarea.setLineWrap(true);
416
+// TEXTAREA infoarea.setWrapStyleWord(true);
363417 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
364418 infoPanel.setPreferredSize(new Dimension(50, 200));
365419 infoPanel.setName("Info");
....@@ -370,16 +424,16 @@
370424 mainPanel.setName("Main");
371425 mainPanel.setContinuousLayout(true);
372426 mainPanel.setOneTouchExpandable(true);
373
- mainPanel.setDividerLocation(1.0);
374427 mainPanel.setDividerSize(9);
375
- mainPanel.setResizeWeight(0);
428
+ mainPanel.setDividerLocation(0.5); //1.0);
429
+ mainPanel.setResizeWeight(0.5);
376430
377431 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
378432 //mainPanel.setLayout(new GridBagLayout());
379433 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
380
- treePanel.setLayout(new GridBagLayout());
381
- ctrlPanel.setLayout(new GridBagLayout());
382
- materialPanel.setLayout(new GridBagLayout());
434
+// treePanel.setLayout(new GridBagLayout());
435
+ //ctrlPanel.setLayout(new GridBagLayout());
436
+ //materialPanel.setLayout(new GridBagLayout());
383437
384438 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
385439 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -418,7 +472,7 @@
418472 static String newline = "\n";
419473 protected static final String buttonString = "JButton";
420474 StyledDocument doc;
421
- JTextArea infoarea;
475
+ JTextPane infoarea;
422476
423477 void ClearInfo()
424478 {
....@@ -441,10 +495,10 @@
441495 e.printStackTrace();
442496 }
443497
444
- String selection = infoarea.getText();
445
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
446
- java.awt.datatransfer.Clipboard clipboard =
447
- 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();
448502 //clipboard.setContents(data, data);
449503 }
450504
....@@ -467,13 +521,13 @@
467521 //SendInfo("Name:", "bold");
468522 if (sel.GetTextures() != null || debug)
469523 {
470
- si.SendInfo(sel.toString(), "bold");
524
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
471525 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
472526 if (sel.Size() > 0)
473527 {
474528 si.SendInfo("#children = " + sel.Size(), "regular");
475529 }
476
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
530
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
477531 if (debug)
478532 {
479533 try
....@@ -485,7 +539,10 @@
485539 }
486540
487541 if (full)
488
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
542
+ {
543
+ si.SendInfo(" BBox min: " + minima, "regular");
544
+ si.SendInfo(" BBox max: " + maxima, "regular");
545
+ }
489546
490547 if (sel.bRep != null)
491548 {
....@@ -512,7 +569,7 @@
512569 }
513570 if (sel.support != null)
514571 {
515
- si.SendInfo(" support: " + sel.support, "regular");
572
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
516573 }
517574 if (sel.scriptnode != null)
518575 {
....@@ -583,6 +640,9 @@
583640 {
584641 CameraPane.pointflow = (PointFlow) sel;
585642 }
643
+
644
+ si.SendInfo("_____________________", "regular");
645
+ si.SendInfo("", "regular");
586646 }
587647 }
588648
....@@ -598,68 +658,140 @@
598658 }
599659 }
600660
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
+
601703 void ToggleFullScreen()
602704 {
603705 if (CameraPane.FULLSCREEN)
604706 {
605
- frame.getContentPane().remove(/*"Center",*/bigThree);
606
- framePanel.add(bigThree);
607
- 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
+
608725 } else
609726 {
610
- frame.getContentPane().remove(/*"Center",*/framePanel);
611
- framePanel.remove(bigThree);
612
- 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);
613744 }
745
+
614746 cameraView.ToggleFullScreen();
615747 }
616748
617
- private JTextArea createTextPane()
749
+ private JTextPane createTextPane()
618750 {
619
- String[] initString =
620
- {
621
- "This is an editable JTextPane, ", //regular
622
- "another ", //italic
623
- "styled ", //bold
624
- "text ", //small
625
- "component, ", //large
626
- "which supports embedded components..." + newline,//regular
627
- " " + newline, //button
628
- "...and embedded icons..." + newline, //regular
629
- " ", //icon
630
- newline + "JTextPane is a subclass of JEditorPane that "
631
- + "uses a StyledEditorKit and StyledDocument, and provides "
632
- + "cover methods for interacting with those objects."
633
- };
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
+// }
634793
635
- String[] initStyles =
636
- {
637
- "regular", "italic", "bold", "small", "large",
638
- "regular", "button", "regular", "icon",
639
- "regular"
640
- };
641
-
642
- JTextPane textPane = new JTextPane();
643
- textPane.setEditable(true);
644
- /*StyledDocument*/ doc = textPane.getStyledDocument();
645
- addStylesToDocument(doc);
646
-
647
- try
648
- {
649
- for (int j = 0; j < 2; j++)
650
- {
651
- for (int i = 0; i < initString.length; i++)
652
- {
653
- doc.insertString(doc.getLength(), initString[i],
654
- doc.getStyle(initStyles[i]));
655
- }
656
- }
657
- } catch (BadLocationException ble)
658
- {
659
- System.err.println("Couldn't insert initial text into text pane.");
660
- }
661
-
662
- return new JTextArea(); // textPane;
794
+ return new JTextPane(); // textPane;
663795 }
664796
665797 protected void addStylesToDocument(StyledDocument doc)
....@@ -712,7 +844,7 @@
712844 protected static ImageIcon createImageIcon(String path,
713845 String description)
714846 {
715
- java.net.URL imgURL = GrafreeD.class.getResource(path);
847
+ java.net.URL imgURL = Grafreed.class.getResource(path);
716848 if (imgURL != null)
717849 {
718850 return new ImageIcon(imgURL, description);
....@@ -744,6 +876,7 @@
744876 // NumberSlider vDivsField;
745877 // JCheckBox endcaps;
746878 JCheckBox liveCB;
879
+ JCheckBox selectCB;
747880 JCheckBox hideCB;
748881 JCheckBox link2masterCB;
749882 JCheckBox markCB;
....@@ -759,115 +892,87 @@
759892 JButton slowerButton;
760893 JButton fasterButton;
761894 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;
762905
763
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
906
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
764907 {
765908 JCheckBox cb;
766909
767
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
768
- oe.aConstraints.gridwidth = 1; // 3;
769
-// oe.aConstraints.weightx = 1;
770
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
771
- 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);
772911 cb.addItemListener(this);
773
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
774
- oe.aConstraints.gridwidth = 1;
775
- oe.aConstraints.gridx += 1;
776912
777913 return cb;
778914 }
779915
780
- cButton AddButton(ObjEditor oe, String label)
916
+ cButton AddButton(cGridBag panel, String label)
781917 {
782918 cButton cb;
783919
784
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
785
- oe.aConstraints.gridwidth = 1;
786
-// oe.aConstraints.weightx = 1;
787
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
788
- 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);
789921 cb.addActionListener(this);
790
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
791
- oe.aConstraints.gridwidth = 1;
792
- oe.aConstraints.gridx += 1;
793922
794923 return cb;
795924 }
796925
797
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
926
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
798927 {
799928 JComboBox combo;
800929
801
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
802
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
803
- oe.aConstraints.gridx += 1;
930
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
804931 combo.addActionListener(this);
805932
806933 return combo;
807934 }
808935
809
- 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)
810937 {
811
- NumberSlider combo;
938
+ cGridBag control = new cGridBag();
939
+
940
+ cNumberSlider combo;
812941
813942 JLabel jlabel = new JLabel(label);
814
-
815
- aConstraints.fill = GridBagConstraints.VERTICAL;
816943 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
817
- aConstraints.gridwidth = 2;
818
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
819
- aConstraints.gridx += 1;
820
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
821
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
822
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
823
- aConstraints.gridx += 1;
824
- aConstraints.gridwidth = 1;
825
-
944
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
945
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
826946 combo.setFloat(current);
827
-
828
- combo.label = jlabel;
829
-
830
- combo.addChangeListener(this);
831
-
832
- return combo;
947
+
948
+ panel.add(control);
949
+
950
+ return control;
833951 }
834952
835
- 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)
836954 {
837
- NumberSlider combo;
955
+ cGridBag control = new cGridBag();
956
+
957
+ cNumberSlider combo;
838958
839959 JLabel jlabel = new JLabel(label);
840
-
841
- aConstraints.fill = GridBagConstraints.VERTICAL;
842960 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
843
- aConstraints.gridwidth = 2;
844
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
845
- aConstraints.gridx += 1;
846
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
847
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
848
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
851
-
961
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
962
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
852963 combo.setInteger(current);
853964
854
- combo.label = jlabel;
855
-
856
- combo.addChangeListener(this);
857
-
858
- return combo;
965
+ panel.add(control);
966
+
967
+ return control;
859968 }
860969
861
- JTextArea AddText(JPanel ctrlPanel, String name)
970
+ JTextArea AddText(cGridBag ctrlPanel, String name)
862971 {
863972 JTextArea text;
864973
865
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
866
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
867
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
974
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
868975 text.addCaretListener(this);
869
- aConstraints.gridx += 1;
870
- aConstraints.gridwidth = 1;
871976
872977 return text;
873978 }
....@@ -897,9 +1002,16 @@
8971002 objEditor.ctrlPanel.remove(j);
8981003 }
8991004
1005
+ void Remove(cNumberSlider j)
1006
+ {
1007
+ j.removeChangeListener(this);
1008
+ //objEditor.ctrlPanel.remove(j.label);
1009
+ objEditor.ctrlPanel.remove(j);
1010
+ }
1011
+
9001012 /*
9011013 */
902
- void Return() // ObjEditor oe)
1014
+ void Return0() // ObjEditor oe)
9031015 {
9041016 aConstraints.gridy += 1;
9051017 aConstraints.gridx = 0;
....@@ -954,35 +1066,77 @@
9541066
9551067 void SetupUI2(ObjEditor oe)
9561068 {
957
-// oe.aConstraints.weightx = 0;
958
-// oe.aConstraints.weighty = 0;
959
-// oe.aConstraints.gridx = 0;
960
-// oe.aConstraints.gridy = 0;
961
- 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();
9621078
9631079 if (!GroupEditor.allparams)
9641080 return;
9651081
966
- liveCB = AddCheckBox(oe, "Live", copy.live);
967
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
968
- 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");
9691088 // Return();
970
- markCB = AddCheckBox(oe, "Mark", copy.marked);
971
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
972
- randomCB = AddCheckBox(oe, "Rand", copy.random);
973
- Return();
974
- resetButton = AddButton(oe, "Reset");
975
- 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");
9761121 // resetAllButton = AddButton(oe, "Reset All");
9771122 // stepAllButton = AddButton(oe, "Step All");
978
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9791123 // Return();
980
- slowerButton = AddButton(oe, "Slow");
981
- fasterButton = AddButton(oe, "Fast");
982
- 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");
9831130
984
- Return();
1131
+ oe.ctrlPanel.add(objectCommandsPanel);
1132
+ oe.ctrlPanel.Return();
9851133
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();
1139
+
9861140 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871141 // ObjEditor.aConstraints.gridx += 1;
9881142
....@@ -1076,7 +1230,7 @@
10761230 oe.aConstraints.gridwidth = 1;
10771231 /**/
10781232 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1233
+ oe.ctrlPanel.Return();
10801234
10811235 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821236 //textureButton.setEnabled(false);
....@@ -1178,11 +1332,25 @@
11781332 //JPanel worldPanel =
11791333 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11801334 //worldPanel.setName("World");
1181
- centralPanel = new JPanel(new BorderLayout());
1182
- timelinePanel = new JPanel(new BorderLayout());
1183
- 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);
11841342
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
+
11851352 centralPanel.add(cameraView);
1353
+ centralPanel.setFocusable(true);
11861354 //frame.setJMenuBar(timelineMenubar);
11871355 //centralPanel.add(timelinePanel);
11881356
....@@ -1201,12 +1369,13 @@
12011369 //frontView.object = copy;
12021370 //sideView.object = copy;
12031371
1204
- XYZPanel = new JPanel();
1205
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1372
+ XYZPanel = new cGridBag().setVertical(true);
1373
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12061374
1207
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1208
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1209
- 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);
12101379
12111380 /*
12121381 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1243,11 +1412,13 @@
12431412
12441413 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12451414 //tmp.setName("Edit");
1415
+ objectPanel.add(toolboxPanel);
12461416 objectPanel.add(materialPanel);
1247
- JPanel north = new JPanel(new BorderLayout());
1248
- north.setName("Edit");
1249
- north.add(ctrlPanel, BorderLayout.NORTH);
1250
- 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);
12511422 objectPanel.add(infoPanel);
12521423
12531424 /*
....@@ -1268,16 +1439,23 @@
12681439 scrollpane.setWheelScrollingEnabled(true);
12691440 scrollpane.addMouseWheelListener(this); // Default not fast enough
12701441
1271
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1272
- scenePanel.add(scrollpane);
1442
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1443
+ scenePanel.preferredWidth = 6;
1444
+
1445
+ JTabbedPane tabbedPane = new JTabbedPane();
1446
+ tabbedPane.add(scrollpane);
12731447
1274
- scenePanel.add(FSPane = new cFileSystemPane(this));
1448
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12751449
1276
- optionsPanel = new JPanel(new GridBagLayout());
1450
+ optionsPanel = new cGridBag().setVertical(true);
12771451
12781452 optionsPanel.setName("Options");
1279
- scenePanel.add(optionsPanel);
1280
-
1453
+
1454
+ AddOptions(optionsPanel); //, aConstraints);
1455
+
1456
+ tabbedPane.add(optionsPanel);
1457
+
1458
+ scenePanel.add(tabbedPane);
12811459
12821460 /*
12831461 cTree jTree = new cTree(null);
....@@ -1311,6 +1489,7 @@
13111489 //bigPanel.setSize(new Dimension(10,10));
13121490 //bigPanel.add(ctrlPanel);
13131491 //bigPanel.add(gridPanel);
1492
+ /**
13141493 bigThree = new JPanel();
13151494 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13161495 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1334,7 +1513,13 @@
13341513 // aConstraints.gridheight = 3;
13351514 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13361515 bigThree.add(XYZPanel, aWindowConstraints);
1516
+ /**/
13371517
1518
+ bigThree = new cGridBag();
1519
+ bigThree.addComponent(scenePanel);
1520
+ bigThree.addComponent(centralPanel);
1521
+ bigThree.addComponent(XYZPanel);
1522
+
13381523 // // SIDE EFFECT!!!
13391524 // aConstraints.gridx = 0;
13401525 // aConstraints.gridy = 0;
....@@ -1355,14 +1540,17 @@
13551540 //worldPane.add(bigPanel);
13561541 //worldPane.add(worldPanel);
13571542 /**/
1358
- frame.getContentPane().add(/*"Center",*/framePanel);
1543
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1544
+ frame.add(/*"Center",*/framePanel);
13591545 //frame.getContentPane().add(/*"Center",*/ worldPane);
13601546
13611547 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13621548
1363
- frame.setSize(1024, 768);
1364
- frame.show();
1549
+ frame.setSize(1280, 860);
1550
+ frame.setVisible(true);
13651551
1552
+ cameraView.requestFocusInWindow();
1553
+
13661554 gridPanel.setDividerLocation(1.0);
13671555
13681556 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1376,6 +1564,10 @@
13761564 });
13771565 }
13781566
1567
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1568
+ {
1569
+ }
1570
+
13791571 JTree GetTree()
13801572 {
13811573 return objEditor.jTree;
....@@ -1387,260 +1579,173 @@
13871579 ctrlPanel.removeAll();
13881580 }
13891581
1390
- void SetupMaterial(JPanel ctrlPanel)
1582
+ void SetupMaterial(cGridBag panel)
13911583 {
1392
- aConstraints.weighty = 0;
1393
- //aConstraints.weightx = 1;
1394
- /*
1584
+ /*
13951585 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13961586 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1397
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1398
- aConstraints.gridx += 1;
13991587 */
14001588
1401
- aConstraints.gridwidth = 1;
1402
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1403
- aConstraints.gridx += 1;
1404
- aConstraints.weighty = 0;
1405
- 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");
14061593
14071594 /*
14081595 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1409
- aConstraints.gridx += 1;
1410
- aConstraints.weighty = 0;
1411
- aConstraints.gridwidth = 1;
14121596 */
14131597
1414
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1415
- 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
+ }
14161607
1417
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1418
-
1419
- aConstraints.gridx += 1;
1420
-
1421
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1422
-
1423
- aConstraints.gridx += 1;
1424
-
1425
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1426
-
1427
- aConstraints.gridx = 0;
1428
- aConstraints.gridy += 1;
1429
- aConstraints.weighty = 0;
1430
- aConstraints.gridwidth = 1;
1608
+ editBar.preferredHeight = 15;
1609
+
1610
+ panel.add(editBar);
1611
+
14311612 /**/
14321613 //aConstraints.weighty = 0;
14331614 ////aConstraints.weightx = 1;
14341615 //aConstraints.weighty = 1;
14351616 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14361617 //aConstraints.gridx += 1;
1437
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1438
- aConstraints.weighty = 0;
1439
- aConstraints.gridx = 0;
1440
- aConstraints.gridy += 1;
1441
- aConstraints.gridwidth = 1;
1618
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14421619
1443
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1444
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1445
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1446
- aConstraints.gridx += 1;
1447
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1448
- //aConstraints.weightx = 0;
1449
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1450
- aConstraints.gridx = 0;
1451
- aConstraints.gridy += 1;
1452
- 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);
14531628
1454
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1455
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1456
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1457
- aConstraints.gridx += 1;
1458
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1459
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1460
- aConstraints.gridx = 0;
1461
- aConstraints.gridy += 1;
1462
- 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);
14631634
1464
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1465
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1466
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1467
- aConstraints.gridx += 1;
1468
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1469
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1470
- aConstraints.gridx = 0;
1471
- aConstraints.gridy += 1;
1472
- 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);
14731640
1474
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1475
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1476
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1477
- aConstraints.gridx += 1;
1478
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1479
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1480
- aConstraints.gridx = 0;
1481
- aConstraints.gridy += 1;
1482
- 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);
14831646
1484
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1485
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1486
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1487
- aConstraints.gridx += 1;
1488
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1489
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1490
- aConstraints.gridx = 0;
1491
- aConstraints.gridy += 1;
1492
- 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);
14931652
1494
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1495
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1496
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1497
- aConstraints.gridx += 1;
1498
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1499
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1500
- aConstraints.gridx = 0;
1501
- aConstraints.gridy += 1;
1502
- 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);
15031658
1504
- //aConstraints.weighty = 1;
1505
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1506
- //aConstraints.gridx += 1;
1507
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1508
- aConstraints.weighty = 0;
1509
- aConstraints.gridx = 0;
1510
- aConstraints.gridy += 1;
1511
- 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);
15121672
1513
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1514
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1515
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1516
- aConstraints.gridx += 1;
1517
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1518
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1519
- aConstraints.gridx = 0;
1520
- aConstraints.gridy += 1;
1521
- 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);
15221678
1523
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1524
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1525
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1526
- aConstraints.gridx += 1;
1527
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1528
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1529
- aConstraints.gridx = 0;
1530
- aConstraints.gridy += 1;
1531
- 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);
15321684
1533
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1534
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1535
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1536
- aConstraints.gridx += 1;
1537
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1538
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1539
- aConstraints.gridx = 0;
1540
- aConstraints.gridy += 1;
1541
- 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);
15421690
1543
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1544
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1545
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1546
- aConstraints.gridx += 1;
1547
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1548
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1549
- aConstraints.gridx = 0;
1550
- aConstraints.gridy += 1;
1551
- 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);
15521696
1553
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1554
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1555
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1556
- aConstraints.gridx += 1;
1557
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1558
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1559
- aConstraints.gridx = 0;
1560
- aConstraints.gridy += 1;
1561
- 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);
15621702
1563
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1564
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1565
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1566
- aConstraints.gridx += 1;
1567
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1568
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1569
- aConstraints.gridx = 0;
1570
- aConstraints.gridy += 1;
1571
- 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);
15721708
1573
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1574
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1575
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1576
- aConstraints.gridx += 1;
1577
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1578
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1579
- aConstraints.gridx = 0;
1580
- aConstraints.gridy += 1;
1581
- 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);
15821716
1583
- //aConstraints.weighty = 1;
1584
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1585
- //aConstraints.gridx += 1;
1586
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1587
- aConstraints.weighty = 0;
1588
- aConstraints.gridx = 0;
1589
- aConstraints.gridy += 1;
1590
- 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);
15911722
1592
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1593
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1594
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1595
- aConstraints.gridx += 1;
1596
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1597
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1598
- aConstraints.gridx = 0;
1599
- aConstraints.gridy += 1;
1600
- 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);
16011728
1602
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1603
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1604
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1605
- aConstraints.gridx += 1;
1606
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1607
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1608
- aConstraints.gridx = 0;
1609
- aConstraints.gridy += 1;
1610
- 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);
16111734
1612
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1613
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1614
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1615
- aConstraints.gridx += 1;
1616
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1617
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1618
- aConstraints.gridx = 0;
1619
- aConstraints.gridy += 1;
1620
- 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);
16211740
1622
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1623
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1624
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1625
- aConstraints.gridx += 1;
1626
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1627
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1628
- aConstraints.gridx = 0;
1629
- aConstraints.gridy += 1;
1630
- 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);
16311746
1632
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1633
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1634
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1635
- aConstraints.gridx += 1;
1636
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1637
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1638
- aConstraints.gridx = 0;
1639
- aConstraints.gridy += 1;
1640
- aConstraints.gridwidth = 1;
1641
-
1642
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1643
- Return();
1747
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1748
+ //Return();
16441749 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16451750 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16461751 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1651,130 +1756,93 @@
16511756 // aConstraints.gridy += 1;
16521757 // aConstraints.gridwidth = 1;
16531758
1654
- //aConstraints.weighty = 1;
1655
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1656
- //aConstraints.gridx += 1;
1657
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1658
- aConstraints.weighty = 0;
1659
- aConstraints.gridx = 0;
1660
- aConstraints.gridy += 1;
1661
- aConstraints.gridwidth = 1;
16621759
1663
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1664
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1665
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1666
- aConstraints.gridx += 1;
1667
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1668
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1669
- aConstraints.gridx = 0;
1670
- aConstraints.gridy += 1;
1671
- 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);
16721767
1673
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1674
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1675
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1676
- aConstraints.gridx += 1;
1677
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1678
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1679
- aConstraints.gridx = 0;
1680
- aConstraints.gridy += 1;
1681
- 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);
16821773
1683
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1684
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1685
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1686
- aConstraints.gridx += 1;
1687
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1688
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1689
- aConstraints.gridx = 0;
1690
- aConstraints.gridy += 1;
1691
- 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);
16921779
1693
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1694
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1695
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1696
- aConstraints.gridx += 1;
1697
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1698
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1699
- aConstraints.gridx = 0;
1700
- aConstraints.gridy += 1;
1701
- aConstraints.gridwidth = 1;
1702
- 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);
17031785
1704
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1705
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1706
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1707
- aConstraints.gridx += 1;
1708
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1709
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1710
- aConstraints.gridx = 0;
1711
- aConstraints.gridy += 1;
1712
- 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);
17131791
1714
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1715
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1716
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1717
- aConstraints.gridx += 1;
1718
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1719
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1720
- aConstraints.gridx = 0;
1721
- aConstraints.gridy += 1;
1722
- 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);
17231799
1724
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1725
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1726
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1727
- aConstraints.gridx += 1;
1728
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1729
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1730
- aConstraints.gridx = 0;
1731
- aConstraints.gridy += 1;
1732
- 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);
17331805
1734
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1735
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1736
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1737
- aConstraints.gridx += 1;
1738
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1739
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1740
- aConstraints.gridx = 0;
1741
- aConstraints.gridy += 1;
1742
- 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);
17431811
1744
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1745
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1746
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1747
- aConstraints.gridx += 1;
1748
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1749
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1750
- aConstraints.gridx = 0;
1751
- aConstraints.gridy += 1;
1752
- 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);
17531817
1754
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1755
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1756
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1757
- aConstraints.gridx += 1;
1758
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1759
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1760
- aConstraints.gridx = 0;
1761
- aConstraints.gridy += 1;
1762
- 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);
17631823
1764
- //aConstraints.weighty = 1;
1765
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1766
- //aConstraints.gridx += 1;
1767
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1768
- 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);
17691829
1770
- aConstraints.gridx = 0;
1771
- aConstraints.gridy = 0;
1772
- 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);
17731841
17741842 SetMaterial(copy); // .GetMaterial());
17751843
1776
- colorField.addChangeListener(this);
1777
- modulationField.addChangeListener(this);
1844
+ //colorField.addChangeListener(this);
1845
+// modulationField.addChangeListener(this);
17781846 metalnessField.addChangeListener(this);
17791847 diffuseField.addChangeListener(this);
17801848 specularField.addChangeListener(this);
....@@ -1804,12 +1872,15 @@
18041872 opacityPowerField.addChangeListener(this);
18051873 /**/
18061874
1807
- resetSlidersButton.addActionListener(this);
18081875 clearMaterialButton.addActionListener(this);
18091876 createMaterialButton.addActionListener(this);
1810
-
1811
- propagateToggle.addItemListener(this);
1812
- multiplyToggle.addItemListener(this);
1877
+
1878
+ if (Globals.ADVANCED)
1879
+ {
1880
+ resetSlidersButton.addActionListener(this);
1881
+ propagateToggle.addItemListener(this);
1882
+ multiplyToggle.addItemListener(this);
1883
+ }
18131884 }
18141885
18151886 void DropFile(java.io.File[] files, boolean textures)
....@@ -1980,7 +2051,7 @@
19802051
19812052 //? flashIt = false;
19822053 CameraPane pane = (CameraPane) cameraView;
1983
- pane.clickStart(location.x, location.y, 0);
2054
+ pane.clickStart(location.x, location.y, 0, 0);
19842055 pane.clickEnd(location.x, location.y, 0, true);
19852056
19862057 if (group.selection.size() == 1)
....@@ -2029,6 +2100,7 @@
20292100 e2.printStackTrace();
20302101 }
20312102 }
2103
+
20322104 LoadJMEThread loadThread;
20332105
20342106 class LoadJMEThread extends Thread
....@@ -2086,6 +2158,7 @@
20862158 //LoadFile0(filename, converter);
20872159 }
20882160 }
2161
+
20892162 LoadOBJThread loadObjThread;
20902163
20912164 class LoadOBJThread extends Thread
....@@ -2164,19 +2237,19 @@
21642237
21652238 void LoadObjFile(String fullname)
21662239 {
2167
- /*
2240
+ System.out.println("Loading " + fullname);
2241
+ /**/
21682242 //lastFilename = fullname;
21692243 if(loadObjThread == null)
21702244 {
2171
- loadObjThread = new LoadOBJThread();
2172
- loadObjThread.start();
2245
+ loadObjThread = new LoadOBJThread();
2246
+ loadObjThread.start();
21732247 }
21742248
21752249 loadObjThread.add(fullname);
2176
- */
2250
+ /**/
21772251
2178
- System.out.println("Loading " + fullname);
2179
- makeSomething(new FileObject(fullname, true), true);
2252
+ //makeSomething(new FileObject(fullname, true), true);
21802253 }
21812254
21822255 void LoadGFDFile(String fullname)
....@@ -2437,11 +2510,11 @@
24372510
24382511 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24392512 {
2440
- if (GrafreeD.standAlone)
2513
+ if (Grafreed.standAlone)
24412514 {
24422515 /**/
24432516 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2444
- browser.show();
2517
+ browser.setVisible(true);
24452518 String filename = browser.getFile();
24462519 if (filename != null && filename.length() > 0)
24472520 {
....@@ -2586,6 +2659,7 @@
25862659 }
25872660 if (input == null)
25882661 {
2662
+ new Exception().printStackTrace();
25892663 System.exit(0);
25902664 }
25912665
....@@ -2800,7 +2874,8 @@
28002874 return;
28012875 }
28022876
2803
- multiplyToggle.setSelected(mat.multiply);
2877
+ if (multiplyToggle != null)
2878
+ multiplyToggle.setSelected(mat.multiply);
28042879
28052880 assert (object.projectedVertices != null);
28062881
....@@ -2989,7 +3064,8 @@
29893064 if (timeline)
29903065 {
29913066 centralPanel.remove(cameraView);
2992
- centralPanel.add(timelinePanel);
3067
+ cameraPanel.add(cameraView);
3068
+ centralPanel.add(cameraPanel);
29933069 frame.setJMenuBar(timelineMenubar);
29943070 wasFullScreen = CameraPane.FULLSCREEN;
29953071 if (!CameraPane.FULLSCREEN)
....@@ -2998,7 +3074,7 @@
29983074 }
29993075 else
30003076 {
3001
- centralPanel.remove(timelinePanel);
3077
+ centralPanel.remove(cameraPanel);
30023078 centralPanel.add(cameraView);
30033079 frame.setJMenuBar(null);
30043080 if (!wasFullScreen)
....@@ -3014,9 +3090,9 @@
30143090 frame.validate();
30153091
30163092 return;
3017
- } else if (event.getSource() == toggleRandomItem)
3093
+ } else if (event.getSource() == toggleSwitchItem)
30183094 {
3019
- cameraView.ToggleRandom();
3095
+ cameraView.ToggleSwitch();
30203096 cameraView.repaint();
30213097 return;
30223098 } else if (event.getSource() == toggleHandleItem)
....@@ -3045,6 +3121,10 @@
30453121 {
30463122 copy.live ^= true;
30473123 return;
3124
+ } else if (event.getSource() == selectCB)
3125
+ {
3126
+ copy.dontselect ^= true;
3127
+ return;
30483128 } else if (event.getSource() == hideCB)
30493129 {
30503130 copy.hide ^= true;
....@@ -3059,6 +3139,7 @@
30593139 if (event.getSource() == randomCB)
30603140 {
30613141 copy.random ^= true;
3142
+ objEditor.refreshContents();
30623143 return;
30633144 }
30643145 if (event.getSource() == speedupCB)
....@@ -3082,8 +3163,9 @@
30823163
30833164 public void actionPerformed(ActionEvent event)
30843165 {
3166
+ Object source = event.getSource();
30853167 // SCRIPT DIALOG
3086
- if (event.getSource() == okbutton)
3168
+ if (source == okbutton)
30873169 {
30883170 textpanel.setVisible(false);
30893171 textpanel.remove(textarea);
....@@ -3095,7 +3177,7 @@
30953177 textarea = null;
30963178 textpanel = null;
30973179 }
3098
- if (event.getSource() == cancelbutton)
3180
+ if (source == cancelbutton)
30993181 {
31003182 textpanel.setVisible(false);
31013183 textpanel.remove(textarea);
....@@ -3107,49 +3189,50 @@
31073189 //applySelf();
31083190 //client.refreshEditWindow();
31093191 //refreshContents();
3110
- if (event.getSource() == nameField)
3192
+ if (source == nameField)
31113193 {
31123194 //System.out.println("ObjEditor " + event);
31133195 applySelf0(true);
31143196 //parent.applySelf();
31153197 objEditor.refreshContents();
3116
- } else if (event.getSource() == resetButton)
3198
+ } else if (source == resetButton)
31173199 {
31183200 CameraPane.fullreset = true;
31193201 copy.Reset(); // ResetMeshes();
31203202 copy.Touch();
31213203 objEditor.refreshContents();
3122
- } else if (event.getSource() == stepItem)
3204
+ } else if (source == stepItem)
31233205 {
3124
- cameraView.ONESTEP = true;
3206
+ //cameraView.ONESTEP = true;
3207
+ Globals.ONESTEP = true;
31253208 cameraView.repaint();
31263209 return;
3127
- } else if (event.getSource() == stepButton)
3210
+ } else if (source == stepButton)
31283211 {
31293212 copy.Step();
31303213 copy.Touch();
31313214 objEditor.refreshContents();
3132
- } else if (event.getSource() == slowerButton)
3215
+ } else if (source == slowerButton)
31333216 {
31343217 copy.Slower();
31353218 copy.Touch();
31363219 objEditor.refreshContents();
3137
- } else if (event.getSource() == fasterButton)
3220
+ } else if (source == fasterButton)
31383221 {
31393222 copy.Faster();
31403223 copy.Touch();
31413224 objEditor.refreshContents();
3142
- } else if (event.getSource() == remarkButton)
3225
+ } else if (source == remarkButton)
31433226 {
31443227 copy.Remark();
31453228 copy.Touch();
31463229 objEditor.refreshContents();
3147
- } else if (event.getSource() == stepAllButton)
3230
+ } else if (source == stepAllButton)
31483231 {
31493232 copy.StepAll();
31503233 copy.Touch();
31513234 objEditor.refreshContents();
3152
- } else if (event.getSource() == resetAllButton)
3235
+ } else if (source == resetAllButton)
31533236 {
31543237 //CameraPane.fullreset = true;
31553238 copy.ResetAll(); // ResetMeshes();
....@@ -3182,53 +3265,75 @@
31823265 // Close();
31833266 // }
31843267 // else
3185
- if (event.getSource() == resetSlidersButton)
3268
+ if (source == resetSlidersButton)
31863269 {
31873270 ResetSliders();
3188
- } else if (event.getSource() == clearMaterialButton)
3271
+ } else if (source == clearMaterialButton)
31893272 {
31903273 ClearMaterial();
3191
- } else if (event.getSource() == createMaterialButton)
3274
+ } else if (source == createMaterialButton)
31923275 {
31933276 CreateMaterial();
3194
- } else if (event.getSource() == clearPanelButton)
3277
+ } else if (source == clearPanelButton)
31953278 {
31963279 copy.ClearUI();
31973280 refreshContents(true);
3198
- } /*
3199
- }
3200
-
3201
- public boolean action(Event event, Object arg)
3202
- {
3203
- */ 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)
32043306 {
32053307 Close();
32063308 //return true;
3207
- } else if (event.getSource() == loadItem)
3309
+ } else if (source == loadItem)
32083310 {
32093311 load();
32103312 //return true;
3211
- } else if (event.getSource() == saveItem)
3313
+ } else if (source == newItem)
3314
+ {
3315
+ New();
3316
+ } else if (source == saveItem)
32123317 {
32133318 save();
32143319 //return true;
3215
- } else if (event.getSource() == saveAsItem)
3320
+ } else if (source == saveAsItem)
32163321 {
32173322 saveAs();
32183323 //return true;
3219
- } else if (event.getSource() == reexportItem)
3324
+ } else if (source == reexportItem)
32203325 {
32213326 reexport();
32223327 //return true;
3223
- } else if (event.getSource() == exportAsItem)
3328
+ } else if (source == exportAsItem)
32243329 {
32253330 export();
32263331 //return true;
3227
- } else if (event.getSource() == povItem)
3332
+ } else if (source == povItem)
32283333 {
32293334 generatePOV();
32303335 //return true;
3231
- } else if (event.getSource() == zBufferItem)
3336
+ } else if (source == zBufferItem)
32323337 {
32333338 try
32343339 {
....@@ -3250,21 +3355,8 @@
32503355 cameraView.repaint();
32513356 //return true;
32523357 }
3253
- */ else if (event.getSource() == editCameraItem)
3254
- {
3255
- cameraView.ProtectCamera();
3256
- cameraView.repaint();
3257
- return;
3258
- } else if (event.getSource() == revertCameraItem)
3259
- {
3260
- cameraView.RevertCamera();
3261
- cameraView.repaint();
3262
- return;
3263
-// } else if (event.getSource() == textureButton)
3264
-// {
3265
-// return; // true;
3266
- } else // combos...
3267
- if (event.getSource() == texresMenu)
3358
+ */ else // combos...
3359
+ if (source == texresMenu)
32683360 {
32693361 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32703362 copy.texres = texresMenu.getSelectedIndex();
....@@ -3276,27 +3368,287 @@
32763368 }
32773369 }
32783370
3279
- void ToggleAnimation()
3371
+ void New()
32803372 {
3281
- if (!CameraPane.ANIMATION)
3373
+ while (copy.Size() > 1)
32823374 {
3283
- 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);
32843602 browser.show();
32853603 String filename = browser.getFile();
32863604 if (filename != null && filename.length() > 0)
32873605 {
3288
- 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;
32893641 //CameraPane.framecount = 0;
3290
- CameraPane.imagecount = 0;
3642
+ Globals.imagecount = 0;
32913643
3292
- CameraPane.ANIMATION ^= true;
3644
+ Globals.ANIMATION ^= true;
32933645
3294
- GrafreeD.wav.cursor = 0;
3295
- GrafreeD.wav.loop = 0;
3646
+ Grafreed.wav.cursor = 0;
3647
+ Grafreed.wav.loop = 0;
32963648 }
32973649 } else
32983650 {
3299
- CameraPane.ANIMATION ^= true;
3651
+ Globals.ANIMATION ^= true;
33003652 }
33013653 }
33023654
....@@ -3342,7 +3694,7 @@
33423694 void CreateMaterial()
33433695 {
33443696 //copy.ClearMaterial(); // PATCH
3345
- copy.CreateMaterialS(multiplyToggle.isSelected());
3697
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33463698 if (copy.selection.size() > 0)
33473699 //SetMaterial(copy);
33483700 {
....@@ -3393,7 +3745,7 @@
33933745 assert false;
33943746 }
33953747
3396
- void EditSelection()
3748
+ void EditSelection(boolean newWindow)
33973749 {
33983750 }
33993751
....@@ -3401,11 +3753,11 @@
34013753 {
34023754 copy.ResetBlockLoop(); // temporary problem
34033755
3404
- boolean random = CameraPane.RANDOM;
3405
- CameraPane.RANDOM = false; // parse everything
3756
+ boolean random = CameraPane.SWITCH;
3757
+ CameraPane.SWITCH = false; // parse everything
34063758 copy.ResetDisplayList();
34073759 copy.HardTouch();
3408
- CameraPane.RANDOM = random;
3760
+ CameraPane.SWITCH = random;
34093761 }
34103762
34113763 // public void applySelf()
....@@ -3475,10 +3827,40 @@
34753827 current.fakedepth = (float) fakedepthField.getFloat();
34763828 current.shadowbias = (float) shadowbiasField.getFloat();
34773829
3478
- if (!NumberSlider.frozen)
3830
+ if (!cNumberSlider.frozen)
34793831 {
34803832 //System.out.println("Propagate = " + propagate);
34813833 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
+
34823864 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34833865 {
34843866 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3523,6 +3905,7 @@
35233905 || e.getSource() == apertureField
35243906 || e.getSource() == shadowblurField)
35253907 {
3908
+ new Exception().printStackTrace();
35263909 System.exit(0);
35273910 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35283911 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3549,7 +3932,13 @@
35493932 //System.out.println("PARENT = " + parent);
35503933 //if (parent != null)
35513934 // parent.applySelf();
3552
- refreshContents();
3935
+ if (e.getSource() == normalpushField)
3936
+ {
3937
+ objEditor.refreshContents();
3938
+ //Refresh();
3939
+ }
3940
+ else
3941
+ refreshContents();
35533942 // ??? client.refreshEditWindow();
35543943 }
35553944 //else
....@@ -3561,7 +3950,7 @@
35613950 //group.name = nameField.getText();
35623951 //objEditor.applySelf();
35633952
3564
- assert (objEditor == this);
3953
+ // OCT2018: assert (objEditor == this);
35653954 if (copy.selection == null || copy.selection.size() == 0)
35663955 //super.applySelf()
35673956 ; else
....@@ -3585,6 +3974,9 @@
35853974 objEditor.copy = keep;
35863975 }
35873976 }
3977
+
3978
+ if (normalpushField != null)
3979
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35883980 }
35893981
35903982 void SnapObject()
....@@ -3839,7 +4231,7 @@
38394231
38404232 radioPanel.revalidate();
38414233 radioPanel.repaint();
3842
- ctrlPanel.revalidate(); // ? new
4234
+ ctrlPanel.validate(); // ? new
38434235 ctrlPanel.repaint();
38444236 }
38454237 }
....@@ -3848,6 +4240,8 @@
38484240
38494241 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38504242 {
4243
+ if (Globals.SAVEONMAKE) // && resetmodel)
4244
+ Save();
38514245 //Tween.set(thing, 0).target(1).start(tweenManager);
38524246 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38534247 // if (thing instanceof GenericJointDemo)
....@@ -3934,6 +4328,12 @@
39344328 {
39354329 ResetModel();
39364330 Select(thing.GetTreePath(), true, false); // unselect... false);
4331
+
4332
+ if (thing.Size() == 0)
4333
+ {
4334
+ //EditSelection(false);
4335
+ }
4336
+
39374337 refreshContents();
39384338 }
39394339
....@@ -4051,6 +4451,7 @@
40514451 }
40524452 }
40534453 }
4454
+
40544455 LoadGFDThread loadGFDThread;
40554456
40564457 void ReadGFD(String fullname, iCallBack cb)
....@@ -4070,8 +4471,10 @@
40704471
40714472 try
40724473 {
4474
+ // Try compressed version first.
40734475 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4074
- 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);
40754478
40764479 readobj = (Object3D) p.readObject();
40774480 istream.close();
....@@ -4079,7 +4482,20 @@
40794482 readobj.ResetDisplayList();
40804483 } catch (Exception e)
40814484 {
4082
- 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
+ }
40834499 }
40844500 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40854501 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4125,6 +4541,12 @@
41254541
41264542 void LoadIt(Object obj)
41274543 {
4544
+ if (obj == null)
4545
+ {
4546
+ // Invalid file
4547
+ return;
4548
+ }
4549
+
41284550 System.out.println("Loaded " + obj);
41294551 //new Exception().printStackTrace();
41304552 Object3D readobj = (Object3D) obj;
....@@ -4134,6 +4556,8 @@
41344556
41354557 if (readobj != null)
41364558 {
4559
+ if (Globals.SAVEONMAKE)
4560
+ Save();
41374561 try
41384562 {
41394563 //readobj.deepCopySelf(copy);
....@@ -4196,7 +4620,7 @@
41964620
41974621 void load() // throws ClassNotFoundException
41984622 {
4199
- if (GrafreeD.standAlone)
4623
+ if (Grafreed.standAlone)
42004624 {
42014625 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42024626 browser.show();
....@@ -4283,11 +4707,13 @@
42834707 try
42844708 {
42854709 FileOutputStream ostream = new FileOutputStream(lastname);
4286
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4710
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4711
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42874712
42884713 p.writeObject(copy);
42894714 p.flush();
42904715
4716
+ zstream.close();
42914717 ostream.close();
42924718
42934719 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4297,11 +4723,12 @@
42974723 {
42984724 }
42994725 }
4726
+
43004727 String lastname;
43014728
43024729 void saveAs()
43034730 {
4304
- if (GrafreeD.standAlone)
4731
+ if (Grafreed.standAlone)
43054732 {
43064733 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43074734 browser.setVisible(true);
....@@ -4406,13 +4833,13 @@
44064833 try
44074834 {
44084835 FileOutputStream ostream = new FileOutputStream(filename);
4409
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4410
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4836
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4837
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44114838
44124839 Object3D objectparent = obj.parent;
44134840 obj.parent = null;
44144841
4415
- Object3D object = (Object3D) GrafreeD.clone(obj);
4842
+ Object3D object = (Object3D) Grafreed.clone(obj);
44164843
44174844 obj.parent = objectparent;
44184845
....@@ -4424,8 +4851,8 @@
44244851 p.writeObject(object);
44254852 p.flush();
44264853
4854
+ zstream.close();
44274855 ostream.close();
4428
- // zstream.close();
44294856
44304857 // group.selection.get(0).parent = parent;
44314858 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4446,7 +4873,7 @@
44464873 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44474874 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44484875 copy.generatePOV(buffer);
4449
- if (GrafreeD.standAlone)
4876
+ if (Grafreed.standAlone)
44504877 {
44514878 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44524879 browser.show();
....@@ -4472,7 +4899,8 @@
44724899 Object3D client;
44734900 Object3D copy;
44744901 MenuBar menuBar;
4475
- Menu windowMenu;
4902
+ Menu fileMenu;
4903
+ MenuItem newItem;
44764904 MenuItem loadItem;
44774905 MenuItem saveItem;
44784906 MenuItem saveAsItem;
....@@ -4480,13 +4908,11 @@
44804908 MenuItem reexportItem;
44814909 MenuItem povItem;
44824910 MenuItem closeItem;
4483
- Menu cameraMenu;
4911
+
44844912 CheckboxMenuItem zBufferItem;
44854913 //MenuItem normalLensItem;
4486
- MenuItem editCameraItem;
4487
- MenuItem revertCameraItem;
4488
- CheckboxMenuItem toggleLiveItem;
44894914 MenuItem stepItem;
4915
+ CheckboxMenuItem toggleLiveItem;
44904916 CheckboxMenuItem toggleFullScreenItem;
44914917 CheckboxMenuItem toggleTimelineItem;
44924918 CheckboxMenuItem toggleRenderItem;
....@@ -4495,28 +4921,40 @@
44954921 CheckboxMenuItem toggleFootContactItem;
44964922 CheckboxMenuItem toggleDLItem;
44974923 CheckboxMenuItem toggleTextureItem;
4498
- CheckboxMenuItem toggleRandomItem;
4924
+ CheckboxMenuItem toggleSwitchItem;
44994925 CheckboxMenuItem toggleRootItem;
45004926 CheckboxMenuItem animationItem;
45014927 CheckboxMenuItem toggleHandleItem;
45024928 CheckboxMenuItem togglePaintItem;
45034929 JSplitPane mainPanel;
45044930 JScrollPane scrollpane;
4931
+
45054932 JPanel toolbarPanel;
4506
- JPanel treePanel;
4933
+
4934
+ cGridBag treePanel;
4935
+
45074936 JPanel radioPanel;
45084937 ButtonGroup buttonGroup;
4509
- JPanel ctrlPanel;
4510
- JPanel materialPanel;
4938
+
4939
+ cGridBag toolboxPanel;
4940
+ cGridBag materialPanel;
4941
+ cGridBag ctrlPanel;
4942
+
45114943 JScrollPane infoPanel;
4512
- JPanel optionsPanel;
4944
+
4945
+ cGridBag optionsPanel;
4946
+
45134947 JTabbedPane objectPanel;
4514
- JPanel XYZPanel;
4948
+
4949
+ cGridBag XYZPanel;
4950
+
45154951 JSplitPane gridPanel;
45164952 JSplitPane bigPanel;
4517
- JPanel bigThree;
4518
- JTabbedPane scenePanel;
4519
- JPanel centralPanel;
4953
+
4954
+ cGridBag bigThree;
4955
+ cGridBag scenePanel;
4956
+ cGridBag centralPanel;
4957
+ JSplitPane cameraPanel;
45204958 JPanel timelinePanel;
45214959 JMenuBar timelineMenubar;
45224960 JSplitPane framePanel;
....@@ -4568,65 +5006,72 @@
45685006 // MATERIAL
45695007 JLabel materialLabel;
45705008 JLabel colorLabel;
4571
- NumberSlider colorField;
5009
+ cNumberSlider colorField;
45725010 JLabel modulationLabel;
4573
- NumberSlider modulationField;
5011
+ cNumberSlider modulationField;
45745012 JLabel metalnessLabel;
4575
- NumberSlider metalnessField;
5013
+ cNumberSlider metalnessField;
45765014 JLabel diffuseLabel;
4577
- NumberSlider diffuseField;
5015
+ cNumberSlider diffuseField;
45785016 JLabel specularLabel;
4579
- NumberSlider specularField;
5017
+ cNumberSlider specularField;
45805018 JLabel shininessLabel;
4581
- NumberSlider shininessField;
5019
+ cNumberSlider shininessField;
45825020 JLabel shiftLabel;
4583
- NumberSlider shiftField;
5021
+ cNumberSlider shiftField;
45845022 JLabel ambientLabel;
4585
- NumberSlider ambientField;
5023
+ cNumberSlider ambientField;
45865024 JLabel lightareaLabel;
4587
- NumberSlider lightareaField;
5025
+ cNumberSlider lightareaField;
45885026 JLabel diffusenessLabel;
4589
- NumberSlider diffusenessField;
5027
+ cNumberSlider diffusenessField;
45905028 JLabel velvetLabel;
4591
- NumberSlider velvetField;
5029
+ cNumberSlider velvetField;
45925030 JLabel sheenLabel;
4593
- NumberSlider sheenField;
5031
+ cNumberSlider sheenField;
45945032 JLabel subsurfaceLabel;
4595
- NumberSlider subsurfaceField;
5033
+ cNumberSlider subsurfaceField;
45965034 //JLabel bumpLabel;
45975035 //NumberSlider bumpField;
45985036 JLabel backlitLabel;
4599
- NumberSlider backlitField;
5037
+ cNumberSlider backlitField;
46005038 JLabel anisoLabel;
4601
- NumberSlider anisoField;
5039
+ cNumberSlider anisoField;
46025040 JLabel anisoVLabel;
4603
- NumberSlider anisoVField;
5041
+ cNumberSlider anisoVField;
46045042 JLabel cameraLabel;
4605
- NumberSlider cameraField;
5043
+ cNumberSlider cameraField;
46065044 JLabel selfshadowLabel;
4607
- NumberSlider selfshadowField;
5045
+ cNumberSlider selfshadowField;
46085046 JLabel shadowLabel;
4609
- NumberSlider shadowField;
5047
+ cNumberSlider shadowField;
46105048 JLabel textureLabel;
4611
- NumberSlider textureField;
5049
+ cNumberSlider textureField;
46125050 JLabel opacityLabel;
4613
- NumberSlider opacityField;
5051
+ cNumberSlider opacityField;
46145052 JLabel fakedepthLabel;
4615
- NumberSlider fakedepthField;
5053
+ cNumberSlider fakedepthField;
46165054 JLabel shadowbiasLabel;
4617
- NumberSlider shadowbiasField;
5055
+ cNumberSlider shadowbiasField;
46185056 JLabel bumpLabel;
4619
- NumberSlider bumpField;
5057
+ cNumberSlider bumpField;
46205058 JLabel noiseLabel;
4621
- NumberSlider noiseField;
5059
+ cNumberSlider noiseField;
46225060 JLabel powerLabel;
4623
- NumberSlider powerField;
5061
+ cNumberSlider powerField;
46245062 JLabel borderfadeLabel;
4625
- NumberSlider borderfadeField;
5063
+ cNumberSlider borderfadeField;
46265064 JLabel fogLabel;
4627
- NumberSlider fogField;
5065
+ cNumberSlider fogField;
46285066 JLabel opacityPowerLabel;
4629
- NumberSlider opacityPowerField;
4630
- JTree jTree;
5067
+ cNumberSlider opacityPowerField;
5068
+ cTree jTree;
46315069 //ObjectUI parent;
5070
+
5071
+ cNumberSlider normalpushField;
5072
+
5073
+ private MenuItem importGFDItem;
5074
+ private MenuItem importVRMLX3DItem;
5075
+ private MenuItem import3DSItem;
5076
+ private MenuItem importOBJItem;
46325077 }