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,
....@@ -28,7 +31,73 @@
2831 iSendInfo
2932 //KeyListener
3033 {
34
+ boolean timeline;
35
+ boolean wasFullScreen;
3136
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
+
32101 // SCRIPT
33102
34103 transient JFrame textpanel = null;
....@@ -119,51 +188,62 @@
119188 void keyPressed(int key, int modifiers)
120189 {
121190 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
191
+ Globals.theRenderer.keyPressed(key, modifiers);
123192 }
124193 */
125194
126195 static GridBagConstraints aConstraints;
127196 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
197
+
130198 static int GRIDWIDTH = 100; // 4;
131199
132200 public void closeUI()
133201 {
134202 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
203
+// System.out.println("this = " + this);
204
+// System.out.println("objEditor = " + objEditor);
137205 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
206
+// objEditor.ctrlPanel.remove(nameField);
207
+
208
+ objEditor.ctrlPanel.remove(namePanel);
139209
140210 if (!GroupEditor.allparams)
141211 return;
142212
143
- objEditor.ctrlPanel.remove(liveCB);
144
- objEditor.ctrlPanel.remove(hideCB);
145
- objEditor.ctrlPanel.remove(markCB);
146
-
147
- objEditor.ctrlPanel.remove(randomCB);
148
- objEditor.ctrlPanel.remove(speedupCB);
149
- objEditor.ctrlPanel.remove(rewindCB);
150
-
151
- objEditor.ctrlPanel.remove(resetButton);
152
- objEditor.ctrlPanel.remove(stepButton);
153
-// objEditor.ctrlPanel.remove(stepAllButton);
154
-// objEditor.ctrlPanel.remove(resetAllButton);
155
- objEditor.ctrlPanel.remove(link2masterCB);
156
- //objEditor.ctrlPanel.remove(flipVCB);
157
- //objEditor.ctrlPanel.remove(texresMenu);
158
- objEditor.ctrlPanel.remove(slowerButton);
159
- objEditor.ctrlPanel.remove(fasterButton);
160
- 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);
161239 }
162240
163241 public ObjEditor GetEditor()
164242 {
165243 return objEditor; //.GetEditor();
166244 }
245
+
246
+ // Sometimes myself, sometimes my callee's.
167247 ObjEditor objEditor;
168248
169249 /*
....@@ -226,6 +306,7 @@
226306 //localCopy.parent = null;
227307
228308 frame = new JFrame();
309
+ frame.setUndecorated(true);
229310 objEditor = this;
230311 this.callee = callee;
231312
....@@ -238,7 +319,7 @@
238319 //if (!isDisplayable())
239320 //setUndecorated(true);
240321
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
322
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242323 client = inClient;
243324 copy = localCopy;
244325 copy.editWindow = this;
....@@ -259,24 +340,40 @@
259340 void SetupMenu()
260341 {
261342 frame.setMenuBar(menuBar = new MenuBar());
262
- menuBar.add(windowMenu = new Menu("File"));
263
- windowMenu.add(loadItem = new MenuItem("Load..."));
264
- windowMenu.add("-");
265
- windowMenu.add(saveItem = new MenuItem("Save"));
266
- 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..."));
267363 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
268
- windowMenu.add("-");
269
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
270
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
271
- windowMenu.add("-");
364
+ fileMenu.add("-");
365
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
366
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
367
+ fileMenu.add("-");
272368 if (client.parent != null)
273369 {
274
- windowMenu.add(closeItem = new MenuItem("Close"));
370
+ fileMenu.add(closeItem = new MenuItem("Close"));
275371 } else
276372 {
277
- windowMenu.add(closeItem = new MenuItem("Exit"));
373
+ fileMenu.add(closeItem = new MenuItem("Exit"));
278374 }
279375
376
+ newItem.addActionListener(this);
280377 loadItem.addActionListener(this);
281378 saveItem.addActionListener(this);
282379 saveAsItem.addActionListener(this);
....@@ -285,79 +382,38 @@
285382 //povItem.addActionListener(this);
286383 closeItem.addActionListener(this);
287384
288
- menuBar.add(cameraMenu = new Menu("View"));
289
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
290
- //zBufferItem.addActionListener(this);
291
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
292
- //normalLensItem.addActionListener(this);
293
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294
- revertCameraItem.addActionListener(this);
295
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullScreenItem.addItemListener(this);
297
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
298
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
299
- toggleTimelineItem.addItemListener(this);
300
- cameraMenu.add("-");
301
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
302
- toggleTextureItem.addItemListener(this);
303
- toggleTextureItem.setState(CameraPane.textureon);
304
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
305
- toggleLiveItem.addItemListener(this);
306
- toggleLiveItem.setState(CameraPane.isLIVE());
307
- cameraMenu.add(stepItem = new MenuItem("Step"));
308
- stepItem.addActionListener(this);
309
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
310
-// toggleDLItem.addItemListener(this);
311
-// toggleDLItem.setState(false);
312
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
313
- toggleRenderItem.addItemListener(this);
314
- toggleRenderItem.setState(!CameraPane.frozen);
315
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
316
- toggleDebugItem.addItemListener(this);
317
- toggleDebugItem.setState(CameraPane.DEBUG);
318
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
319
- toggleFrustumItem.addItemListener(this);
320
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
321
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
322
- toggleFootContactItem.addItemListener(this);
323
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
324
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
325
- toggleRandomItem.addItemListener(this);
326
- toggleRandomItem.setState(CameraPane.RANDOM);
327
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
328
- toggleHandleItem.addItemListener(this);
329
- toggleHandleItem.setState(CameraPane.HANDLES);
330
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
331
- togglePaintItem.addItemListener(this);
332
- togglePaintItem.setState(CameraPane.PAINTMODE);
333
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
334
-// toggleRootItem.addItemListener(this);
335
-// toggleRootItem.setState(false);
336
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
337
-// animationItem.addItemListener(this);
338
-// animationItem.setState(CameraPane.ANIMATION);
339
- cameraMenu.add("-");
340
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
341
- editCameraItem.addActionListener(this);
342
-
343385 objectPanel = new JTabbedPane();
344386 toolbarPanel = new JPanel();
345387 toolbarPanel.setName("Toolbar");
346
- treePanel = new JPanel();
388
+ treePanel = new cGridBag();
347389 treePanel.setName("Tree");
348
- ctrlPanel = new JPanel(); // new GridBagLayout());
349
- ctrlPanel.setName("Edit");
350
- 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);
351404 materialPanel.setName("Material");
405
+
352406 /*JTextPane*/
353407 infoarea = createTextPane();
408
+ doc = infoarea.getStyledDocument();
409
+
354410 infoarea.setEditable(true);
355411 SetText();
356412 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
357413 // infoarea.setOpaque(false);
358414 // //infoarea.setForeground(textcolor);
359
- infoarea.setLineWrap(true);
360
- infoarea.setWrapStyleWord(true);
415
+// TEXTAREA infoarea.setLineWrap(true);
416
+// TEXTAREA infoarea.setWrapStyleWord(true);
361417 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
362418 infoPanel.setPreferredSize(new Dimension(50, 200));
363419 infoPanel.setName("Info");
....@@ -368,16 +424,16 @@
368424 mainPanel.setName("Main");
369425 mainPanel.setContinuousLayout(true);
370426 mainPanel.setOneTouchExpandable(true);
371
- mainPanel.setDividerLocation(1.0);
372427 mainPanel.setDividerSize(9);
373
- mainPanel.setResizeWeight(0);
428
+ mainPanel.setDividerLocation(0.5); //1.0);
429
+ mainPanel.setResizeWeight(0.5);
374430
375431 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
376432 //mainPanel.setLayout(new GridBagLayout());
377433 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
378
- treePanel.setLayout(new GridBagLayout());
379
- ctrlPanel.setLayout(new GridBagLayout());
380
- materialPanel.setLayout(new GridBagLayout());
434
+// treePanel.setLayout(new GridBagLayout());
435
+ //ctrlPanel.setLayout(new GridBagLayout());
436
+ //materialPanel.setLayout(new GridBagLayout());
381437
382438 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
383439 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -416,7 +472,7 @@
416472 static String newline = "\n";
417473 protected static final String buttonString = "JButton";
418474 StyledDocument doc;
419
- JTextArea infoarea;
475
+ JTextPane infoarea;
420476
421477 void ClearInfo()
422478 {
....@@ -439,10 +495,10 @@
439495 e.printStackTrace();
440496 }
441497
442
- String selection = infoarea.getText();
443
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
444
- java.awt.datatransfer.Clipboard clipboard =
445
- 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();
446502 //clipboard.setContents(data, data);
447503 }
448504
....@@ -465,13 +521,13 @@
465521 //SendInfo("Name:", "bold");
466522 if (sel.GetTextures() != null || debug)
467523 {
468
- si.SendInfo(sel.toString(), "bold");
524
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
469525 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
470526 if (sel.Size() > 0)
471527 {
472528 si.SendInfo("#children = " + sel.Size(), "regular");
473529 }
474
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
530
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
475531 if (debug)
476532 {
477533 try
....@@ -483,7 +539,10 @@
483539 }
484540
485541 if (full)
486
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
542
+ {
543
+ si.SendInfo(" BBox min: " + minima, "regular");
544
+ si.SendInfo(" BBox max: " + maxima, "regular");
545
+ }
487546
488547 if (sel.bRep != null)
489548 {
....@@ -510,7 +569,7 @@
510569 }
511570 if (sel.support != null)
512571 {
513
- si.SendInfo(" support: " + sel.support, "regular");
572
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
514573 }
515574 if (sel.scriptnode != null)
516575 {
....@@ -581,6 +640,9 @@
581640 {
582641 CameraPane.pointflow = (PointFlow) sel;
583642 }
643
+
644
+ si.SendInfo("_____________________", "regular");
645
+ si.SendInfo("", "regular");
584646 }
585647 }
586648
....@@ -596,52 +658,140 @@
596658 }
597659 }
598660
599
- private JTextArea createTextPane()
600
- {
601
- String[] initString =
602
- {
603
- "This is an editable JTextPane, ", //regular
604
- "another ", //italic
605
- "styled ", //bold
606
- "text ", //small
607
- "component, ", //large
608
- "which supports embedded components..." + newline,//regular
609
- " " + newline, //button
610
- "...and embedded icons..." + newline, //regular
611
- " ", //icon
612
- newline + "JTextPane is a subclass of JEditorPane that "
613
- + "uses a StyledEditorKit and StyledDocument, and provides "
614
- + "cover methods for interacting with those objects."
615
- };
661
+static GraphicsDevice device = GraphicsEnvironment
662
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
616663
617
- String[] initStyles =
618
- {
619
- "regular", "italic", "bold", "small", "large",
620
- "regular", "button", "regular", "icon",
621
- "regular"
622
- };
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;
623679
624
- JTextPane textPane = new JTextPane();
625
- textPane.setEditable(true);
626
- /*StyledDocument*/ doc = textPane.getStyledDocument();
627
- addStylesToDocument(doc);
628
-
629
- try
680
+ void Minimize()
630681 {
631
- for (int j = 0; j < 2; j++)
682
+ frame.setState(Frame.ICONIFIED);
683
+ }
684
+
685
+ void Maximize()
686
+ {
687
+ if (maximized)
632688 {
633
- for (int i = 0; i < initString.length; i++)
634
- {
635
- doc.insertString(doc.getLength(), initString[i],
636
- doc.getStyle(initStyles[i]));
637
- }
689
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
638690 }
639
- } catch (BadLocationException ble)
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
+
703
+ void ToggleFullScreen()
640704 {
641
- System.err.println("Couldn't insert initial text into text pane.");
705
+ if (CameraPane.FULLSCREEN)
706
+ {
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
+
725
+ } else
726
+ {
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);
744
+ }
745
+
746
+ cameraView.ToggleFullScreen();
642747 }
643748
644
- return new JTextArea(); // textPane;
749
+ private JTextPane createTextPane()
750
+ {
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
+// }
793
+
794
+ return new JTextPane(); // textPane;
645795 }
646796
647797 protected void addStylesToDocument(StyledDocument doc)
....@@ -694,7 +844,7 @@
694844 protected static ImageIcon createImageIcon(String path,
695845 String description)
696846 {
697
- java.net.URL imgURL = GrafreeD.class.getResource(path);
847
+ java.net.URL imgURL = Grafreed.class.getResource(path);
698848 if (imgURL != null)
699849 {
700850 return new ImageIcon(imgURL, description);
....@@ -726,6 +876,7 @@
726876 // NumberSlider vDivsField;
727877 // JCheckBox endcaps;
728878 JCheckBox liveCB;
879
+ JCheckBox selectCB;
729880 JCheckBox hideCB;
730881 JCheckBox link2masterCB;
731882 JCheckBox markCB;
....@@ -741,115 +892,87 @@
741892 JButton slowerButton;
742893 JButton fasterButton;
743894 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;
744905
745
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
906
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
746907 {
747908 JCheckBox cb;
748909
749
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
750
- oe.aConstraints.gridwidth = 1; // 3;
751
-// oe.aConstraints.weightx = 1;
752
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
753
- 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);
754911 cb.addItemListener(this);
755
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
756
- oe.aConstraints.gridwidth = 1;
757
- oe.aConstraints.gridx += 1;
758912
759913 return cb;
760914 }
761915
762
- cButton AddButton(ObjEditor oe, String label)
916
+ cButton AddButton(cGridBag panel, String label)
763917 {
764918 cButton cb;
765919
766
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
767
- oe.aConstraints.gridwidth = 1;
768
-// oe.aConstraints.weightx = 1;
769
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
770
- 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);
771921 cb.addActionListener(this);
772
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
773
- oe.aConstraints.gridwidth = 1;
774
- oe.aConstraints.gridx += 1;
775922
776923 return cb;
777924 }
778925
779
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
926
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
780927 {
781928 JComboBox combo;
782929
783
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
784
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
785
- oe.aConstraints.gridx += 1;
930
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
786931 combo.addActionListener(this);
787932
788933 return combo;
789934 }
790935
791
- 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)
792937 {
793
- NumberSlider combo;
938
+ cGridBag control = new cGridBag();
939
+
940
+ cNumberSlider combo;
794941
795942 JLabel jlabel = new JLabel(label);
796
-
797
- aConstraints.fill = GridBagConstraints.VERTICAL;
798943 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
799
- aConstraints.gridwidth = 2;
800
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
801
- aConstraints.gridx += 1;
802
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
803
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
804
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
805
- aConstraints.gridx += 1;
806
- aConstraints.gridwidth = 1;
807
-
944
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
945
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808946 combo.setFloat(current);
809
-
810
- combo.label = jlabel;
811
-
812
- combo.addChangeListener(this);
813
-
814
- return combo;
947
+
948
+ panel.add(control);
949
+
950
+ return control;
815951 }
816952
817
- 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)
818954 {
819
- NumberSlider combo;
955
+ cGridBag control = new cGridBag();
956
+
957
+ cNumberSlider combo;
820958
821959 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824960 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
825
- aConstraints.gridwidth = 2;
826
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
827
- aConstraints.gridx += 1;
828
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
829
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
830
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
831
- aConstraints.gridx += 1;
832
- aConstraints.gridwidth = 1;
833
-
961
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
962
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834963 combo.setInteger(current);
835964
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
965
+ panel.add(control);
966
+
967
+ return control;
841968 }
842969
843
- JTextArea AddText(JPanel ctrlPanel, String name)
970
+ JTextArea AddText(cGridBag ctrlPanel, String name)
844971 {
845972 JTextArea text;
846973
847
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
848
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
849
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
974
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
850975 text.addCaretListener(this);
851
- aConstraints.gridx += 1;
852
- aConstraints.gridwidth = 1;
853976
854977 return text;
855978 }
....@@ -879,9 +1002,16 @@
8791002 objEditor.ctrlPanel.remove(j);
8801003 }
8811004
1005
+ void Remove(cNumberSlider j)
1006
+ {
1007
+ j.removeChangeListener(this);
1008
+ //objEditor.ctrlPanel.remove(j.label);
1009
+ objEditor.ctrlPanel.remove(j);
1010
+ }
1011
+
8821012 /*
8831013 */
884
- void Return() // ObjEditor oe)
1014
+ void Return0() // ObjEditor oe)
8851015 {
8861016 aConstraints.gridy += 1;
8871017 aConstraints.gridx = 0;
....@@ -936,35 +1066,77 @@
9361066
9371067 void SetupUI2(ObjEditor oe)
9381068 {
939
-// oe.aConstraints.weightx = 0;
940
-// oe.aConstraints.weighty = 0;
941
-// oe.aConstraints.gridx = 0;
942
-// oe.aConstraints.gridy = 0;
943
- 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();
9441078
9451079 if (!GroupEditor.allparams)
9461080 return;
9471081
948
- liveCB = AddCheckBox(oe, "Live", copy.live);
949
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
950
- 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");
9511088 // Return();
952
- markCB = AddCheckBox(oe, "Mark", copy.marked);
953
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
954
- randomCB = AddCheckBox(oe, "Rand", copy.random);
955
- Return();
956
- resetButton = AddButton(oe, "Reset");
957
- 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");
9581121 // resetAllButton = AddButton(oe, "Reset All");
9591122 // stepAllButton = AddButton(oe, "Step All");
960
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9611123 // Return();
962
- slowerButton = AddButton(oe, "Slow");
963
- fasterButton = AddButton(oe, "Fast");
964
- 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");
9651130
966
- Return();
1131
+ oe.ctrlPanel.add(objectCommandsPanel);
1132
+ oe.ctrlPanel.Return();
9671133
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
+
9681140 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9691141 // ObjEditor.aConstraints.gridx += 1;
9701142
....@@ -1058,7 +1230,7 @@
10581230 oe.aConstraints.gridwidth = 1;
10591231 /**/
10601232 nameField = AddText(oe.ctrlPanel, copy.GetName());
1061
- Return();
1233
+ oe.ctrlPanel.Return();
10621234
10631235 //ctrlPanel.add(textureButton = new Button("Texture..."));
10641236 //textureButton.setEnabled(false);
....@@ -1160,11 +1332,25 @@
11601332 //JPanel worldPanel =
11611333 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11621334 //worldPanel.setName("World");
1163
- centralPanel = new JPanel(new BorderLayout());
1164
- timelinePanel = new JPanel(new BorderLayout());
1165
- 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);
11661342
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
+
11671352 centralPanel.add(cameraView);
1353
+ centralPanel.setFocusable(true);
11681354 //frame.setJMenuBar(timelineMenubar);
11691355 //centralPanel.add(timelinePanel);
11701356
....@@ -1183,12 +1369,13 @@
11831369 //frontView.object = copy;
11841370 //sideView.object = copy;
11851371
1186
- XYZPanel = new JPanel();
1187
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1372
+ XYZPanel = new cGridBag().setVertical(true);
1373
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11881374
1189
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1190
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1191
- 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);
11921379
11931380 /*
11941381 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1225,11 +1412,13 @@
12251412
12261413 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12271414 //tmp.setName("Edit");
1415
+ objectPanel.add(toolboxPanel);
12281416 objectPanel.add(materialPanel);
1229
- JPanel north = new JPanel(new BorderLayout());
1230
- north.setName("Edit");
1231
- north.add(ctrlPanel, BorderLayout.NORTH);
1232
- 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);
12331422 objectPanel.add(infoPanel);
12341423
12351424 /*
....@@ -1250,16 +1439,23 @@
12501439 scrollpane.setWheelScrollingEnabled(true);
12511440 scrollpane.addMouseWheelListener(this); // Default not fast enough
12521441
1253
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1254
- scenePanel.add(scrollpane);
1442
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1443
+ scenePanel.preferredWidth = 6;
1444
+
1445
+ JTabbedPane tabbedPane = new JTabbedPane();
1446
+ tabbedPane.add(scrollpane);
12551447
1256
- scenePanel.add(FSPane = new cFileSystemPane(this));
1448
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12571449
1258
- optionsPanel = new JPanel(new GridBagLayout());
1450
+ optionsPanel = new cGridBag().setVertical(true);
12591451
12601452 optionsPanel.setName("Options");
1261
- scenePanel.add(optionsPanel);
1262
-
1453
+
1454
+ AddOptions(optionsPanel); //, aConstraints);
1455
+
1456
+ tabbedPane.add(optionsPanel);
1457
+
1458
+ scenePanel.add(tabbedPane);
12631459
12641460 /*
12651461 cTree jTree = new cTree(null);
....@@ -1293,6 +1489,7 @@
12931489 //bigPanel.setSize(new Dimension(10,10));
12941490 //bigPanel.add(ctrlPanel);
12951491 //bigPanel.add(gridPanel);
1492
+ /**
12961493 bigThree = new JPanel();
12971494 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12981495 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1316,7 +1513,13 @@
13161513 // aConstraints.gridheight = 3;
13171514 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13181515 bigThree.add(XYZPanel, aWindowConstraints);
1516
+ /**/
13191517
1518
+ bigThree = new cGridBag();
1519
+ bigThree.addComponent(scenePanel);
1520
+ bigThree.addComponent(centralPanel);
1521
+ bigThree.addComponent(XYZPanel);
1522
+
13201523 // // SIDE EFFECT!!!
13211524 // aConstraints.gridx = 0;
13221525 // aConstraints.gridy = 0;
....@@ -1337,14 +1540,17 @@
13371540 //worldPane.add(bigPanel);
13381541 //worldPane.add(worldPanel);
13391542 /**/
1340
- frame.getContentPane().add(/*"Center",*/framePanel);
1543
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1544
+ frame.add(/*"Center",*/framePanel);
13411545 //frame.getContentPane().add(/*"Center",*/ worldPane);
13421546
13431547 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13441548
1345
- frame.setSize(1024, 768);
1346
- frame.show();
1549
+ frame.setSize(1280, 860);
1550
+ frame.setVisible(true);
13471551
1552
+ cameraView.requestFocusInWindow();
1553
+
13481554 gridPanel.setDividerLocation(1.0);
13491555
13501556 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1358,6 +1564,10 @@
13581564 });
13591565 }
13601566
1567
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1568
+ {
1569
+ }
1570
+
13611571 JTree GetTree()
13621572 {
13631573 return objEditor.jTree;
....@@ -1369,260 +1579,173 @@
13691579 ctrlPanel.removeAll();
13701580 }
13711581
1372
- void SetupMaterial(JPanel ctrlPanel)
1582
+ void SetupMaterial(cGridBag panel)
13731583 {
1374
- aConstraints.weighty = 0;
1375
- //aConstraints.weightx = 1;
1376
- /*
1584
+ /*
13771585 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13781586 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1379
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1380
- aConstraints.gridx += 1;
13811587 */
13821588
1383
- aConstraints.gridwidth = 1;
1384
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- 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");
13881593
13891594 /*
13901595 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1391
- aConstraints.gridx += 1;
1392
- aConstraints.weighty = 0;
1393
- aConstraints.gridwidth = 1;
13941596 */
13951597
1396
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1397
- 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
+ }
13981607
1399
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1400
-
1401
- aConstraints.gridx += 1;
1402
-
1403
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1404
-
1405
- aConstraints.gridx += 1;
1406
-
1407
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1408
-
1409
- aConstraints.gridx = 0;
1410
- aConstraints.gridy += 1;
1411
- aConstraints.weighty = 0;
1412
- aConstraints.gridwidth = 1;
1608
+ editBar.preferredHeight = 15;
1609
+
1610
+ panel.add(editBar);
1611
+
14131612 /**/
14141613 //aConstraints.weighty = 0;
14151614 ////aConstraints.weightx = 1;
14161615 //aConstraints.weighty = 1;
14171616 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14181617 //aConstraints.gridx += 1;
1419
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1420
- aConstraints.weighty = 0;
1421
- aConstraints.gridx = 0;
1422
- aConstraints.gridy += 1;
1423
- aConstraints.gridwidth = 1;
1618
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14241619
1425
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1426
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1427
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1428
- aConstraints.gridx += 1;
1429
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1430
- //aConstraints.weightx = 0;
1431
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1432
- aConstraints.gridx = 0;
1433
- aConstraints.gridy += 1;
1434
- 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);
14351628
1436
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1437
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1438
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1439
- aConstraints.gridx += 1;
1440
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1441
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1442
- aConstraints.gridx = 0;
1443
- aConstraints.gridy += 1;
1444
- 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);
14451634
1446
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1447
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1448
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1449
- aConstraints.gridx += 1;
1450
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1451
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1452
- aConstraints.gridx = 0;
1453
- aConstraints.gridy += 1;
1454
- 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);
14551640
1456
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1457
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1458
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1459
- aConstraints.gridx += 1;
1460
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1461
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1462
- aConstraints.gridx = 0;
1463
- aConstraints.gridy += 1;
1464
- 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);
14651646
1466
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1467
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1468
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1469
- aConstraints.gridx += 1;
1470
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1471
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1472
- aConstraints.gridx = 0;
1473
- aConstraints.gridy += 1;
1474
- 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);
14751652
1476
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1477
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1479
- aConstraints.gridx += 1;
1480
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1481
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1482
- aConstraints.gridx = 0;
1483
- aConstraints.gridy += 1;
1484
- 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);
14851658
1486
- //aConstraints.weighty = 1;
1487
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1488
- //aConstraints.gridx += 1;
1489
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1490
- aConstraints.weighty = 0;
1491
- aConstraints.gridx = 0;
1492
- aConstraints.gridy += 1;
1493
- 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);
14941672
1495
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1496
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1497
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1498
- aConstraints.gridx += 1;
1499
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1500
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1501
- aConstraints.gridx = 0;
1502
- aConstraints.gridy += 1;
1503
- 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);
15041678
1505
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1506
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1507
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1508
- aConstraints.gridx += 1;
1509
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1510
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1511
- aConstraints.gridx = 0;
1512
- aConstraints.gridy += 1;
1513
- 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);
15141684
1515
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1516
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1517
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1518
- aConstraints.gridx += 1;
1519
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1520
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1521
- aConstraints.gridx = 0;
1522
- aConstraints.gridy += 1;
1523
- 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);
15241690
1525
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1526
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1527
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1528
- aConstraints.gridx += 1;
1529
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1530
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1531
- aConstraints.gridx = 0;
1532
- aConstraints.gridy += 1;
1533
- 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);
15341696
1535
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1536
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1537
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1538
- aConstraints.gridx += 1;
1539
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1540
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1541
- aConstraints.gridx = 0;
1542
- aConstraints.gridy += 1;
1543
- 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);
15441702
1545
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1546
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1547
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1548
- aConstraints.gridx += 1;
1549
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1550
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1551
- aConstraints.gridx = 0;
1552
- aConstraints.gridy += 1;
1553
- 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);
15541708
1555
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1556
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1557
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1558
- aConstraints.gridx += 1;
1559
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1560
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1561
- aConstraints.gridx = 0;
1562
- aConstraints.gridy += 1;
1563
- 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);
15641716
1565
- //aConstraints.weighty = 1;
1566
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1567
- //aConstraints.gridx += 1;
1568
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1569
- aConstraints.weighty = 0;
1570
- aConstraints.gridx = 0;
1571
- aConstraints.gridy += 1;
1572
- 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);
15731722
1574
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1575
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1576
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1577
- aConstraints.gridx += 1;
1578
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1579
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1580
- aConstraints.gridx = 0;
1581
- aConstraints.gridy += 1;
1582
- 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);
15831728
1584
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1585
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1586
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1587
- aConstraints.gridx += 1;
1588
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1589
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1590
- aConstraints.gridx = 0;
1591
- aConstraints.gridy += 1;
1592
- 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);
15931734
1594
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1595
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1596
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1597
- aConstraints.gridx += 1;
1598
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1599
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1600
- aConstraints.gridx = 0;
1601
- aConstraints.gridy += 1;
1602
- 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);
16031740
1604
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1605
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1606
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1607
- aConstraints.gridx += 1;
1608
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1609
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1610
- aConstraints.gridx = 0;
1611
- aConstraints.gridy += 1;
1612
- 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);
16131746
1614
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1615
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1616
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1617
- aConstraints.gridx += 1;
1618
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1619
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1620
- aConstraints.gridx = 0;
1621
- aConstraints.gridy += 1;
1622
- aConstraints.gridwidth = 1;
1623
-
1624
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1625
- Return();
1747
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1748
+ //Return();
16261749 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16271750 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16281751 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1633,130 +1756,93 @@
16331756 // aConstraints.gridy += 1;
16341757 // aConstraints.gridwidth = 1;
16351758
1636
- //aConstraints.weighty = 1;
1637
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1638
- //aConstraints.gridx += 1;
1639
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1640
- aConstraints.weighty = 0;
1641
- aConstraints.gridx = 0;
1642
- aConstraints.gridy += 1;
1643
- aConstraints.gridwidth = 1;
16441759
1645
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1646
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1647
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1648
- aConstraints.gridx += 1;
1649
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1650
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1651
- aConstraints.gridx = 0;
1652
- aConstraints.gridy += 1;
1653
- 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);
16541767
1655
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1656
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1658
- aConstraints.gridx += 1;
1659
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1660
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1661
- aConstraints.gridx = 0;
1662
- aConstraints.gridy += 1;
1663
- 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);
16641773
1665
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1666
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1667
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1668
- aConstraints.gridx += 1;
1669
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1670
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1671
- aConstraints.gridx = 0;
1672
- aConstraints.gridy += 1;
1673
- 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);
16741779
1675
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1676
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1677
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1678
- aConstraints.gridx += 1;
1679
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1680
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1681
- aConstraints.gridx = 0;
1682
- aConstraints.gridy += 1;
1683
- aConstraints.gridwidth = 1;
1684
- 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);
16851785
1686
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1687
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1689
- aConstraints.gridx += 1;
1690
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1691
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1692
- aConstraints.gridx = 0;
1693
- aConstraints.gridy += 1;
1694
- 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);
16951791
1696
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1697
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1699
- aConstraints.gridx += 1;
1700
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1701
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1702
- aConstraints.gridx = 0;
1703
- aConstraints.gridy += 1;
1704
- 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);
17051799
1706
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1707
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1709
- aConstraints.gridx += 1;
1710
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1711
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1712
- aConstraints.gridx = 0;
1713
- aConstraints.gridy += 1;
1714
- 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);
17151805
1716
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1717
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1718
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1719
- aConstraints.gridx += 1;
1720
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1721
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1722
- aConstraints.gridx = 0;
1723
- aConstraints.gridy += 1;
1724
- 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);
17251811
1726
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1727
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1728
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1729
- aConstraints.gridx += 1;
1730
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1731
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1732
- aConstraints.gridx = 0;
1733
- aConstraints.gridy += 1;
1734
- 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);
17351817
1736
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1737
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1738
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1739
- aConstraints.gridx += 1;
1740
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1741
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1742
- aConstraints.gridx = 0;
1743
- aConstraints.gridy += 1;
1744
- 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);
17451823
1746
- //aConstraints.weighty = 1;
1747
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1748
- //aConstraints.gridx += 1;
1749
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1750
- 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);
17511829
1752
- aConstraints.gridx = 0;
1753
- aConstraints.gridy = 0;
1754
- 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);
17551841
17561842 SetMaterial(copy); // .GetMaterial());
17571843
1758
- colorField.addChangeListener(this);
1759
- modulationField.addChangeListener(this);
1844
+ //colorField.addChangeListener(this);
1845
+// modulationField.addChangeListener(this);
17601846 metalnessField.addChangeListener(this);
17611847 diffuseField.addChangeListener(this);
17621848 specularField.addChangeListener(this);
....@@ -1786,12 +1872,15 @@
17861872 opacityPowerField.addChangeListener(this);
17871873 /**/
17881874
1789
- resetSlidersButton.addActionListener(this);
17901875 clearMaterialButton.addActionListener(this);
17911876 createMaterialButton.addActionListener(this);
1792
-
1793
- propagateToggle.addItemListener(this);
1794
- multiplyToggle.addItemListener(this);
1877
+
1878
+ if (Globals.ADVANCED)
1879
+ {
1880
+ resetSlidersButton.addActionListener(this);
1881
+ propagateToggle.addItemListener(this);
1882
+ multiplyToggle.addItemListener(this);
1883
+ }
17951884 }
17961885
17971886 void DropFile(java.io.File[] files, boolean textures)
....@@ -1962,7 +2051,7 @@
19622051
19632052 //? flashIt = false;
19642053 CameraPane pane = (CameraPane) cameraView;
1965
- pane.clickStart(location.x, location.y, 0);
2054
+ pane.clickStart(location.x, location.y, 0, 0);
19662055 pane.clickEnd(location.x, location.y, 0, true);
19672056
19682057 if (group.selection.size() == 1)
....@@ -2011,6 +2100,7 @@
20112100 e2.printStackTrace();
20122101 }
20132102 }
2103
+
20142104 LoadJMEThread loadThread;
20152105
20162106 class LoadJMEThread extends Thread
....@@ -2068,6 +2158,7 @@
20682158 //LoadFile0(filename, converter);
20692159 }
20702160 }
2161
+
20712162 LoadOBJThread loadObjThread;
20722163
20732164 class LoadOBJThread extends Thread
....@@ -2146,19 +2237,19 @@
21462237
21472238 void LoadObjFile(String fullname)
21482239 {
2149
- /*
2240
+ System.out.println("Loading " + fullname);
2241
+ /**/
21502242 //lastFilename = fullname;
21512243 if(loadObjThread == null)
21522244 {
2153
- loadObjThread = new LoadOBJThread();
2154
- loadObjThread.start();
2245
+ loadObjThread = new LoadOBJThread();
2246
+ loadObjThread.start();
21552247 }
21562248
21572249 loadObjThread.add(fullname);
2158
- */
2250
+ /**/
21592251
2160
- System.out.println("Loading " + fullname);
2161
- makeSomething(new FileObject(fullname, true), true);
2252
+ //makeSomething(new FileObject(fullname, true), true);
21622253 }
21632254
21642255 void LoadGFDFile(String fullname)
....@@ -2419,11 +2510,11 @@
24192510
24202511 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24212512 {
2422
- if (GrafreeD.standAlone)
2513
+ if (Grafreed.standAlone)
24232514 {
24242515 /**/
24252516 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2426
- browser.show();
2517
+ browser.setVisible(true);
24272518 String filename = browser.getFile();
24282519 if (filename != null && filename.length() > 0)
24292520 {
....@@ -2568,6 +2659,7 @@
25682659 }
25692660 if (input == null)
25702661 {
2662
+ new Exception().printStackTrace();
25712663 System.exit(0);
25722664 }
25732665
....@@ -2782,7 +2874,8 @@
27822874 return;
27832875 }
27842876
2785
- multiplyToggle.setSelected(mat.multiply);
2877
+ if (multiplyToggle != null)
2878
+ multiplyToggle.setSelected(mat.multiply);
27862879
27872880 assert (object.projectedVertices != null);
27882881
....@@ -2966,42 +3059,40 @@
29663059 return;
29673060 } else if (event.getSource() == toggleTimelineItem)
29683061 {
2969
- copy.timeline ^= true;
3062
+ timeline ^= true;
29703063
2971
- if (copy.timeline)
3064
+ if (timeline)
29723065 {
29733066 centralPanel.remove(cameraView);
2974
- centralPanel.add(timelinePanel);
3067
+ cameraPanel.add(cameraView);
3068
+ centralPanel.add(cameraPanel);
29753069 frame.setJMenuBar(timelineMenubar);
3070
+ wasFullScreen = CameraPane.FULLSCREEN;
3071
+ if (!CameraPane.FULLSCREEN)
3072
+ ToggleFullScreen();
3073
+ toggleFullScreenItem.setEnabled(false);
29763074 }
29773075 else
29783076 {
2979
- centralPanel.remove(timelinePanel);
3077
+ centralPanel.remove(cameraPanel);
29803078 centralPanel.add(cameraView);
29813079 frame.setJMenuBar(null);
3080
+ if (!wasFullScreen)
3081
+ ToggleFullScreen();
3082
+ toggleFullScreenItem.setEnabled(true);
29823083 }
29833084
29843085 frame.validate();
29853086 return;
29863087 } else if (event.getSource() == toggleFullScreenItem)
29873088 {
2988
- if (CameraPane.FULLSCREEN)
2989
- {
2990
- frame.getContentPane().remove(/*"Center",*/bigThree);
2991
- framePanel.add(bigThree);
2992
- frame.getContentPane().add(/*"Center",*/framePanel);
2993
- } else
2994
- {
2995
- frame.getContentPane().remove(/*"Center",*/framePanel);
2996
- frame.getContentPane().add(/*"Center",*/bigThree);
2997
- }
3089
+ ToggleFullScreen();
29983090 frame.validate();
2999
- cameraView.ToggleFullScreen();
30003091
30013092 return;
3002
- } else if (event.getSource() == toggleRandomItem)
3093
+ } else if (event.getSource() == toggleSwitchItem)
30033094 {
3004
- cameraView.ToggleRandom();
3095
+ cameraView.ToggleSwitch();
30053096 cameraView.repaint();
30063097 return;
30073098 } else if (event.getSource() == toggleHandleItem)
....@@ -3030,6 +3121,10 @@
30303121 {
30313122 copy.live ^= true;
30323123 return;
3124
+ } else if (event.getSource() == selectCB)
3125
+ {
3126
+ copy.dontselect ^= true;
3127
+ return;
30333128 } else if (event.getSource() == hideCB)
30343129 {
30353130 copy.hide ^= true;
....@@ -3044,6 +3139,7 @@
30443139 if (event.getSource() == randomCB)
30453140 {
30463141 copy.random ^= true;
3142
+ objEditor.refreshContents();
30473143 return;
30483144 }
30493145 if (event.getSource() == speedupCB)
....@@ -3067,8 +3163,9 @@
30673163
30683164 public void actionPerformed(ActionEvent event)
30693165 {
3166
+ Object source = event.getSource();
30703167 // SCRIPT DIALOG
3071
- if (event.getSource() == okbutton)
3168
+ if (source == okbutton)
30723169 {
30733170 textpanel.setVisible(false);
30743171 textpanel.remove(textarea);
....@@ -3080,7 +3177,7 @@
30803177 textarea = null;
30813178 textpanel = null;
30823179 }
3083
- if (event.getSource() == cancelbutton)
3180
+ if (source == cancelbutton)
30843181 {
30853182 textpanel.setVisible(false);
30863183 textpanel.remove(textarea);
....@@ -3092,49 +3189,50 @@
30923189 //applySelf();
30933190 //client.refreshEditWindow();
30943191 //refreshContents();
3095
- if (event.getSource() == nameField)
3192
+ if (source == nameField)
30963193 {
30973194 //System.out.println("ObjEditor " + event);
30983195 applySelf0(true);
30993196 //parent.applySelf();
31003197 objEditor.refreshContents();
3101
- } else if (event.getSource() == resetButton)
3198
+ } else if (source == resetButton)
31023199 {
31033200 CameraPane.fullreset = true;
31043201 copy.Reset(); // ResetMeshes();
31053202 copy.Touch();
31063203 objEditor.refreshContents();
3107
- } else if (event.getSource() == stepItem)
3204
+ } else if (source == stepItem)
31083205 {
3109
- cameraView.ONESTEP = true;
3206
+ //cameraView.ONESTEP = true;
3207
+ Globals.ONESTEP = true;
31103208 cameraView.repaint();
31113209 return;
3112
- } else if (event.getSource() == stepButton)
3210
+ } else if (source == stepButton)
31133211 {
31143212 copy.Step();
31153213 copy.Touch();
31163214 objEditor.refreshContents();
3117
- } else if (event.getSource() == slowerButton)
3215
+ } else if (source == slowerButton)
31183216 {
31193217 copy.Slower();
31203218 copy.Touch();
31213219 objEditor.refreshContents();
3122
- } else if (event.getSource() == fasterButton)
3220
+ } else if (source == fasterButton)
31233221 {
31243222 copy.Faster();
31253223 copy.Touch();
31263224 objEditor.refreshContents();
3127
- } else if (event.getSource() == remarkButton)
3225
+ } else if (source == remarkButton)
31283226 {
31293227 copy.Remark();
31303228 copy.Touch();
31313229 objEditor.refreshContents();
3132
- } else if (event.getSource() == stepAllButton)
3230
+ } else if (source == stepAllButton)
31333231 {
31343232 copy.StepAll();
31353233 copy.Touch();
31363234 objEditor.refreshContents();
3137
- } else if (event.getSource() == resetAllButton)
3235
+ } else if (source == resetAllButton)
31383236 {
31393237 //CameraPane.fullreset = true;
31403238 copy.ResetAll(); // ResetMeshes();
....@@ -3167,53 +3265,75 @@
31673265 // Close();
31683266 // }
31693267 // else
3170
- if (event.getSource() == resetSlidersButton)
3268
+ if (source == resetSlidersButton)
31713269 {
31723270 ResetSliders();
3173
- } else if (event.getSource() == clearMaterialButton)
3271
+ } else if (source == clearMaterialButton)
31743272 {
31753273 ClearMaterial();
3176
- } else if (event.getSource() == createMaterialButton)
3274
+ } else if (source == createMaterialButton)
31773275 {
31783276 CreateMaterial();
3179
- } else if (event.getSource() == clearPanelButton)
3277
+ } else if (source == clearPanelButton)
31803278 {
31813279 copy.ClearUI();
31823280 refreshContents(true);
3183
- } /*
3184
- }
3185
-
3186
- public boolean action(Event event, Object arg)
3187
- {
3188
- */ 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)
31893306 {
31903307 Close();
31913308 //return true;
3192
- } else if (event.getSource() == loadItem)
3309
+ } else if (source == loadItem)
31933310 {
31943311 load();
31953312 //return true;
3196
- } else if (event.getSource() == saveItem)
3313
+ } else if (source == newItem)
3314
+ {
3315
+ New();
3316
+ } else if (source == saveItem)
31973317 {
31983318 save();
31993319 //return true;
3200
- } else if (event.getSource() == saveAsItem)
3320
+ } else if (source == saveAsItem)
32013321 {
32023322 saveAs();
32033323 //return true;
3204
- } else if (event.getSource() == reexportItem)
3324
+ } else if (source == reexportItem)
32053325 {
32063326 reexport();
32073327 //return true;
3208
- } else if (event.getSource() == exportAsItem)
3328
+ } else if (source == exportAsItem)
32093329 {
32103330 export();
32113331 //return true;
3212
- } else if (event.getSource() == povItem)
3332
+ } else if (source == povItem)
32133333 {
32143334 generatePOV();
32153335 //return true;
3216
- } else if (event.getSource() == zBufferItem)
3336
+ } else if (source == zBufferItem)
32173337 {
32183338 try
32193339 {
....@@ -3235,21 +3355,8 @@
32353355 cameraView.repaint();
32363356 //return true;
32373357 }
3238
- */ else if (event.getSource() == editCameraItem)
3239
- {
3240
- cameraView.ProtectCamera();
3241
- cameraView.repaint();
3242
- return;
3243
- } else if (event.getSource() == revertCameraItem)
3244
- {
3245
- cameraView.RevertCamera();
3246
- cameraView.repaint();
3247
- return;
3248
-// } else if (event.getSource() == textureButton)
3249
-// {
3250
-// return; // true;
3251
- } else // combos...
3252
- if (event.getSource() == texresMenu)
3358
+ */ else // combos...
3359
+ if (source == texresMenu)
32533360 {
32543361 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32553362 copy.texres = texresMenu.getSelectedIndex();
....@@ -3261,27 +3368,287 @@
32613368 }
32623369 }
32633370
3264
- void ToggleAnimation()
3371
+ void New()
32653372 {
3266
- if (!CameraPane.ANIMATION)
3373
+ while (copy.Size() > 1)
32673374 {
3268
- 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);
32693602 browser.show();
32703603 String filename = browser.getFile();
32713604 if (filename != null && filename.length() > 0)
32723605 {
3273
- 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;
32743641 //CameraPane.framecount = 0;
3275
- CameraPane.imagecount = 0;
3642
+ Globals.imagecount = 0;
32763643
3277
- CameraPane.ANIMATION ^= true;
3644
+ Globals.ANIMATION ^= true;
32783645
3279
- GrafreeD.wav.cursor = 0;
3280
- GrafreeD.wav.loop = 0;
3646
+ Grafreed.wav.cursor = 0;
3647
+ Grafreed.wav.loop = 0;
32813648 }
32823649 } else
32833650 {
3284
- CameraPane.ANIMATION ^= true;
3651
+ Globals.ANIMATION ^= true;
32853652 }
32863653 }
32873654
....@@ -3327,7 +3694,7 @@
33273694 void CreateMaterial()
33283695 {
33293696 //copy.ClearMaterial(); // PATCH
3330
- copy.CreateMaterialS(multiplyToggle.isSelected());
3697
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33313698 if (copy.selection.size() > 0)
33323699 //SetMaterial(copy);
33333700 {
....@@ -3378,7 +3745,7 @@
33783745 assert false;
33793746 }
33803747
3381
- void EditSelection()
3748
+ void EditSelection(boolean newWindow)
33823749 {
33833750 }
33843751
....@@ -3386,11 +3753,11 @@
33863753 {
33873754 copy.ResetBlockLoop(); // temporary problem
33883755
3389
- boolean random = CameraPane.RANDOM;
3390
- CameraPane.RANDOM = false; // parse everything
3756
+ boolean random = CameraPane.SWITCH;
3757
+ CameraPane.SWITCH = false; // parse everything
33913758 copy.ResetDisplayList();
33923759 copy.HardTouch();
3393
- CameraPane.RANDOM = random;
3760
+ CameraPane.SWITCH = random;
33943761 }
33953762
33963763 // public void applySelf()
....@@ -3460,10 +3827,40 @@
34603827 current.fakedepth = (float) fakedepthField.getFloat();
34613828 current.shadowbias = (float) shadowbiasField.getFloat();
34623829
3463
- if (!NumberSlider.frozen)
3830
+ if (!cNumberSlider.frozen)
34643831 {
34653832 //System.out.println("Propagate = " + propagate);
34663833 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
+
34673864 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34683865 {
34693866 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3508,6 +3905,7 @@
35083905 || e.getSource() == apertureField
35093906 || e.getSource() == shadowblurField)
35103907 {
3908
+ new Exception().printStackTrace();
35113909 System.exit(0);
35123910 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35133911 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3534,7 +3932,13 @@
35343932 //System.out.println("PARENT = " + parent);
35353933 //if (parent != null)
35363934 // parent.applySelf();
3537
- refreshContents();
3935
+ if (e.getSource() == normalpushField)
3936
+ {
3937
+ objEditor.refreshContents();
3938
+ //Refresh();
3939
+ }
3940
+ else
3941
+ refreshContents();
35383942 // ??? client.refreshEditWindow();
35393943 }
35403944 //else
....@@ -3546,7 +3950,7 @@
35463950 //group.name = nameField.getText();
35473951 //objEditor.applySelf();
35483952
3549
- assert (objEditor == this);
3953
+ // OCT2018: assert (objEditor == this);
35503954 if (copy.selection == null || copy.selection.size() == 0)
35513955 //super.applySelf()
35523956 ; else
....@@ -3570,12 +3974,18 @@
35703974 objEditor.copy = keep;
35713975 }
35723976 }
3977
+
3978
+ if (normalpushField != null)
3979
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35733980 }
35743981
35753982 void SnapObject()
35763983 {
3577
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3578
- SnapObject(obj);
3984
+ if (copy.selection.size() > 0)
3985
+ {
3986
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3987
+ SnapObject(obj);
3988
+ }
35793989 }
35803990
35813991 void SnapObject(Object3D obj)
....@@ -3821,7 +4231,7 @@
38214231
38224232 radioPanel.revalidate();
38234233 radioPanel.repaint();
3824
- ctrlPanel.revalidate(); // ? new
4234
+ ctrlPanel.validate(); // ? new
38254235 ctrlPanel.repaint();
38264236 }
38274237 }
....@@ -3830,6 +4240,8 @@
38304240
38314241 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38324242 {
4243
+ if (Globals.SAVEONMAKE) // && resetmodel)
4244
+ Save();
38334245 //Tween.set(thing, 0).target(1).start(tweenManager);
38344246 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38354247 // if (thing instanceof GenericJointDemo)
....@@ -3916,6 +4328,12 @@
39164328 {
39174329 ResetModel();
39184330 Select(thing.GetTreePath(), true, false); // unselect... false);
4331
+
4332
+ if (thing.Size() == 0)
4333
+ {
4334
+ //EditSelection(false);
4335
+ }
4336
+
39194337 refreshContents();
39204338 }
39214339
....@@ -4033,6 +4451,7 @@
40334451 }
40344452 }
40354453 }
4454
+
40364455 LoadGFDThread loadGFDThread;
40374456
40384457 void ReadGFD(String fullname, iCallBack cb)
....@@ -4052,8 +4471,10 @@
40524471
40534472 try
40544473 {
4474
+ // Try compressed version first.
40554475 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4056
- 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);
40574478
40584479 readobj = (Object3D) p.readObject();
40594480 istream.close();
....@@ -4061,7 +4482,20 @@
40614482 readobj.ResetDisplayList();
40624483 } catch (Exception e)
40634484 {
4064
- 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
+ }
40654499 }
40664500 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40674501 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4107,6 +4541,12 @@
41074541
41084542 void LoadIt(Object obj)
41094543 {
4544
+ if (obj == null)
4545
+ {
4546
+ // Invalid file
4547
+ return;
4548
+ }
4549
+
41104550 System.out.println("Loaded " + obj);
41114551 //new Exception().printStackTrace();
41124552 Object3D readobj = (Object3D) obj;
....@@ -4116,6 +4556,8 @@
41164556
41174557 if (readobj != null)
41184558 {
4559
+ if (Globals.SAVEONMAKE)
4560
+ Save();
41194561 try
41204562 {
41214563 //readobj.deepCopySelf(copy);
....@@ -4178,7 +4620,7 @@
41784620
41794621 void load() // throws ClassNotFoundException
41804622 {
4181
- if (GrafreeD.standAlone)
4623
+ if (Grafreed.standAlone)
41824624 {
41834625 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
41844626 browser.show();
....@@ -4265,11 +4707,13 @@
42654707 try
42664708 {
42674709 FileOutputStream ostream = new FileOutputStream(lastname);
4268
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4710
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4711
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42694712
42704713 p.writeObject(copy);
42714714 p.flush();
42724715
4716
+ zstream.close();
42734717 ostream.close();
42744718
42754719 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4279,11 +4723,12 @@
42794723 {
42804724 }
42814725 }
4726
+
42824727 String lastname;
42834728
42844729 void saveAs()
42854730 {
4286
- if (GrafreeD.standAlone)
4731
+ if (Grafreed.standAlone)
42874732 {
42884733 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42894734 browser.setVisible(true);
....@@ -4388,13 +4833,13 @@
43884833 try
43894834 {
43904835 FileOutputStream ostream = new FileOutputStream(filename);
4391
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4392
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4836
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4837
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43934838
43944839 Object3D objectparent = obj.parent;
43954840 obj.parent = null;
43964841
4397
- Object3D object = (Object3D) GrafreeD.clone(obj);
4842
+ Object3D object = (Object3D) Grafreed.clone(obj);
43984843
43994844 obj.parent = objectparent;
44004845
....@@ -4406,8 +4851,8 @@
44064851 p.writeObject(object);
44074852 p.flush();
44084853
4854
+ zstream.close();
44094855 ostream.close();
4410
- // zstream.close();
44114856
44124857 // group.selection.get(0).parent = parent;
44134858 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4428,7 +4873,7 @@
44284873 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44294874 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44304875 copy.generatePOV(buffer);
4431
- if (GrafreeD.standAlone)
4876
+ if (Grafreed.standAlone)
44324877 {
44334878 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44344879 browser.show();
....@@ -4454,7 +4899,8 @@
44544899 Object3D client;
44554900 Object3D copy;
44564901 MenuBar menuBar;
4457
- Menu windowMenu;
4902
+ Menu fileMenu;
4903
+ MenuItem newItem;
44584904 MenuItem loadItem;
44594905 MenuItem saveItem;
44604906 MenuItem saveAsItem;
....@@ -4462,13 +4908,11 @@
44624908 MenuItem reexportItem;
44634909 MenuItem povItem;
44644910 MenuItem closeItem;
4465
- Menu cameraMenu;
4911
+
44664912 CheckboxMenuItem zBufferItem;
44674913 //MenuItem normalLensItem;
4468
- MenuItem editCameraItem;
4469
- MenuItem revertCameraItem;
4470
- CheckboxMenuItem toggleLiveItem;
44714914 MenuItem stepItem;
4915
+ CheckboxMenuItem toggleLiveItem;
44724916 CheckboxMenuItem toggleFullScreenItem;
44734917 CheckboxMenuItem toggleTimelineItem;
44744918 CheckboxMenuItem toggleRenderItem;
....@@ -4477,28 +4921,40 @@
44774921 CheckboxMenuItem toggleFootContactItem;
44784922 CheckboxMenuItem toggleDLItem;
44794923 CheckboxMenuItem toggleTextureItem;
4480
- CheckboxMenuItem toggleRandomItem;
4924
+ CheckboxMenuItem toggleSwitchItem;
44814925 CheckboxMenuItem toggleRootItem;
44824926 CheckboxMenuItem animationItem;
44834927 CheckboxMenuItem toggleHandleItem;
44844928 CheckboxMenuItem togglePaintItem;
44854929 JSplitPane mainPanel;
44864930 JScrollPane scrollpane;
4931
+
44874932 JPanel toolbarPanel;
4488
- JPanel treePanel;
4933
+
4934
+ cGridBag treePanel;
4935
+
44894936 JPanel radioPanel;
44904937 ButtonGroup buttonGroup;
4491
- JPanel ctrlPanel;
4492
- JPanel materialPanel;
4938
+
4939
+ cGridBag toolboxPanel;
4940
+ cGridBag materialPanel;
4941
+ cGridBag ctrlPanel;
4942
+
44934943 JScrollPane infoPanel;
4494
- JPanel optionsPanel;
4944
+
4945
+ cGridBag optionsPanel;
4946
+
44954947 JTabbedPane objectPanel;
4496
- JPanel XYZPanel;
4948
+
4949
+ cGridBag XYZPanel;
4950
+
44974951 JSplitPane gridPanel;
44984952 JSplitPane bigPanel;
4499
- JPanel bigThree;
4500
- JTabbedPane scenePanel;
4501
- JPanel centralPanel;
4953
+
4954
+ cGridBag bigThree;
4955
+ cGridBag scenePanel;
4956
+ cGridBag centralPanel;
4957
+ JSplitPane cameraPanel;
45024958 JPanel timelinePanel;
45034959 JMenuBar timelineMenubar;
45044960 JSplitPane framePanel;
....@@ -4550,65 +5006,72 @@
45505006 // MATERIAL
45515007 JLabel materialLabel;
45525008 JLabel colorLabel;
4553
- NumberSlider colorField;
5009
+ cNumberSlider colorField;
45545010 JLabel modulationLabel;
4555
- NumberSlider modulationField;
5011
+ cNumberSlider modulationField;
45565012 JLabel metalnessLabel;
4557
- NumberSlider metalnessField;
5013
+ cNumberSlider metalnessField;
45585014 JLabel diffuseLabel;
4559
- NumberSlider diffuseField;
5015
+ cNumberSlider diffuseField;
45605016 JLabel specularLabel;
4561
- NumberSlider specularField;
5017
+ cNumberSlider specularField;
45625018 JLabel shininessLabel;
4563
- NumberSlider shininessField;
5019
+ cNumberSlider shininessField;
45645020 JLabel shiftLabel;
4565
- NumberSlider shiftField;
5021
+ cNumberSlider shiftField;
45665022 JLabel ambientLabel;
4567
- NumberSlider ambientField;
5023
+ cNumberSlider ambientField;
45685024 JLabel lightareaLabel;
4569
- NumberSlider lightareaField;
5025
+ cNumberSlider lightareaField;
45705026 JLabel diffusenessLabel;
4571
- NumberSlider diffusenessField;
5027
+ cNumberSlider diffusenessField;
45725028 JLabel velvetLabel;
4573
- NumberSlider velvetField;
5029
+ cNumberSlider velvetField;
45745030 JLabel sheenLabel;
4575
- NumberSlider sheenField;
5031
+ cNumberSlider sheenField;
45765032 JLabel subsurfaceLabel;
4577
- NumberSlider subsurfaceField;
5033
+ cNumberSlider subsurfaceField;
45785034 //JLabel bumpLabel;
45795035 //NumberSlider bumpField;
45805036 JLabel backlitLabel;
4581
- NumberSlider backlitField;
5037
+ cNumberSlider backlitField;
45825038 JLabel anisoLabel;
4583
- NumberSlider anisoField;
5039
+ cNumberSlider anisoField;
45845040 JLabel anisoVLabel;
4585
- NumberSlider anisoVField;
5041
+ cNumberSlider anisoVField;
45865042 JLabel cameraLabel;
4587
- NumberSlider cameraField;
5043
+ cNumberSlider cameraField;
45885044 JLabel selfshadowLabel;
4589
- NumberSlider selfshadowField;
5045
+ cNumberSlider selfshadowField;
45905046 JLabel shadowLabel;
4591
- NumberSlider shadowField;
5047
+ cNumberSlider shadowField;
45925048 JLabel textureLabel;
4593
- NumberSlider textureField;
5049
+ cNumberSlider textureField;
45945050 JLabel opacityLabel;
4595
- NumberSlider opacityField;
5051
+ cNumberSlider opacityField;
45965052 JLabel fakedepthLabel;
4597
- NumberSlider fakedepthField;
5053
+ cNumberSlider fakedepthField;
45985054 JLabel shadowbiasLabel;
4599
- NumberSlider shadowbiasField;
5055
+ cNumberSlider shadowbiasField;
46005056 JLabel bumpLabel;
4601
- NumberSlider bumpField;
5057
+ cNumberSlider bumpField;
46025058 JLabel noiseLabel;
4603
- NumberSlider noiseField;
5059
+ cNumberSlider noiseField;
46045060 JLabel powerLabel;
4605
- NumberSlider powerField;
5061
+ cNumberSlider powerField;
46065062 JLabel borderfadeLabel;
4607
- NumberSlider borderfadeField;
5063
+ cNumberSlider borderfadeField;
46085064 JLabel fogLabel;
4609
- NumberSlider fogField;
5065
+ cNumberSlider fogField;
46105066 JLabel opacityPowerLabel;
4611
- NumberSlider opacityPowerField;
4612
- JTree jTree;
5067
+ cNumberSlider opacityPowerField;
5068
+ cTree jTree;
46135069 //ObjectUI parent;
5070
+
5071
+ cNumberSlider normalpushField;
5072
+
5073
+ private MenuItem importGFDItem;
5074
+ private MenuItem importVRMLX3DItem;
5075
+ private MenuItem import3DSItem;
5076
+ private MenuItem importOBJItem;
46145077 }