Normand Briere
2019-07-17 a5580a47d246c1272b10adba68070f6e13da5e41
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.*;
....@@ -14,10 +15,15 @@
1415 //import javax.swing.plaf.ColorUIResource;
1516 //import javax.swing.plaf.metal.DefaultMetalTheme;
1617
18
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
19
+import javax.swing.plaf.basic.BasicSplitPaneUI;
20
+
1721 //import javax.media.opengl.GLCanvas;
1822
1923 import //weka.core.
2024 matrix.Matrix;
25
+
26
+import grafeme.ui.*;
2127
2228 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2329 ActionListener, ChangeListener,
....@@ -28,7 +34,73 @@
2834 iSendInfo
2935 //KeyListener
3036 {
37
+ boolean timeline;
38
+ boolean wasFullScreen;
3139
40
+ GroupEditor callee;
41
+ JFrame frame;
42
+
43
+ static ObjEditor theFrame;
44
+
45
+ cButton GetButton(String name, boolean border)
46
+ {
47
+ try
48
+ {
49
+ ImageIcon icon = GetIcon(name);
50
+ return new cButton(icon, border);
51
+ }
52
+ catch (Exception e)
53
+ {
54
+ return new cButton(name, border);
55
+ }
56
+ }
57
+
58
+ cToggleButton GetToggleButton(String name, boolean border)
59
+ {
60
+ try
61
+ {
62
+ ImageIcon icon = GetIcon(name);
63
+ return new cToggleButton(icon, border);
64
+ }
65
+ catch (Exception e)
66
+ {
67
+ return new cToggleButton(name, border);
68
+ }
69
+ }
70
+
71
+ cCheckBox GetCheckBox(String name, boolean border)
72
+ {
73
+ try
74
+ {
75
+ ImageIcon icon = GetIcon(name);
76
+ return new cCheckBox(icon, border);
77
+ }
78
+ catch (Exception e)
79
+ {
80
+ return new cCheckBox(name, border);
81
+ }
82
+ }
83
+
84
+ private ImageIcon GetIcon(String name) throws IOException
85
+ {
86
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
87
+
88
+ if (image.getWidth() != 24 && image.getHeight() != 24)
89
+ {
90
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
91
+ Graphics2D g = resized.createGraphics();
92
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
93
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
94
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
95
+ g.dispose();
96
+
97
+ image = resized;
98
+ }
99
+
100
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
101
+ return icon;
102
+ }
103
+
32104 // SCRIPT
33105
34106 transient JFrame textpanel = null;
....@@ -119,51 +191,62 @@
119191 void keyPressed(int key, int modifiers)
120192 {
121193 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
194
+ Globals.theRenderer.keyPressed(key, modifiers);
123195 }
124196 */
125197
126198 static GridBagConstraints aConstraints;
127199 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
200
+
130201 static int GRIDWIDTH = 100; // 4;
131202
132203 public void closeUI()
133204 {
134205 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
206
+// System.out.println("this = " + this);
207
+// System.out.println("objEditor = " + objEditor);
137208 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
209
+// objEditor.ctrlPanel.remove(nameField);
139210
140
- if (!GroupEditor.allparams)
211
+ objEditor.ctrlPanel.remove(namePanel);
212
+
213
+ if (!allparams)
141214 return;
142215
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);
216
+// objEditor.ctrlPanel.remove(liveCB);
217
+// objEditor.ctrlPanel.remove(hideCB);
218
+// objEditor.ctrlPanel.remove(markCB);
219
+//
220
+// objEditor.ctrlPanel.remove(randomCB);
221
+// objEditor.ctrlPanel.remove(speedupCB);
222
+// objEditor.ctrlPanel.remove(rewindCB);
223
+//
224
+// objEditor.ctrlPanel.remove(resetButton);
225
+// objEditor.ctrlPanel.remove(stepButton);
226
+//// objEditor.ctrlPanel.remove(stepAllButton);
227
+//// objEditor.ctrlPanel.remove(resetAllButton);
228
+// objEditor.ctrlPanel.remove(link2masterCB);
229
+// //objEditor.ctrlPanel.remove(flipVCB);
230
+// //objEditor.ctrlPanel.remove(texresMenu);
231
+// objEditor.ctrlPanel.remove(slowerButton);
232
+// objEditor.ctrlPanel.remove(fasterButton);
233
+// objEditor.ctrlPanel.remove(remarkButton);
234
+
235
+ objEditor.ctrlPanel.remove(setupPanel);
236
+ objEditor.ctrlPanel.remove(setupPanel2);
237
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
238
+ objEditor.ctrlPanel.remove(pushPanel);
239
+ //objEditor.ctrlPanel.remove(fillPanel);
240
+
241
+ //Remove(normalpushField);
161242 }
162243
163244 public ObjEditor GetEditor()
164245 {
165246 return objEditor; //.GetEditor();
166247 }
248
+
249
+ // Sometimes myself, sometimes my callee's.
167250 ObjEditor objEditor;
168251
169252 /*
....@@ -226,6 +309,7 @@
226309 //localCopy.parent = null;
227310
228311 frame = new JFrame();
312
+ frame.setUndecorated(false);
229313 objEditor = this;
230314 this.callee = callee;
231315
....@@ -238,7 +322,7 @@
238322 //if (!isDisplayable())
239323 //setUndecorated(true);
240324
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
325
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242326 client = inClient;
243327 copy = localCopy;
244328 copy.editWindow = this;
....@@ -256,28 +340,49 @@
256340 return frame.action(event, obj);
257341 }
258342
343
+ // Cannot work without static
344
+ static boolean allparams = true;
345
+
346
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
347
+
259348 void SetupMenu()
260349 {
261350 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..."));
351
+ menuBar.add(fileMenu = new Menu("File"));
352
+ fileMenu.add(newItem = new MenuItem("New"));
353
+ fileMenu.add(openItem = new MenuItem("Open..."));
354
+
355
+ //oe.menuBar.add(menu = new Menu("Include"));
356
+ Menu menu = new Menu("Import");
357
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
358
+ importOBJItem.addActionListener(this);
359
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
360
+ import3DSItem.addActionListener(this);
361
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
362
+ importVRMLX3DItem.addActionListener(this);
363
+ menu.add("-");
364
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
365
+ importGFDItem.addActionListener(this);
366
+ fileMenu.add(menu);
367
+ fileMenu.add("-");
368
+
369
+ fileMenu.add(saveItem = new MenuItem("Save"));
370
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
267371 //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("-");
372
+ fileMenu.add("-");
373
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
374
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
375
+ fileMenu.add("-");
272376 if (client.parent != null)
273377 {
274
- windowMenu.add(closeItem = new MenuItem("Close"));
378
+ fileMenu.add(closeItem = new MenuItem("Close"));
275379 } else
276380 {
277
- windowMenu.add(closeItem = new MenuItem("Exit"));
381
+ fileMenu.add(closeItem = new MenuItem("Exit"));
278382 }
279383
280
- loadItem.addActionListener(this);
384
+ newItem.addActionListener(this);
385
+ openItem.addActionListener(this);
281386 saveItem.addActionListener(this);
282387 saveAsItem.addActionListener(this);
283388 exportAsItem.addActionListener(this);
....@@ -285,79 +390,66 @@
285390 //povItem.addActionListener(this);
286391 closeItem.addActionListener(this);
287392
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(toggleFullItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullItem.addItemListener(this);
297
- toggleFullItem.setState(CameraPane.FULLSCREEN);
298
- cameraMenu.add("-");
299
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
300
- toggleTextureItem.addItemListener(this);
301
- toggleTextureItem.setState(CameraPane.textureon);
302
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
303
- toggleLiveItem.addItemListener(this);
304
- toggleLiveItem.setState(CameraPane.isLIVE());
305
- cameraMenu.add(stepItem = new MenuItem("Step"));
306
- stepItem.addActionListener(this);
307
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
308
-// toggleDLItem.addItemListener(this);
309
-// toggleDLItem.setState(false);
310
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
311
- toggleRenderItem.addItemListener(this);
312
- toggleRenderItem.setState(!CameraPane.frozen);
313
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
314
- toggleDebugItem.addItemListener(this);
315
- toggleDebugItem.setState(CameraPane.DEBUG);
316
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
317
- toggleFrustumItem.addItemListener(this);
318
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
319
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
320
- toggleFootContactItem.addItemListener(this);
321
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
322
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
323
- toggleRandomItem.addItemListener(this);
324
- toggleRandomItem.setState(CameraPane.RANDOM);
325
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
326
- toggleHandleItem.addItemListener(this);
327
- toggleHandleItem.setState(CameraPane.HANDLES);
328
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
329
- togglePaintItem.addItemListener(this);
330
- togglePaintItem.setState(CameraPane.PAINTMODE);
331
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
332
-// toggleRootItem.addItemListener(this);
333
-// toggleRootItem.setState(false);
334
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
335
-// animationItem.addItemListener(this);
336
-// animationItem.setState(CameraPane.ANIMATION);
337
- cameraMenu.add("-");
338
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
339
- editCameraItem.addActionListener(this);
340
-
341393 objectPanel = new JTabbedPane();
394
+
395
+ ChangeListener changeListener = new ChangeListener()
396
+ {
397
+ public void stateChanged(ChangeEvent changeEvent)
398
+ {
399
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
400
+// {
401
+// if (latestObject != null)
402
+// {
403
+// refreshContents(true);
404
+// SetMaterial(latestObject);
405
+// }
406
+//
407
+// materialFlushed = true;
408
+// }
409
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
410
+// {
411
+// if (listUI.size() == 0)
412
+// EditSelection(false);
413
+// }
414
+
415
+ refreshContents(false); // To refresh Info tab
416
+ }
417
+ };
418
+ objectPanel.addChangeListener(changeListener);
419
+
342420 toolbarPanel = new JPanel();
343421 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
422
+ treePanel = new cGridBag();
345423 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
347
- ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
424
+
425
+ editPanel = new cGridBag().setVertical(true);
426
+ editPanel.setName("Edit");
427
+
428
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
429
+
430
+ editCommandsPanel = new cGridBag();
431
+ editPanel.add(editCommandsPanel);
432
+ editPanel.add(ctrlPanel);
433
+
434
+ toolboxPanel = new cGridBag().setVertical(false);
435
+ toolboxPanel.setName("Toolbox");
436
+
437
+ materialPanel = new cGridBag().setVertical(true);
349438 materialPanel.setName("Material");
439
+
350440 /*JTextPane*/
351441 infoarea = createTextPane();
442
+ doc = infoarea.getStyledDocument();
443
+
352444 infoarea.setEditable(true);
353445 SetText();
354446 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355447 // infoarea.setOpaque(false);
356448 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
449
+// TEXTAREA infoarea.setLineWrap(true);
450
+// TEXTAREA infoarea.setWrapStyleWord(true);
359451 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
360
- infoPanel.setPreferredSize(new Dimension(50, 200));
452
+ infoPanel.setPreferredSize(new Dimension(1, 1));
361453 infoPanel.setName("Info");
362454 //infoPanel.setLayout(new BorderLayout());
363455 //infoPanel.add(createTextPane());
....@@ -366,16 +458,23 @@
366458 mainPanel.setName("Main");
367459 mainPanel.setContinuousLayout(true);
368460 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370461 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
372
-
462
+ mainPanel.setDividerLocation(0.5); //1.0);
463
+ mainPanel.setResizeWeight(0.5);
464
+
465
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
466
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
467
+ divider.setDividerSize(15);
468
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
469
+
470
+ mainPanel.setUI(new BasicSplitPaneUI());
471
+
373472 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374473 //mainPanel.setLayout(new GridBagLayout());
375474 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
475
+// treePanel.setLayout(new GridBagLayout());
476
+ //ctrlPanel.setLayout(new GridBagLayout());
477
+ //materialPanel.setLayout(new GridBagLayout());
379478
380479 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381480 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +513,7 @@
414513 static String newline = "\n";
415514 protected static final String buttonString = "JButton";
416515 StyledDocument doc;
417
- JTextArea infoarea;
516
+ JTextPane infoarea;
418517
419518 void ClearInfo()
420519 {
....@@ -437,10 +536,10 @@
437536 e.printStackTrace();
438537 }
439538
440
- String selection = infoarea.getText();
441
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
442
- java.awt.datatransfer.Clipboard clipboard =
443
- Toolkit.getDefaultToolkit().getSystemClipboard();
539
+// String selection = infoarea.getText();
540
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
541
+// java.awt.datatransfer.Clipboard clipboard =
542
+// Toolkit.getDefaultToolkit().getSystemClipboard();
444543 //clipboard.setContents(data, data);
445544 }
446545
....@@ -463,13 +562,13 @@
463562 //SendInfo("Name:", "bold");
464563 if (sel.GetTextures() != null || debug)
465564 {
466
- si.SendInfo(sel.toString(), "bold");
565
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
467566 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
468567 if (sel.Size() > 0)
469568 {
470569 si.SendInfo("#children = " + sel.Size(), "regular");
471570 }
472
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
571
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
473572 if (debug)
474573 {
475574 try
....@@ -481,7 +580,10 @@
481580 }
482581
483582 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
583
+ {
584
+ si.SendInfo(" BBox min: " + minima, "regular");
585
+ si.SendInfo(" BBox max: " + maxima, "regular");
586
+ }
485587
486588 if (sel.bRep != null)
487589 {
....@@ -508,7 +610,7 @@
508610 }
509611 if (sel.support != null)
510612 {
511
- si.SendInfo(" support: " + sel.support, "regular");
613
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
512614 }
513615 if (sel.scriptnode != null)
514616 {
....@@ -522,18 +624,18 @@
522624 maxima.y = sel.toParent[3][1];
523625 maxima.z = sel.toParent[3][2];
524626 si.SendInfo(" Orig: " + maxima, "regular");
525
- maxima.x = sel.globalTransform[3][0];
526
- maxima.y = sel.globalTransform[3][1];
527
- maxima.z = sel.globalTransform[3][2];
528
- if (full)
529
- si.SendInfo(" Global Orig: " + maxima, "regular");
530627 maxima.x = sel.toParent[0][0];
531628 maxima.y = sel.toParent[1][1];
532629 maxima.z = sel.toParent[2][2];
533630 si.SendInfo(" Scale: " + maxima, "regular");
534
- maxima.x = sel.globalTransform[0][0];
535
- maxima.y = sel.globalTransform[1][1];
536
- maxima.z = sel.globalTransform[2][2];
631
+ maxima.x = sel.globalTransform[3][0];
632
+ maxima.y = sel.globalTransform[3][1];
633
+ maxima.z = sel.globalTransform[3][2];
634
+ if (full)
635
+ si.SendInfo(" Global Orig: " + maxima, "regular");
636
+ maxima.x = sel.globalTransform[0][0];
637
+ maxima.y = sel.globalTransform[1][1];
638
+ maxima.z = sel.globalTransform[2][2];
537639 if (full)
538640 si.SendInfo(" Global Scale: " + maxima, "regular");
539641 }
....@@ -579,6 +681,9 @@
579681 {
580682 CameraPane.pointflow = (PointFlow) sel;
581683 }
684
+
685
+ si.SendInfo("_____________________", "regular");
686
+ si.SendInfo("", "regular");
582687 }
583688 }
584689
....@@ -594,52 +699,191 @@
594699 }
595700 }
596701
597
- private JTextArea createTextPane()
598
- {
599
- String[] initString =
600
- {
601
- "This is an editable JTextPane, ", //regular
602
- "another ", //italic
603
- "styled ", //bold
604
- "text ", //small
605
- "component, ", //large
606
- "which supports embedded components..." + newline,//regular
607
- " " + newline, //button
608
- "...and embedded icons..." + newline, //regular
609
- " ", //icon
610
- newline + "JTextPane is a subclass of JEditorPane that "
611
- + "uses a StyledEditorKit and StyledDocument, and provides "
612
- + "cover methods for interacting with those objects."
613
- };
702
+//static GraphicsDevice device = GraphicsEnvironment
703
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
614704
615
- String[] initStyles =
616
- {
617
- "regular", "italic", "bold", "small", "large",
618
- "regular", "button", "regular", "icon",
619
- "regular"
620
- };
705
+ Rectangle keeprect;
706
+ cRadio radio;
707
+
708
+cButton keepButton;
709
+ cButton twoButton; // Full 3D
710
+ cButton sixButton;
711
+ cButton threeButton;
712
+ cButton sevenButton;
713
+ cButton fourButton; // full panel
714
+ cButton oneButton; // full XYZ
715
+ //cButton currentLayout;
716
+
717
+ boolean maximized;
718
+
719
+ cButton fullscreenLayout;
621720
622
- JTextPane textPane = new JTextPane();
623
- textPane.setEditable(true);
624
- /*StyledDocument*/ doc = textPane.getStyledDocument();
625
- addStylesToDocument(doc);
626
-
627
- try
721
+ void Minimize()
628722 {
629
- for (int j = 0; j < 2; j++)
723
+ frame.setState(Frame.ICONIFIED);
724
+ frame.validate();
725
+ }
726
+
727
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
728
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
729
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
730
+ void Maximize()
731
+ {
732
+ if (CameraPane.FULLSCREEN)
630733 {
631
- for (int i = 0; i < initString.length; i++)
632
- {
633
- doc.insertString(doc.getLength(), initString[i],
634
- doc.getStyle(initStyles[i]));
635
- }
734
+ ToggleFullScreen();
636735 }
637
- } catch (BadLocationException ble)
736
+
737
+ if (maximized)
738
+ {
739
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
740
+ }
741
+ else
742
+ {
743
+ keeprect = frame.getBounds();
744
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
745
+// Dimension rect2 = frame.getToolkit().getScreenSize();
746
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
747
+// frame.setState(Frame.MAXIMIZED_BOTH);
748
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
749
+ }
750
+
751
+ maximized ^= true;
752
+
753
+ frame.validate();
754
+ }
755
+
756
+ cButton minButton;
757
+ cButton maxButton;
758
+ cButton fullButton;
759
+
760
+ void ToggleFullScreen()
638761 {
639
- System.err.println("Couldn't insert initial text into text pane.");
762
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
763
+
764
+ cameraView.ToggleFullScreen();
765
+
766
+ if (!CameraPane.FULLSCREEN)
767
+ {
768
+ device.setFullScreenWindow(null);
769
+ frame.dispose();
770
+ frame.setUndecorated(false);
771
+ frame.validate();
772
+ frame.setVisible(true);
773
+
774
+ //frame.setVisible(false);
775
+// frame.removeNotify();
776
+// frame.setUndecorated(false);
777
+// frame.addNotify();
778
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
779
+
780
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
781
+// X framePanel.add(bigThree);
782
+// X frame.getContentPane().add(/*"Center",*/framePanel);
783
+ framePanel.setDividerLocation(46);
784
+
785
+ //frame.setVisible(true);
786
+ radio.layout = keepButton;
787
+ //theFrame = null;
788
+ keepButton = null;
789
+ radio.layout.doClick();
790
+
791
+ } else
792
+ {
793
+ keepButton = radio.layout;
794
+ //keeprect = frame.getBounds();
795
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
796
+// frame.getToolkit().getScreenSize().height);
797
+ //frame.setVisible(false);
798
+
799
+ frame.dispose();
800
+ frame.setUndecorated(true);
801
+ device.setFullScreenWindow(frame);
802
+ frame.validate();
803
+ frame.setVisible(true);
804
+// frame.removeNotify();
805
+// frame.setUndecorated(true);
806
+// frame.addNotify();
807
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
808
+// X framePanel.remove(bigThree);
809
+// X frame.getContentPane().add(/*"Center",*/bigThree);
810
+ framePanel.setDividerLocation(0);
811
+
812
+ radio.layout = fullscreenLayout;
813
+ radio.layout.doClick();
814
+ //frame.setVisible(true);
815
+ }
816
+ frame.validate();
640817 }
641818
642
- return new JTextArea(); // textPane;
819
+ private byte[] CompressCopy()
820
+ {
821
+ boolean temp = CameraPane.SWITCH;
822
+ CameraPane.SWITCH = false;
823
+
824
+ copy.ExtractBigData(versiontable);
825
+ // if (copy == client)
826
+
827
+ byte[] versions[] = copy.versions;
828
+ copy.versions = null;
829
+
830
+ byte[] compress = Compress(copy);
831
+
832
+ copy.versions = versions;
833
+
834
+ copy.RestoreBigData(versiontable);
835
+
836
+ CameraPane.SWITCH = temp;
837
+
838
+ return compress;
839
+ }
840
+
841
+ private JTextPane createTextPane()
842
+ {
843
+// TEXTAREA String[] initString =
844
+// {
845
+// "This is an editable JTextPane, ", //regular
846
+// "another ", //italic
847
+// "styled ", //bold
848
+// "text ", //small
849
+// "component, ", //large
850
+// "which supports embedded components..." + newline,//regular
851
+// " " + newline, //button
852
+// "...and embedded icons..." + newline, //regular
853
+// " ", //icon
854
+// newline + "JTextPane is a subclass of JEditorPane that "
855
+// + "uses a StyledEditorKit and StyledDocument, and provides "
856
+// + "cover methods for interacting with those objects."
857
+// };
858
+//
859
+// String[] initStyles =
860
+// {
861
+// "regular", "italic", "bold", "small", "large",
862
+// "regular", "button", "regular", "icon",
863
+// "regular"
864
+// };
865
+//
866
+// JTextPane textPane = new JTextPane();
867
+// textPane.setEditable(true);
868
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
869
+// addStylesToDocument(doc);
870
+//
871
+// try
872
+// {
873
+// for (int j = 0; j < 2; j++)
874
+// {
875
+// for (int i = 0; i < initString.length; i++)
876
+// {
877
+// doc.insertString(doc.getLength(), initString[i],
878
+// doc.getStyle(initStyles[i]));
879
+// }
880
+// }
881
+// } catch (BadLocationException ble)
882
+// {
883
+// System.err.println("Couldn't insert initial text into text pane.");
884
+// }
885
+
886
+ return new JTextPane(); // textPane;
643887 }
644888
645889 protected void addStylesToDocument(StyledDocument doc)
....@@ -692,7 +936,7 @@
692936 protected static ImageIcon createImageIcon(String path,
693937 String description)
694938 {
695
- java.net.URL imgURL = GrafreeD.class.getResource(path);
939
+ java.net.URL imgURL = Grafreed.class.getResource(path);
696940 if (imgURL != null)
697941 {
698942 return new ImageIcon(imgURL, description);
....@@ -724,6 +968,7 @@
724968 // NumberSlider vDivsField;
725969 // JCheckBox endcaps;
726970 JCheckBox liveCB;
971
+ JCheckBox selectCB;
727972 JCheckBox hideCB;
728973 JCheckBox link2masterCB;
729974 JCheckBox markCB;
....@@ -731,7 +976,12 @@
731976 JCheckBox speedupCB;
732977 JCheckBox rewindCB;
733978 JCheckBox flipVCB;
979
+
980
+ cCheckBox toggleTextureCB;
981
+ cCheckBox toggleSwitchCB;
982
+
734983 JComboBox texresMenu;
984
+
735985 JButton resetButton;
736986 JButton stepButton;
737987 JButton stepAllButton;
....@@ -739,115 +989,87 @@
739989 JButton slowerButton;
740990 JButton fasterButton;
741991 JButton remarkButton;
992
+
993
+ cGridBag editPanel;
994
+ cGridBag editCommandsPanel;
995
+
996
+ cGridBag namePanel;
997
+ cGridBag setupPanel;
998
+ cGridBag setupPanel2;
999
+ cGridBag objectCommandsPanel;
1000
+ cGridBag pushPanel;
1001
+ cGridBag fillPanel;
7421002
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
1003
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
7441004 {
7451005 JCheckBox cb;
7461006
747
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
748
- oe.aConstraints.gridwidth = 1; // 3;
749
-// oe.aConstraints.weightx = 1;
750
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
751
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1007
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7521008 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
7561009
7571010 return cb;
7581011 }
7591012
760
- cButton AddButton(ObjEditor oe, String label)
1013
+ cButton AddButton(cGridBag panel, String label)
7611014 {
7621015 cButton cb;
7631016
764
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
765
- oe.aConstraints.gridwidth = 1;
766
-// oe.aConstraints.weightx = 1;
767
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
768
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
1017
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
7691018 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
7731019
7741020 return cb;
7751021 }
7761022
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
1023
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
7781024 {
7791025 JComboBox combo;
7801026
781
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
782
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
783
- oe.aConstraints.gridx += 1;
1027
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7841028 combo.addActionListener(this);
7851029
7861030 return combo;
7871031 }
7881032
789
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
1033
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
7901034 {
791
- NumberSlider combo;
1035
+ cGridBag control = new cGridBag();
1036
+
1037
+ cNumberSlider combo;
7921038
7931039 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
7961040 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
797
- aConstraints.gridwidth = 2;
798
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
799
- aConstraints.gridx += 1;
800
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
801
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
802
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
803
- aConstraints.gridx += 1;
804
- aConstraints.gridwidth = 1;
805
-
1041
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1042
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8061043 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
1044
+
1045
+ panel.add(control);
1046
+
1047
+ return control;
8131048 }
8141049
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
1050
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
8161051 {
817
- NumberSlider combo;
1052
+ cGridBag control = new cGridBag();
1053
+
1054
+ cNumberSlider combo;
8181055
8191056 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
8221057 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
823
- aConstraints.gridwidth = 2;
824
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
825
- aConstraints.gridx += 1;
826
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
827
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
828
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
829
- aConstraints.gridx += 1;
830
- aConstraints.gridwidth = 1;
831
-
1058
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1059
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8321060 combo.setInteger(current);
8331061
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
1062
+ panel.add(control);
1063
+
1064
+ return control;
8391065 }
8401066
841
- JTextArea AddText(JPanel ctrlPanel, String name)
1067
+ JTextArea AddText(cGridBag ctrlPanel, String name)
8421068 {
8431069 JTextArea text;
8441070
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1071
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8481072 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
8511073
8521074 return text;
8531075 }
....@@ -877,9 +1099,16 @@
8771099 objEditor.ctrlPanel.remove(j);
8781100 }
8791101
1102
+ void Remove(cNumberSlider j)
1103
+ {
1104
+ j.removeChangeListener(this);
1105
+ //objEditor.ctrlPanel.remove(j.label);
1106
+ objEditor.ctrlPanel.remove(j);
1107
+ }
1108
+
8801109 /*
8811110 */
882
- void Return() // ObjEditor oe)
1111
+ void Return0() // ObjEditor oe)
8831112 {
8841113 aConstraints.gridy += 1;
8851114 aConstraints.gridx = 0;
....@@ -934,35 +1163,78 @@
9341163
9351164 void SetupUI2(ObjEditor oe)
9361165 {
937
-// oe.aConstraints.weightx = 0;
938
-// oe.aConstraints.weighty = 0;
939
-// oe.aConstraints.gridx = 0;
940
-// oe.aConstraints.gridy = 0;
941
- SetupName(oe);
1166
+ //SetupName(oe);
9421167
943
- if (!GroupEditor.allparams)
1168
+ namePanel = new cGridBag();
1169
+
1170
+ nameField = AddText(namePanel, copy.GetName());
1171
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
1172
+ oe.ctrlPanel.add(namePanel);
1173
+
1174
+ oe.ctrlPanel.Return();
1175
+
1176
+ if (!allparams)
9441177 return;
9451178
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1179
+ setupPanel = new cGridBag().setVertical(false);
1180
+
1181
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1182
+ liveCB.setToolTipText("Animate object");
1183
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1184
+ selectCB.setToolTipText("Make object selectable");
9491185 // Return();
950
- markCB = AddCheckBox(oe, "Mark", copy.marked);
951
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
952
- randomCB = AddCheckBox(oe, "Rand", copy.random);
953
- Return();
954
- resetButton = AddButton(oe, "Reset");
955
- stepButton = AddButton(oe, "Step");
1186
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1187
+ hideCB.setToolTipText("Hide object");
1188
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1189
+ markCB.setToolTipText("As animation target transform");
1190
+
1191
+ setupPanel2 = new cGridBag().setVertical(false);
1192
+
1193
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1194
+ rewindCB.setToolTipText("Rewind animation");
1195
+
1196
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1197
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
1198
+
1199
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1200
+ link2masterCB.setToolTipText("Attach to support");
1201
+
1202
+ if (Globals.ADVANCED)
1203
+ {
1204
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1205
+ speedupCB.setToolTipText("Option motion capture");
1206
+ }
1207
+
1208
+ oe.ctrlPanel.add(setupPanel);
1209
+ oe.ctrlPanel.Return();
1210
+ oe.ctrlPanel.add(setupPanel2);
1211
+ oe.ctrlPanel.Return();
1212
+
1213
+ objectCommandsPanel = new cGridBag().setVertical(false);
1214
+
1215
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1216
+ resetButton.setToolTipText("Jump to frame zero");
1217
+ stepButton = AddButton(objectCommandsPanel, "Step");
1218
+ stepButton.setToolTipText("Step one frame");
9561219 // resetAllButton = AddButton(oe, "Reset All");
9571220 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9591221 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- remarkButton = AddButton(oe, "Rem");
1222
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1223
+ slowerButton.setToolTipText("Decrease animation speed");
1224
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1225
+ fasterButton.setToolTipText("Increase animation speed");
1226
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1227
+ remarkButton.setToolTipText("Set the current transform as the target");
9631228
964
- Return();
1229
+ oe.ctrlPanel.add(objectCommandsPanel);
1230
+ oe.ctrlPanel.Return();
9651231
1232
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1233
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1234
+ //Return();
1235
+
1236
+ oe.ctrlPanel.Return();
1237
+
9661238 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671239 // ObjEditor.aConstraints.gridx += 1;
9681240
....@@ -1056,7 +1328,7 @@
10561328 oe.aConstraints.gridwidth = 1;
10571329 /**/
10581330 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1331
+ oe.ctrlPanel.Return();
10601332
10611333 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621334 //textureButton.setEnabled(false);
....@@ -1158,10 +1430,28 @@
11581430 //JPanel worldPanel =
11591431 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601432 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1433
+ centralPanel = new cGridBag();
1434
+ centralPanel.preferredWidth = 20;
1435
+
1436
+ if (Globals.ADVANCED)
1437
+ {
1438
+ timelinePanel = new JPanel(new BorderLayout());
1439
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11641440
1441
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1442
+ cameraPanel.setContinuousLayout(true);
1443
+ cameraPanel.setOneTouchExpandable(true);
1444
+// cameraPanel.setDividerLocation(0.9);
1445
+// cameraPanel.setDividerSize(9);
1446
+ cameraPanel.setResizeWeight(1.0);
1447
+
1448
+ }
1449
+
1450
+ centralPanel.add(cameraView);
1451
+ centralPanel.setFocusable(true);
1452
+ //frame.setJMenuBar(timelineMenubar);
1453
+ //centralPanel.add(timelinePanel);
1454
+
11651455 //topView.camera = ;
11661456 //frontView.camera = new Camera(2);
11671457 //sideView.camera = new Camera(3);
....@@ -1177,12 +1467,13 @@
11771467 //frontView.object = copy;
11781468 //sideView.object = copy;
11791469
1180
- XYZPanel = new JPanel();
1181
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1470
+ XYZPanel = new cGridBag().setVertical(true);
1471
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11821472
1183
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1184
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1473
+ XYZPanel.preferredWidth = 5;
1474
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1475
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1476
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
11861477
11871478 /*
11881479 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1191,7 +1482,7 @@
11911482 gridPanel.add(cameraView);
11921483 gridPanel.add(XYZPanel);
11931484 */
1194
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1485
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11951486 gridPanel.setContinuousLayout(true);
11961487 gridPanel.setOneTouchExpandable(true);
11971488 gridPanel.setDividerLocation(1.0);
....@@ -1220,11 +1511,16 @@
12201511 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12211512 //tmp.setName("Edit");
12221513 objectPanel.add(materialPanel);
1223
- JPanel north = new JPanel(new BorderLayout());
1224
- north.setName("Edit");
1225
- north.add(ctrlPanel, BorderLayout.NORTH);
1226
- objectPanel.add(north);
1227
- objectPanel.add(infoPanel);
1514
+// JPanel north = new JPanel(new BorderLayout());
1515
+// north.setName("Edit");
1516
+// north.add(ctrlPanel, BorderLayout.NORTH);
1517
+// objectPanel.add(north);
1518
+ objectPanel.add(editPanel);
1519
+
1520
+ //if (Globals.ADVANCED)
1521
+ objectPanel.add(infoPanel);
1522
+
1523
+ objectPanel.add(toolboxPanel);
12281524
12291525 /*
12301526 aConstraints.gridx = 0;
....@@ -1233,7 +1529,7 @@
12331529 aConstraints.gridy += 1;
12341530 aConstraints.gridwidth = 1;
12351531 mainPanel.add(objectPanel, aConstraints);
1236
- */
1532
+ */
12371533
12381534 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12391535 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1244,16 +1540,23 @@
12441540 scrollpane.setWheelScrollingEnabled(true);
12451541 scrollpane.addMouseWheelListener(this); // Default not fast enough
12461542
1247
- /*JTabbedPane*/ jtp = new JTabbedPane();
1248
- jtp.add(scrollpane);
1543
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1544
+ scenePanel.preferredWidth = 6;
1545
+
1546
+ JTabbedPane tabbedPane = new JTabbedPane();
1547
+ tabbedPane.add(scrollpane);
12491548
1250
- jtp.add(FSPane = new cFileSystemPane(this));
1251
-
1252
- optionsPanel = new JPanel(new GridBagLayout());
1549
+ optionsPanel = new cGridBag().setVertical(false);
12531550
12541551 optionsPanel.setName("Options");
1255
- jtp.add(optionsPanel);
1552
+
1553
+ AddOptions(optionsPanel); //, aConstraints);
1554
+
1555
+ tabbedPane.add(optionsPanel);
1556
+
1557
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12561558
1559
+ scenePanel.add(tabbedPane);
12571560
12581561 /*
12591562 cTree jTree = new cTree(null);
....@@ -1275,7 +1578,7 @@
12751578 jtp.add(tree);
12761579 */
12771580
1278
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);
1581
+ bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
12791582 bigPanel.setContinuousLayout(true);
12801583 bigPanel.setOneTouchExpandable(true);
12811584 bigPanel.setDividerLocation(0.8);
....@@ -1287,6 +1590,7 @@
12871590 //bigPanel.setSize(new Dimension(10,10));
12881591 //bigPanel.add(ctrlPanel);
12891592 //bigPanel.add(gridPanel);
1593
+ /**
12901594 bigThree = new JPanel();
12911595 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12921596 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1297,20 +1601,26 @@
12971601 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
12981602 aWindowConstraints.weightx = 0;
12991603 aWindowConstraints.weighty = 1;
1300
- bigThree.add(jtp, aWindowConstraints);
1604
+ bigThree.add(scenePanel, aWindowConstraints);
13011605 aWindowConstraints.weightx = 1;
13021606 aWindowConstraints.gridwidth = 3;
13031607 // aConstraints.gridheight = 3;
13041608 aWindowConstraints.gridx = 1;
13051609 aWindowConstraints.fill = GridBagConstraints.BOTH;
1306
- bigThree.add(cameraPanel, aWindowConstraints);
1610
+ bigThree.add(centralPanel, aWindowConstraints);
13071611 aWindowConstraints.weightx = 0;
13081612 aWindowConstraints.gridx = 4;
13091613 aWindowConstraints.gridwidth = 1;
13101614 // aConstraints.gridheight = 3;
13111615 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13121616 bigThree.add(XYZPanel, aWindowConstraints);
1617
+ /**/
13131618
1619
+ bigThree = new cGridBag();
1620
+ bigThree.addComponent(scenePanel);
1621
+ bigThree.addComponent(centralPanel);
1622
+ bigThree.addComponent(XYZPanel);
1623
+
13141624 // // SIDE EFFECT!!!
13151625 // aConstraints.gridx = 0;
13161626 // aConstraints.gridy = 0;
....@@ -1318,9 +1628,9 @@
13181628 // aConstraints.gridheight = 1;
13191629
13201630 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1321
- framePanel.setContinuousLayout(true);
1322
- framePanel.setOneTouchExpandable(true);
1323
- framePanel.setDividerLocation(0.8);
1631
+ framePanel.setContinuousLayout(false);
1632
+ framePanel.setOneTouchExpandable(false);
1633
+ //.setDividerLocation(0.8);
13241634 //framePanel.setDividerSize(15);
13251635 //framePanel.setResizeWeight(0.15);
13261636 framePanel.setName("Frame");
....@@ -1331,15 +1641,21 @@
13311641 //worldPane.add(bigPanel);
13321642 //worldPane.add(worldPanel);
13331643 /**/
1334
- frame.getContentPane().add(/*"Center",*/framePanel);
1644
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1645
+ frame.add(/*"Center",*/framePanel);
13351646 //frame.getContentPane().add(/*"Center",*/ worldPane);
13361647
13371648 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13381649
1339
- frame.setSize(1024, 768);
1340
- frame.show();
1341
-
1650
+ frame.setSize(1280, 860);
1651
+
1652
+ cameraView.requestFocusInWindow();
1653
+
13421654 gridPanel.setDividerLocation(1.0);
1655
+
1656
+ frame.validate();
1657
+
1658
+ frame.setVisible(true);
13431659
13441660 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
13451661 frame.addWindowListener(new WindowAdapter()
....@@ -1352,6 +1668,10 @@
13521668 });
13531669 }
13541670
1671
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1672
+ {
1673
+ }
1674
+
13551675 JTree GetTree()
13561676 {
13571677 return objEditor.jTree;
....@@ -1363,260 +1683,161 @@
13631683 ctrlPanel.removeAll();
13641684 }
13651685
1366
- void SetupMaterial(JPanel ctrlPanel)
1686
+ void SetupMaterial(cGridBag panel)
13671687 {
1368
- aConstraints.weighty = 0;
1369
- //aConstraints.weightx = 1;
1370
- /*
1688
+ /*
13711689 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13721690 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1373
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1374
- aConstraints.gridx += 1;
13751691 */
13761692
1377
- aConstraints.gridwidth = 1;
1378
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1379
- aConstraints.gridx += 1;
1380
- aConstraints.weighty = 0;
1381
- aConstraints.gridwidth = 1;
1693
+ cGridBag editBar = new cGridBag().setVertical(false);
1694
+
1695
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1696
+ createMaterialButton.setToolTipText("Create material");
13821697
13831698 /*
13841699 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
13881700 */
13891701
1390
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1391
- aConstraints.gridx += 1;
1702
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1703
+ clearMaterialButton.setToolTipText("Clear material");
1704
+
1705
+ if (Globals.ADVANCED)
1706
+ {
1707
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1708
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1709
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1710
+ }
13921711
1393
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1394
-
1395
- aConstraints.gridx += 1;
1396
-
1397
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1398
-
1399
- aConstraints.gridx += 1;
1400
-
1401
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1402
-
1403
- aConstraints.gridx = 0;
1404
- aConstraints.gridy += 1;
1405
- aConstraints.weighty = 0;
1406
- aConstraints.gridwidth = 1;
1712
+ editBar.preferredHeight = 15;
1713
+
1714
+ panel.add(editBar);
1715
+
14071716 /**/
14081717 //aConstraints.weighty = 0;
14091718 ////aConstraints.weightx = 1;
14101719 //aConstraints.weighty = 1;
14111720 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14121721 //aConstraints.gridx += 1;
1413
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1414
- aConstraints.weighty = 0;
1415
- aConstraints.gridx = 0;
1416
- aConstraints.gridy += 1;
1417
- aConstraints.gridwidth = 1;
1722
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14181723
1419
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1420
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1421
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1422
- aConstraints.gridx += 1;
1423
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1424
- //aConstraints.weightx = 0;
1425
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1426
- aConstraints.gridx = 0;
1427
- aConstraints.gridy += 1;
1428
- aConstraints.gridwidth = 1;
1724
+ cGridBag colorSection = new cGridBag().setVertical(true);
1725
+
1726
+ cGridBag color = new cGridBag();
1727
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1728
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1729
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1730
+ //colorField.preferredWidth = 200;
1731
+ colorSection.add(color);
14291732
1430
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1431
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1432
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1433
- aConstraints.gridx += 1;
1434
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1435
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1436
- aConstraints.gridx = 0;
1437
- aConstraints.gridy += 1;
1438
- aConstraints.gridwidth = 1;
1733
+ cGridBag modulation = new cGridBag();
1734
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1735
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1736
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1737
+ colorSection.add(modulation);
14391738
1440
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1441
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1442
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1443
- aConstraints.gridx += 1;
1444
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1445
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1446
- aConstraints.gridx = 0;
1447
- aConstraints.gridy += 1;
1448
- aConstraints.gridwidth = 1;
1739
+ cGridBag texture = new cGridBag();
1740
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1741
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1742
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1743
+ colorSection.add(texture);
14491744
1450
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1451
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1452
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1453
- aConstraints.gridx += 1;
1454
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1455
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1456
- aConstraints.gridx = 0;
1457
- aConstraints.gridy += 1;
1458
- aConstraints.gridwidth = 1;
1745
+ panel.add(new JSeparator());
1746
+
1747
+ panel.add(colorSection);
1748
+
1749
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1750
+
1751
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1752
+
1753
+ cGridBag diffuse = new cGridBag();
1754
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1755
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1756
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1757
+ diffuseSection.add(diffuse);
14591758
1460
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1461
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1462
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1463
- aConstraints.gridx += 1;
1464
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1465
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1466
- aConstraints.gridx = 0;
1467
- aConstraints.gridy += 1;
1468
- aConstraints.gridwidth = 1;
1759
+ cGridBag diffuseness = new cGridBag();
1760
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1761
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1762
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1763
+ diffuseSection.add(diffuseness);
14691764
1470
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1471
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1472
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1473
- aConstraints.gridx += 1;
1474
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1475
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1476
- aConstraints.gridx = 0;
1477
- aConstraints.gridy += 1;
1478
- aConstraints.gridwidth = 1;
1765
+ cGridBag selfshadow = new cGridBag();
1766
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1767
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1768
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1769
+ diffuseSection.add(selfshadow);
14791770
1480
- //aConstraints.weighty = 1;
1481
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1482
- //aConstraints.gridx += 1;
1483
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1484
- aConstraints.weighty = 0;
1485
- aConstraints.gridx = 0;
1486
- aConstraints.gridy += 1;
1487
- aConstraints.gridwidth = 1;
1771
+ cGridBag sheen = new cGridBag();
1772
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1773
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1774
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1775
+ diffuseSection.add(sheen);
14881776
1489
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1490
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1491
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1492
- aConstraints.gridx += 1;
1493
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1494
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1495
- aConstraints.gridx = 0;
1496
- aConstraints.gridy += 1;
1497
- aConstraints.gridwidth = 1;
1777
+ cGridBag subsurface = new cGridBag();
1778
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1779
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1780
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1781
+ diffuseSection.add(subsurface);
14981782
1499
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1500
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1501
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1502
- aConstraints.gridx += 1;
1503
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1504
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1505
- aConstraints.gridx = 0;
1506
- aConstraints.gridy += 1;
1507
- aConstraints.gridwidth = 1;
1783
+ cGridBag shadow = new cGridBag();
1784
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1785
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1786
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1787
+ diffuseSection.add(shadow);
15081788
1509
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1510
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1511
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1512
- aConstraints.gridx += 1;
1513
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1514
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1515
- aConstraints.gridx = 0;
1516
- aConstraints.gridy += 1;
1517
- aConstraints.gridwidth = 1;
1789
+ cGridBag fakedepth = new cGridBag();
1790
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1791
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1792
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1793
+ diffuseSection.add(fakedepth);
15181794
1519
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1520
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1521
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1522
- aConstraints.gridx += 1;
1523
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1524
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1525
- aConstraints.gridx = 0;
1526
- aConstraints.gridy += 1;
1527
- aConstraints.gridwidth = 1;
1795
+ cGridBag shadowbias = new cGridBag();
1796
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1797
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1798
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1799
+ diffuseSection.add(shadowbias);
15281800
1529
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1530
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1531
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1532
- aConstraints.gridx += 1;
1533
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1534
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1535
- aConstraints.gridx = 0;
1536
- aConstraints.gridy += 1;
1537
- aConstraints.gridwidth = 1;
1801
+ panel.add(new JSeparator());
1802
+
1803
+ panel.add(diffuseSection);
1804
+
1805
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1806
+
1807
+ cGridBag specularSection = new cGridBag().setVertical(true);
15381808
1539
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1540
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1541
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1542
- aConstraints.gridx += 1;
1543
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1544
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1545
- aConstraints.gridx = 0;
1546
- aConstraints.gridy += 1;
1547
- aConstraints.gridwidth = 1;
1809
+ cGridBag specular = new cGridBag();
1810
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1811
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1812
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1813
+ specularSection.add(specular);
15481814
1549
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1550
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1551
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1552
- aConstraints.gridx += 1;
1553
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1554
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1555
- aConstraints.gridx = 0;
1556
- aConstraints.gridy += 1;
1557
- aConstraints.gridwidth = 1;
1815
+ cGridBag lightarea = new cGridBag();
1816
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1817
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1818
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1819
+ specularSection.add(lightarea);
15581820
1559
- //aConstraints.weighty = 1;
1560
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1561
- //aConstraints.gridx += 1;
1562
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1563
- aConstraints.weighty = 0;
1564
- aConstraints.gridx = 0;
1565
- aConstraints.gridy += 1;
1566
- aConstraints.gridwidth = 1;
1821
+ cGridBag shininess = new cGridBag();
1822
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1823
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1824
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1825
+ specularSection.add(shininess);
15671826
1568
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1569
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1570
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1571
- aConstraints.gridx += 1;
1572
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1573
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1574
- aConstraints.gridx = 0;
1575
- aConstraints.gridy += 1;
1576
- aConstraints.gridwidth = 1;
1827
+ cGridBag metalness = new cGridBag();
1828
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1829
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1830
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1831
+ specularSection.add(metalness);
15771832
1578
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1579
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1580
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1581
- aConstraints.gridx += 1;
1582
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1583
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1584
- aConstraints.gridx = 0;
1585
- aConstraints.gridy += 1;
1586
- aConstraints.gridwidth = 1;
1833
+ cGridBag velvet = new cGridBag();
1834
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1835
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1836
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1837
+ specularSection.add(velvet);
15871838
1588
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1589
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1590
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1591
- aConstraints.gridx += 1;
1592
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1593
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1594
- aConstraints.gridx = 0;
1595
- aConstraints.gridy += 1;
1596
- aConstraints.gridwidth = 1;
1597
-
1598
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1599
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1600
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1601
- aConstraints.gridx += 1;
1602
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1603
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1604
- aConstraints.gridx = 0;
1605
- aConstraints.gridy += 1;
1606
- aConstraints.gridwidth = 1;
1607
-
1608
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1609
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1610
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1611
- aConstraints.gridx += 1;
1612
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1613
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1614
- aConstraints.gridx = 0;
1615
- aConstraints.gridy += 1;
1616
- aConstraints.gridwidth = 1;
1617
-
1618
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1619
- Return();
1839
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1840
+ //Return();
16201841 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16211842 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16221843 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1627,130 +1848,105 @@
16271848 // aConstraints.gridy += 1;
16281849 // aConstraints.gridwidth = 1;
16291850
1630
- //aConstraints.weighty = 1;
1631
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1632
- //aConstraints.gridx += 1;
1633
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1634
- aConstraints.weighty = 0;
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
1851
+ cGridBag anisoU = new cGridBag();
1852
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1853
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1854
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1855
+ specularSection.add(anisoU);
16381856
1639
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1640
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- aConstraints.gridwidth = 1;
1857
+ cGridBag anisoV = new cGridBag();
1858
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1859
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1860
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1861
+ specularSection.add(anisoV);
16481862
1649
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1650
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1652
- aConstraints.gridx += 1;
1653
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1654
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1655
- aConstraints.gridx = 0;
1656
- aConstraints.gridy += 1;
1657
- aConstraints.gridwidth = 1;
16581863
1659
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1660
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1661
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1662
- aConstraints.gridx += 1;
1663
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1664
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1665
- aConstraints.gridx = 0;
1666
- aConstraints.gridy += 1;
1667
- aConstraints.gridwidth = 1;
1864
+ panel.add(new JSeparator());
1865
+
1866
+ panel.add(specularSection);
1867
+
1868
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1869
+
1870
+ //cGridBag globalSection = new cGridBag().setVertical(true);
16681871
1669
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1670
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1672
- aConstraints.gridx += 1;
1673
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1674
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1675
- aConstraints.gridx = 0;
1676
- aConstraints.gridy += 1;
1677
- aConstraints.gridwidth = 1;
1678
- aConstraints.weighty = 0;
1872
+ cGridBag camera = new cGridBag();
1873
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1874
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1875
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1876
+ colorSection.add(camera);
16791877
1680
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1681
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- aConstraints.gridwidth = 1;
1878
+ cGridBag ambient = new cGridBag();
1879
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1880
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1881
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1882
+ colorSection.add(ambient);
16891883
1690
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1691
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- aConstraints.gridwidth = 1;
1884
+ cGridBag backlit = new cGridBag();
1885
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1886
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1887
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1888
+ colorSection.add(backlit);
16991889
1700
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1701
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- aConstraints.gridwidth = 1;
1890
+ cGridBag opacity = new cGridBag();
1891
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1892
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1893
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1894
+ colorSection.add(opacity);
17091895
1710
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1711
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1712
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1713
- aConstraints.gridx += 1;
1714
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1715
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1716
- aConstraints.gridx = 0;
1717
- aConstraints.gridy += 1;
1718
- aConstraints.gridwidth = 1;
1896
+ //panel.add(new JSeparator());
1897
+
1898
+ //panel.add(globalSection);
1899
+
1900
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1901
+
1902
+ cGridBag textureSection = new cGridBag().setVertical(true);
17191903
1720
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1721
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1722
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1723
- aConstraints.gridx += 1;
1724
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1725
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1726
- aConstraints.gridx = 0;
1727
- aConstraints.gridy += 1;
1728
- aConstraints.gridwidth = 1;
1904
+ cGridBag bump = new cGridBag();
1905
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1906
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1907
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1908
+ textureSection.add(bump);
17291909
1730
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1731
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1732
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1733
- aConstraints.gridx += 1;
1734
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1735
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1736
- aConstraints.gridx = 0;
1737
- aConstraints.gridy += 1;
1738
- aConstraints.gridwidth = 1;
1910
+ cGridBag noise = new cGridBag();
1911
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1912
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1913
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1914
+ textureSection.add(noise);
17391915
1740
- //aConstraints.weighty = 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1742
- //aConstraints.gridx += 1;
1743
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1744
- aConstraints.weighty = 0;
1916
+ cGridBag power = new cGridBag();
1917
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1918
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1919
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1920
+ textureSection.add(power);
17451921
1746
- aConstraints.gridx = 0;
1747
- aConstraints.gridy = 0;
1748
- aConstraints.gridwidth = 1;
1922
+ cGridBag borderfade = new cGridBag();
1923
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1924
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1925
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1926
+ textureSection.add(borderfade);
1927
+
1928
+ cGridBag fog = new cGridBag();
1929
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1930
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1931
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1932
+ textureSection.add(fog);
1933
+
1934
+ cGridBag opacityPower = new cGridBag();
1935
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1936
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1937
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1938
+ textureSection.add(opacityPower);
1939
+
1940
+ panel.add(new JSeparator());
1941
+
1942
+ panel.add(textureSection);
1943
+
1944
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17491945
17501946 SetMaterial(copy); // .GetMaterial());
17511947
1752
- colorField.addChangeListener(this);
1753
- modulationField.addChangeListener(this);
1948
+ //colorField.addChangeListener(this);
1949
+// modulationField.addChangeListener(this);
17541950 metalnessField.addChangeListener(this);
17551951 diffuseField.addChangeListener(this);
17561952 specularField.addChangeListener(this);
....@@ -1780,12 +1976,15 @@
17801976 opacityPowerField.addChangeListener(this);
17811977 /**/
17821978
1783
- resetSlidersButton.addActionListener(this);
17841979 clearMaterialButton.addActionListener(this);
17851980 createMaterialButton.addActionListener(this);
1786
-
1787
- propagateToggle.addItemListener(this);
1788
- multiplyToggle.addItemListener(this);
1981
+
1982
+ if (Globals.ADVANCED)
1983
+ {
1984
+ resetSlidersButton.addActionListener(this);
1985
+ propagateToggle.addItemListener(this);
1986
+ multiplyToggle.addItemListener(this);
1987
+ }
17891988 }
17901989
17911990 void DropFile(java.io.File[] files, boolean textures)
....@@ -1803,8 +2002,9 @@
18032002 // 3D models
18042003 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
18052004 {
1806
- lastConverter = new com.jmex.model.converters.MaxToJme();
1807
- LoadFile(filename, lastConverter);
2005
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2006
+ //LoadFile(filename, lastConverter);
2007
+ LoadObjFile(filename); // New 3ds loader
18082008 continue;
18092009 }
18102010 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -1859,19 +2059,21 @@
18592059 }
18602060
18612061 // Images/textures
1862
- if (textures
1863
- && (filename.toLowerCase().endsWith(".jpg")
1864
- || filename.toLowerCase().endsWith(".jpeg")
1865
- || filename.toLowerCase().endsWith(".gif")
1866
- || filename.toLowerCase().endsWith(".png")
1867
- || filename.toLowerCase().endsWith(".tre")
1868
- || filename.toLowerCase().endsWith(".bmp")
1869
- || filename.toLowerCase().endsWith(".tga")
1870
- || filename.toLowerCase().endsWith(".sgi")
1871
- || filename.toLowerCase().endsWith(".tif")
1872
- || filename.toLowerCase().endsWith(".tiff")))
2062
+ if (filename.toLowerCase().endsWith(".jpg")
2063
+ || filename.toLowerCase().endsWith(".jpeg")
2064
+ || filename.toLowerCase().endsWith(".gif")
2065
+ || filename.toLowerCase().endsWith(".png")
2066
+ || filename.toLowerCase().endsWith(".tre")
2067
+ || filename.toLowerCase().endsWith(".bmp")
2068
+ || filename.toLowerCase().endsWith(".tga")
2069
+ || filename.toLowerCase().endsWith(".sgi")
2070
+ || filename.toLowerCase().endsWith(".tif")
2071
+ || filename.toLowerCase().endsWith(".tiff"))
18732072 {
1874
- DropTexture(filename);
2073
+ if (textures)
2074
+ DropTexture(filename);
2075
+ else
2076
+ CreateBillboard(filename);
18752077 continue;
18762078 }
18772079
....@@ -1880,6 +2082,60 @@
18802082 }
18812083
18822084 ResetModel();
2085
+ }
2086
+
2087
+ void CreateBillboard(String filename)
2088
+ {
2089
+ Object3D source = null;
2090
+ Object3D group = copy;
2091
+
2092
+ if (group.selection.size() > 0)
2093
+ {
2094
+ source = group.selection.get(0);
2095
+ }
2096
+
2097
+ Grid grid = new Grid(1,1);
2098
+ grid.material = null;
2099
+
2100
+ grid.toParent = LA.newMatrix();
2101
+ grid.fromParent = LA.newMatrix();
2102
+ LA.matYRotate(grid.toParent, Math.PI/2);
2103
+ LA.matXRotate(grid.toParent, -Math.PI/2);
2104
+ LA.matXRotate(grid.fromParent, Math.PI/2);
2105
+ LA.matYRotate(grid.fromParent, -Math.PI/2);
2106
+
2107
+ BillboardNode bb = new BillboardNode();
2108
+ bb.addChild(grid);
2109
+
2110
+ Object3D newgroup = new Object3D();
2111
+ newgroup.CreateMaterial();
2112
+
2113
+ File file = new File(filename);
2114
+ newgroup.name = file.getName();
2115
+ newgroup.addChild(bb);
2116
+
2117
+ Object3D main = newgroup;
2118
+
2119
+ main.SetPigmentTexture(filename);
2120
+
2121
+ if (source != null)
2122
+ {
2123
+ main.material = new cMaterial(source.material);
2124
+ if (main.projectedVertices.length < source.projectedVertices.length)
2125
+ {
2126
+ main.projectedVertices = new Object3D.cVector2[source.projectedVertices.length];
2127
+ }
2128
+
2129
+ for (int i=0; i<source.projectedVertices.length; i++)
2130
+ {
2131
+ main.projectedVertices[i].x = source.projectedVertices[i].x;
2132
+ main.projectedVertices[i].y = source.projectedVertices[i].y;
2133
+ }
2134
+
2135
+ main.texres = source.texres;
2136
+ }
2137
+
2138
+ makeSomething(newgroup, false);
18832139 }
18842140
18852141 Point location;
....@@ -1900,7 +2156,7 @@
19002156
19012157 //? flashIt = false;
19022158 CameraPane pane = (CameraPane) cameraView;
1903
- pane.clickStart(location.x, location.y, 0);
2159
+ pane.clickStart(location.x, location.y, 0, 0);
19042160 pane.clickEnd(location.x, location.y, 0, true);
19052161
19062162 if (group.selection.size() == 1)
....@@ -1949,6 +2205,7 @@
19492205 e2.printStackTrace();
19502206 }
19512207 }
2208
+
19522209 LoadJMEThread loadThread;
19532210
19542211 class LoadJMEThread extends Thread
....@@ -2006,6 +2263,7 @@
20062263 //LoadFile0(filename, converter);
20072264 }
20082265 }
2266
+
20092267 LoadOBJThread loadObjThread;
20102268
20112269 class LoadOBJThread extends Thread
....@@ -2084,19 +2342,19 @@
20842342
20852343 void LoadObjFile(String fullname)
20862344 {
2087
- /*
2345
+ System.out.println("Loading " + fullname);
2346
+ /**/
20882347 //lastFilename = fullname;
20892348 if(loadObjThread == null)
20902349 {
2091
- loadObjThread = new LoadOBJThread();
2092
- loadObjThread.start();
2350
+ loadObjThread = new LoadOBJThread();
2351
+ loadObjThread.start();
20932352 }
20942353
20952354 loadObjThread.add(fullname);
2096
- */
2355
+ /**/
20972356
2098
- System.out.println("Loading " + fullname);
2099
- makeSomething(new FileObject(fullname, true), true);
2357
+ //makeSomething(new FileObject(fullname, true), true);
21002358 }
21012359
21022360 void LoadGFDFile(String fullname)
....@@ -2138,6 +2396,8 @@
21382396 {
21392397 Mocap sel = (Mocap) copy.selection.get(0);
21402398
2399
+ sel.SetCurrentBones(sel.frame);
2400
+
21412401 sel.fullname = fullname;
21422402
21432403 if (changename)
....@@ -2151,14 +2411,18 @@
21512411 sel.smoothed = false;
21522412
21532413 // if (!changename)
2154
- sel.SetPositionDelta(false, true, true, true/*?*/); // false
2414
+ //sel.SetPositionDelta(false, true, true, true/*?*/); // false
2415
+ sel.SetGlobalTransform();
2416
+ sel.LoadData();
2417
+ sel.Rewind();
2418
+ sel.Fade();
21552419 // sel.setPose(0);
21562420 refreshContents();
21572421 } else
21582422 {
21592423 mocap.Reset();
21602424 // new skeleton
2161
- makeSomething(mocap, false); // true);
2425
+ makeSomething(mocap, true); // true);
21622426 }
21632427 } catch (Exception e)
21642428 {
....@@ -2185,6 +2449,8 @@
21852449 {
21862450 Mocap sel = (Mocap) select;
21872451
2452
+ sel.SetCurrentBones(sel.frame);
2453
+
21882454 File file = new File(fullname);
21892455
21902456 // Mocap mocap = new Mocap("Mocap" + file.getName());
....@@ -2251,7 +2517,11 @@
22512517
22522518 if (!changename)
22532519 {
2254
- sel.SetPositionDelta(false, true, true, true/*?*/);
2520
+ //sel.SetPositionDelta(false, true, true, true/*?*/);
2521
+ sel.SetGlobalTransform();
2522
+ sel.LoadData();
2523
+ sel.Rewind();
2524
+ sel.Fade();
22552525 }
22562526
22572527 // sel.setPose(0);
....@@ -2345,11 +2615,11 @@
23452615
23462616 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23472617 {
2348
- if (GrafreeD.standAlone)
2618
+ if (Grafreed.standAlone)
23492619 {
23502620 /**/
23512621 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2352
- browser.show();
2622
+ browser.setVisible(true);
23532623 String filename = browser.getFile();
23542624 if (filename != null && filename.length() > 0)
23552625 {
....@@ -2460,6 +2730,7 @@
24602730 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
24612731 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
24622732 }
2733
+
24632734 //cJME.count++;
24642735 //cJME.count %= 12;
24652736 if (gc)
....@@ -2494,6 +2765,7 @@
24942765 }
24952766 if (input == null)
24962767 {
2768
+ new Exception().printStackTrace();
24972769 System.exit(0);
24982770 }
24992771
....@@ -2642,6 +2914,7 @@
26422914 }
26432915 }
26442916 }
2917
+
26452918 cFileSystemPane FSPane;
26462919
26472920 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2695,11 +2968,14 @@
26952968 }
26962969 }
26972970 }
2971
+
26982972 freezematerial = false;
26992973 }
27002974
27012975 void SetMaterial(Object3D object)
27022976 {
2977
+ latestObject = object;
2978
+
27032979 cMaterial mat = object.material;
27042980
27052981 if (mat == null)
....@@ -2708,7 +2984,8 @@
27082984 return;
27092985 }
27102986
2711
- multiplyToggle.setSelected(mat.multiply);
2987
+ if (multiplyToggle != null)
2988
+ multiplyToggle.setSelected(mat.multiply);
27122989
27132990 assert (object.projectedVertices != null);
27142991
....@@ -2810,12 +3087,17 @@
28103087 // }
28113088
28123089 /**/
2813
- if (deselect)
3090
+ if (deselect || child == null)
28143091 {
28153092 //group.deselectAll();
28163093 //freeze = true;
28173094 GetTree().clearSelection();
28183095 //freeze = false;
3096
+
3097
+ if (child == null)
3098
+ {
3099
+ return;
3100
+ }
28193101 }
28203102
28213103 //group.addSelectee(child);
....@@ -2884,31 +3166,48 @@
28843166 cameraView.ToggleDL();
28853167 cameraView.repaint();
28863168 return;
2887
- } else if (event.getSource() == toggleTextureItem)
3169
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
28883170 {
28893171 cameraView.ToggleTexture();
28903172 // june 2013 copy.HardTouch();
28913173 cameraView.repaint();
28923174 return;
2893
- } else if (event.getSource() == toggleFullItem)
3175
+ } else if (event.getSource() == toggleTimelineItem)
28943176 {
2895
- if (CameraPane.FULLSCREEN)
3177
+ timeline ^= true;
3178
+
3179
+ if (timeline)
28963180 {
2897
- frame.getContentPane().remove(/*"Center",*/bigThree);
2898
- framePanel.add(bigThree);
2899
- frame.getContentPane().add(/*"Center",*/framePanel);
2900
- } else
2901
- {
2902
- frame.getContentPane().remove(/*"Center",*/framePanel);
2903
- frame.getContentPane().add(/*"Center",*/bigThree);
3181
+ centralPanel.remove(cameraView);
3182
+ cameraPanel.add(cameraView);
3183
+ centralPanel.add(cameraPanel);
3184
+ frame.setJMenuBar(timelineMenubar);
3185
+ wasFullScreen = CameraPane.FULLSCREEN;
3186
+ if (!CameraPane.FULLSCREEN)
3187
+ ToggleFullScreen();
3188
+ toggleFullScreenItem.setEnabled(false);
29043189 }
3190
+ else
3191
+ {
3192
+ centralPanel.remove(cameraPanel);
3193
+ centralPanel.add(cameraView);
3194
+ frame.setJMenuBar(null);
3195
+ if (!wasFullScreen)
3196
+ ToggleFullScreen();
3197
+ toggleFullScreenItem.setEnabled(true);
3198
+ }
3199
+
29053200 frame.validate();
2906
- cameraView.ToggleFullScreen();
3201
+ return;
3202
+ } else if (event.getSource() == toggleFullScreenItem)
3203
+ {
3204
+ ToggleFullScreen();
3205
+ frame.validate();
29073206
29083207 return;
2909
- } else if (event.getSource() == toggleRandomItem)
3208
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29103209 {
2911
- cameraView.ToggleRandom();
3210
+ cameraView.ToggleSwitch();
29123211 cameraView.repaint();
29133212 return;
29143213 } else if (event.getSource() == toggleHandleItem)
....@@ -2937,6 +3236,10 @@
29373236 {
29383237 copy.live ^= true;
29393238 return;
3239
+ } else if (event.getSource() == selectCB)
3240
+ {
3241
+ copy.dontselect ^= true;
3242
+ return;
29403243 } else if (event.getSource() == hideCB)
29413244 {
29423245 copy.hide ^= true;
....@@ -2951,6 +3254,7 @@
29513254 if (event.getSource() == randomCB)
29523255 {
29533256 copy.random ^= true;
3257
+ objEditor.refreshContents();
29543258 return;
29553259 }
29563260 if (event.getSource() == speedupCB)
....@@ -2974,8 +3278,9 @@
29743278
29753279 public void actionPerformed(ActionEvent event)
29763280 {
3281
+ Object source = event.getSource();
29773282 // SCRIPT DIALOG
2978
- if (event.getSource() == okbutton)
3283
+ if (source == okbutton)
29793284 {
29803285 textpanel.setVisible(false);
29813286 textpanel.remove(textarea);
....@@ -2987,7 +3292,7 @@
29873292 textarea = null;
29883293 textpanel = null;
29893294 }
2990
- if (event.getSource() == cancelbutton)
3295
+ if (source == cancelbutton)
29913296 {
29923297 textpanel.setVisible(false);
29933298 textpanel.remove(textarea);
....@@ -2999,49 +3304,50 @@
29993304 //applySelf();
30003305 //client.refreshEditWindow();
30013306 //refreshContents();
3002
- if (event.getSource() == nameField)
3307
+ if (source == nameField)
30033308 {
30043309 //System.out.println("ObjEditor " + event);
30053310 applySelf0(true);
30063311 //parent.applySelf();
30073312 objEditor.refreshContents();
3008
- } else if (event.getSource() == resetButton)
3313
+ } else if (source == resetButton)
30093314 {
30103315 CameraPane.fullreset = true;
30113316 copy.Reset(); // ResetMeshes();
30123317 copy.Touch();
30133318 objEditor.refreshContents();
3014
- } else if (event.getSource() == stepItem)
3319
+ } else if (source == stepItem)
30153320 {
3016
- cameraView.ONESTEP = true;
3321
+ //cameraView.ONESTEP = true;
3322
+ Globals.ONESTEP = true;
30173323 cameraView.repaint();
30183324 return;
3019
- } else if (event.getSource() == stepButton)
3325
+ } else if (source == stepButton)
30203326 {
30213327 copy.Step();
30223328 copy.Touch();
30233329 objEditor.refreshContents();
3024
- } else if (event.getSource() == slowerButton)
3330
+ } else if (source == slowerButton)
30253331 {
30263332 copy.Slower();
30273333 copy.Touch();
30283334 objEditor.refreshContents();
3029
- } else if (event.getSource() == fasterButton)
3335
+ } else if (source == fasterButton)
30303336 {
30313337 copy.Faster();
30323338 copy.Touch();
30333339 objEditor.refreshContents();
3034
- } else if (event.getSource() == remarkButton)
3340
+ } else if (source == remarkButton)
30353341 {
30363342 copy.Remark();
30373343 copy.Touch();
30383344 objEditor.refreshContents();
3039
- } else if (event.getSource() == stepAllButton)
3345
+ } else if (source == stepAllButton)
30403346 {
30413347 copy.StepAll();
30423348 copy.Touch();
30433349 objEditor.refreshContents();
3044
- } else if (event.getSource() == resetAllButton)
3350
+ } else if (source == resetAllButton)
30453351 {
30463352 //CameraPane.fullreset = true;
30473353 copy.ResetAll(); // ResetMeshes();
....@@ -3074,53 +3380,79 @@
30743380 // Close();
30753381 // }
30763382 // else
3077
- if (event.getSource() == resetSlidersButton)
3383
+ if (source == resetSlidersButton)
30783384 {
30793385 ResetSliders();
3080
- } else if (event.getSource() == clearMaterialButton)
3386
+ } else if (source == clearMaterialButton)
30813387 {
30823388 ClearMaterial();
3083
- } else if (event.getSource() == createMaterialButton)
3389
+ } else if (source == createMaterialButton)
30843390 {
30853391 CreateMaterial();
3086
- } else if (event.getSource() == clearPanelButton)
3392
+ } else if (source == clearPanelButton)
30873393 {
30883394 copy.ClearUI();
30893395 refreshContents(true);
3090
- } /*
3091
- }
3092
-
3093
- public boolean action(Event event, Object arg)
3094
- {
3095
- */ else if (event.getSource() == closeItem)
3396
+ } else if (source == importGFDItem)
3397
+ {
3398
+ ImportGFD();
3399
+ } else
3400
+ if (source == importVRMLX3DItem)
3401
+ {
3402
+ ImportVRMLX3D();
3403
+ } else
3404
+ if (source == import3DSItem)
3405
+ {
3406
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3407
+ } else
3408
+ if (source == importOBJItem)
3409
+ {
3410
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3411
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3412
+ browser.setVisible(true);
3413
+ String filename = browser.getFile();
3414
+ if (filename != null && filename.length() > 0)
3415
+ {
3416
+ String fullname = browser.getDirectory() + filename;
3417
+ makeSomething(ReadOBJ(fullname), true);
3418
+ }
3419
+ } else
3420
+ if (source == closeItem)
30963421 {
30973422 Close();
30983423 //return true;
3099
- } else if (event.getSource() == loadItem)
3424
+ } else if (source == openItem)
31003425 {
3101
- load();
3426
+ Open();
31023427 //return true;
3103
- } else if (event.getSource() == saveItem)
3428
+ } else if (source == newItem)
3429
+ {
3430
+ New();
3431
+ } else if (source == saveItem)
31043432 {
31053433 save();
31063434 //return true;
3107
- } else if (event.getSource() == saveAsItem)
3435
+ } else if (source == saveAsItem)
31083436 {
31093437 saveAs();
31103438 //return true;
3111
- } else if (event.getSource() == reexportItem)
3439
+ } else if (source == reexportItem)
31123440 {
31133441 reexport();
31143442 //return true;
3115
- } else if (event.getSource() == exportAsItem)
3443
+ } else if (source == exportAsItem)
31163444 {
31173445 export();
31183446 //return true;
3119
- } else if (event.getSource() == povItem)
3447
+ } else if (source == povItem)
31203448 {
31213449 generatePOV();
31223450 //return true;
3123
- } else if (event.getSource() == zBufferItem)
3451
+ } else if (event.getSource() == archiveItem)
3452
+ {
3453
+ cTools.Archive(frame);
3454
+ return;
3455
+ } else if (source == zBufferItem)
31243456 {
31253457 try
31263458 {
....@@ -3142,21 +3474,8 @@
31423474 cameraView.repaint();
31433475 //return true;
31443476 }
3145
- */ else if (event.getSource() == editCameraItem)
3146
- {
3147
- cameraView.ProtectCamera();
3148
- cameraView.repaint();
3149
- return;
3150
- } else if (event.getSource() == revertCameraItem)
3151
- {
3152
- cameraView.RevertCamera();
3153
- cameraView.repaint();
3154
- return;
3155
- } else if (event.getSource() == textureButton)
3156
- {
3157
- return; // true;
3158
- } else // combos...
3159
- if (event.getSource() == texresMenu)
3477
+ */ else // combos...
3478
+ if (source == texresMenu)
31603479 {
31613480 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
31623481 copy.texres = texresMenu.getSelectedIndex();
....@@ -3168,27 +3487,397 @@
31683487 }
31693488 }
31703489
3171
- void ToggleAnimation()
3490
+ void New()
31723491 {
3173
- if (!CameraPane.ANIMATION)
3492
+ while (copy.Size() > 1)
31743493 {
3175
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3494
+ copy.remove(1);
3495
+ }
3496
+
3497
+ ResetModel();
3498
+ objEditor.refreshContents();
3499
+ }
3500
+
3501
+ static public byte[] Compress(Object3D o)
3502
+ {
3503
+ try
3504
+ {
3505
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3506
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3507
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
3508
+
3509
+ Object3D parent = o.parent;
3510
+ o.parent = null;
3511
+
3512
+ out.writeObject(o);
3513
+
3514
+ o.parent = parent;
3515
+
3516
+ out.flush();
3517
+
3518
+ baos //zstream
3519
+ .close();
3520
+ out.close();
3521
+
3522
+ byte[] bytes = baos.toByteArray();
3523
+
3524
+ System.out.println("save #bytes = " + bytes.length);
3525
+ return bytes;
3526
+ } catch (Exception e)
3527
+ {
3528
+ System.err.println(e);
3529
+ return null;
3530
+ }
3531
+ }
3532
+
3533
+ static public Object Uncompress(byte[] bytes)
3534
+ {
3535
+ System.out.println("restore #bytes = " + bytes.length);
3536
+ try
3537
+ {
3538
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3539
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3540
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
3541
+ Object obj = in.readObject();
3542
+
3543
+ bais //istream
3544
+ .close();
3545
+ in.close();
3546
+
3547
+ return obj;
3548
+ } catch (Exception e)
3549
+ {
3550
+ System.err.println(e);
3551
+ return null;
3552
+ }
3553
+ }
3554
+
3555
+ static public Object clone(Object o)
3556
+ {
3557
+ try
3558
+ {
3559
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3560
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3561
+
3562
+ out.writeObject(o);
3563
+
3564
+ out.flush();
3565
+ out.close();
3566
+
3567
+ byte[] bytes = baos.toByteArray();
3568
+
3569
+ System.out.println("clone = " + bytes.length);
3570
+
3571
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3572
+ ObjectInputStream in = new ObjectInputStream(bais);
3573
+ Object obj = in.readObject();
3574
+ in.close();
3575
+
3576
+ return obj;
3577
+ } catch (Exception e)
3578
+ {
3579
+ System.err.println(e);
3580
+ return null;
3581
+ }
3582
+ }
3583
+
3584
+ cRadio GetCurrentTab()
3585
+ {
3586
+ cRadio ab;
3587
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3588
+ {
3589
+ ab = (cRadio)e.nextElement();
3590
+ if(ab.GetObject() == copy)
3591
+ {
3592
+ return ab;
3593
+ }
3594
+ }
3595
+
3596
+ return null;
3597
+ }
3598
+
3599
+
3600
+ public void Save()
3601
+ {
3602
+ //Save(true);
3603
+ Replace();
3604
+ }
3605
+
3606
+ private boolean Equal(byte[] compress, byte[] name)
3607
+ {
3608
+ if (compress.length != name.length)
3609
+ {
3610
+ return false;
3611
+ }
3612
+
3613
+ for (int i=compress.length; --i>=0;)
3614
+ {
3615
+ if (compress[i] != name[i])
3616
+ return false;
3617
+ }
3618
+
3619
+ return true;
3620
+ }
3621
+
3622
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
3623
+
3624
+ public boolean Save(boolean user)
3625
+ {
3626
+ System.err.println("Save");
3627
+
3628
+ cRadio tab = GetCurrentTab();
3629
+
3630
+ byte[] compress = CompressCopy();
3631
+
3632
+ boolean thesame = false;
3633
+
3634
+ // Quick heuristic using length. Works only when stream is compressed.
3635
+ if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3636
+ {
3637
+ thesame = true;
3638
+ }
3639
+
3640
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3641
+ if (!thesame)
3642
+ {
3643
+ //tab.user[tab.versionindex] = user;
3644
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
3645
+
3646
+ copy.versions[++copy.versionindex] = compress;
3647
+
3648
+ // if (increment)
3649
+ // tab.versionindex++;
3650
+ }
3651
+
3652
+ //copy.RestoreBigData(versiontable);
3653
+
3654
+ //assert(hashtable.isEmpty());
3655
+
3656
+ for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3657
+ {
3658
+ //tab.user[i] = false;
3659
+ copy.versions[i] = null;
3660
+ }
3661
+
3662
+ SetUndoStates();
3663
+
3664
+ // test save
3665
+ if (false)
3666
+ {
3667
+ try
3668
+ {
3669
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
3670
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3671
+
3672
+ p.writeObject(copy);
3673
+
3674
+ p.flush();
3675
+
3676
+ ostream.close();
3677
+ } catch (Exception e)
3678
+ {
3679
+ e.printStackTrace();
3680
+ }
3681
+ }
3682
+
3683
+ return !thesame;
3684
+ }
3685
+
3686
+ void CopyChanged(Object3D obj)
3687
+ {
3688
+ SetUndoStates();
3689
+
3690
+ boolean temp = CameraPane.SWITCH;
3691
+ CameraPane.SWITCH = false;
3692
+
3693
+ copy.ExtractBigData(versiontable);
3694
+
3695
+ copy.clear();
3696
+
3697
+ for (int i=0; i<obj.Size(); i++)
3698
+ {
3699
+ copy.add(obj.get(i));
3700
+ }
3701
+
3702
+ copy.RestoreBigData(versiontable);
3703
+
3704
+ CameraPane.SWITCH = temp;
3705
+
3706
+ //assert(hashtable.isEmpty());
3707
+
3708
+ copy.Touch();
3709
+
3710
+ ResetModel();
3711
+ copy.HardTouch(); // recompile?
3712
+
3713
+ cRadio ab;
3714
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3715
+ {
3716
+ ab = (cRadio)e.nextElement();
3717
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3718
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3719
+ if (test != null)
3720
+ {
3721
+ test.editWindow = ab.object.editWindow;
3722
+ ab.object = test;
3723
+ }
3724
+ }
3725
+
3726
+ refreshContents();
3727
+ }
3728
+
3729
+ cButton undoButton;
3730
+ cButton restoreButton;
3731
+ cButton replaceButton;
3732
+ cButton redoButton;
3733
+
3734
+ void SetUndoStates()
3735
+ {
3736
+ cRadio tab = GetCurrentTab();
3737
+
3738
+ restoreButton.setEnabled(copy.versionindex != -1);
3739
+ replaceButton.setEnabled(copy.versionindex != -1);
3740
+ undoButton.setEnabled(copy.versionindex > 0);
3741
+ redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
3742
+ }
3743
+
3744
+ public boolean Undo()
3745
+ {
3746
+ System.err.println("Undo");
3747
+
3748
+ cRadio tab = GetCurrentTab();
3749
+
3750
+ if (copy.versionindex == 0)
3751
+ {
3752
+ java.awt.Toolkit.getDefaultToolkit().beep();
3753
+ return false;
3754
+ }
3755
+
3756
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
3757
+// {
3758
+// if (Save(false))
3759
+// tab.versionindex -= 1;
3760
+// else
3761
+// {
3762
+// if (tab.versionindex <= 0)
3763
+// return false;
3764
+// else
3765
+// tab.versionindex -= 1;
3766
+// }
3767
+// }
3768
+
3769
+ copy.versionindex -= 1;
3770
+
3771
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3772
+
3773
+ return true;
3774
+ }
3775
+
3776
+ public boolean Restore()
3777
+ {
3778
+ System.err.println("Restore");
3779
+
3780
+ cRadio tab = GetCurrentTab();
3781
+
3782
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3783
+ {
3784
+ java.awt.Toolkit.getDefaultToolkit().beep();
3785
+ return false;
3786
+ }
3787
+
3788
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3789
+
3790
+ return true;
3791
+ }
3792
+
3793
+ public boolean Replace()
3794
+ {
3795
+ System.err.println("Replace");
3796
+
3797
+ cRadio tab = GetCurrentTab();
3798
+
3799
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3800
+ {
3801
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
3802
+ return false;
3803
+ }
3804
+
3805
+ copy.versions[copy.versionindex] = CompressCopy();
3806
+
3807
+ return true;
3808
+ }
3809
+
3810
+ public void Redo()
3811
+ {
3812
+ cRadio tab = GetCurrentTab();
3813
+
3814
+ if (copy.versions[copy.versionindex + 1] == null)
3815
+ {
3816
+ java.awt.Toolkit.getDefaultToolkit().beep();
3817
+ return;
3818
+ }
3819
+
3820
+ copy.versionindex += 1;
3821
+
3822
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3823
+
3824
+ //if (!tab.user[tab.versionindex])
3825
+ // tab.graphs[tab.versionindex] = null;
3826
+ }
3827
+
3828
+ void ImportGFD()
3829
+ {
3830
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
31763831 browser.show();
31773832 String filename = browser.getFile();
31783833 if (filename != null && filename.length() > 0)
31793834 {
3180
- CameraPane.filename = browser.getDirectory() + filename;
3835
+ String fullname = browser.getDirectory() + filename;
3836
+
3837
+ //Object3D readobj =
3838
+ objEditor.ReadGFD(fullname, objEditor);
3839
+ //makeSomething(readobj);
3840
+ }
3841
+ }
3842
+
3843
+ void ImportVRMLX3D()
3844
+ {
3845
+ if (Grafreed.standAlone)
3846
+ {
3847
+ /**/
3848
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3849
+ browser.show();
3850
+ String filename = browser.getFile();
3851
+ if (filename != null && filename.length() > 0)
3852
+ {
3853
+ String fullname = browser.getDirectory() + filename;
3854
+ LoadVRMLX3D(fullname);
3855
+ }
3856
+ /**/
3857
+ }
3858
+ }
3859
+
3860
+ void ToggleAnimation()
3861
+ {
3862
+ if (!Globals.ANIMATION)
3863
+ {
3864
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3865
+ browser.setVisible(true);
3866
+ String filename = browser.getFile();
3867
+ if (filename != null && filename.length() > 0)
3868
+ {
3869
+ Globals.filename = browser.getDirectory() + filename;
31813870 //CameraPane.framecount = 0;
3182
- CameraPane.imagecount = 0;
3871
+ Globals.imagecount = 0;
31833872
3184
- CameraPane.ANIMATION ^= true;
3873
+ Globals.ANIMATION ^= true;
31853874
3186
- GrafreeD.wav.cursor = 0;
3187
- GrafreeD.wav.loop = 0;
3875
+ Grafreed.wav.cursor = 0;
3876
+ Grafreed.wav.loop = 0;
31883877 }
31893878 } else
31903879 {
3191
- CameraPane.ANIMATION ^= true;
3880
+ Globals.ANIMATION ^= true;
31923881 }
31933882 }
31943883
....@@ -3234,7 +3923,7 @@
32343923 void CreateMaterial()
32353924 {
32363925 //copy.ClearMaterial(); // PATCH
3237
- copy.CreateMaterialS(multiplyToggle.isSelected());
3926
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32383927 if (copy.selection.size() > 0)
32393928 //SetMaterial(copy);
32403929 {
....@@ -3285,7 +3974,7 @@
32853974 assert false;
32863975 }
32873976
3288
- void EditSelection()
3977
+ void EditSelection(boolean newWindow)
32893978 {
32903979 }
32913980
....@@ -3293,11 +3982,11 @@
32933982 {
32943983 copy.ResetBlockLoop(); // temporary problem
32953984
3296
- boolean random = CameraPane.RANDOM;
3297
- CameraPane.RANDOM = false; // parse everything
3985
+ boolean random = CameraPane.SWITCH;
3986
+ CameraPane.SWITCH = false; // parse everything
32983987 copy.ResetDisplayList();
32993988 copy.HardTouch();
3300
- CameraPane.RANDOM = random;
3989
+ CameraPane.SWITCH = random;
33013990 }
33023991
33033992 // public void applySelf()
....@@ -3367,10 +4056,40 @@
33674056 current.fakedepth = (float) fakedepthField.getFloat();
33684057 current.shadowbias = (float) shadowbiasField.getFloat();
33694058
3370
- if (!NumberSlider.frozen)
4059
+ if (!cNumberSlider.frozen)
33714060 {
33724061 //System.out.println("Propagate = " + propagate);
33734062 copy.UpdateMaterial(anchor, current, propagate);
4063
+
4064
+ if (copy.material != null)
4065
+ {
4066
+ cMaterial mat = copy.material;
4067
+
4068
+ colorField.SetToolTipValue((mat.color));
4069
+ modulationField.SetToolTipValue((mat.modulation));
4070
+ metalnessField.SetToolTipValue((mat.metalness));
4071
+ diffuseField.SetToolTipValue((mat.diffuse));
4072
+ specularField.SetToolTipValue((mat.specular));
4073
+ shininessField.SetToolTipValue((mat.shininess));
4074
+ shiftField.SetToolTipValue((mat.shift));
4075
+ ambientField.SetToolTipValue((mat.ambient));
4076
+ lightareaField.SetToolTipValue((mat.lightarea));
4077
+ diffusenessField.SetToolTipValue((mat.factor));
4078
+ velvetField.SetToolTipValue((mat.velvet));
4079
+ sheenField.SetToolTipValue((mat.sheen));
4080
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4081
+ backlitField.SetToolTipValue((mat.bump));
4082
+ anisoField.SetToolTipValue((mat.aniso));
4083
+ anisoVField.SetToolTipValue((mat.anisoV));
4084
+ cameraField.SetToolTipValue((mat.cameralight));
4085
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4086
+ shadowField.SetToolTipValue((mat.shadow));
4087
+ textureField.SetToolTipValue((mat.texture));
4088
+ opacityField.SetToolTipValue((mat.opacity));
4089
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4090
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
4091
+ }
4092
+
33744093 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
33754094 {
33764095 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3399,9 +4118,22 @@
33994118 //copy.Touch();
34004119 }
34014120
4121
+ cNumberSlider versionField;
4122
+
34024123 public void stateChanged(ChangeEvent e)
34034124 {
34044125 // assert(false);
4126
+ if (e.getSource() == versionField)
4127
+ {
4128
+ int version = versionField.getInteger();
4129
+
4130
+ if (copy.versions[version] != null)
4131
+ {
4132
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version]));
4133
+ }
4134
+
4135
+ return;
4136
+ }
34054137
34064138 if (freezematerial)
34074139 {
....@@ -3415,6 +4147,7 @@
34154147 || e.getSource() == apertureField
34164148 || e.getSource() == shadowblurField)
34174149 {
4150
+ new Exception().printStackTrace();
34184151 System.exit(0);
34194152 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34204153 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3441,7 +4174,13 @@
34414174 //System.out.println("PARENT = " + parent);
34424175 //if (parent != null)
34434176 // parent.applySelf();
3444
- refreshContents();
4177
+ if (e.getSource() == normalpushField)
4178
+ {
4179
+ objEditor.refreshContents();
4180
+ //Refresh();
4181
+ }
4182
+ else
4183
+ refreshContents();
34454184 // ??? client.refreshEditWindow();
34464185 }
34474186 //else
....@@ -3453,7 +4192,7 @@
34534192 //group.name = nameField.getText();
34544193 //objEditor.applySelf();
34554194
3456
- assert (objEditor == this);
4195
+ // OCT2018: assert (objEditor == this);
34574196 if (copy.selection == null || copy.selection.size() == 0)
34584197 //super.applySelf()
34594198 ; else
....@@ -3477,12 +4216,18 @@
34774216 objEditor.copy = keep;
34784217 }
34794218 }
4219
+
4220
+ if (normalpushField != null)
4221
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
34804222 }
34814223
34824224 void SnapObject()
34834225 {
3484
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3485
- SnapObject(obj);
4226
+ if (copy.selection.size() > 0)
4227
+ {
4228
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
4229
+ SnapObject(obj);
4230
+ }
34864231 }
34874232
34884233 void SnapObject(Object3D obj)
....@@ -3596,7 +4341,7 @@
35964341
35974342 if (obj.parent != null)
35984343 {
3599
- obj.parent.TransformToWorld(interest);
4344
+// obj.parent.TransformToWorld(interest);
36004345 }
36014346
36024347 if (!CameraPane.TRACK)
....@@ -3728,7 +4473,7 @@
37284473
37294474 radioPanel.revalidate();
37304475 radioPanel.repaint();
3731
- ctrlPanel.revalidate(); // ? new
4476
+ ctrlPanel.validate(); // ? new
37324477 ctrlPanel.repaint();
37334478 }
37344479 }
....@@ -3737,6 +4482,8 @@
37374482
37384483 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37394484 {
4485
+ if (Globals.REPLACEONMAKE) // && resetmodel)
4486
+ Save();
37404487 //Tween.set(thing, 0).target(1).start(tweenManager);
37414488 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37424489 // if (thing instanceof GenericJointDemo)
....@@ -3823,6 +4570,12 @@
38234570 {
38244571 ResetModel();
38254572 Select(thing.GetTreePath(), true, false); // unselect... false);
4573
+
4574
+ if (thing.Size() == 0)
4575
+ {
4576
+ //EditSelection(false);
4577
+ }
4578
+
38264579 refreshContents();
38274580 }
38284581
....@@ -3940,6 +4693,7 @@
39404693 }
39414694 }
39424695 }
4696
+
39434697 LoadGFDThread loadGFDThread;
39444698
39454699 void ReadGFD(String fullname, iCallBack cb)
....@@ -3959,8 +4713,10 @@
39594713
39604714 try
39614715 {
4716
+ // Try compressed version first.
39624717 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
3963
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4718
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4719
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
39644720
39654721 readobj = (Object3D) p.readObject();
39664722 istream.close();
....@@ -3968,7 +4724,20 @@
39684724 readobj.ResetDisplayList();
39694725 } catch (Exception e)
39704726 {
3971
- e.printStackTrace();
4727
+ //e.printStackTrace();
4728
+ try
4729
+ {
4730
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4731
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4732
+
4733
+ readobj = (Object3D) p.readObject();
4734
+ istream.close();
4735
+
4736
+ readobj.ResetDisplayList();
4737
+ } catch (Exception e2)
4738
+ {
4739
+ e2.printStackTrace();
4740
+ }
39724741 }
39734742 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
39744743 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4014,6 +4783,12 @@
40144783
40154784 void LoadIt(Object obj)
40164785 {
4786
+ if (obj == null)
4787
+ {
4788
+ // Invalid file
4789
+ return;
4790
+ }
4791
+
40174792 System.out.println("Loaded " + obj);
40184793 //new Exception().printStackTrace();
40194794 Object3D readobj = (Object3D) obj;
....@@ -4023,6 +4798,8 @@
40234798
40244799 if (readobj != null)
40254800 {
4801
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
4802
+ // Save();
40264803 try
40274804 {
40284805 //readobj.deepCopySelf(copy);
....@@ -4077,15 +4854,20 @@
40774854 c.addChild(csg);
40784855 }
40794856
4857
+ copy.versions = readobj.versions;
4858
+ copy.versionindex = readobj.versionindex;
4859
+
4860
+ SetUndoStates();
4861
+
40804862 ResetModel();
40814863 copy.HardTouch(); // recompile?
40824864 refreshContents();
40834865 }
40844866 }
40854867
4086
- void load() // throws ClassNotFoundException
4868
+ void Open() // throws ClassNotFoundException
40874869 {
4088
- if (GrafreeD.standAlone)
4870
+ if (Grafreed.standAlone)
40894871 {
40904872 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
40914873 browser.show();
....@@ -4172,11 +4954,13 @@
41724954 try
41734955 {
41744956 FileOutputStream ostream = new FileOutputStream(lastname);
4175
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4957
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4958
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
41764959
41774960 p.writeObject(copy);
41784961 p.flush();
41794962
4963
+ zstream.close();
41804964 ostream.close();
41814965
41824966 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4186,17 +4970,20 @@
41864970 {
41874971 }
41884972 }
4973
+
41894974 String lastname;
41904975
41914976 void saveAs()
41924977 {
4193
- if (GrafreeD.standAlone)
4978
+ if (Grafreed.standAlone)
41944979 {
41954980 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
41964981 browser.setVisible(true);
41974982 String filename = browser.getFile();
41984983 if (filename != null && filename.length() > 0)
41994984 {
4985
+ if (!filename.endsWith(".gfd"))
4986
+ filename += ".gfd";
42004987 lastname = browser.getDirectory() + filename;
42014988 save();
42024989 }
....@@ -4295,13 +5082,13 @@
42955082 try
42965083 {
42975084 FileOutputStream ostream = new FileOutputStream(filename);
4298
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4299
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
5085
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5086
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43005087
43015088 Object3D objectparent = obj.parent;
43025089 obj.parent = null;
43035090
4304
- Object3D object = (Object3D) GrafreeD.clone(obj);
5091
+ Object3D object = (Object3D) Grafreed.clone(obj);
43055092
43065093 obj.parent = objectparent;
43075094
....@@ -4313,8 +5100,8 @@
43135100 p.writeObject(object);
43145101 p.flush();
43155102
5103
+ zstream.close();
43165104 ostream.close();
4317
- // zstream.close();
43185105
43195106 // group.selection.get(0).parent = parent;
43205107 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4335,7 +5122,7 @@
43355122 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43365123 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43375124 copy.generatePOV(buffer);
4338
- if (GrafreeD.standAlone)
5125
+ if (Grafreed.standAlone)
43395126 {
43405127 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43415128 browser.show();
....@@ -4361,53 +5148,70 @@
43615148 Object3D client;
43625149 Object3D copy;
43635150 MenuBar menuBar;
4364
- Menu windowMenu;
4365
- MenuItem loadItem;
5151
+ Menu fileMenu;
5152
+ MenuItem newItem;
5153
+ MenuItem openItem;
43665154 MenuItem saveItem;
43675155 MenuItem saveAsItem;
43685156 MenuItem exportAsItem;
43695157 MenuItem reexportItem;
43705158 MenuItem povItem;
43715159 MenuItem closeItem;
4372
- Menu cameraMenu;
5160
+
43735161 CheckboxMenuItem zBufferItem;
43745162 //MenuItem normalLensItem;
4375
- MenuItem editCameraItem;
4376
- MenuItem revertCameraItem;
4377
- CheckboxMenuItem toggleLiveItem;
43785163 MenuItem stepItem;
4379
- CheckboxMenuItem toggleFullItem;
5164
+ CheckboxMenuItem toggleLiveItem;
5165
+ CheckboxMenuItem toggleFullScreenItem;
5166
+ CheckboxMenuItem toggleTimelineItem;
43805167 CheckboxMenuItem toggleRenderItem;
43815168 CheckboxMenuItem toggleDebugItem;
43825169 CheckboxMenuItem toggleFrustumItem;
43835170 CheckboxMenuItem toggleFootContactItem;
43845171 CheckboxMenuItem toggleDLItem;
43855172 CheckboxMenuItem toggleTextureItem;
4386
- CheckboxMenuItem toggleRandomItem;
5173
+ CheckboxMenuItem toggleSwitchItem;
43875174 CheckboxMenuItem toggleRootItem;
43885175 CheckboxMenuItem animationItem;
5176
+ MenuItem archiveItem;
43895177 CheckboxMenuItem toggleHandleItem;
43905178 CheckboxMenuItem togglePaintItem;
43915179 JSplitPane mainPanel;
43925180 JScrollPane scrollpane;
5181
+
43935182 JPanel toolbarPanel;
4394
- JPanel treePanel;
5183
+
5184
+ cGridBag treePanel;
5185
+
43955186 JPanel radioPanel;
43965187 ButtonGroup buttonGroup;
4397
- JPanel ctrlPanel;
4398
- JPanel materialPanel;
5188
+
5189
+ cGridBag toolboxPanel;
5190
+ cGridBag materialPanel;
5191
+ cGridBag ctrlPanel;
5192
+
43995193 JScrollPane infoPanel;
4400
- JPanel optionsPanel;
5194
+
5195
+ cGridBag optionsPanel;
5196
+
44015197 JTabbedPane objectPanel;
4402
- JPanel XYZPanel;
5198
+ boolean materialFlushed;
5199
+ Object3D latestObject;
5200
+
5201
+ cGridBag XYZPanel;
5202
+
44035203 JSplitPane gridPanel;
44045204 JSplitPane bigPanel;
4405
- JPanel bigThree;
4406
- JTabbedPane jtp;
4407
- JPanel cameraPanel;
5205
+
5206
+ cGridBag bigThree;
5207
+ cGridBag scenePanel;
5208
+ cGridBag centralPanel;
5209
+ JSplitPane cameraPanel;
5210
+ JPanel timelinePanel;
5211
+ JMenuBar timelineMenubar;
44085212 JSplitPane framePanel;
44095213 JTextArea/*Field*/ nameField;
4410
- cButton textureButton;
5214
+ //cButton textureButton;
44115215 cButton okButton;
44125216 cButton applyButton;
44135217 cButton cancelButton;
....@@ -4454,65 +5258,72 @@
44545258 // MATERIAL
44555259 JLabel materialLabel;
44565260 JLabel colorLabel;
4457
- NumberSlider colorField;
5261
+ cNumberSlider colorField;
44585262 JLabel modulationLabel;
4459
- NumberSlider modulationField;
5263
+ cNumberSlider modulationField;
44605264 JLabel metalnessLabel;
4461
- NumberSlider metalnessField;
5265
+ cNumberSlider metalnessField;
44625266 JLabel diffuseLabel;
4463
- NumberSlider diffuseField;
5267
+ cNumberSlider diffuseField;
44645268 JLabel specularLabel;
4465
- NumberSlider specularField;
5269
+ cNumberSlider specularField;
44665270 JLabel shininessLabel;
4467
- NumberSlider shininessField;
5271
+ cNumberSlider shininessField;
44685272 JLabel shiftLabel;
4469
- NumberSlider shiftField;
5273
+ cNumberSlider shiftField;
44705274 JLabel ambientLabel;
4471
- NumberSlider ambientField;
5275
+ cNumberSlider ambientField;
44725276 JLabel lightareaLabel;
4473
- NumberSlider lightareaField;
5277
+ cNumberSlider lightareaField;
44745278 JLabel diffusenessLabel;
4475
- NumberSlider diffusenessField;
5279
+ cNumberSlider diffusenessField;
44765280 JLabel velvetLabel;
4477
- NumberSlider velvetField;
5281
+ cNumberSlider velvetField;
44785282 JLabel sheenLabel;
4479
- NumberSlider sheenField;
5283
+ cNumberSlider sheenField;
44805284 JLabel subsurfaceLabel;
4481
- NumberSlider subsurfaceField;
5285
+ cNumberSlider subsurfaceField;
44825286 //JLabel bumpLabel;
44835287 //NumberSlider bumpField;
44845288 JLabel backlitLabel;
4485
- NumberSlider backlitField;
5289
+ cNumberSlider backlitField;
44865290 JLabel anisoLabel;
4487
- NumberSlider anisoField;
5291
+ cNumberSlider anisoField;
44885292 JLabel anisoVLabel;
4489
- NumberSlider anisoVField;
5293
+ cNumberSlider anisoVField;
44905294 JLabel cameraLabel;
4491
- NumberSlider cameraField;
5295
+ cNumberSlider cameraField;
44925296 JLabel selfshadowLabel;
4493
- NumberSlider selfshadowField;
5297
+ cNumberSlider selfshadowField;
44945298 JLabel shadowLabel;
4495
- NumberSlider shadowField;
5299
+ cNumberSlider shadowField;
44965300 JLabel textureLabel;
4497
- NumberSlider textureField;
5301
+ cNumberSlider textureField;
44985302 JLabel opacityLabel;
4499
- NumberSlider opacityField;
5303
+ cNumberSlider opacityField;
45005304 JLabel fakedepthLabel;
4501
- NumberSlider fakedepthField;
5305
+ cNumberSlider fakedepthField;
45025306 JLabel shadowbiasLabel;
4503
- NumberSlider shadowbiasField;
5307
+ cNumberSlider shadowbiasField;
45045308 JLabel bumpLabel;
4505
- NumberSlider bumpField;
5309
+ cNumberSlider bumpField;
45065310 JLabel noiseLabel;
4507
- NumberSlider noiseField;
5311
+ cNumberSlider noiseField;
45085312 JLabel powerLabel;
4509
- NumberSlider powerField;
5313
+ cNumberSlider powerField;
45105314 JLabel borderfadeLabel;
4511
- NumberSlider borderfadeField;
5315
+ cNumberSlider borderfadeField;
45125316 JLabel fogLabel;
4513
- NumberSlider fogField;
5317
+ cNumberSlider fogField;
45145318 JLabel opacityPowerLabel;
4515
- NumberSlider opacityPowerField;
4516
- JTree jTree;
5319
+ cNumberSlider opacityPowerField;
5320
+ cTree jTree;
45175321 //ObjectUI parent;
5322
+
5323
+ cNumberSlider normalpushField;
5324
+
5325
+ private MenuItem importGFDItem;
5326
+ private MenuItem importVRMLX3DItem;
5327
+ private MenuItem import3DSItem;
5328
+ private MenuItem importOBJItem;
45185329 }