Normand Briere
2019-06-24 914255f70cf047897212839cbf3a6722703f4457
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -19,6 +20,8 @@
1920 import //weka.core.
2021 matrix.Matrix;
2122
23
+import grafeme.ui.*;
24
+
2225 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2326 ActionListener, ChangeListener,
2427 InputMethodListener,
....@@ -28,7 +31,60 @@
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
+ cCheckBox GetCheckBox(String name, boolean border)
56
+ {
57
+ try
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cCheckBox(icon, border);
61
+ }
62
+ catch (Exception e)
63
+ {
64
+ return new cCheckBox(name, border);
65
+ }
66
+ }
67
+
68
+ private ImageIcon GetIcon(String name) throws IOException
69
+ {
70
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
71
+
72
+ if (image.getWidth() != 24 && image.getHeight() != 24)
73
+ {
74
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
75
+ Graphics2D g = resized.createGraphics();
76
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
77
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
78
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
79
+ g.dispose();
80
+
81
+ image = resized;
82
+ }
83
+
84
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
85
+ return icon;
86
+ }
87
+
3288 // SCRIPT
3389
3490 transient JFrame textpanel = null;
....@@ -119,51 +175,62 @@
119175 void keyPressed(int key, int modifiers)
120176 {
121177 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
178
+ Globals.theRenderer.keyPressed(key, modifiers);
123179 }
124180 */
125181
126182 static GridBagConstraints aConstraints;
127183 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
184
+
130185 static int GRIDWIDTH = 100; // 4;
131186
132187 public void closeUI()
133188 {
134189 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
190
+// System.out.println("this = " + this);
191
+// System.out.println("objEditor = " + objEditor);
137192 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
193
+// objEditor.ctrlPanel.remove(nameField);
194
+
195
+ objEditor.ctrlPanel.remove(namePanel);
139196
140197 if (!GroupEditor.allparams)
141198 return;
142199
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);
200
+// objEditor.ctrlPanel.remove(liveCB);
201
+// objEditor.ctrlPanel.remove(hideCB);
202
+// objEditor.ctrlPanel.remove(markCB);
203
+//
204
+// objEditor.ctrlPanel.remove(randomCB);
205
+// objEditor.ctrlPanel.remove(speedupCB);
206
+// objEditor.ctrlPanel.remove(rewindCB);
207
+//
208
+// objEditor.ctrlPanel.remove(resetButton);
209
+// objEditor.ctrlPanel.remove(stepButton);
210
+//// objEditor.ctrlPanel.remove(stepAllButton);
211
+//// objEditor.ctrlPanel.remove(resetAllButton);
212
+// objEditor.ctrlPanel.remove(link2masterCB);
213
+// //objEditor.ctrlPanel.remove(flipVCB);
214
+// //objEditor.ctrlPanel.remove(texresMenu);
215
+// objEditor.ctrlPanel.remove(slowerButton);
216
+// objEditor.ctrlPanel.remove(fasterButton);
217
+// objEditor.ctrlPanel.remove(remarkButton);
218
+
219
+ objEditor.ctrlPanel.remove(setupPanel);
220
+ objEditor.ctrlPanel.remove(setupPanel2);
221
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
222
+ objEditor.ctrlPanel.remove(pushPanel);
223
+ //objEditor.ctrlPanel.remove(fillPanel);
224
+
225
+ //Remove(normalpushField);
161226 }
162227
163228 public ObjEditor GetEditor()
164229 {
165230 return objEditor; //.GetEditor();
166231 }
232
+
233
+ // Sometimes myself, sometimes my callee's.
167234 ObjEditor objEditor;
168235
169236 /*
....@@ -226,6 +293,7 @@
226293 //localCopy.parent = null;
227294
228295 frame = new JFrame();
296
+ frame.setUndecorated(true);
229297 objEditor = this;
230298 this.callee = callee;
231299
....@@ -238,7 +306,7 @@
238306 //if (!isDisplayable())
239307 //setUndecorated(true);
240308
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
309
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242310 client = inClient;
243311 copy = localCopy;
244312 copy.editWindow = this;
....@@ -259,24 +327,40 @@
259327 void SetupMenu()
260328 {
261329 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..."));
330
+ menuBar.add(fileMenu = new Menu("File"));
331
+ fileMenu.add(newItem = new MenuItem("New"));
332
+ fileMenu.add(loadItem = new MenuItem("Open..."));
333
+
334
+ //oe.menuBar.add(menu = new Menu("Include"));
335
+ Menu menu = new Menu("Import");
336
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
337
+ importOBJItem.addActionListener(this);
338
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
339
+ import3DSItem.addActionListener(this);
340
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
341
+ importVRMLX3DItem.addActionListener(this);
342
+ menu.add("-");
343
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
344
+ importGFDItem.addActionListener(this);
345
+ fileMenu.add(menu);
346
+ fileMenu.add("-");
347
+
348
+ fileMenu.add(saveItem = new MenuItem("Save"));
349
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
267350 //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("-");
351
+ fileMenu.add("-");
352
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
353
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
354
+ fileMenu.add("-");
272355 if (client.parent != null)
273356 {
274
- windowMenu.add(closeItem = new MenuItem("Close"));
357
+ fileMenu.add(closeItem = new MenuItem("Close"));
275358 } else
276359 {
277
- windowMenu.add(closeItem = new MenuItem("Exit"));
360
+ fileMenu.add(closeItem = new MenuItem("Exit"));
278361 }
279362
363
+ newItem.addActionListener(this);
280364 loadItem.addActionListener(this);
281365 saveItem.addActionListener(this);
282366 saveAsItem.addActionListener(this);
....@@ -285,79 +369,35 @@
285369 //povItem.addActionListener(this);
286370 closeItem.addActionListener(this);
287371
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
-
343372 objectPanel = new JTabbedPane();
344373 toolbarPanel = new JPanel();
345374 toolbarPanel.setName("Toolbar");
346
- treePanel = new JPanel();
375
+ treePanel = new cGridBag();
347376 treePanel.setName("Tree");
348
- ctrlPanel = new JPanel(); // new GridBagLayout());
349
- ctrlPanel.setName("Edit");
350
- materialPanel = new JPanel();
377
+
378
+ editPanel = new cGridBag().setVertical(true);
379
+ editPanel.setName("Edit");
380
+
381
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
382
+
383
+ editCommandsPanel = new cGridBag();
384
+ editPanel.add(editCommandsPanel);
385
+ editPanel.add(ctrlPanel);
386
+
387
+ materialPanel = new cGridBag().setVertical(true);
388
+
351389 materialPanel.setName("Material");
352390 /*JTextPane*/
353391 infoarea = createTextPane();
392
+ doc = infoarea.getStyledDocument();
393
+
354394 infoarea.setEditable(true);
355395 SetText();
356396 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
357397 // infoarea.setOpaque(false);
358398 // //infoarea.setForeground(textcolor);
359
- infoarea.setLineWrap(true);
360
- infoarea.setWrapStyleWord(true);
399
+// TEXTAREA infoarea.setLineWrap(true);
400
+// TEXTAREA infoarea.setWrapStyleWord(true);
361401 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
362402 infoPanel.setPreferredSize(new Dimension(50, 200));
363403 infoPanel.setName("Info");
....@@ -368,16 +408,16 @@
368408 mainPanel.setName("Main");
369409 mainPanel.setContinuousLayout(true);
370410 mainPanel.setOneTouchExpandable(true);
371
- mainPanel.setDividerLocation(1.0);
372411 mainPanel.setDividerSize(9);
373
- mainPanel.setResizeWeight(0);
412
+ mainPanel.setDividerLocation(0.5); //1.0);
413
+ mainPanel.setResizeWeight(0.5);
374414
375415 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
376416 //mainPanel.setLayout(new GridBagLayout());
377417 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
378
- treePanel.setLayout(new GridBagLayout());
379
- ctrlPanel.setLayout(new GridBagLayout());
380
- materialPanel.setLayout(new GridBagLayout());
418
+// treePanel.setLayout(new GridBagLayout());
419
+ //ctrlPanel.setLayout(new GridBagLayout());
420
+ //materialPanel.setLayout(new GridBagLayout());
381421
382422 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
383423 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -416,7 +456,7 @@
416456 static String newline = "\n";
417457 protected static final String buttonString = "JButton";
418458 StyledDocument doc;
419
- JTextArea infoarea;
459
+ JTextPane infoarea;
420460
421461 void ClearInfo()
422462 {
....@@ -439,10 +479,10 @@
439479 e.printStackTrace();
440480 }
441481
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();
482
+// String selection = infoarea.getText();
483
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
484
+// java.awt.datatransfer.Clipboard clipboard =
485
+// Toolkit.getDefaultToolkit().getSystemClipboard();
446486 //clipboard.setContents(data, data);
447487 }
448488
....@@ -465,13 +505,13 @@
465505 //SendInfo("Name:", "bold");
466506 if (sel.GetTextures() != null || debug)
467507 {
468
- si.SendInfo(sel.toString(), "bold");
508
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
469509 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
470510 if (sel.Size() > 0)
471511 {
472512 si.SendInfo("#children = " + sel.Size(), "regular");
473513 }
474
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
514
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
475515 if (debug)
476516 {
477517 try
....@@ -483,7 +523,10 @@
483523 }
484524
485525 if (full)
486
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
526
+ {
527
+ si.SendInfo(" BBox min: " + minima, "regular");
528
+ si.SendInfo(" BBox max: " + maxima, "regular");
529
+ }
487530
488531 if (sel.bRep != null)
489532 {
....@@ -510,7 +553,7 @@
510553 }
511554 if (sel.support != null)
512555 {
513
- si.SendInfo(" support: " + sel.support, "regular");
556
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
514557 }
515558 if (sel.scriptnode != null)
516559 {
....@@ -581,6 +624,9 @@
581624 {
582625 CameraPane.pointflow = (PointFlow) sel;
583626 }
627
+
628
+ si.SendInfo("_____________________", "regular");
629
+ si.SendInfo("", "regular");
584630 }
585631 }
586632
....@@ -596,52 +642,138 @@
596642 }
597643 }
598644
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
- };
645
+static GraphicsDevice device = GraphicsEnvironment
646
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
616647
617
- String[] initStyles =
648
+ Rectangle keeprect;
649
+ cRadio radio;
650
+
651
+cButton keepButton;
652
+ cButton twoButton; // Full 3D
653
+ cButton sixButton;
654
+ cButton threeButton;
655
+ cButton sevenButton;
656
+ cButton fourButton; // full panel
657
+ cButton oneButton; // full XYZ
658
+ //cButton currentLayout;
659
+
660
+ boolean maximized;
661
+
662
+ void Minimize()
618663 {
619
- "regular", "italic", "bold", "small", "large",
620
- "regular", "button", "regular", "icon",
621
- "regular"
622
- };
623
-
624
- JTextPane textPane = new JTextPane();
625
- textPane.setEditable(true);
626
- /*StyledDocument*/ doc = textPane.getStyledDocument();
627
- addStylesToDocument(doc);
628
-
629
- try
664
+ frame.setState(Frame.ICONIFIED);
665
+ }
666
+
667
+ void Maximize()
630668 {
631
- for (int j = 0; j < 2; j++)
669
+ if (maximized)
632670 {
633
- for (int i = 0; i < initString.length; i++)
634
- {
635
- doc.insertString(doc.getLength(), initString[i],
636
- doc.getStyle(initStyles[i]));
637
- }
671
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
638672 }
639
- } catch (BadLocationException ble)
673
+ else
674
+ {
675
+ keeprect = frame.getBounds();
676
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
677
+ Dimension rect2 = frame.getToolkit().getScreenSize();
678
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
679
+// frame.setState(Frame.MAXIMIZED_BOTH);
680
+ }
681
+
682
+ maximized ^= true;
683
+ }
684
+
685
+ void ToggleFullScreen()
640686 {
641
- System.err.println("Couldn't insert initial text into text pane.");
687
+ if (CameraPane.FULLSCREEN)
688
+ {
689
+ device.setFullScreenWindow(null);
690
+ //frame.setVisible(false);
691
+// frame.removeNotify();
692
+// frame.setUndecorated(false);
693
+// frame.addNotify();
694
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
695
+
696
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
697
+// X framePanel.add(bigThree);
698
+// X frame.getContentPane().add(/*"Center",*/framePanel);
699
+ framePanel.setDividerLocation(1);
700
+
701
+ //frame.setVisible(true);
702
+ radio.layout = keepButton;
703
+ //theFrame = null;
704
+ keepButton = null;
705
+ radio.layout.doClick();
706
+
707
+ } else
708
+ {
709
+ keepButton = radio.layout;
710
+ //keeprect = frame.getBounds();
711
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
712
+// frame.getToolkit().getScreenSize().height);
713
+ //frame.setVisible(false);
714
+ device.setFullScreenWindow(frame);
715
+// frame.removeNotify();
716
+// frame.setUndecorated(true);
717
+// frame.addNotify();
718
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
719
+// X framePanel.remove(bigThree);
720
+// X frame.getContentPane().add(/*"Center",*/bigThree);
721
+ framePanel.setDividerLocation(0);
722
+
723
+ radio.layout = twoButton;
724
+ radio.layout.doClick();
725
+ //frame.setVisible(true);
726
+ }
727
+
728
+ cameraView.ToggleFullScreen();
642729 }
643730
644
- return new JTextArea(); // textPane;
731
+ private JTextPane createTextPane()
732
+ {
733
+// TEXTAREA String[] initString =
734
+// {
735
+// "This is an editable JTextPane, ", //regular
736
+// "another ", //italic
737
+// "styled ", //bold
738
+// "text ", //small
739
+// "component, ", //large
740
+// "which supports embedded components..." + newline,//regular
741
+// " " + newline, //button
742
+// "...and embedded icons..." + newline, //regular
743
+// " ", //icon
744
+// newline + "JTextPane is a subclass of JEditorPane that "
745
+// + "uses a StyledEditorKit and StyledDocument, and provides "
746
+// + "cover methods for interacting with those objects."
747
+// };
748
+//
749
+// String[] initStyles =
750
+// {
751
+// "regular", "italic", "bold", "small", "large",
752
+// "regular", "button", "regular", "icon",
753
+// "regular"
754
+// };
755
+//
756
+// JTextPane textPane = new JTextPane();
757
+// textPane.setEditable(true);
758
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
759
+// addStylesToDocument(doc);
760
+//
761
+// try
762
+// {
763
+// for (int j = 0; j < 2; j++)
764
+// {
765
+// for (int i = 0; i < initString.length; i++)
766
+// {
767
+// doc.insertString(doc.getLength(), initString[i],
768
+// doc.getStyle(initStyles[i]));
769
+// }
770
+// }
771
+// } catch (BadLocationException ble)
772
+// {
773
+// System.err.println("Couldn't insert initial text into text pane.");
774
+// }
775
+
776
+ return new JTextPane(); // textPane;
645777 }
646778
647779 protected void addStylesToDocument(StyledDocument doc)
....@@ -694,7 +826,7 @@
694826 protected static ImageIcon createImageIcon(String path,
695827 String description)
696828 {
697
- java.net.URL imgURL = GrafreeD.class.getResource(path);
829
+ java.net.URL imgURL = Grafreed.class.getResource(path);
698830 if (imgURL != null)
699831 {
700832 return new ImageIcon(imgURL, description);
....@@ -726,6 +858,7 @@
726858 // NumberSlider vDivsField;
727859 // JCheckBox endcaps;
728860 JCheckBox liveCB;
861
+ JCheckBox selectCB;
729862 JCheckBox hideCB;
730863 JCheckBox link2masterCB;
731864 JCheckBox markCB;
....@@ -741,115 +874,87 @@
741874 JButton slowerButton;
742875 JButton fasterButton;
743876 JButton remarkButton;
877
+
878
+ cGridBag editPanel;
879
+ cGridBag editCommandsPanel;
880
+
881
+ cGridBag namePanel;
882
+ cGridBag setupPanel;
883
+ cGridBag setupPanel2;
884
+ cGridBag objectCommandsPanel;
885
+ cGridBag pushPanel;
886
+ cGridBag fillPanel;
744887
745
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
888
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
746889 {
747890 JCheckBox cb;
748891
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);
892
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
754893 cb.addItemListener(this);
755
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
756
- oe.aConstraints.gridwidth = 1;
757
- oe.aConstraints.gridx += 1;
758894
759895 return cb;
760896 }
761897
762
- cButton AddButton(ObjEditor oe, String label)
898
+ cButton AddButton(cGridBag panel, String label)
763899 {
764900 cButton cb;
765901
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);
902
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
771903 cb.addActionListener(this);
772
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
773
- oe.aConstraints.gridwidth = 1;
774
- oe.aConstraints.gridx += 1;
775904
776905 return cb;
777906 }
778907
779
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
908
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
780909 {
781910 JComboBox combo;
782911
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;
912
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
786913 combo.addActionListener(this);
787914
788915 return combo;
789916 }
790917
791
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
918
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
792919 {
793
- NumberSlider combo;
920
+ cGridBag control = new cGridBag();
921
+
922
+ cNumberSlider combo;
794923
795924 JLabel jlabel = new JLabel(label);
796
-
797
- aConstraints.fill = GridBagConstraints.VERTICAL;
798925 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
-
926
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
927
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
808928 combo.setFloat(current);
809
-
810
- combo.label = jlabel;
811
-
812
- combo.addChangeListener(this);
813
-
814
- return combo;
929
+
930
+ panel.add(control);
931
+
932
+ return control;
815933 }
816934
817
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
935
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
818936 {
819
- NumberSlider combo;
937
+ cGridBag control = new cGridBag();
938
+
939
+ cNumberSlider combo;
820940
821941 JLabel jlabel = new JLabel(label);
822
-
823
- aConstraints.fill = GridBagConstraints.VERTICAL;
824942 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
-
943
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
944
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
834945 combo.setInteger(current);
835946
836
- combo.label = jlabel;
837
-
838
- combo.addChangeListener(this);
839
-
840
- return combo;
947
+ panel.add(control);
948
+
949
+ return control;
841950 }
842951
843
- JTextArea AddText(JPanel ctrlPanel, String name)
952
+ JTextArea AddText(cGridBag ctrlPanel, String name)
844953 {
845954 JTextArea text;
846955
847
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
848
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
849
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
956
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
850957 text.addCaretListener(this);
851
- aConstraints.gridx += 1;
852
- aConstraints.gridwidth = 1;
853958
854959 return text;
855960 }
....@@ -879,9 +984,16 @@
879984 objEditor.ctrlPanel.remove(j);
880985 }
881986
987
+ void Remove(cNumberSlider j)
988
+ {
989
+ j.removeChangeListener(this);
990
+ //objEditor.ctrlPanel.remove(j.label);
991
+ objEditor.ctrlPanel.remove(j);
992
+ }
993
+
882994 /*
883995 */
884
- void Return() // ObjEditor oe)
996
+ void Return0() // ObjEditor oe)
885997 {
886998 aConstraints.gridy += 1;
887999 aConstraints.gridx = 0;
....@@ -936,35 +1048,77 @@
9361048
9371049 void SetupUI2(ObjEditor oe)
9381050 {
939
-// oe.aConstraints.weightx = 0;
940
-// oe.aConstraints.weighty = 0;
941
-// oe.aConstraints.gridx = 0;
942
-// oe.aConstraints.gridy = 0;
943
- SetupName(oe);
1051
+ //SetupName(oe);
1052
+
1053
+ namePanel = new cGridBag();
1054
+
1055
+ nameField = AddText(namePanel, copy.GetName());
1056
+ namePanel.add(nameField);
1057
+ oe.ctrlPanel.add(namePanel);
1058
+
1059
+ oe.ctrlPanel.Return();
9441060
9451061 if (!GroupEditor.allparams)
9461062 return;
9471063
948
- liveCB = AddCheckBox(oe, "Live", copy.live);
949
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
950
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1064
+ setupPanel = new cGridBag().setVertical(false);
1065
+
1066
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1067
+ liveCB.setToolTipText("Animate object");
1068
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1069
+ selectCB.setToolTipText("Make object selectable");
9511070 // 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");
1071
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1072
+ hideCB.setToolTipText("Hide object");
1073
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1074
+ markCB.setToolTipText("Set the animation target transform");
1075
+
1076
+ setupPanel2 = new cGridBag().setVertical(false);
1077
+
1078
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1079
+ rewindCB.setToolTipText("Rewind animation");
1080
+
1081
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1082
+ randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1083
+
1084
+ if (Globals.ADVANCED)
1085
+ {
1086
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1087
+ link2masterCB.setToolTipText("Attach to support");
1088
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1089
+ speedupCB.setToolTipText("Option motion capture");
1090
+ }
1091
+
1092
+ oe.ctrlPanel.add(setupPanel);
1093
+ oe.ctrlPanel.Return();
1094
+ oe.ctrlPanel.add(setupPanel2);
1095
+ oe.ctrlPanel.Return();
1096
+
1097
+ objectCommandsPanel = new cGridBag().setVertical(false);
1098
+
1099
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1100
+ resetButton.setToolTipText("Jump to frame zero");
1101
+ stepButton = AddButton(objectCommandsPanel, "Step");
1102
+ stepButton.setToolTipText("Step one frame");
9581103 // resetAllButton = AddButton(oe, "Reset All");
9591104 // stepAllButton = AddButton(oe, "Step All");
960
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9611105 // Return();
962
- slowerButton = AddButton(oe, "Slow");
963
- fasterButton = AddButton(oe, "Fast");
964
- remarkButton = AddButton(oe, "Rem");
1106
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1107
+ slowerButton.setToolTipText("Decrease animation speed");
1108
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1109
+ fasterButton.setToolTipText("Increase animation speed");
1110
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1111
+ remarkButton.setToolTipText("Set the current transform as the target");
9651112
966
- Return();
1113
+ oe.ctrlPanel.add(objectCommandsPanel);
1114
+ oe.ctrlPanel.Return();
9671115
1116
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1117
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1118
+ //Return();
1119
+
1120
+ oe.ctrlPanel.Return();
1121
+
9681122 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9691123 // ObjEditor.aConstraints.gridx += 1;
9701124
....@@ -1058,7 +1212,7 @@
10581212 oe.aConstraints.gridwidth = 1;
10591213 /**/
10601214 nameField = AddText(oe.ctrlPanel, copy.GetName());
1061
- Return();
1215
+ oe.ctrlPanel.Return();
10621216
10631217 //ctrlPanel.add(textureButton = new Button("Texture..."));
10641218 //textureButton.setEnabled(false);
....@@ -1160,11 +1314,25 @@
11601314 //JPanel worldPanel =
11611315 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11621316 //worldPanel.setName("World");
1163
- centralPanel = new JPanel(new BorderLayout());
1164
- timelinePanel = new JPanel(new BorderLayout());
1165
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1317
+ centralPanel = new cGridBag();
1318
+ centralPanel.preferredWidth = 20;
1319
+
1320
+ if (Globals.ADVANCED)
1321
+ {
1322
+ timelinePanel = new JPanel(new BorderLayout());
1323
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11661324
1325
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1326
+ cameraPanel.setContinuousLayout(true);
1327
+ cameraPanel.setOneTouchExpandable(true);
1328
+// cameraPanel.setDividerLocation(0.9);
1329
+// cameraPanel.setDividerSize(9);
1330
+ cameraPanel.setResizeWeight(1.0);
1331
+
1332
+ }
1333
+
11671334 centralPanel.add(cameraView);
1335
+ centralPanel.setFocusable(true);
11681336 //frame.setJMenuBar(timelineMenubar);
11691337 //centralPanel.add(timelinePanel);
11701338
....@@ -1183,12 +1351,13 @@
11831351 //frontView.object = copy;
11841352 //sideView.object = copy;
11851353
1186
- XYZPanel = new JPanel();
1187
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1354
+ XYZPanel = new cGridBag().setVertical(true);
1355
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11881356
1189
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1190
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1191
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1357
+ XYZPanel.preferredWidth = 5;
1358
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1359
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1360
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
11921361
11931362 /*
11941363 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1226,10 +1395,11 @@
12261395 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12271396 //tmp.setName("Edit");
12281397 objectPanel.add(materialPanel);
1229
- JPanel north = new JPanel(new BorderLayout());
1230
- north.setName("Edit");
1231
- north.add(ctrlPanel, BorderLayout.NORTH);
1232
- objectPanel.add(north);
1398
+// JPanel north = new JPanel(new BorderLayout());
1399
+// north.setName("Edit");
1400
+// north.add(ctrlPanel, BorderLayout.NORTH);
1401
+// objectPanel.add(north);
1402
+ objectPanel.add(editPanel);
12331403 objectPanel.add(infoPanel);
12341404
12351405 /*
....@@ -1250,16 +1420,23 @@
12501420 scrollpane.setWheelScrollingEnabled(true);
12511421 scrollpane.addMouseWheelListener(this); // Default not fast enough
12521422
1253
- /*JTabbedPane*/ scenePanel = new JTabbedPane();
1254
- scenePanel.add(scrollpane);
1423
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1424
+ scenePanel.preferredWidth = 6;
1425
+
1426
+ JTabbedPane tabbedPane = new JTabbedPane();
1427
+ tabbedPane.add(scrollpane);
12551428
1256
- scenePanel.add(FSPane = new cFileSystemPane(this));
1429
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12571430
1258
- optionsPanel = new JPanel(new GridBagLayout());
1431
+ optionsPanel = new cGridBag().setVertical(true);
12591432
12601433 optionsPanel.setName("Options");
1261
- scenePanel.add(optionsPanel);
1262
-
1434
+
1435
+ AddOptions(optionsPanel); //, aConstraints);
1436
+
1437
+ tabbedPane.add(optionsPanel);
1438
+
1439
+ scenePanel.add(tabbedPane);
12631440
12641441 /*
12651442 cTree jTree = new cTree(null);
....@@ -1293,6 +1470,7 @@
12931470 //bigPanel.setSize(new Dimension(10,10));
12941471 //bigPanel.add(ctrlPanel);
12951472 //bigPanel.add(gridPanel);
1473
+ /**
12961474 bigThree = new JPanel();
12971475 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12981476 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1316,7 +1494,13 @@
13161494 // aConstraints.gridheight = 3;
13171495 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13181496 bigThree.add(XYZPanel, aWindowConstraints);
1497
+ /**/
13191498
1499
+ bigThree = new cGridBag();
1500
+ bigThree.addComponent(scenePanel);
1501
+ bigThree.addComponent(centralPanel);
1502
+ bigThree.addComponent(XYZPanel);
1503
+
13201504 // // SIDE EFFECT!!!
13211505 // aConstraints.gridx = 0;
13221506 // aConstraints.gridy = 0;
....@@ -1337,14 +1521,17 @@
13371521 //worldPane.add(bigPanel);
13381522 //worldPane.add(worldPanel);
13391523 /**/
1340
- frame.getContentPane().add(/*"Center",*/framePanel);
1524
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1525
+ frame.add(/*"Center",*/framePanel);
13411526 //frame.getContentPane().add(/*"Center",*/ worldPane);
13421527
13431528 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13441529
1345
- frame.setSize(1024, 768);
1346
- frame.show();
1530
+ frame.setSize(1280, 860);
1531
+ frame.setVisible(true);
13471532
1533
+ cameraView.requestFocusInWindow();
1534
+
13481535 gridPanel.setDividerLocation(1.0);
13491536
13501537 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1358,6 +1545,10 @@
13581545 });
13591546 }
13601547
1548
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1549
+ {
1550
+ }
1551
+
13611552 JTree GetTree()
13621553 {
13631554 return objEditor.jTree;
....@@ -1369,260 +1560,173 @@
13691560 ctrlPanel.removeAll();
13701561 }
13711562
1372
- void SetupMaterial(JPanel ctrlPanel)
1563
+ void SetupMaterial(cGridBag panel)
13731564 {
1374
- aConstraints.weighty = 0;
1375
- //aConstraints.weightx = 1;
1376
- /*
1565
+ /*
13771566 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13781567 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1379
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1380
- aConstraints.gridx += 1;
13811568 */
13821569
1383
- aConstraints.gridwidth = 1;
1384
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
1570
+ cGridBag editBar = new cGridBag().setVertical(false);
1571
+
1572
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1573
+ createMaterialButton.setToolTipText("Create material");
13881574
13891575 /*
13901576 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1391
- aConstraints.gridx += 1;
1392
- aConstraints.weighty = 0;
1393
- aConstraints.gridwidth = 1;
13941577 */
13951578
1396
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1397
- aConstraints.gridx += 1;
1579
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1580
+ clearMaterialButton.setToolTipText("Clear material");
1581
+
1582
+ if (Globals.ADVANCED)
1583
+ {
1584
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1585
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1586
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1587
+ }
13981588
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;
1589
+ editBar.preferredHeight = 15;
1590
+
1591
+ panel.add(editBar);
1592
+
14131593 /**/
14141594 //aConstraints.weighty = 0;
14151595 ////aConstraints.weightx = 1;
14161596 //aConstraints.weighty = 1;
14171597 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14181598 //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;
1599
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14241600
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;
1601
+ cGridBag colorSection = new cGridBag().setVertical(true);
1602
+
1603
+ cGridBag color = new cGridBag();
1604
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1605
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1606
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1607
+ //colorField.preferredWidth = 200;
1608
+ colorSection.add(color);
14351609
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;
1610
+ cGridBag modulation = new cGridBag();
1611
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1612
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1613
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1614
+ colorSection.add(modulation);
14451615
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;
1616
+ cGridBag texture = new cGridBag();
1617
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1618
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1619
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1620
+ colorSection.add(texture);
14551621
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;
1622
+ cGridBag anisoU = new cGridBag();
1623
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1624
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1625
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1626
+ colorSection.add(anisoU);
14651627
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;
1628
+ cGridBag anisoV = new cGridBag();
1629
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1630
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1632
+ colorSection.add(anisoV);
14751633
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;
1634
+ cGridBag shadowbias = new cGridBag();
1635
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1636
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1637
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1638
+ colorSection.add(shadowbias);
14851639
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;
1640
+ panel.add(new JSeparator());
1641
+
1642
+ panel.add(colorSection);
1643
+
1644
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1645
+
1646
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1647
+
1648
+ cGridBag diffuse = new cGridBag();
1649
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1650
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1652
+ diffuseSection.add(diffuse);
14941653
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;
1654
+ cGridBag diffuseness = new cGridBag();
1655
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1656
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1657
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1658
+ diffuseSection.add(diffuseness);
15041659
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;
1660
+ cGridBag selfshadow = new cGridBag();
1661
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1662
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1663
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1664
+ diffuseSection.add(selfshadow);
15141665
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;
1666
+ cGridBag sheen = new cGridBag();
1667
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1668
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1669
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1670
+ diffuseSection.add(sheen);
15241671
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;
1672
+ cGridBag subsurface = new cGridBag();
1673
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1674
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1675
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1676
+ diffuseSection.add(subsurface);
15341677
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;
1678
+ cGridBag shadow = new cGridBag();
1679
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1680
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1681
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1682
+ diffuseSection.add(shadow);
15441683
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;
1684
+ cGridBag fakedepth = new cGridBag();
1685
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1686
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1687
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1688
+ diffuseSection.add(fakedepth);
15541689
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;
1690
+ panel.add(new JSeparator());
1691
+
1692
+ panel.add(diffuseSection);
1693
+
1694
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1695
+
1696
+ cGridBag specularSection = new cGridBag().setVertical(true);
15641697
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;
1698
+ cGridBag specular = new cGridBag();
1699
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1700
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1701
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1702
+ specularSection.add(specular);
15731703
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;
1704
+ cGridBag lightarea = new cGridBag();
1705
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1706
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1707
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1708
+ specularSection.add(lightarea);
15831709
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;
1710
+ cGridBag shininess = new cGridBag();
1711
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1712
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1713
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1714
+ specularSection.add(shininess);
15931715
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;
1716
+ cGridBag metalness = new cGridBag();
1717
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1718
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1719
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1720
+ specularSection.add(metalness);
16031721
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;
1722
+ cGridBag velvet = new cGridBag();
1723
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1724
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1725
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1726
+ specularSection.add(velvet);
16131727
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();
1728
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1729
+ //Return();
16261730 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16271731 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16281732 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1633,130 +1737,93 @@
16331737 // aConstraints.gridy += 1;
16341738 // aConstraints.gridwidth = 1;
16351739
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;
16441740
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;
1741
+ panel.add(new JSeparator());
1742
+
1743
+ panel.add(specularSection);
1744
+
1745
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1746
+
1747
+ cGridBag globalSection = new cGridBag().setVertical(true);
16541748
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;
1749
+ cGridBag camera = new cGridBag();
1750
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1751
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1752
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1753
+ globalSection.add(camera);
16641754
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;
1755
+ cGridBag ambient = new cGridBag();
1756
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1757
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1758
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1759
+ globalSection.add(ambient);
16741760
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;
1761
+ cGridBag backlit = new cGridBag();
1762
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1763
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1764
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1765
+ globalSection.add(backlit);
16851766
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;
1767
+ cGridBag opacity = new cGridBag();
1768
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1769
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1770
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1771
+ globalSection.add(opacity);
16951772
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;
1773
+ panel.add(new JSeparator());
1774
+
1775
+ panel.add(globalSection);
1776
+
1777
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1778
+
1779
+ cGridBag textureSection = new cGridBag().setVertical(true);
17051780
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;
1781
+ cGridBag bump = new cGridBag();
1782
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1783
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1784
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1785
+ textureSection.add(bump);
17151786
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;
1787
+ cGridBag noise = new cGridBag();
1788
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1789
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1790
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1791
+ textureSection.add(noise);
17251792
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;
1793
+ cGridBag power = new cGridBag();
1794
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1795
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1796
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1797
+ textureSection.add(power);
17351798
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;
1799
+ cGridBag borderfade = new cGridBag();
1800
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1801
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1802
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1803
+ textureSection.add(borderfade);
17451804
1746
- //aConstraints.weighty = 1;
1747
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1748
- //aConstraints.gridx += 1;
1749
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1750
- aConstraints.weighty = 0;
1805
+ cGridBag fog = new cGridBag();
1806
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1807
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1808
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1809
+ textureSection.add(fog);
17511810
1752
- aConstraints.gridx = 0;
1753
- aConstraints.gridy = 0;
1754
- aConstraints.gridwidth = 1;
1811
+ cGridBag opacityPower = new cGridBag();
1812
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1813
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1814
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1815
+ textureSection.add(opacityPower);
1816
+
1817
+ panel.add(new JSeparator());
1818
+
1819
+ panel.add(textureSection);
1820
+
1821
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17551822
17561823 SetMaterial(copy); // .GetMaterial());
17571824
1758
- colorField.addChangeListener(this);
1759
- modulationField.addChangeListener(this);
1825
+ //colorField.addChangeListener(this);
1826
+// modulationField.addChangeListener(this);
17601827 metalnessField.addChangeListener(this);
17611828 diffuseField.addChangeListener(this);
17621829 specularField.addChangeListener(this);
....@@ -1786,12 +1853,15 @@
17861853 opacityPowerField.addChangeListener(this);
17871854 /**/
17881855
1789
- resetSlidersButton.addActionListener(this);
17901856 clearMaterialButton.addActionListener(this);
17911857 createMaterialButton.addActionListener(this);
1792
-
1793
- propagateToggle.addItemListener(this);
1794
- multiplyToggle.addItemListener(this);
1858
+
1859
+ if (Globals.ADVANCED)
1860
+ {
1861
+ resetSlidersButton.addActionListener(this);
1862
+ propagateToggle.addItemListener(this);
1863
+ multiplyToggle.addItemListener(this);
1864
+ }
17951865 }
17961866
17971867 void DropFile(java.io.File[] files, boolean textures)
....@@ -1962,7 +2032,7 @@
19622032
19632033 //? flashIt = false;
19642034 CameraPane pane = (CameraPane) cameraView;
1965
- pane.clickStart(location.x, location.y, 0);
2035
+ pane.clickStart(location.x, location.y, 0, 0);
19662036 pane.clickEnd(location.x, location.y, 0, true);
19672037
19682038 if (group.selection.size() == 1)
....@@ -2011,6 +2081,7 @@
20112081 e2.printStackTrace();
20122082 }
20132083 }
2084
+
20142085 LoadJMEThread loadThread;
20152086
20162087 class LoadJMEThread extends Thread
....@@ -2068,6 +2139,7 @@
20682139 //LoadFile0(filename, converter);
20692140 }
20702141 }
2142
+
20712143 LoadOBJThread loadObjThread;
20722144
20732145 class LoadOBJThread extends Thread
....@@ -2146,19 +2218,19 @@
21462218
21472219 void LoadObjFile(String fullname)
21482220 {
2149
- /*
2221
+ System.out.println("Loading " + fullname);
2222
+ /**/
21502223 //lastFilename = fullname;
21512224 if(loadObjThread == null)
21522225 {
2153
- loadObjThread = new LoadOBJThread();
2154
- loadObjThread.start();
2226
+ loadObjThread = new LoadOBJThread();
2227
+ loadObjThread.start();
21552228 }
21562229
21572230 loadObjThread.add(fullname);
2158
- */
2231
+ /**/
21592232
2160
- System.out.println("Loading " + fullname);
2161
- makeSomething(new FileObject(fullname, true), true);
2233
+ //makeSomething(new FileObject(fullname, true), true);
21622234 }
21632235
21642236 void LoadGFDFile(String fullname)
....@@ -2419,11 +2491,11 @@
24192491
24202492 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24212493 {
2422
- if (GrafreeD.standAlone)
2494
+ if (Grafreed.standAlone)
24232495 {
24242496 /**/
24252497 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2426
- browser.show();
2498
+ browser.setVisible(true);
24272499 String filename = browser.getFile();
24282500 if (filename != null && filename.length() > 0)
24292501 {
....@@ -2568,6 +2640,7 @@
25682640 }
25692641 if (input == null)
25702642 {
2643
+ new Exception().printStackTrace();
25712644 System.exit(0);
25722645 }
25732646
....@@ -2782,7 +2855,8 @@
27822855 return;
27832856 }
27842857
2785
- multiplyToggle.setSelected(mat.multiply);
2858
+ if (multiplyToggle != null)
2859
+ multiplyToggle.setSelected(mat.multiply);
27862860
27872861 assert (object.projectedVertices != null);
27882862
....@@ -2966,42 +3040,40 @@
29663040 return;
29673041 } else if (event.getSource() == toggleTimelineItem)
29683042 {
2969
- copy.timeline ^= true;
3043
+ timeline ^= true;
29703044
2971
- if (copy.timeline)
3045
+ if (timeline)
29723046 {
29733047 centralPanel.remove(cameraView);
2974
- centralPanel.add(timelinePanel);
3048
+ cameraPanel.add(cameraView);
3049
+ centralPanel.add(cameraPanel);
29753050 frame.setJMenuBar(timelineMenubar);
3051
+ wasFullScreen = CameraPane.FULLSCREEN;
3052
+ if (!CameraPane.FULLSCREEN)
3053
+ ToggleFullScreen();
3054
+ toggleFullScreenItem.setEnabled(false);
29763055 }
29773056 else
29783057 {
2979
- centralPanel.remove(timelinePanel);
3058
+ centralPanel.remove(cameraPanel);
29803059 centralPanel.add(cameraView);
29813060 frame.setJMenuBar(null);
3061
+ if (!wasFullScreen)
3062
+ ToggleFullScreen();
3063
+ toggleFullScreenItem.setEnabled(true);
29823064 }
29833065
29843066 frame.validate();
29853067 return;
29863068 } else if (event.getSource() == toggleFullScreenItem)
29873069 {
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
- }
3070
+ ToggleFullScreen();
29983071 frame.validate();
2999
- cameraView.ToggleFullScreen();
30003072
30013073 return;
3002
- } else if (event.getSource() == toggleRandomItem)
3074
+ } else if (event.getSource() == toggleSwitchItem)
30033075 {
3004
- cameraView.ToggleRandom();
3076
+ cameraView.ToggleSwitch();
30053077 cameraView.repaint();
30063078 return;
30073079 } else if (event.getSource() == toggleHandleItem)
....@@ -3030,6 +3102,10 @@
30303102 {
30313103 copy.live ^= true;
30323104 return;
3105
+ } else if (event.getSource() == selectCB)
3106
+ {
3107
+ copy.dontselect ^= true;
3108
+ return;
30333109 } else if (event.getSource() == hideCB)
30343110 {
30353111 copy.hide ^= true;
....@@ -3044,6 +3120,7 @@
30443120 if (event.getSource() == randomCB)
30453121 {
30463122 copy.random ^= true;
3123
+ objEditor.refreshContents();
30473124 return;
30483125 }
30493126 if (event.getSource() == speedupCB)
....@@ -3067,8 +3144,9 @@
30673144
30683145 public void actionPerformed(ActionEvent event)
30693146 {
3147
+ Object source = event.getSource();
30703148 // SCRIPT DIALOG
3071
- if (event.getSource() == okbutton)
3149
+ if (source == okbutton)
30723150 {
30733151 textpanel.setVisible(false);
30743152 textpanel.remove(textarea);
....@@ -3080,7 +3158,7 @@
30803158 textarea = null;
30813159 textpanel = null;
30823160 }
3083
- if (event.getSource() == cancelbutton)
3161
+ if (source == cancelbutton)
30843162 {
30853163 textpanel.setVisible(false);
30863164 textpanel.remove(textarea);
....@@ -3092,49 +3170,50 @@
30923170 //applySelf();
30933171 //client.refreshEditWindow();
30943172 //refreshContents();
3095
- if (event.getSource() == nameField)
3173
+ if (source == nameField)
30963174 {
30973175 //System.out.println("ObjEditor " + event);
30983176 applySelf0(true);
30993177 //parent.applySelf();
31003178 objEditor.refreshContents();
3101
- } else if (event.getSource() == resetButton)
3179
+ } else if (source == resetButton)
31023180 {
31033181 CameraPane.fullreset = true;
31043182 copy.Reset(); // ResetMeshes();
31053183 copy.Touch();
31063184 objEditor.refreshContents();
3107
- } else if (event.getSource() == stepItem)
3185
+ } else if (source == stepItem)
31083186 {
3109
- cameraView.ONESTEP = true;
3187
+ //cameraView.ONESTEP = true;
3188
+ Globals.ONESTEP = true;
31103189 cameraView.repaint();
31113190 return;
3112
- } else if (event.getSource() == stepButton)
3191
+ } else if (source == stepButton)
31133192 {
31143193 copy.Step();
31153194 copy.Touch();
31163195 objEditor.refreshContents();
3117
- } else if (event.getSource() == slowerButton)
3196
+ } else if (source == slowerButton)
31183197 {
31193198 copy.Slower();
31203199 copy.Touch();
31213200 objEditor.refreshContents();
3122
- } else if (event.getSource() == fasterButton)
3201
+ } else if (source == fasterButton)
31233202 {
31243203 copy.Faster();
31253204 copy.Touch();
31263205 objEditor.refreshContents();
3127
- } else if (event.getSource() == remarkButton)
3206
+ } else if (source == remarkButton)
31283207 {
31293208 copy.Remark();
31303209 copy.Touch();
31313210 objEditor.refreshContents();
3132
- } else if (event.getSource() == stepAllButton)
3211
+ } else if (source == stepAllButton)
31333212 {
31343213 copy.StepAll();
31353214 copy.Touch();
31363215 objEditor.refreshContents();
3137
- } else if (event.getSource() == resetAllButton)
3216
+ } else if (source == resetAllButton)
31383217 {
31393218 //CameraPane.fullreset = true;
31403219 copy.ResetAll(); // ResetMeshes();
....@@ -3167,53 +3246,75 @@
31673246 // Close();
31683247 // }
31693248 // else
3170
- if (event.getSource() == resetSlidersButton)
3249
+ if (source == resetSlidersButton)
31713250 {
31723251 ResetSliders();
3173
- } else if (event.getSource() == clearMaterialButton)
3252
+ } else if (source == clearMaterialButton)
31743253 {
31753254 ClearMaterial();
3176
- } else if (event.getSource() == createMaterialButton)
3255
+ } else if (source == createMaterialButton)
31773256 {
31783257 CreateMaterial();
3179
- } else if (event.getSource() == clearPanelButton)
3258
+ } else if (source == clearPanelButton)
31803259 {
31813260 copy.ClearUI();
31823261 refreshContents(true);
3183
- } /*
3184
- }
3185
-
3186
- public boolean action(Event event, Object arg)
3187
- {
3188
- */ else if (event.getSource() == closeItem)
3262
+ } else if (source == importGFDItem)
3263
+ {
3264
+ ImportGFD();
3265
+ } else
3266
+ if (source == importVRMLX3DItem)
3267
+ {
3268
+ ImportVRMLX3D();
3269
+ } else
3270
+ if (source == import3DSItem)
3271
+ {
3272
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3273
+ } else
3274
+ if (source == importOBJItem)
3275
+ {
3276
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3277
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3278
+ browser.setVisible(true);
3279
+ String filename = browser.getFile();
3280
+ if (filename != null && filename.length() > 0)
3281
+ {
3282
+ String fullname = browser.getDirectory() + filename;
3283
+ makeSomething(ReadOBJ(fullname), true);
3284
+ }
3285
+ } else
3286
+ if (source == closeItem)
31893287 {
31903288 Close();
31913289 //return true;
3192
- } else if (event.getSource() == loadItem)
3290
+ } else if (source == loadItem)
31933291 {
31943292 load();
31953293 //return true;
3196
- } else if (event.getSource() == saveItem)
3294
+ } else if (source == newItem)
3295
+ {
3296
+ New();
3297
+ } else if (source == saveItem)
31973298 {
31983299 save();
31993300 //return true;
3200
- } else if (event.getSource() == saveAsItem)
3301
+ } else if (source == saveAsItem)
32013302 {
32023303 saveAs();
32033304 //return true;
3204
- } else if (event.getSource() == reexportItem)
3305
+ } else if (source == reexportItem)
32053306 {
32063307 reexport();
32073308 //return true;
3208
- } else if (event.getSource() == exportAsItem)
3309
+ } else if (source == exportAsItem)
32093310 {
32103311 export();
32113312 //return true;
3212
- } else if (event.getSource() == povItem)
3313
+ } else if (source == povItem)
32133314 {
32143315 generatePOV();
32153316 //return true;
3216
- } else if (event.getSource() == zBufferItem)
3317
+ } else if (source == zBufferItem)
32173318 {
32183319 try
32193320 {
....@@ -3235,21 +3336,8 @@
32353336 cameraView.repaint();
32363337 //return true;
32373338 }
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)
3339
+ */ else // combos...
3340
+ if (source == texresMenu)
32533341 {
32543342 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32553343 copy.texres = texresMenu.getSelectedIndex();
....@@ -3261,27 +3349,287 @@
32613349 }
32623350 }
32633351
3264
- void ToggleAnimation()
3352
+ void New()
32653353 {
3266
- if (!CameraPane.ANIMATION)
3354
+ while (copy.Size() > 1)
32673355 {
3268
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3356
+ copy.remove(1);
3357
+ }
3358
+
3359
+ ResetModel();
3360
+ objEditor.refreshContents();
3361
+ }
3362
+
3363
+ static public byte[] Compress(Object3D o)
3364
+ {
3365
+ try
3366
+ {
3367
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3368
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3369
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3370
+
3371
+ Object3D parent = o.parent;
3372
+ o.parent = null;
3373
+
3374
+ out.writeObject(o);
3375
+
3376
+ o.parent = parent;
3377
+
3378
+ out.flush();
3379
+
3380
+ zstream.close();
3381
+ out.close();
3382
+
3383
+ return baos.toByteArray();
3384
+ } catch (Exception e)
3385
+ {
3386
+ System.err.println(e);
3387
+ return null;
3388
+ }
3389
+ }
3390
+
3391
+ static public Object Uncompress(byte[] bytes)
3392
+ {
3393
+ System.out.println("#bytes = " + bytes.length);
3394
+ try
3395
+ {
3396
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3397
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3398
+ ObjectInputStream in = new ObjectInputStream(istream);
3399
+ Object obj = in.readObject();
3400
+ in.close();
3401
+
3402
+ return obj;
3403
+ } catch (Exception e)
3404
+ {
3405
+ System.err.println(e);
3406
+ return null;
3407
+ }
3408
+ }
3409
+
3410
+ static public Object clone(Object o)
3411
+ {
3412
+ try
3413
+ {
3414
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3415
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3416
+
3417
+ out.writeObject(o);
3418
+
3419
+ out.flush();
3420
+ out.close();
3421
+
3422
+ byte[] bytes = baos.toByteArray();
3423
+
3424
+ System.out.println("clone = " + bytes.length);
3425
+
3426
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3427
+ ObjectInputStream in = new ObjectInputStream(bais);
3428
+ Object obj = in.readObject();
3429
+ in.close();
3430
+
3431
+ return obj;
3432
+ } catch (Exception e)
3433
+ {
3434
+ System.err.println(e);
3435
+ return null;
3436
+ }
3437
+ }
3438
+
3439
+ cRadio GetCurrentTab()
3440
+ {
3441
+ cRadio ab;
3442
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3443
+ {
3444
+ ab = (cRadio)e.nextElement();
3445
+ if(ab.GetObject() == copy)
3446
+ {
3447
+ return ab;
3448
+ }
3449
+ }
3450
+
3451
+ return null;
3452
+ }
3453
+
3454
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3455
+
3456
+ public void Save()
3457
+ {
3458
+ System.err.println("Save");
3459
+
3460
+ cRadio tab = GetCurrentTab();
3461
+
3462
+ boolean temp = CameraPane.SWITCH;
3463
+ CameraPane.SWITCH = false;
3464
+
3465
+ copy.ExtractBigData(hashtable);
3466
+
3467
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3468
+ tab.graphs[tab.undoindex++] = Compress(copy);
3469
+
3470
+ copy.RestoreBigData(hashtable);
3471
+
3472
+ CameraPane.SWITCH = temp;
3473
+
3474
+ //assert(hashtable.isEmpty());
3475
+
3476
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3477
+ {
3478
+ tab.graphs[i] = null;
3479
+ }
3480
+
3481
+ // test save
3482
+ if (false)
3483
+ {
3484
+ try
3485
+ {
3486
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3487
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3488
+
3489
+ p.writeObject(copy);
3490
+
3491
+ p.flush();
3492
+
3493
+ ostream.close();
3494
+ } catch (Exception e)
3495
+ {
3496
+ e.printStackTrace();
3497
+ }
3498
+ }
3499
+ }
3500
+
3501
+ void CopyChanged(Object3D obj)
3502
+ {
3503
+ boolean temp = CameraPane.SWITCH;
3504
+ CameraPane.SWITCH = false;
3505
+
3506
+ copy.ExtractBigData(hashtable);
3507
+
3508
+ copy.clear();
3509
+
3510
+ for (int i=0; i<obj.Size(); i++)
3511
+ {
3512
+ copy.add(obj.get(i));
3513
+ }
3514
+
3515
+ copy.RestoreBigData(hashtable);
3516
+
3517
+ CameraPane.SWITCH = temp;
3518
+
3519
+ //assert(hashtable.isEmpty());
3520
+
3521
+ copy.Touch();
3522
+
3523
+ ResetModel();
3524
+ copy.HardTouch(); // recompile?
3525
+
3526
+ cRadio ab;
3527
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3528
+ {
3529
+ ab = (cRadio)e.nextElement();
3530
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3531
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3532
+ if (test != null)
3533
+ {
3534
+ test.editWindow = ab.object.editWindow;
3535
+ ab.object = test;
3536
+ }
3537
+ }
3538
+
3539
+ refreshContents();
3540
+ }
3541
+
3542
+ public void Undo()
3543
+ {
3544
+ System.err.println("Undo");
3545
+
3546
+ cRadio tab = GetCurrentTab();
3547
+
3548
+ if (tab.undoindex == 0)
3549
+ {
3550
+ java.awt.Toolkit.getDefaultToolkit().beep();
3551
+ return;
3552
+ }
3553
+
3554
+ if (tab.graphs[tab.undoindex] == null)
3555
+ {
3556
+ Save();
3557
+ tab.undoindex -= 1;
3558
+ }
3559
+
3560
+ tab.undoindex -= 1;
3561
+
3562
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3563
+ }
3564
+
3565
+ public void Redo()
3566
+ {
3567
+ cRadio tab = GetCurrentTab();
3568
+
3569
+ if (tab.graphs[tab.undoindex + 1] == null)
3570
+ {
3571
+ java.awt.Toolkit.getDefaultToolkit().beep();
3572
+ return;
3573
+ }
3574
+
3575
+ tab.undoindex += 1;
3576
+
3577
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3578
+ }
3579
+
3580
+ void ImportGFD()
3581
+ {
3582
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32693583 browser.show();
32703584 String filename = browser.getFile();
32713585 if (filename != null && filename.length() > 0)
32723586 {
3273
- CameraPane.filename = browser.getDirectory() + filename;
3587
+ String fullname = browser.getDirectory() + filename;
3588
+
3589
+ //Object3D readobj =
3590
+ objEditor.ReadGFD(fullname, objEditor);
3591
+ //makeSomething(readobj);
3592
+ }
3593
+ }
3594
+
3595
+ void ImportVRMLX3D()
3596
+ {
3597
+ if (Grafreed.standAlone)
3598
+ {
3599
+ /**/
3600
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3601
+ browser.show();
3602
+ String filename = browser.getFile();
3603
+ if (filename != null && filename.length() > 0)
3604
+ {
3605
+ String fullname = browser.getDirectory() + filename;
3606
+ LoadVRMLX3D(fullname);
3607
+ }
3608
+ /**/
3609
+ }
3610
+ }
3611
+
3612
+ void ToggleAnimation()
3613
+ {
3614
+ if (!Globals.ANIMATION)
3615
+ {
3616
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3617
+ browser.setVisible(true);
3618
+ String filename = browser.getFile();
3619
+ if (filename != null && filename.length() > 0)
3620
+ {
3621
+ Globals.filename = browser.getDirectory() + filename;
32743622 //CameraPane.framecount = 0;
3275
- CameraPane.imagecount = 0;
3623
+ Globals.imagecount = 0;
32763624
3277
- CameraPane.ANIMATION ^= true;
3625
+ Globals.ANIMATION ^= true;
32783626
3279
- GrafreeD.wav.cursor = 0;
3280
- GrafreeD.wav.loop = 0;
3627
+ Grafreed.wav.cursor = 0;
3628
+ Grafreed.wav.loop = 0;
32813629 }
32823630 } else
32833631 {
3284
- CameraPane.ANIMATION ^= true;
3632
+ Globals.ANIMATION ^= true;
32853633 }
32863634 }
32873635
....@@ -3327,7 +3675,7 @@
33273675 void CreateMaterial()
33283676 {
33293677 //copy.ClearMaterial(); // PATCH
3330
- copy.CreateMaterialS(multiplyToggle.isSelected());
3678
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33313679 if (copy.selection.size() > 0)
33323680 //SetMaterial(copy);
33333681 {
....@@ -3386,11 +3734,11 @@
33863734 {
33873735 copy.ResetBlockLoop(); // temporary problem
33883736
3389
- boolean random = CameraPane.RANDOM;
3390
- CameraPane.RANDOM = false; // parse everything
3737
+ boolean random = CameraPane.SWITCH;
3738
+ CameraPane.SWITCH = false; // parse everything
33913739 copy.ResetDisplayList();
33923740 copy.HardTouch();
3393
- CameraPane.RANDOM = random;
3741
+ CameraPane.SWITCH = random;
33943742 }
33953743
33963744 // public void applySelf()
....@@ -3460,10 +3808,40 @@
34603808 current.fakedepth = (float) fakedepthField.getFloat();
34613809 current.shadowbias = (float) shadowbiasField.getFloat();
34623810
3463
- if (!NumberSlider.frozen)
3811
+ if (!cNumberSlider.frozen)
34643812 {
34653813 //System.out.println("Propagate = " + propagate);
34663814 copy.UpdateMaterial(anchor, current, propagate);
3815
+
3816
+ if (copy.material != null)
3817
+ {
3818
+ cMaterial mat = copy.material;
3819
+
3820
+ colorField.SetToolTipValue((mat.color));
3821
+ modulationField.SetToolTipValue((mat.modulation));
3822
+ metalnessField.SetToolTipValue((mat.metalness));
3823
+ diffuseField.SetToolTipValue((mat.diffuse));
3824
+ specularField.SetToolTipValue((mat.specular));
3825
+ shininessField.SetToolTipValue((mat.shininess));
3826
+ shiftField.SetToolTipValue((mat.shift));
3827
+ ambientField.SetToolTipValue((mat.ambient));
3828
+ lightareaField.SetToolTipValue((mat.lightarea));
3829
+ diffusenessField.SetToolTipValue((mat.factor));
3830
+ velvetField.SetToolTipValue((mat.velvet));
3831
+ sheenField.SetToolTipValue((mat.sheen));
3832
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3833
+ backlitField.SetToolTipValue((mat.bump));
3834
+ anisoField.SetToolTipValue((mat.aniso));
3835
+ anisoVField.SetToolTipValue((mat.anisoV));
3836
+ cameraField.SetToolTipValue((mat.cameralight));
3837
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3838
+ shadowField.SetToolTipValue((mat.shadow));
3839
+ textureField.SetToolTipValue((mat.texture));
3840
+ opacityField.SetToolTipValue((mat.opacity));
3841
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3842
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3843
+ }
3844
+
34673845 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34683846 {
34693847 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3508,6 +3886,7 @@
35083886 || e.getSource() == apertureField
35093887 || e.getSource() == shadowblurField)
35103888 {
3889
+ new Exception().printStackTrace();
35113890 System.exit(0);
35123891 cameraView.options1[0] = (float) focusField.getFloat() * 10;
35133892 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3534,7 +3913,13 @@
35343913 //System.out.println("PARENT = " + parent);
35353914 //if (parent != null)
35363915 // parent.applySelf();
3537
- refreshContents();
3916
+ if (e.getSource() == normalpushField)
3917
+ {
3918
+ objEditor.refreshContents();
3919
+ //Refresh();
3920
+ }
3921
+ else
3922
+ refreshContents();
35383923 // ??? client.refreshEditWindow();
35393924 }
35403925 //else
....@@ -3546,7 +3931,7 @@
35463931 //group.name = nameField.getText();
35473932 //objEditor.applySelf();
35483933
3549
- assert (objEditor == this);
3934
+ // OCT2018: assert (objEditor == this);
35503935 if (copy.selection == null || copy.selection.size() == 0)
35513936 //super.applySelf()
35523937 ; else
....@@ -3570,12 +3955,18 @@
35703955 objEditor.copy = keep;
35713956 }
35723957 }
3958
+
3959
+ if (normalpushField != null)
3960
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35733961 }
35743962
35753963 void SnapObject()
35763964 {
3577
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3578
- SnapObject(obj);
3965
+ if (copy.selection.size() > 0)
3966
+ {
3967
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
3968
+ SnapObject(obj);
3969
+ }
35793970 }
35803971
35813972 void SnapObject(Object3D obj)
....@@ -3821,7 +4212,7 @@
38214212
38224213 radioPanel.revalidate();
38234214 radioPanel.repaint();
3824
- ctrlPanel.revalidate(); // ? new
4215
+ ctrlPanel.validate(); // ? new
38254216 ctrlPanel.repaint();
38264217 }
38274218 }
....@@ -3830,6 +4221,8 @@
38304221
38314222 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38324223 {
4224
+ if (Globals.SAVEONMAKE)
4225
+ Save();
38334226 //Tween.set(thing, 0).target(1).start(tweenManager);
38344227 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38354228 // if (thing instanceof GenericJointDemo)
....@@ -4033,6 +4426,7 @@
40334426 }
40344427 }
40354428 }
4429
+
40364430 LoadGFDThread loadGFDThread;
40374431
40384432 void ReadGFD(String fullname, iCallBack cb)
....@@ -4052,8 +4446,10 @@
40524446
40534447 try
40544448 {
4449
+ // Try compressed version first.
40554450 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4056
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4451
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4452
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40574453
40584454 readobj = (Object3D) p.readObject();
40594455 istream.close();
....@@ -4061,7 +4457,20 @@
40614457 readobj.ResetDisplayList();
40624458 } catch (Exception e)
40634459 {
4064
- e.printStackTrace();
4460
+ //e.printStackTrace();
4461
+ try
4462
+ {
4463
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4464
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4465
+
4466
+ readobj = (Object3D) p.readObject();
4467
+ istream.close();
4468
+
4469
+ readobj.ResetDisplayList();
4470
+ } catch (Exception e2)
4471
+ {
4472
+ e2.printStackTrace();
4473
+ }
40654474 }
40664475 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40674476 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4107,6 +4516,12 @@
41074516
41084517 void LoadIt(Object obj)
41094518 {
4519
+ if (obj == null)
4520
+ {
4521
+ // Invalid file
4522
+ return;
4523
+ }
4524
+
41104525 System.out.println("Loaded " + obj);
41114526 //new Exception().printStackTrace();
41124527 Object3D readobj = (Object3D) obj;
....@@ -4116,6 +4531,8 @@
41164531
41174532 if (readobj != null)
41184533 {
4534
+ if (Globals.SAVEONMAKE)
4535
+ Save();
41194536 try
41204537 {
41214538 //readobj.deepCopySelf(copy);
....@@ -4178,7 +4595,7 @@
41784595
41794596 void load() // throws ClassNotFoundException
41804597 {
4181
- if (GrafreeD.standAlone)
4598
+ if (Grafreed.standAlone)
41824599 {
41834600 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
41844601 browser.show();
....@@ -4265,11 +4682,13 @@
42654682 try
42664683 {
42674684 FileOutputStream ostream = new FileOutputStream(lastname);
4268
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4685
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4686
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42694687
42704688 p.writeObject(copy);
42714689 p.flush();
42724690
4691
+ zstream.close();
42734692 ostream.close();
42744693
42754694 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4279,11 +4698,12 @@
42794698 {
42804699 }
42814700 }
4701
+
42824702 String lastname;
42834703
42844704 void saveAs()
42854705 {
4286
- if (GrafreeD.standAlone)
4706
+ if (Grafreed.standAlone)
42874707 {
42884708 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42894709 browser.setVisible(true);
....@@ -4388,13 +4808,13 @@
43884808 try
43894809 {
43904810 FileOutputStream ostream = new FileOutputStream(filename);
4391
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4392
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4811
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4812
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43934813
43944814 Object3D objectparent = obj.parent;
43954815 obj.parent = null;
43964816
4397
- Object3D object = (Object3D) GrafreeD.clone(obj);
4817
+ Object3D object = (Object3D) Grafreed.clone(obj);
43984818
43994819 obj.parent = objectparent;
44004820
....@@ -4406,8 +4826,8 @@
44064826 p.writeObject(object);
44074827 p.flush();
44084828
4829
+ zstream.close();
44094830 ostream.close();
4410
- // zstream.close();
44114831
44124832 // group.selection.get(0).parent = parent;
44134833 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4428,7 +4848,7 @@
44284848 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44294849 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44304850 copy.generatePOV(buffer);
4431
- if (GrafreeD.standAlone)
4851
+ if (Grafreed.standAlone)
44324852 {
44334853 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44344854 browser.show();
....@@ -4454,7 +4874,8 @@
44544874 Object3D client;
44554875 Object3D copy;
44564876 MenuBar menuBar;
4457
- Menu windowMenu;
4877
+ Menu fileMenu;
4878
+ MenuItem newItem;
44584879 MenuItem loadItem;
44594880 MenuItem saveItem;
44604881 MenuItem saveAsItem;
....@@ -4462,13 +4883,11 @@
44624883 MenuItem reexportItem;
44634884 MenuItem povItem;
44644885 MenuItem closeItem;
4465
- Menu cameraMenu;
4886
+
44664887 CheckboxMenuItem zBufferItem;
44674888 //MenuItem normalLensItem;
4468
- MenuItem editCameraItem;
4469
- MenuItem revertCameraItem;
4470
- CheckboxMenuItem toggleLiveItem;
44714889 MenuItem stepItem;
4890
+ CheckboxMenuItem toggleLiveItem;
44724891 CheckboxMenuItem toggleFullScreenItem;
44734892 CheckboxMenuItem toggleTimelineItem;
44744893 CheckboxMenuItem toggleRenderItem;
....@@ -4477,7 +4896,7 @@
44774896 CheckboxMenuItem toggleFootContactItem;
44784897 CheckboxMenuItem toggleDLItem;
44794898 CheckboxMenuItem toggleTextureItem;
4480
- CheckboxMenuItem toggleRandomItem;
4899
+ CheckboxMenuItem toggleSwitchItem;
44814900 CheckboxMenuItem toggleRootItem;
44824901 CheckboxMenuItem animationItem;
44834902 CheckboxMenuItem toggleHandleItem;
....@@ -4485,20 +4904,21 @@
44854904 JSplitPane mainPanel;
44864905 JScrollPane scrollpane;
44874906 JPanel toolbarPanel;
4488
- JPanel treePanel;
4907
+ cGridBag treePanel;
44894908 JPanel radioPanel;
44904909 ButtonGroup buttonGroup;
4491
- JPanel ctrlPanel;
4492
- JPanel materialPanel;
4910
+ cGridBag ctrlPanel;
4911
+ cGridBag materialPanel;
44934912 JScrollPane infoPanel;
4494
- JPanel optionsPanel;
4913
+ cGridBag optionsPanel;
44954914 JTabbedPane objectPanel;
4496
- JPanel XYZPanel;
4915
+ cGridBag XYZPanel;
44974916 JSplitPane gridPanel;
44984917 JSplitPane bigPanel;
4499
- JPanel bigThree;
4500
- JTabbedPane scenePanel;
4501
- JPanel centralPanel;
4918
+ cGridBag bigThree;
4919
+ cGridBag scenePanel;
4920
+ cGridBag centralPanel;
4921
+ JSplitPane cameraPanel;
45024922 JPanel timelinePanel;
45034923 JMenuBar timelineMenubar;
45044924 JSplitPane framePanel;
....@@ -4550,65 +4970,72 @@
45504970 // MATERIAL
45514971 JLabel materialLabel;
45524972 JLabel colorLabel;
4553
- NumberSlider colorField;
4973
+ cNumberSlider colorField;
45544974 JLabel modulationLabel;
4555
- NumberSlider modulationField;
4975
+ cNumberSlider modulationField;
45564976 JLabel metalnessLabel;
4557
- NumberSlider metalnessField;
4977
+ cNumberSlider metalnessField;
45584978 JLabel diffuseLabel;
4559
- NumberSlider diffuseField;
4979
+ cNumberSlider diffuseField;
45604980 JLabel specularLabel;
4561
- NumberSlider specularField;
4981
+ cNumberSlider specularField;
45624982 JLabel shininessLabel;
4563
- NumberSlider shininessField;
4983
+ cNumberSlider shininessField;
45644984 JLabel shiftLabel;
4565
- NumberSlider shiftField;
4985
+ cNumberSlider shiftField;
45664986 JLabel ambientLabel;
4567
- NumberSlider ambientField;
4987
+ cNumberSlider ambientField;
45684988 JLabel lightareaLabel;
4569
- NumberSlider lightareaField;
4989
+ cNumberSlider lightareaField;
45704990 JLabel diffusenessLabel;
4571
- NumberSlider diffusenessField;
4991
+ cNumberSlider diffusenessField;
45724992 JLabel velvetLabel;
4573
- NumberSlider velvetField;
4993
+ cNumberSlider velvetField;
45744994 JLabel sheenLabel;
4575
- NumberSlider sheenField;
4995
+ cNumberSlider sheenField;
45764996 JLabel subsurfaceLabel;
4577
- NumberSlider subsurfaceField;
4997
+ cNumberSlider subsurfaceField;
45784998 //JLabel bumpLabel;
45794999 //NumberSlider bumpField;
45805000 JLabel backlitLabel;
4581
- NumberSlider backlitField;
5001
+ cNumberSlider backlitField;
45825002 JLabel anisoLabel;
4583
- NumberSlider anisoField;
5003
+ cNumberSlider anisoField;
45845004 JLabel anisoVLabel;
4585
- NumberSlider anisoVField;
5005
+ cNumberSlider anisoVField;
45865006 JLabel cameraLabel;
4587
- NumberSlider cameraField;
5007
+ cNumberSlider cameraField;
45885008 JLabel selfshadowLabel;
4589
- NumberSlider selfshadowField;
5009
+ cNumberSlider selfshadowField;
45905010 JLabel shadowLabel;
4591
- NumberSlider shadowField;
5011
+ cNumberSlider shadowField;
45925012 JLabel textureLabel;
4593
- NumberSlider textureField;
5013
+ cNumberSlider textureField;
45945014 JLabel opacityLabel;
4595
- NumberSlider opacityField;
5015
+ cNumberSlider opacityField;
45965016 JLabel fakedepthLabel;
4597
- NumberSlider fakedepthField;
5017
+ cNumberSlider fakedepthField;
45985018 JLabel shadowbiasLabel;
4599
- NumberSlider shadowbiasField;
5019
+ cNumberSlider shadowbiasField;
46005020 JLabel bumpLabel;
4601
- NumberSlider bumpField;
5021
+ cNumberSlider bumpField;
46025022 JLabel noiseLabel;
4603
- NumberSlider noiseField;
5023
+ cNumberSlider noiseField;
46045024 JLabel powerLabel;
4605
- NumberSlider powerField;
5025
+ cNumberSlider powerField;
46065026 JLabel borderfadeLabel;
4607
- NumberSlider borderfadeField;
5027
+ cNumberSlider borderfadeField;
46085028 JLabel fogLabel;
4609
- NumberSlider fogField;
5029
+ cNumberSlider fogField;
46105030 JLabel opacityPowerLabel;
4611
- NumberSlider opacityPowerField;
5031
+ cNumberSlider opacityPowerField;
46125032 JTree jTree;
46135033 //ObjectUI parent;
5034
+
5035
+ cNumberSlider normalpushField;
5036
+
5037
+ private MenuItem importGFDItem;
5038
+ private MenuItem importVRMLX3DItem;
5039
+ private MenuItem import3DSItem;
5040
+ private MenuItem importOBJItem;
46145041 }