Normand Briere
2019-08-18 480ad70047e54b2b92f974e6c2ac5a6c0bdc5a5c
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.*;
....@@ -13,6 +14,9 @@
1314 import javax.swing.plaf.metal.MetalLookAndFeel;
1415 //import javax.swing.plaf.ColorUIResource;
1516 //import javax.swing.plaf.metal.DefaultMetalTheme;
17
+
18
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
19
+import javax.swing.plaf.basic.BasicSplitPaneUI;
1620
1721 //import javax.media.opengl.GLCanvas;
1822
....@@ -30,11 +34,146 @@
3034 iSendInfo
3135 //KeyListener
3236 {
37
+ public cToggleButton pinButton;
3338 boolean timeline;
3439 boolean wasFullScreen;
3540
3641 GroupEditor callee;
3742 JFrame frame;
43
+
44
+ static ObjEditor theFrame;
45
+
46
+ public void AllocProjectedVertices(Object3D object)
47
+ {
48
+ assert (object.projectedVertices != null);
49
+
50
+ if (object.projectedVertices.length <= 2)
51
+ {
52
+ // Side effect...
53
+ Object3D.cVector2[] keep = object.projectedVertices;
54
+ object.projectedVertices = new Object3D.cVector2[3];
55
+ for (int i = 0; i < 3; i++)
56
+ {
57
+ if (i < keep.length)
58
+ {
59
+ object.projectedVertices[i] = keep[i];
60
+ } else
61
+ {
62
+ object.projectedVertices[i] = new Object3D.cVector2();
63
+ }
64
+ /*
65
+ if(keep.length == 0)
66
+ object.projectedVertices[0] = new Object3D.cVector2();
67
+ else
68
+ object.projectedVertices[0] = keep[0];
69
+ object.projectedVertices[1] = new Object3D.cVector2();
70
+ */
71
+ }
72
+ }
73
+ }
74
+
75
+ public Composite CreateCameras()
76
+ {
77
+ Composite cams = new cTemplate();
78
+ cams.name = "Cameras";
79
+ copy.insertElementAt(cams, 0);
80
+
81
+ cams.addChild(new Camera());
82
+ cams.addChild(new Camera(1));
83
+ cams.addChild(new Camera(2));
84
+ cams.addChild(new Camera(3));
85
+ cams.addChild(new Camera(4));
86
+
87
+ return cams;
88
+ }
89
+
90
+ public cGridBag GetSeparator()
91
+ {
92
+ cGridBag separator = new cGridBag();
93
+ separator.add(new JSeparator());
94
+ separator.preferredHeight = 5;
95
+ return separator;
96
+ }
97
+
98
+ cButton GetButton(String name, boolean border)
99
+ {
100
+ ImageIcon icon = GetIcon(name);
101
+ if (icon != null || name.contains("/"))
102
+ return new cButton(icon, border);
103
+ else
104
+ return new cButton(name, border);
105
+ }
106
+
107
+ cLabel GetLabel(String name, boolean border)
108
+ {
109
+ //ImageIcon icon = GetIcon(name);
110
+ return new cLabel(GetImage(name), border);
111
+ }
112
+
113
+ cToggleButton GetToggleButton(String name, boolean border)
114
+ {
115
+ ImageIcon icon = GetIcon(name);
116
+ return new cToggleButton(icon, border);
117
+ }
118
+
119
+ cCheckBox GetCheckBox(String name, boolean border)
120
+ {
121
+ ImageIcon icon = GetIcon(name);
122
+ return new cCheckBox(icon, border);
123
+ }
124
+
125
+ static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>();
126
+
127
+ static ImageIcon GetIcon(String name)
128
+ {
129
+ javax.swing.ImageIcon iconCache = icons.get(name);
130
+ if (iconCache != null)
131
+ {
132
+ return iconCache;
133
+ }
134
+
135
+ try
136
+ {
137
+ BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
138
+
139
+// if (image.getWidth() > 48 && image.getHeight() > 48)
140
+// {
141
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
142
+// Graphics2D g = resized.createGraphics();
143
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
144
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
145
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
146
+// g.dispose();
147
+//
148
+// image = resized;
149
+// }
150
+
151
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
152
+
153
+ icons.put(name, icon);
154
+
155
+ return icon;
156
+ }
157
+ catch (Exception e)
158
+ {
159
+ //icons.put(name, null);
160
+ return null;
161
+ }
162
+ }
163
+
164
+ BufferedImage GetImage(String name)
165
+ {
166
+ try
167
+ {
168
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
169
+
170
+ return image;
171
+ }
172
+ catch (Exception e)
173
+ {
174
+ return null;
175
+ }
176
+ }
38177
39178 // SCRIPT
40179
....@@ -138,34 +277,42 @@
138277 public void closeUI()
139278 {
140279 //new Exception().printStackTrace();
141
- System.out.println("this = " + this);
142
- System.out.println("objEditor = " + objEditor);
280
+// System.out.println("this = " + this);
281
+// System.out.println("objEditor = " + objEditor);
143282 //nameField.removeActionListener(this);
144
- objEditor.ctrlPanel.remove(nameField);
283
+// objEditor.ctrlPanel.remove(nameField);
145284
146
- if (!GroupEditor.allparams)
285
+ objEditor.ctrlPanel.remove(namePanel);
286
+
287
+ if (!allparams)
147288 return;
148289
149
- objEditor.ctrlPanel.remove(liveCB);
150
- objEditor.ctrlPanel.remove(hideCB);
151
- objEditor.ctrlPanel.remove(markCB);
152
-
153
- objEditor.ctrlPanel.remove(randomCB);
154
- objEditor.ctrlPanel.remove(speedupCB);
155
- objEditor.ctrlPanel.remove(rewindCB);
156
-
157
- objEditor.ctrlPanel.remove(resetButton);
158
- objEditor.ctrlPanel.remove(stepButton);
159
-// objEditor.ctrlPanel.remove(stepAllButton);
160
-// objEditor.ctrlPanel.remove(resetAllButton);
161
- objEditor.ctrlPanel.remove(link2masterCB);
162
- //objEditor.ctrlPanel.remove(flipVCB);
163
- //objEditor.ctrlPanel.remove(texresMenu);
164
- objEditor.ctrlPanel.remove(slowerButton);
165
- objEditor.ctrlPanel.remove(fasterButton);
166
- objEditor.ctrlPanel.remove(remarkButton);
290
+// objEditor.ctrlPanel.remove(liveCB);
291
+// objEditor.ctrlPanel.remove(hideCB);
292
+// objEditor.ctrlPanel.remove(markCB);
293
+//
294
+// objEditor.ctrlPanel.remove(randomCB);
295
+// objEditor.ctrlPanel.remove(speedupCB);
296
+// objEditor.ctrlPanel.remove(rewindCB);
297
+//
298
+// objEditor.ctrlPanel.remove(resetButton);
299
+// objEditor.ctrlPanel.remove(stepButton);
300
+//// objEditor.ctrlPanel.remove(stepAllButton);
301
+//// objEditor.ctrlPanel.remove(resetAllButton);
302
+// objEditor.ctrlPanel.remove(link2masterCB);
303
+// //objEditor.ctrlPanel.remove(flipVCB);
304
+// //objEditor.ctrlPanel.remove(texresMenu);
305
+// objEditor.ctrlPanel.remove(slowerButton);
306
+// objEditor.ctrlPanel.remove(fasterButton);
307
+// objEditor.ctrlPanel.remove(remarkButton);
167308
168
- Remove(normalpushField);
309
+ objEditor.ctrlPanel.remove(setupPanel);
310
+ objEditor.ctrlPanel.remove(setupPanel2);
311
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
312
+ objEditor.ctrlPanel.remove(pushPanel);
313
+ //objEditor.ctrlPanel.remove(fillPanel);
314
+
315
+ //Remove(normalpushField);
169316 }
170317
171318 public ObjEditor GetEditor()
....@@ -209,6 +356,14 @@
209356 client = inClient;
210357 copy = client;
211358
359
+// if (copy.versionlist == null)
360
+// {
361
+// copy.versionlist = new Object3D[100];
362
+// copy.versionindex = -1;
363
+//
364
+// callee.Save(true);
365
+// }
366
+
212367 // "this" is not called: SetupUI2(objEditor);
213368 }
214369
....@@ -222,6 +377,14 @@
222377 client = inClient;
223378 copy = client;
224379
380
+ if (copy.versionlist == null)
381
+ {
382
+ copy.versionlist = new Object3D[100];
383
+ copy.versionindex = -1;
384
+
385
+// Save(true);
386
+ }
387
+
225388 SetupUI2(callee.GetEditor());
226389 }
227390
....@@ -236,13 +399,15 @@
236399 //localCopy.parent = null;
237400
238401 frame = new JFrame();
402
+ frame.setUndecorated(false);
239403 objEditor = this;
240404 this.callee = callee;
241405
242406 //parent = p;
243407
244408 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
245
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
409
+ if (Globals.DEBUG)
410
+ System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
246411 //gd.setFullScreenWindow(this);
247412 //setResizable(false);
248413 //if (!isDisplayable())
....@@ -253,6 +418,14 @@
253418 copy = localCopy;
254419 copy.editWindow = this;
255420
421
+// if (copy.versionlist == null)
422
+// {
423
+// copy.versionlist = new Object3D[100];
424
+// copy.versionindex = -1;
425
+//
426
+// Save(true);
427
+// }
428
+
256429 SetupMenu();
257430
258431 //SetupName(objEditor); // new
....@@ -266,28 +439,52 @@
266439 return frame.action(event, obj);
267440 }
268441
442
+ // Cannot work without static
443
+ static boolean allparams = true;
444
+
445
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
446
+
447
+ // This is to refresh the UI of the material panel.
448
+ boolean patchMaterial;
449
+
269450 void SetupMenu()
270451 {
271452 frame.setMenuBar(menuBar = new MenuBar());
272
- menuBar.add(windowMenu = new Menu("File"));
273
- windowMenu.add(loadItem = new MenuItem("Load..."));
274
- windowMenu.add("-");
275
- windowMenu.add(saveItem = new MenuItem("Save"));
276
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
453
+ menuBar.add(fileMenu = new Menu("File"));
454
+ fileMenu.add(newItem = new MenuItem("New"));
455
+ fileMenu.add(openItem = new MenuItem("Open..."));
456
+
457
+ //oe.menuBar.add(menu = new Menu("Include"));
458
+ Menu menu = new Menu("Import");
459
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
460
+ importOBJItem.addActionListener(this);
461
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
462
+ import3DSItem.addActionListener(this);
463
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
464
+ importVRMLX3DItem.addActionListener(this);
465
+ menu.add("-");
466
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
467
+ importGFDItem.addActionListener(this);
468
+ fileMenu.add(menu);
469
+ fileMenu.add("-");
470
+
471
+ fileMenu.add(saveItem = new MenuItem("Save"));
472
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
277473 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
278
- windowMenu.add("-");
279
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
280
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
281
- windowMenu.add("-");
474
+ fileMenu.add("-");
475
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
476
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
477
+ fileMenu.add("-");
282478 if (client.parent != null)
283479 {
284
- windowMenu.add(closeItem = new MenuItem("Close"));
480
+ fileMenu.add(closeItem = new MenuItem("Close"));
285481 } else
286482 {
287
- windowMenu.add(closeItem = new MenuItem("Exit"));
483
+ fileMenu.add(closeItem = new MenuItem("Exit"));
288484 }
289485
290
- loadItem.addActionListener(this);
486
+ newItem.addActionListener(this);
487
+ openItem.addActionListener(this);
291488 saveItem.addActionListener(this);
292489 saveAsItem.addActionListener(this);
293490 exportAsItem.addActionListener(this);
....@@ -295,82 +492,103 @@
295492 //povItem.addActionListener(this);
296493 closeItem.addActionListener(this);
297494
298
- menuBar.add(cameraMenu = new Menu("View"));
299
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
300
- //zBufferItem.addActionListener(this);
301
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
302
- //normalLensItem.addActionListener(this);
303
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
304
- revertCameraItem.addActionListener(this);
305
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
306
- toggleTimelineItem.addItemListener(this);
307
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
308
- toggleFullScreenItem.addItemListener(this);
309
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
310
- cameraMenu.add("-");
311
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
312
- toggleTextureItem.addItemListener(this);
313
- toggleTextureItem.setState(CameraPane.textureon);
314
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
315
- toggleLiveItem.addItemListener(this);
316
- toggleLiveItem.setState(Globals.isLIVE());
317
- cameraMenu.add(stepItem = new MenuItem("Step"));
318
- stepItem.addActionListener(this);
319
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
320
-// toggleDLItem.addItemListener(this);
321
-// toggleDLItem.setState(false);
322
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
323
- toggleRenderItem.addItemListener(this);
324
- toggleRenderItem.setState(!CameraPane.frozen);
325
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
326
- toggleDebugItem.addItemListener(this);
327
- toggleDebugItem.setState(CameraPane.DEBUG);
328
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
329
- toggleFrustumItem.addItemListener(this);
330
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
331
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
332
- toggleFootContactItem.addItemListener(this);
333
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
334
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
335
- toggleRandomItem.addItemListener(this);
336
- toggleRandomItem.setState(CameraPane.RANDOM);
337
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
338
- toggleHandleItem.addItemListener(this);
339
- toggleHandleItem.setState(CameraPane.HANDLES);
340
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
341
- togglePaintItem.addItemListener(this);
342
- togglePaintItem.setState(CameraPane.PAINTMODE);
343
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
344
-// toggleRootItem.addItemListener(this);
345
-// toggleRootItem.setState(false);
346
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
347
-// animationItem.addItemListener(this);
348
-// animationItem.setState(CameraPane.ANIMATION);
349
- cameraMenu.add("-");
350
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
351
- editCameraItem.addActionListener(this);
352
-
353495 objectPanel = new JTabbedPane();
496
+
497
+ ChangeListener changeListener = new ChangeListener()
498
+ {
499
+ //String name;
500
+
501
+ public void stateChanged(ChangeEvent changeEvent)
502
+ {
503
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
504
+// {
505
+// if (latestObject != null)
506
+// {
507
+// refreshContents(true);
508
+// SetMaterial(latestObject);
509
+// }
510
+//
511
+// materialFlushed = true;
512
+// }
513
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
514
+// {
515
+// if (listUI.size() == 0)
516
+// EditSelection(false);
517
+// }
518
+
519
+// if (objectPanel.getSelectedIndex() == 4)
520
+// {
521
+// name = copy.skyboxname;
522
+//
523
+// if (name == null)
524
+// {
525
+// name = "";
526
+// }
527
+//
528
+// copy.skyboxname = "cubemaps/default-skyboxes/rgb";
529
+// copy.skyboxext = "jpg";
530
+// }
531
+// else
532
+// {
533
+// if (name != null)
534
+// {
535
+// if (name.equals(""))
536
+// {
537
+// copy.skyboxname = null;
538
+// copy.skyboxext = null;
539
+// }
540
+// else
541
+// {
542
+// copy.skyboxname = name;
543
+// }
544
+// }
545
+// }
546
+ cameraView.transformMode = objectPanel.getSelectedIndex() == 4;
547
+
548
+// refreshContents(false); // To refresh Info tab
549
+ cameraView.repaint();
550
+ }
551
+ };
552
+ objectPanel.addChangeListener(changeListener);
553
+
354554 toolbarPanel = new JPanel();
355555 toolbarPanel.setName("Toolbar");
356
- treePanel = new JPanel();
556
+
557
+ treePanel = new cGridBag();
357558 treePanel.setName("Tree");
358
- ctrlPanel = new cGridBag(); // new GridBagLayout());
359
- ctrlPanel.setName("Edit");
360
- materialPanel = new cGridBag().setVertical(true);
361
- materialPanel.setName("Material");
559
+
560
+ editPanel = new cGridBag().setVertical(true);
561
+ //editPanel.setName("Edit");
562
+
563
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
564
+
565
+ editCommandsPanel = new cGridBag();
566
+ editPanel.add(editCommandsPanel);
567
+ editPanel.add(ctrlPanel);
568
+
569
+ toolboxPanel = new cGridBag().setVertical(true);
570
+ //toolboxPanel.setName("Toolbox");
571
+
572
+ skyboxPanel = new cGridBag().setVertical(true);
573
+
574
+ materialPanel = new cGridBag().setVertical(false);
575
+ //materialPanel.setName("Material");
576
+
362577 /*JTextPane*/
363578 infoarea = createTextPane();
579
+ doc = infoarea.getStyledDocument();
580
+
364581 infoarea.setEditable(true);
365582 SetText();
583
+
366584 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
367585 // infoarea.setOpaque(false);
368586 // //infoarea.setForeground(textcolor);
369
- infoarea.setLineWrap(true);
370
- infoarea.setWrapStyleWord(true);
587
+// TEXTAREA infoarea.setLineWrap(true);
588
+// TEXTAREA infoarea.setWrapStyleWord(true);
371589 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
372
- infoPanel.setPreferredSize(new Dimension(50, 200));
373
- infoPanel.setName("Info");
590
+ infoPanel.setPreferredSize(new Dimension(1, 1));
591
+ //infoPanel.setName("Info");
374592 //infoPanel.setLayout(new BorderLayout());
375593 //infoPanel.add(createTextPane());
376594
....@@ -378,15 +596,22 @@
378596 mainPanel.setName("Main");
379597 mainPanel.setContinuousLayout(true);
380598 mainPanel.setOneTouchExpandable(true);
381
- mainPanel.setDividerLocation(1.0);
382599 mainPanel.setDividerSize(9);
383
- mainPanel.setResizeWeight(0);
384
-
600
+ mainPanel.setDividerLocation(0.5); //1.0);
601
+ mainPanel.setResizeWeight(0.5);
602
+
603
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
604
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
605
+ divider.setDividerSize(15);
606
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
607
+
608
+ mainPanel.setUI(new BasicSplitPaneUI());
609
+
385610 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
386611 //mainPanel.setLayout(new GridBagLayout());
387612 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388
- treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
613
+// treePanel.setLayout(new GridBagLayout());
614
+ //ctrlPanel.setLayout(new GridBagLayout());
390615 //materialPanel.setLayout(new GridBagLayout());
391616
392617 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
....@@ -426,7 +651,7 @@
426651 static String newline = "\n";
427652 protected static final String buttonString = "JButton";
428653 StyledDocument doc;
429
- JTextArea infoarea;
654
+ JTextPane infoarea;
430655
431656 void ClearInfo()
432657 {
....@@ -449,10 +674,10 @@
449674 e.printStackTrace();
450675 }
451676
452
- String selection = infoarea.getText();
453
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
454
- java.awt.datatransfer.Clipboard clipboard =
455
- Toolkit.getDefaultToolkit().getSystemClipboard();
677
+// String selection = infoarea.getText();
678
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
679
+// java.awt.datatransfer.Clipboard clipboard =
680
+// Toolkit.getDefaultToolkit().getSystemClipboard();
456681 //clipboard.setContents(data, data);
457682 }
458683
....@@ -475,13 +700,13 @@
475700 //SendInfo("Name:", "bold");
476701 if (sel.GetTextures() != null || debug)
477702 {
478
- si.SendInfo(sel.toString(), "bold");
703
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
479704 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
480705 if (sel.Size() > 0)
481706 {
482707 si.SendInfo("#children = " + sel.Size(), "regular");
483708 }
484
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
709
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
485710 if (debug)
486711 {
487712 try
....@@ -493,7 +718,10 @@
493718 }
494719
495720 if (full)
496
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
721
+ {
722
+ si.SendInfo(" BBox min: " + minima, "regular");
723
+ si.SendInfo(" BBox max: " + maxima, "regular");
724
+ }
497725
498726 if (sel.bRep != null)
499727 {
....@@ -520,7 +748,7 @@
520748 }
521749 if (sel.support != null)
522750 {
523
- si.SendInfo(" support: " + sel.support, "regular");
751
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
524752 }
525753 if (sel.scriptnode != null)
526754 {
....@@ -591,6 +819,9 @@
591819 {
592820 CameraPane.pointflow = (PointFlow) sel;
593821 }
822
+
823
+ si.SendInfo("_____________________", "regular");
824
+ si.SendInfo("", "regular");
594825 }
595826 }
596827
....@@ -606,68 +837,216 @@
606837 }
607838 }
608839
840
+//static GraphicsDevice device = GraphicsEnvironment
841
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
842
+
843
+ Rectangle keeprect;
844
+ cRadio radio;
845
+
846
+cButton keepButton;
847
+ cButton twoButton; // Full 3D
848
+ cButton sixButton;
849
+ cButton threeButton;
850
+ cButton sevenButton;
851
+ cButton fourButton; // full panel
852
+ cButton oneButton; // full XYZ
853
+ //cButton currentLayout;
854
+
855
+ boolean maximized;
856
+
857
+ cButton fullscreenLayout;
858
+ cButton expandedLayout;
859
+
860
+ void Minimize()
861
+ {
862
+ frame.setState(Frame.ICONIFIED);
863
+ frame.validate();
864
+ }
865
+
866
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
867
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
868
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
869
+ void Maximize()
870
+ {
871
+ if (CameraPane.FULLSCREEN)
872
+ {
873
+ ToggleFullScreen();
874
+ }
875
+
876
+ if (maximized)
877
+ {
878
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
879
+ }
880
+ else
881
+ {
882
+ keeprect = frame.getBounds();
883
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
884
+// Dimension rect2 = frame.getToolkit().getScreenSize();
885
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
886
+// frame.setState(Frame.MAXIMIZED_BOTH);
887
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
888
+ }
889
+
890
+ maximized ^= true;
891
+
892
+ frame.validate();
893
+ }
894
+
895
+ cButton minButton;
896
+ cButton maxButton;
897
+ cButton fullButton;
898
+ cButton collapseButton;
899
+ cButton maximize3DButton;
900
+
609901 void ToggleFullScreen()
610902 {
611
- if (CameraPane.FULLSCREEN)
903
+ GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
904
+
905
+ cameraView.ToggleFullScreen();
906
+
907
+ if (!CameraPane.FULLSCREEN)
612908 {
613
- frame.getContentPane().remove(/*"Center",*/bigThree);
614
- framePanel.add(bigThree);
615
- frame.getContentPane().add(/*"Center",*/framePanel);
909
+ device.setFullScreenWindow(null);
910
+ frame.dispose();
911
+ frame.setUndecorated(false);
912
+ frame.validate();
913
+ frame.setVisible(true);
914
+
915
+ //frame.setVisible(false);
916
+// frame.removeNotify();
917
+// frame.setUndecorated(false);
918
+// frame.addNotify();
919
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
920
+
921
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
922
+// X framePanel.add(bigThree);
923
+// X frame.getContentPane().add(/*"Center",*/framePanel);
924
+// framePanel.setDividerLocation(46); // icons are 24x24
925
+
926
+ //frame.setVisible(true);
927
+// radio.layout = keepButton;
928
+ //theFrame = null;
929
+ keepButton = null;
930
+// radio.layout.doClick();
931
+
616932 } else
617933 {
618
- frame.getContentPane().remove(/*"Center",*/framePanel);
619
- framePanel.remove(bigThree);
620
- frame.getContentPane().add(/*"Center",*/bigThree);
934
+ keepButton = radio.layout;
935
+ //keeprect = frame.getBounds();
936
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
937
+// frame.getToolkit().getScreenSize().height);
938
+ //frame.setVisible(false);
939
+
940
+ frame.dispose();
941
+ frame.setUndecorated(true);
942
+ device.setFullScreenWindow(frame);
943
+ frame.validate();
944
+ frame.setVisible(true);
945
+// frame.removeNotify();
946
+// frame.setUndecorated(true);
947
+// frame.addNotify();
948
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
949
+// X framePanel.remove(bigThree);
950
+// X frame.getContentPane().add(/*"Center",*/bigThree);
951
+// framePanel.setDividerLocation(0);
952
+
953
+// radio.layout = fullscreenLayout;
954
+// radio.layout.doClick();
955
+ //frame.setVisible(true);
621956 }
622
- cameraView.ToggleFullScreen();
957
+ frame.validate();
958
+
959
+ cameraView.requestFocusInWindow();
623960 }
624961
625
- private JTextArea createTextPane()
962
+ void CollapseToolbar()
963
+ {
964
+ framePanel.setDividerLocation(0);
965
+ //frame.validate();
966
+
967
+ cameraView.requestFocusInWindow();
968
+ }
969
+
970
+ private Object3D Duplicate(Object3D object)
626971 {
627
- String[] initString =
628
- {
629
- "This is an editable JTextPane, ", //regular
630
- "another ", //italic
631
- "styled ", //bold
632
- "text ", //small
633
- "component, ", //large
634
- "which supports embedded components..." + newline,//regular
635
- " " + newline, //button
636
- "...and embedded icons..." + newline, //regular
637
- " ", //icon
638
- newline + "JTextPane is a subclass of JEditorPane that "
639
- + "uses a StyledEditorKit and StyledDocument, and provides "
640
- + "cover methods for interacting with those objects."
641
- };
972
+ boolean temp = CameraPane.SWITCH;
973
+ CameraPane.SWITCH = false;
974
+
975
+ if (Grafreed.grafreed.universe.versiontable == null)
976
+ Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
977
+
978
+ object.ExtractBigData(Grafreed.grafreed.universe.versiontable);
979
+ // if (copy == client)
980
+
981
+ Object3D versions[] = object.versionlist;
982
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe
983
+ object.versionlist = null;
984
+ object.versiontable = null;
985
+
986
+ Object3D parent = object.parent;
987
+ object.parent = null;
988
+
989
+ //byte[] compress = Compress(copy);
990
+ Object3D compress = (Object3D)Grafreed.clone(object);
991
+
992
+ object.parent = parent;
993
+
994
+ object.versionlist = versions;
995
+ object.versiontable = versiontable; // if Grafreed.grafreed.universe
996
+
997
+ object.RestoreBigData(Grafreed.grafreed.universe.versiontable);
998
+
999
+ CameraPane.SWITCH = temp;
1000
+
1001
+ return compress;
1002
+ }
6421003
643
- String[] initStyles =
644
- {
645
- "regular", "italic", "bold", "small", "large",
646
- "regular", "button", "regular", "icon",
647
- "regular"
648
- };
1004
+ private JTextPane createTextPane()
1005
+ {
1006
+// TEXTAREA String[] initString =
1007
+// {
1008
+// "This is an editable JTextPane, ", //regular
1009
+// "another ", //italic
1010
+// "styled ", //bold
1011
+// "text ", //small
1012
+// "component, ", //large
1013
+// "which supports embedded components..." + newline,//regular
1014
+// " " + newline, //button
1015
+// "...and embedded icons..." + newline, //regular
1016
+// " ", //icon
1017
+// newline + "JTextPane is a subclass of JEditorPane that "
1018
+// + "uses a StyledEditorKit and StyledDocument, and provides "
1019
+// + "cover methods for interacting with those objects."
1020
+// };
1021
+//
1022
+// String[] initStyles =
1023
+// {
1024
+// "regular", "italic", "bold", "small", "large",
1025
+// "regular", "button", "regular", "icon",
1026
+// "regular"
1027
+// };
1028
+//
1029
+// JTextPane textPane = new JTextPane();
1030
+// textPane.setEditable(true);
1031
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
1032
+// addStylesToDocument(doc);
1033
+//
1034
+// try
1035
+// {
1036
+// for (int j = 0; j < 2; j++)
1037
+// {
1038
+// for (int i = 0; i < initString.length; i++)
1039
+// {
1040
+// doc.insertString(doc.getLength(), initString[i],
1041
+// doc.getStyle(initStyles[i]));
1042
+// }
1043
+// }
1044
+// } catch (BadLocationException ble)
1045
+// {
1046
+// System.err.println("Couldn't insert initial text into text pane.");
1047
+// }
6491048
650
- JTextPane textPane = new JTextPane();
651
- textPane.setEditable(true);
652
- /*StyledDocument*/ doc = textPane.getStyledDocument();
653
- addStylesToDocument(doc);
654
-
655
- try
656
- {
657
- for (int j = 0; j < 2; j++)
658
- {
659
- for (int i = 0; i < initString.length; i++)
660
- {
661
- doc.insertString(doc.getLength(), initString[i],
662
- doc.getStyle(initStyles[i]));
663
- }
664
- }
665
- } catch (BadLocationException ble)
666
- {
667
- System.err.println("Couldn't insert initial text into text pane.");
668
- }
669
-
670
- return new JTextArea(); // textPane;
1049
+ return new JTextPane(); // textPane;
6711050 }
6721051
6731052 protected void addStylesToDocument(StyledDocument doc)
....@@ -720,7 +1099,7 @@
7201099 protected static ImageIcon createImageIcon(String path,
7211100 String description)
7221101 {
723
- java.net.URL imgURL = GrafreeD.class.getResource(path);
1102
+ java.net.URL imgURL = Grafreed.class.getResource(path);
7241103 if (imgURL != null)
7251104 {
7261105 return new ImageIcon(imgURL, description);
....@@ -743,6 +1122,7 @@
7431122 {
7441123 SetupMaterial(materialPanel);
7451124 }
1125
+
7461126 //SetupName();
7471127 //SetupViews();
7481128 }
....@@ -752,6 +1132,7 @@
7521132 // NumberSlider vDivsField;
7531133 // JCheckBox endcaps;
7541134 JCheckBox liveCB;
1135
+ JCheckBox selectableCB;
7551136 JCheckBox hideCB;
7561137 JCheckBox link2masterCB;
7571138 JCheckBox markCB;
....@@ -759,7 +1140,12 @@
7591140 JCheckBox speedupCB;
7601141 JCheckBox rewindCB;
7611142 JCheckBox flipVCB;
1143
+
1144
+ cCheckBox toggleTextureCB;
1145
+ cCheckBox toggleSwitchCB;
1146
+
7621147 JComboBox texresMenu;
1148
+
7631149 JButton resetButton;
7641150 JButton stepButton;
7651151 JButton stepAllButton;
....@@ -767,54 +1153,48 @@
7671153 JButton slowerButton;
7681154 JButton fasterButton;
7691155 JButton remarkButton;
1156
+
1157
+ cGridBag editPanel;
1158
+ cGridBag editCommandsPanel;
1159
+
1160
+ cGridBag namePanel;
1161
+ cGridBag setupPanel;
1162
+ cGridBag setupPanel2;
1163
+ cGridBag objectCommandsPanel;
1164
+ cGridBag pushPanel;
1165
+ cGridBag fillPanel;
7701166
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
1167
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
7721168 {
7731169 JCheckBox cb;
7741170
775
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
776
- oe.aConstraints.gridwidth = 1; // 3;
777
-// oe.aConstraints.weightx = 1;
778
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
779
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1171
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7801172 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
7841173
7851174 return cb;
7861175 }
7871176
788
- cButton AddButton(ObjEditor oe, String label)
1177
+ cButton AddButton(cGridBag panel, String label)
7891178 {
7901179 cButton cb;
7911180
792
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
793
- oe.aConstraints.gridwidth = 1;
794
-// oe.aConstraints.weightx = 1;
795
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
796
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
1181
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
7971182 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
8011183
8021184 return cb;
8031185 }
8041186
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
1187
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
8061188 {
8071189 JComboBox combo;
8081190
809
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
810
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
811
- oe.aConstraints.gridx += 1;
1191
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8121192 combo.addActionListener(this);
8131193
8141194 return combo;
8151195 }
8161196
817
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, double min, double max, double current, double pow)
1197
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
8181198 {
8191199 cGridBag control = new cGridBag();
8201200
....@@ -826,12 +1206,12 @@
8261206 control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8271207 combo.setFloat(current);
8281208
829
- ctrlPanel.add(control);
1209
+ panel.add(control);
8301210
831
- return combo;
1211
+ return control;
8321212 }
8331213
834
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, int min, int max, int current)
1214
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
8351215 {
8361216 cGridBag control = new cGridBag();
8371217
....@@ -839,25 +1219,21 @@
8391219
8401220 JLabel jlabel = new JLabel(label);
8411221 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
842
- ctrlPanel.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
843
- ctrlPanel.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1222
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1223
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8441224 combo.setInteger(current);
8451225
846
- ctrlPanel.add(control);
1226
+ panel.add(control);
8471227
848
- return combo;
1228
+ return control;
8491229 }
8501230
8511231 JTextArea AddText(cGridBag ctrlPanel, String name)
8521232 {
8531233 JTextArea text;
8541234
855
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
856
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
8571235 ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8581236 text.addCaretListener(this);
859
- aConstraints.gridx += 1;
860
- aConstraints.gridwidth = 1;
8611237
8621238 return text;
8631239 }
....@@ -896,7 +1272,7 @@
8961272
8971273 /*
8981274 */
899
- void Return() // ObjEditor oe)
1275
+ void Return0() // ObjEditor oe)
9001276 {
9011277 aConstraints.gridy += 1;
9021278 aConstraints.gridx = 0;
....@@ -951,37 +1327,92 @@
9511327
9521328 void SetupUI2(ObjEditor oe)
9531329 {
954
-// oe.aConstraints.weightx = 0;
955
-// oe.aConstraints.weighty = 0;
956
-// oe.aConstraints.gridx = 0;
957
-// oe.aConstraints.gridy = 0;
958
- SetupName(oe);
1330
+ //SetupName(oe);
9591331
960
- if (!GroupEditor.allparams)
1332
+ namePanel = new cGridBag();
1333
+
1334
+ //if (copy.pinned)
1335
+ {
1336
+ pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF);
1337
+ pinButton.setSelected(copy.pinned);
1338
+ cGridBag t = new cGridBag();
1339
+ t.preferredWidth = 2;
1340
+ t.add(pinButton);
1341
+ namePanel.add(t);
1342
+
1343
+ pinButton.addItemListener(this);
1344
+ }
1345
+
1346
+ nameField = AddText(namePanel, copy.GetName());
1347
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
1348
+ oe.ctrlPanel.add(namePanel);
1349
+
1350
+ oe.ctrlPanel.Return();
1351
+
1352
+ if (!allparams)
9611353 return;
9621354
963
- liveCB = AddCheckBox(oe, "Live", copy.live);
964
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
965
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1355
+ setupPanel = new cGridBag().setVertical(false);
1356
+
1357
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1358
+ liveCB.setToolTipText("Animate object");
1359
+ markCB = AddCheckBox(setupPanel, "Anim", copy.marked);
1360
+ markCB.setToolTipText("Set target transform");
1361
+ selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1362
+ selectableCB.setToolTipText("Make object selectable");
9661363 // Return();
967
- markCB = AddCheckBox(oe, "Mark", copy.marked);
968
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
969
- randomCB = AddCheckBox(oe, "Rand", copy.random);
970
- Return();
971
- resetButton = AddButton(oe, "Reset");
972
- stepButton = AddButton(oe, "Step");
1364
+
1365
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1366
+ hideCB.setToolTipText("Hide object");
1367
+
1368
+ ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
1369
+
1370
+ setupPanel2 = new cGridBag().setVertical(false);
1371
+
1372
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1373
+ rewindCB.setToolTipText("Rewind animation");
1374
+
1375
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1376
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
1377
+
1378
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1379
+ link2masterCB.setToolTipText("Attach to support");
1380
+
1381
+ if (Globals.ADVANCED)
1382
+ {
1383
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1384
+ speedupCB.setToolTipText("Option motion capture");
1385
+ }
1386
+
1387
+ oe.ctrlPanel.add(setupPanel);
1388
+ oe.ctrlPanel.Return();
1389
+ oe.ctrlPanel.add(setupPanel2);
1390
+ oe.ctrlPanel.Return();
1391
+
1392
+ objectCommandsPanel = new cGridBag().setVertical(false);
1393
+
1394
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1395
+ resetButton.setToolTipText("Jump to frame zero");
1396
+ stepButton = AddButton(objectCommandsPanel, "Step");
1397
+ stepButton.setToolTipText("Step one frame");
9731398 // resetAllButton = AddButton(oe, "Reset All");
9741399 // stepAllButton = AddButton(oe, "Step All");
975
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9761400 // Return();
977
- slowerButton = AddButton(oe, "Slow");
978
- fasterButton = AddButton(oe, "Fast");
979
- remarkButton = AddButton(oe, "Rem");
1401
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1402
+ slowerButton.setToolTipText("Decrease animation speed");
1403
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1404
+ fasterButton.setToolTipText("Increase animation speed");
1405
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1406
+ remarkButton.setToolTipText("Set the current transform as the target");
9801407
981
- //Return();
1408
+ oe.ctrlPanel.add(objectCommandsPanel);
1409
+ oe.ctrlPanel.Return();
9821410
983
- //normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
1411
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1412
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
9841413 //Return();
1414
+
1415
+ oe.ctrlPanel.Return();
9851416
9861417 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871418 // ObjEditor.aConstraints.gridx += 1;
....@@ -1076,7 +1507,7 @@
10761507 oe.aConstraints.gridwidth = 1;
10771508 /**/
10781509 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1510
+ oe.ctrlPanel.Return();
10801511
10811512 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821513 //textureButton.setEnabled(false);
....@@ -1134,22 +1565,9 @@
11341565
11351566 if (cam == null || !(copy.get(0) instanceof cGroup))
11361567 {
1137
- System.out.println("CREATE CAMERAS");
1138
- cams = new cTemplate();
1139
- cams.name = "Cameras";
1140
- copy.insertElementAt(cams, 0);
1141
- //cams.parent = copy;
1142
-
1143
- cam = new Camera(); // LA.newVector(3, 2, 1));
1144
- cams.addChild(cam);
1145
- cam = new Camera(1);
1146
- cams.addChild(cam);
1147
- cam = new Camera(2);
1148
- cams.addChild(cam);
1149
- cam = new Camera(3);
1150
- cams.addChild(cam);
1151
- cam = new Camera(4); // Light
1152
- cams.addChild(cam);
1568
+ if (Globals.DEBUG)
1569
+ System.out.println("CREATE CAMERAS");
1570
+ cams = CreateCameras();
11531571 } else
11541572 {
11551573 cams = (cGroup) copy.get(0);
....@@ -1180,8 +1598,11 @@
11801598 //worldPanel.setName("World");
11811599 centralPanel = new cGridBag();
11821600 centralPanel.preferredWidth = 20;
1183
- timelinePanel = new JPanel(new BorderLayout());
1184
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1601
+
1602
+ if (Globals.ADVANCED)
1603
+ {
1604
+ timelinePanel = new JPanel(new BorderLayout());
1605
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11851606
11861607 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
11871608 cameraPanel.setContinuousLayout(true);
....@@ -1190,7 +1611,10 @@
11901611 // cameraPanel.setDividerSize(9);
11911612 cameraPanel.setResizeWeight(1.0);
11921613
1614
+ }
1615
+
11931616 centralPanel.add(cameraView);
1617
+ centralPanel.setFocusable(true);
11941618 //frame.setJMenuBar(timelineMenubar);
11951619 //centralPanel.add(timelinePanel);
11961620
....@@ -1209,6 +1633,45 @@
12091633 //frontView.object = copy;
12101634 //sideView.object = copy;
12111635
1636
+ transformPanel = new cGridBag().setVertical(true);
1637
+
1638
+ cGridBag resetTransformPanel = new cGridBag();
1639
+
1640
+ resetTransformPanel.preferredHeight = 2;
1641
+
1642
+ cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF);
1643
+ resetTransform.setToolTipText("Reset Translation, Rotation and Scale");
1644
+ resetTransform.addMouseListener(new MouseAdapter()
1645
+ {
1646
+ public void mouseClicked(MouseEvent e)
1647
+ {
1648
+ ResetTransform();
1649
+ }
1650
+ });
1651
+ resetTransformPanel.add(resetTransform);
1652
+
1653
+ resetTransform = GetButton("T only", !Globals.NIMBUSLAF);
1654
+ resetTransform.setToolTipText("Reset Translation only");
1655
+ resetTransform.addMouseListener(new MouseAdapter()
1656
+ {
1657
+ public void mouseClicked(MouseEvent e)
1658
+ {
1659
+ ResetTransform(1);
1660
+ }
1661
+ });
1662
+ resetTransformPanel.add(resetTransform);
1663
+
1664
+ resetTransform = GetButton("RS only", !Globals.NIMBUSLAF);
1665
+ resetTransform.setToolTipText("Reset Rotation and Scale only");
1666
+ resetTransform.addMouseListener(new MouseAdapter()
1667
+ {
1668
+ public void mouseClicked(MouseEvent e)
1669
+ {
1670
+ ResetTransform(2);
1671
+ }
1672
+ });
1673
+ resetTransformPanel.add(resetTransform);
1674
+
12121675 XYZPanel = new cGridBag().setVertical(true);
12131676 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12141677
....@@ -1216,7 +1679,11 @@
12161679 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
12171680 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
12181681 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1682
+ //XYZPanel.setName("XYZ");
12191683
1684
+ transformPanel.add(resetTransformPanel);
1685
+ transformPanel.add(XYZPanel);
1686
+
12201687 /*
12211688 gridPanel = new JPanel(); //new BorderLayout());
12221689 gridPanel.setLayout(new GridLayout(1, 2));
....@@ -1224,12 +1691,12 @@
12241691 gridPanel.add(cameraView);
12251692 gridPanel.add(XYZPanel);
12261693 */
1227
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1228
- gridPanel.setContinuousLayout(true);
1229
- gridPanel.setOneTouchExpandable(true);
1230
- gridPanel.setDividerLocation(1.0);
1231
- gridPanel.setDividerSize(9);
1232
- gridPanel.setResizeWeight(0.85);
1694
+// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1695
+// gridPanel.setContinuousLayout(true);
1696
+// gridPanel.setOneTouchExpandable(true);
1697
+// gridPanel.setDividerLocation(1.0);
1698
+// gridPanel.setDividerSize(9);
1699
+// gridPanel.setResizeWeight(0.85);
12331700
12341701 // aConstraints.weighty = 0;
12351702 //System.out.println("THIS = " + this);
....@@ -1252,13 +1719,34 @@
12521719
12531720 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12541721 //tmp.setName("Edit");
1255
- objectPanel.add(materialPanel);
1256
- JPanel north = new JPanel(new BorderLayout());
1257
- north.setName("Edit");
1258
- north.add(ctrlPanel, BorderLayout.NORTH);
1259
- objectPanel.add(north);
1260
- objectPanel.add(infoPanel);
1722
+ objectPanel.add(skyboxPanel);
1723
+ objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg"));
1724
+ objectPanel.setToolTipTextAt(0, "Backgrounds");
1725
+
1726
+ objectPanel.add(toolboxPanel);
1727
+ objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
1728
+ objectPanel.setToolTipTextAt(1, "Objects & textures");
12611729
1730
+ objectPanel.add(materialPanel);
1731
+ objectPanel.setIconAt(2, GetIcon("icons/material.png"));
1732
+ objectPanel.setToolTipTextAt(2, "Material");
1733
+
1734
+// JPanel north = new JPanel(new BorderLayout());
1735
+// north.setName("Edit");
1736
+// north.add(ctrlPanel, BorderLayout.NORTH);
1737
+// objectPanel.add(north);
1738
+ objectPanel.add(editPanel);
1739
+ objectPanel.setIconAt(3, GetIcon("icons/writewhite.png"));
1740
+ objectPanel.setToolTipTextAt(3, "Edit controls");
1741
+
1742
+ objectPanel.add(transformPanel);
1743
+ objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1744
+ objectPanel.setToolTipTextAt(4, "TRS transform");
1745
+
1746
+ patchMaterial = true;
1747
+ cameraView.patchMaterial = this;
1748
+ objectPanel.setSelectedIndex(2);
1749
+
12621750 /*
12631751 aConstraints.gridx = 0;
12641752 aConstraints.gridwidth = 1;
....@@ -1266,7 +1754,7 @@
12661754 aConstraints.gridy += 1;
12671755 aConstraints.gridwidth = 1;
12681756 mainPanel.add(objectPanel, aConstraints);
1269
- */
1757
+ */
12701758
12711759 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12721760 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1278,22 +1766,62 @@
12781766 scrollpane.addMouseWheelListener(this); // Default not fast enough
12791767
12801768 /*JTabbedPane*/ scenePanel = new cGridBag();
1281
- scenePanel.preferredWidth = 7;
1769
+ scenePanel.preferredWidth = 6;
12821770
12831771 JTabbedPane tabbedPane = new JTabbedPane();
12841772 tabbedPane.add(scrollpane);
12851773
1286
- tabbedPane.add(FSPane = new cFileSystemPane(this));
1287
-
1288
- optionsPanel = new cGridBag().setVertical(true);
1774
+ optionsPanel = new cGridBag().setVertical(false);
12891775
12901776 optionsPanel.setName("Options");
12911777
12921778 AddOptions(optionsPanel); //, aConstraints);
12931779
1780
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
1781
+
12941782 tabbedPane.add(optionsPanel);
12951783
12961784 scenePanel.add(tabbedPane);
1785
+
1786
+ cGridBag creditsPanel = new cGridBag().setVertical(true);
1787
+ creditsPanel.setName("Credits");
1788
+
1789
+ cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1790
+ creditsPanel.add(ogaLabel);
1791
+
1792
+ cButton opengameartButton;
1793
+ creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
1794
+ opengameartButton.setToolTipText("https://opengameart.org");
1795
+
1796
+ opengameartButton.addMouseListener(new MouseAdapter()
1797
+ {
1798
+ public void mouseClicked(MouseEvent e)
1799
+ {
1800
+ try
1801
+ {
1802
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
1803
+ } catch (Exception e1)
1804
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1805
+ {
1806
+ e1.printStackTrace();
1807
+ }
1808
+ }
1809
+ });
1810
+
1811
+ for (int i=10; --i>=0;)
1812
+ {
1813
+ creditsPanel.add(new cGridBag());
1814
+ }
1815
+
1816
+ tabbedPane.add(creditsPanel);
1817
+ tabbedPane.setToolTipTextAt(3, "Credits");
1818
+
1819
+ if (Globals.ADVANCED)
1820
+ {
1821
+ tabbedPane.add(infoPanel);
1822
+ tabbedPane.setIconAt(4, GetIcon("icons/info.png"));
1823
+ tabbedPane.setToolTipTextAt(4, "Information");
1824
+ }
12971825
12981826 /*
12991827 cTree jTree = new cTree(null);
....@@ -1315,13 +1843,13 @@
13151843 jtp.add(tree);
13161844 */
13171845
1318
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1319
- bigPanel.setContinuousLayout(true);
1320
- bigPanel.setOneTouchExpandable(true);
1321
- bigPanel.setDividerLocation(0.8);
1322
- bigPanel.setDividerSize(15);
1323
- bigPanel.setResizeWeight(0.15);
1324
- bigPanel.setName("Scene");
1846
+// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1847
+// bigPanel.setContinuousLayout(true);
1848
+// bigPanel.setOneTouchExpandable(true);
1849
+// bigPanel.setDividerLocation(0.8);
1850
+// bigPanel.setDividerSize(15);
1851
+// bigPanel.setResizeWeight(0.15);
1852
+// bigPanel.setName("Scene");
13251853
13261854 //bigPanel.setLayout(new BorderLayout());
13271855 //bigPanel.setSize(new Dimension(10,10));
....@@ -1356,7 +1884,7 @@
13561884 bigThree = new cGridBag();
13571885 bigThree.addComponent(scenePanel);
13581886 bigThree.addComponent(centralPanel);
1359
- bigThree.addComponent(XYZPanel);
1887
+ //bigThree.addComponent(XYZPanel);
13601888
13611889 // // SIDE EFFECT!!!
13621890 // aConstraints.gridx = 0;
....@@ -1365,16 +1893,33 @@
13651893 // aConstraints.gridheight = 1;
13661894
13671895 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1368
- framePanel.setContinuousLayout(true);
1369
- framePanel.setOneTouchExpandable(true);
1370
- framePanel.setDividerLocation(0.8);
1896
+
1897
+ framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,
1898
+ new java.beans.PropertyChangeListener()
1899
+ {
1900
+ public void propertyChange(java.beans.PropertyChangeEvent pce)
1901
+ {
1902
+ if ((Integer)pce.getOldValue() == 1)
1903
+ {
1904
+ if (radio.layout != expandedLayout)
1905
+ {
1906
+ radio.layout = expandedLayout;
1907
+ radio.layout.doClick();
1908
+ }
1909
+ }
1910
+ }
1911
+ });
1912
+
1913
+ framePanel.setContinuousLayout(false);
1914
+ framePanel.setOneTouchExpandable(false);
1915
+ //.setDividerLocation(0.8);
13711916 //framePanel.setDividerSize(15);
13721917 //framePanel.setResizeWeight(0.15);
13731918 framePanel.setName("Frame");
13741919
13751920 frame.getContentPane().setLayout(new BorderLayout());
13761921 /**/
1377
- JTabbedPane worldPane = new JTabbedPane();
1922
+ //JTabbedPane worldPane = new JTabbedPane();
13781923 //worldPane.add(bigPanel);
13791924 //worldPane.add(worldPanel);
13801925 /**/
....@@ -1384,15 +1929,19 @@
13841929
13851930 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13861931
1387
- frame.setSize(1024, 768);
1388
- frame.show();
1932
+ frame.setSize(1280, 860);
1933
+
1934
+ cameraView.requestFocusInWindow();
1935
+
1936
+// gridPanel.setDividerLocation(1.0);
1937
+
1938
+ frame.validate();
13891939
1390
- gridPanel.setDividerLocation(1.0);
1940
+ frame.setVisible(true);
13911941
13921942 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
13931943 frame.addWindowListener(new WindowAdapter()
13941944 {
1395
-
13961945 public void windowClosing(WindowEvent e)
13971946 {
13981947 Close();
....@@ -1415,27 +1964,449 @@
14151964 ctrlPanel.removeAll();
14161965 }
14171966
1418
- void SetupMaterial(cGridBag ctrlPanel)
1967
+ void SetupMaterial(cGridBag materialpanel)
14191968 {
1420
- /*
1969
+ cGridBag presetpanel = new cGridBag().setVertical(true);
1970
+
1971
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF);
1972
+ skin.setToolTipText("Skin");
1973
+ skin.addMouseListener(new MouseAdapter()
1974
+ {
1975
+ public void mouseClicked(MouseEvent e)
1976
+ {
1977
+ Object3D object = Grafreed.materials.versionlist[0].get(0);
1978
+ cMaterial material = object.material;
1979
+
1980
+ // Skin
1981
+ colorField.setFloat(material.color);
1982
+ float saturation = material.modulation;
1983
+
1984
+ if (!cameraView.Skinshader)
1985
+ {
1986
+ saturation /= 1.5;
1987
+ }
1988
+
1989
+ saturationField.setFloat(saturation);
1990
+
1991
+ subsurfaceField.setFloat(material.subsurface);
1992
+ selfshadowField.setFloat(material.diffuseness);
1993
+ diffusenessField.setFloat(material.factor);
1994
+ shininessField.setFloat(material.shininess);
1995
+ shadowbiasField.setFloat(material.shadowbias);
1996
+ diffuseField.setFloat(material.diffuse);
1997
+ specularField.setFloat(material.specular);
1998
+
1999
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2000
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2001
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2002
+
2003
+ materialtouched = true;
2004
+ applySelf();
2005
+ }
2006
+ });
2007
+ presetpanel.add(skin);
2008
+
2009
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF);
2010
+ lambert.setToolTipText("Diffuse");
2011
+ lambert.addMouseListener(new MouseAdapter()
2012
+ {
2013
+ public void mouseClicked(MouseEvent e)
2014
+ {
2015
+ Object3D object = Grafreed.materials.versionlist[2].get(0);
2016
+ cMaterial material = object.material;
2017
+
2018
+ diffusenessField.setFloat(material.factor);
2019
+ selfshadowField.setFloat(material.diffuseness);
2020
+
2021
+ materialtouched = true;
2022
+ applySelf();
2023
+ }
2024
+ });
2025
+ presetpanel.add(lambert);
2026
+
2027
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF);
2028
+ diffuse2.setToolTipText("Diffuse2");
2029
+ diffuse2.addMouseListener(new MouseAdapter()
2030
+ {
2031
+ public void mouseClicked(MouseEvent e)
2032
+ {
2033
+ Object3D object = Grafreed.materials.versionlist[3].get(0);
2034
+ cMaterial material = object.material;
2035
+
2036
+ diffusenessField.setFloat(material.factor);
2037
+ selfshadowField.setFloat(material.diffuseness);
2038
+
2039
+ materialtouched = true;
2040
+ applySelf();
2041
+ }
2042
+ });
2043
+ presetpanel.add(diffuse2);
2044
+
2045
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF);
2046
+ diffusemoon.setToolTipText("Moon");
2047
+ diffusemoon.addMouseListener(new MouseAdapter()
2048
+ {
2049
+ public void mouseClicked(MouseEvent e)
2050
+ {
2051
+ Object3D object = Grafreed.materials.versionlist[4].get(0);
2052
+ cMaterial material = object.material;
2053
+
2054
+ diffusenessField.setFloat(material.factor);
2055
+ selfshadowField.setFloat(material.diffuseness);
2056
+
2057
+ materialtouched = true;
2058
+ applySelf();
2059
+ }
2060
+ });
2061
+ presetpanel.add(diffusemoon);
2062
+
2063
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF);
2064
+ diffusemoon2.setToolTipText("Moon2");
2065
+ diffusemoon2.addMouseListener(new MouseAdapter()
2066
+ {
2067
+ public void mouseClicked(MouseEvent e)
2068
+ {
2069
+ Object3D object = Grafreed.materials.versionlist[5].get(0);
2070
+ cMaterial material = object.material;
2071
+
2072
+ diffusenessField.setFloat(material.factor);
2073
+ selfshadowField.setFloat(material.diffuseness);
2074
+
2075
+ materialtouched = true;
2076
+ applySelf();
2077
+ }
2078
+ });
2079
+ presetpanel.add(diffusemoon2);
2080
+
2081
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF);
2082
+ diffusemoon3.setToolTipText("Moon3");
2083
+ diffusemoon3.addMouseListener(new MouseAdapter()
2084
+ {
2085
+ public void mouseClicked(MouseEvent e)
2086
+ {
2087
+ Object3D object = Grafreed.materials.versionlist[6].get(0);
2088
+ cMaterial material = object.material;
2089
+
2090
+ diffusenessField.setFloat(material.factor);
2091
+ selfshadowField.setFloat(material.diffuseness);
2092
+
2093
+ materialtouched = true;
2094
+ applySelf();
2095
+ }
2096
+ });
2097
+ presetpanel.add(diffusemoon3);
2098
+
2099
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF);
2100
+ diffusesheen.setToolTipText("Sheen");
2101
+ diffusesheen.addMouseListener(new MouseAdapter()
2102
+ {
2103
+ public void mouseClicked(MouseEvent e)
2104
+ {
2105
+ Object3D object = Grafreed.materials.versionlist[7].get(0);
2106
+ cMaterial material = object.material;
2107
+
2108
+ sheenField.setFloat(material.sheen);
2109
+
2110
+ materialtouched = true;
2111
+ applySelf();
2112
+ }
2113
+ });
2114
+ presetpanel.add(diffusesheen);
2115
+
2116
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF);
2117
+ rough.setToolTipText("Rough metal");
2118
+ rough.addMouseListener(new MouseAdapter()
2119
+ {
2120
+ public void mouseClicked(MouseEvent e)
2121
+ {
2122
+ Object3D object = Grafreed.materials.versionlist[1].get(0);
2123
+ cMaterial material = object.material;
2124
+
2125
+ shininessField.setFloat(material.shininess);
2126
+ velvetField.setFloat(material.velvet);
2127
+
2128
+ materialtouched = true;
2129
+ applySelf();
2130
+ }
2131
+ });
2132
+ presetpanel.add(rough);
2133
+
2134
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF);
2135
+ rough2.setToolTipText("Medium metal");
2136
+ rough2.addMouseListener(new MouseAdapter()
2137
+ {
2138
+ public void mouseClicked(MouseEvent e)
2139
+ {
2140
+ Object3D object = Grafreed.materials.versionlist[13].get(0);
2141
+ cMaterial material = object.material;
2142
+
2143
+ shininessField.setFloat(material.shininess);
2144
+ lightareaField.setFloat(material.lightarea);
2145
+
2146
+ materialtouched = true;
2147
+ applySelf();
2148
+ }
2149
+ });
2150
+ presetpanel.add(rough2);
2151
+
2152
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF);
2153
+ shini0.setToolTipText("Shiny");
2154
+ shini0.addMouseListener(new MouseAdapter()
2155
+ {
2156
+ public void mouseClicked(MouseEvent e)
2157
+ {
2158
+ Object3D object = Grafreed.materials.versionlist[14].get(0);
2159
+ cMaterial material = object.material;
2160
+
2161
+ shininessField.setFloat(material.shininess);
2162
+ lightareaField.setFloat(material.lightarea);
2163
+
2164
+ materialtouched = true;
2165
+ applySelf();
2166
+ }
2167
+ });
2168
+ presetpanel.add(shini0);
2169
+
2170
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF);
2171
+ shini1.setToolTipText("Shiny2");
2172
+ shini1.addMouseListener(new MouseAdapter()
2173
+ {
2174
+ public void mouseClicked(MouseEvent e)
2175
+ {
2176
+ Object3D object = Grafreed.materials.versionlist[11].get(0);
2177
+ cMaterial material = object.material;
2178
+
2179
+ shininessField.setFloat(material.shininess);
2180
+ lightareaField.setFloat(material.lightarea);
2181
+
2182
+ materialtouched = true;
2183
+ applySelf();
2184
+ }
2185
+ });
2186
+ presetpanel.add(shini1);
2187
+
2188
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF);
2189
+ shini2.setToolTipText("Shiny3");
2190
+ shini2.addMouseListener(new MouseAdapter()
2191
+ {
2192
+ public void mouseClicked(MouseEvent e)
2193
+ {
2194
+ Object3D object = Grafreed.materials.versionlist[12].get(0);
2195
+ cMaterial material = object.material;
2196
+
2197
+ shininessField.setFloat(material.shininess);
2198
+ lightareaField.setFloat(material.lightarea);
2199
+
2200
+ materialtouched = true;
2201
+ applySelf();
2202
+ }
2203
+ });
2204
+ presetpanel.add(shini2);
2205
+
2206
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF);
2207
+ aniso.setToolTipText("AnisoU");
2208
+ aniso.addMouseListener(new MouseAdapter()
2209
+ {
2210
+ public void mouseClicked(MouseEvent e)
2211
+ {
2212
+ Object3D object = Grafreed.materials.versionlist[8].get(0);
2213
+ cMaterial material = object.material;
2214
+
2215
+ anisoField.setFloat(material.aniso);
2216
+ anisoVField.setFloat(material.anisoV);
2217
+
2218
+ materialtouched = true;
2219
+ applySelf();
2220
+ }
2221
+ });
2222
+ presetpanel.add(aniso);
2223
+
2224
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF);
2225
+ aniso2.setToolTipText("AnisoV");
2226
+ aniso2.addMouseListener(new MouseAdapter()
2227
+ {
2228
+ public void mouseClicked(MouseEvent e)
2229
+ {
2230
+ Object3D object = Grafreed.materials.versionlist[9].get(0);
2231
+ cMaterial material = object.material;
2232
+
2233
+ anisoField.setFloat(material.aniso);
2234
+ anisoVField.setFloat(material.anisoV);
2235
+
2236
+ materialtouched = true;
2237
+ applySelf();
2238
+ }
2239
+ });
2240
+ presetpanel.add(aniso2);
2241
+
2242
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF);
2243
+ aniso3.setToolTipText("AnisoUV");
2244
+ aniso3.addMouseListener(new MouseAdapter()
2245
+ {
2246
+ public void mouseClicked(MouseEvent e)
2247
+ {
2248
+ Object3D object = Grafreed.materials.versionlist[10].get(0);
2249
+ cMaterial material = object.material;
2250
+
2251
+ anisoField.setFloat(material.aniso);
2252
+ anisoVField.setFloat(material.anisoV);
2253
+
2254
+ materialtouched = true;
2255
+ applySelf();
2256
+ }
2257
+ });
2258
+ presetpanel.add(aniso3);
2259
+
2260
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF);
2261
+ velvet0.setToolTipText("Velvet");
2262
+ velvet0.addMouseListener(new MouseAdapter()
2263
+ {
2264
+ public void mouseClicked(MouseEvent e)
2265
+ {
2266
+ Object3D object = Grafreed.materials.versionlist[15].get(0);
2267
+ cMaterial material = object.material;
2268
+
2269
+ diffusenessField.setFloat(material.factor);
2270
+ selfshadowField.setFloat(material.diffuseness);
2271
+ sheenField.setFloat(material.sheen);
2272
+ shininessField.setFloat(material.shininess);
2273
+ velvetField.setFloat(material.velvet);
2274
+ shiftField.setFloat(material.shift);
2275
+
2276
+ materialtouched = true;
2277
+ applySelf();
2278
+ }
2279
+ });
2280
+ presetpanel.add(velvet0);
2281
+
2282
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF);
2283
+ bump0.setToolTipText("Bump texture");
2284
+ bump0.addMouseListener(new MouseAdapter()
2285
+ {
2286
+ public void mouseClicked(MouseEvent e)
2287
+ {
2288
+ Object3D object = Grafreed.materials.versionlist[16].get(0);
2289
+ cMaterial material = object.material;
2290
+
2291
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2292
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2293
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2294
+
2295
+ materialtouched = true;
2296
+ applySelf();
2297
+ }
2298
+ });
2299
+ presetpanel.add(bump0);
2300
+
2301
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF);
2302
+ borderShader.setToolTipText("Border fade");
2303
+ borderShader.addMouseListener(new MouseAdapter()
2304
+ {
2305
+ public void mouseClicked(MouseEvent e)
2306
+ {
2307
+ borderfadeField.setFloat(0.5);
2308
+ opacityField.setFloat(0.75);
2309
+
2310
+ materialtouched = true;
2311
+ applySelf();
2312
+ }
2313
+ });
2314
+ presetpanel.add(borderShader);
2315
+
2316
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF);
2317
+ halo.setToolTipText("Halo");
2318
+ halo.addMouseListener(new MouseAdapter()
2319
+ {
2320
+ public void mouseClicked(MouseEvent e)
2321
+ {
2322
+ Object3D object = Grafreed.materials.versionlist[17].get(0);
2323
+ cMaterial material = object.material;
2324
+
2325
+ opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0);
2326
+
2327
+ materialtouched = true;
2328
+ applySelf();
2329
+ }
2330
+ });
2331
+ presetpanel.add(halo);
2332
+
2333
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF);
2334
+ candle.setToolTipText("Candle");
2335
+ candle.addMouseListener(new MouseAdapter()
2336
+ {
2337
+ public void mouseClicked(MouseEvent e)
2338
+ {
2339
+ Object3D object = Grafreed.materials.versionlist[18].get(0);
2340
+ cMaterial material = object.material;
2341
+
2342
+ subsurfaceField.setFloat(material.subsurface);
2343
+ shadowbiasField.setFloat(material.shadowbias);
2344
+ ambientField.setFloat(material.ambient);
2345
+ specularField.setFloat(material.specular);
2346
+ lightareaField.setFloat(material.lightarea);
2347
+ shininessField.setFloat(material.shininess);
2348
+
2349
+ materialtouched = true;
2350
+ applySelf();
2351
+ }
2352
+ });
2353
+ presetpanel.add(candle);
2354
+
2355
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF);
2356
+ shadowShader.setToolTipText("Shadow");
2357
+ shadowShader.addMouseListener(new MouseAdapter()
2358
+ {
2359
+ public void mouseClicked(MouseEvent e)
2360
+ {
2361
+ diffuseField.setFloat(0.001);
2362
+ ambientField.setFloat(0.001);
2363
+ cameraField.setFloat(0.001);
2364
+ specularField.setFloat(0.001);
2365
+ fakedepthField.setFloat(0.001);
2366
+ opacityField.setFloat(0.6);
2367
+
2368
+ materialtouched = true;
2369
+ applySelf();
2370
+ }
2371
+ });
2372
+ presetpanel.add(shadowShader);
2373
+
2374
+ cGridBag panel = new cGridBag().setVertical(true);
2375
+
2376
+ presetpanel.preferredWidth = 1;
2377
+
2378
+ materialpanel.add(presetpanel);
2379
+ materialpanel.add(panel);
2380
+
2381
+ panel.preferredWidth = 8;
2382
+
2383
+ /*
14212384 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14222385 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1423
- */
2386
+ */
14242387
14252388 cGridBag editBar = new cGridBag().setVertical(false);
14262389
1427
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
2390
+ editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints);
2391
+ createMaterialButton.setToolTipText("Create material");
14282392
14292393 /*
14302394 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14312395 */
14322396
1433
- editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints);
1434
- editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints);
1435
- editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1436
- editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
2397
+ editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints);
2398
+ clearMaterialButton.setToolTipText("Clear material");
2399
+
2400
+ if (Globals.ADVANCED)
2401
+ {
2402
+ editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints);
2403
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
2404
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
2405
+ }
14372406
1438
- ctrlPanel.add(editBar);
2407
+ editBar.preferredHeight = 15;
2408
+
2409
+ panel.add(editBar);
14392410
14402411 /**/
14412412 //aConstraints.weighty = 0;
....@@ -1446,47 +2417,63 @@
14462417 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14472418
14482419 cGridBag colorSection = new cGridBag().setVertical(true);
2420
+
2421
+ cGridBag huepanel = new cGridBag();
2422
+ cGridBag huelabel = new cGridBag();
2423
+ cLabel hue = GetLabel("icons/hue.png", false);
2424
+ hue.fit = true;
2425
+
2426
+ hue.addMouseListener(new MouseAdapter()
2427
+ {
2428
+ public void mousePressed(MouseEvent e)
2429
+ {
2430
+ int x = e.getX();
2431
+
2432
+ colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth());
2433
+ }
2434
+ });
2435
+
2436
+ huelabel.add(hue);
2437
+ huelabel.preferredWidth = 20;
2438
+ huepanel.add(new cGridBag()); // Label
2439
+ huepanel.add(huelabel); // Field/slider
2440
+
2441
+ huepanel.preferredHeight = 7;
2442
+
2443
+ colorSection.add(huepanel);
14492444
14502445 cGridBag color = new cGridBag();
1451
- color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1452
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1453
- color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2446
+
2447
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
2448
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2449
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2450
+
14542451 //colorField.preferredWidth = 200;
14552452 colorSection.add(color);
14562453
14572454 cGridBag modulation = new cGridBag();
14582455 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
14592456 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1460
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2457
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
14612458 colorSection.add(modulation);
14622459
2460
+ cGridBag opacity = new cGridBag();
2461
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
2462
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2463
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2464
+ colorSection.add(opacity);
2465
+
2466
+ colorSection.add(GetSeparator());
2467
+
14632468 cGridBag texture = new cGridBag();
14642469 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
14652470 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
14662471 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
14672472 colorSection.add(texture);
14682473
1469
- cGridBag anisoU = new cGridBag();
1470
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1471
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1472
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1473
- colorSection.add(anisoU);
1474
-
1475
- cGridBag anisoV = new cGridBag();
1476
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1477
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1479
- colorSection.add(anisoV);
1480
-
1481
- cGridBag shadowbias = new cGridBag();
1482
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1483
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1484
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1485
- colorSection.add(shadowbias);
1486
-
1487
- ctrlPanel.add(new JSeparator());
2474
+ panel.add(GetSeparator());
14882475
1489
- ctrlPanel.add(colorSection);
2476
+ panel.add(colorSection);
14902477
14912478 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14922479
....@@ -1534,9 +2521,15 @@
15342521 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15352522 diffuseSection.add(fakedepth);
15362523
1537
- ctrlPanel.add(new JSeparator());
2524
+ cGridBag shadowbias = new cGridBag();
2525
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
2526
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2527
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2528
+ diffuseSection.add(shadowbias);
2529
+
2530
+ panel.add(GetSeparator());
15382531
1539
- ctrlPanel.add(diffuseSection);
2532
+ panel.add(diffuseSection);
15402533
15412534 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15422535
....@@ -1572,7 +2565,7 @@
15722565 velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15732566 specularSection.add(velvet);
15742567
1575
- shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1);
2568
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
15762569 //Return();
15772570 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
15782571 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
....@@ -1584,42 +2577,48 @@
15842577 // aConstraints.gridy += 1;
15852578 // aConstraints.gridwidth = 1;
15862579
2580
+ cGridBag anisoU = new cGridBag();
2581
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
2582
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2583
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2584
+ specularSection.add(anisoU);
15872585
1588
- ctrlPanel.add(new JSeparator());
2586
+ cGridBag anisoV = new cGridBag();
2587
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
2588
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2589
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2590
+ specularSection.add(anisoV);
2591
+
2592
+
2593
+ panel.add(GetSeparator());
15892594
1590
- ctrlPanel.add(specularSection);
2595
+ panel.add(specularSection);
15912596
15922597 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15932598
1594
- cGridBag globalSection = new cGridBag().setVertical(true);
2599
+ //cGridBag globalSection = new cGridBag().setVertical(true);
15952600
15962601 cGridBag camera = new cGridBag();
15972602 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
15982603 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
15992604 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1600
- globalSection.add(camera);
2605
+ colorSection.add(camera);
16012606
16022607 cGridBag ambient = new cGridBag();
16032608 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
16042609 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16052610 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1606
- globalSection.add(ambient);
2611
+ colorSection.add(ambient);
16072612
16082613 cGridBag backlit = new cGridBag();
16092614 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
16102615 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16112616 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1612
- globalSection.add(backlit);
2617
+ colorSection.add(backlit);
16132618
1614
- cGridBag opacity = new cGridBag();
1615
- opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1616
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1617
- opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1618
- globalSection.add(opacity);
1619
-
1620
- ctrlPanel.add(new JSeparator());
2619
+ //panel.add(new JSeparator());
16212620
1622
- ctrlPanel.add(globalSection);
2621
+ //panel.add(globalSection);
16232622
16242623 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16252624
....@@ -1661,9 +2660,9 @@
16612660 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
16622661 textureSection.add(opacityPower);
16632662
1664
- ctrlPanel.add(new JSeparator());
2663
+ panel.add(GetSeparator());
16652664
1666
- ctrlPanel.add(textureSection);
2665
+ panel.add(textureSection);
16672666
16682667 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16692668
....@@ -1700,12 +2699,15 @@
17002699 opacityPowerField.addChangeListener(this);
17012700 /**/
17022701
1703
- resetSlidersButton.addActionListener(this);
17042702 clearMaterialButton.addActionListener(this);
17052703 createMaterialButton.addActionListener(this);
1706
-
1707
- propagateToggle.addItemListener(this);
1708
- multiplyToggle.addItemListener(this);
2704
+
2705
+ if (Globals.ADVANCED)
2706
+ {
2707
+ resetSlidersButton.addActionListener(this);
2708
+ propagateToggle.addItemListener(this);
2709
+ multiplyToggle.addItemListener(this);
2710
+ }
17092711 }
17102712
17112713 void DropFile(java.io.File[] files, boolean textures)
....@@ -1723,8 +2725,9 @@
17232725 // 3D models
17242726 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
17252727 {
1726
- lastConverter = new com.jmex.model.converters.MaxToJme();
1727
- LoadFile(filename, lastConverter);
2728
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2729
+ //LoadFile(filename, lastConverter);
2730
+ LoadObjFile(filename); // New 3ds loader
17282731 continue;
17292732 }
17302733 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -1876,7 +2879,7 @@
18762879
18772880 //? flashIt = false;
18782881 CameraPane pane = (CameraPane) cameraView;
1879
- pane.clickStart(location.x, location.y, 0);
2882
+ pane.clickStart(location.x, location.y, 0, 0);
18802883 pane.clickEnd(location.x, location.y, 0, true);
18812884
18822885 if (group.selection.size() == 1)
....@@ -1925,6 +2928,7 @@
19252928 e2.printStackTrace();
19262929 }
19272930 }
2931
+
19282932 LoadJMEThread loadThread;
19292933
19302934 class LoadJMEThread extends Thread
....@@ -1982,6 +2986,7 @@
19822986 //LoadFile0(filename, converter);
19832987 }
19842988 }
2989
+
19852990 LoadOBJThread loadObjThread;
19862991
19872992 class LoadOBJThread extends Thread
....@@ -2060,19 +3065,19 @@
20603065
20613066 void LoadObjFile(String fullname)
20623067 {
2063
- /*
3068
+ System.out.println("Loading " + fullname);
3069
+ /**/
20643070 //lastFilename = fullname;
20653071 if(loadObjThread == null)
20663072 {
2067
- loadObjThread = new LoadOBJThread();
2068
- loadObjThread.start();
3073
+ loadObjThread = new LoadOBJThread();
3074
+ loadObjThread.start();
20693075 }
20703076
20713077 loadObjThread.add(fullname);
2072
- */
3078
+ /**/
20733079
2074
- System.out.println("Loading " + fullname);
2075
- makeSomething(new FileObject(fullname, true), true);
3080
+ //makeSomething(new FileObject(fullname, true), true);
20763081 }
20773082
20783083 void LoadGFDFile(String fullname)
....@@ -2333,11 +3338,11 @@
23333338
23343339 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23353340 {
2336
- if (GrafreeD.standAlone)
3341
+ if (Grafreed.standAlone)
23373342 {
23383343 /**/
23393344 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2340
- browser.show();
3345
+ browser.setVisible(true);
23413346 String filename = browser.getFile();
23423347 if (filename != null && filename.length() > 0)
23433348 {
....@@ -2448,6 +3453,7 @@
24483453 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
24493454 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
24503455 }
3456
+
24513457 //cJME.count++;
24523458 //cJME.count %= 12;
24533459 if (gc)
....@@ -2482,6 +3488,7 @@
24823488 }
24833489 if (input == null)
24843490 {
3491
+ new Exception().printStackTrace();
24853492 System.exit(0);
24863493 }
24873494
....@@ -2630,6 +3637,7 @@
26303637 }
26313638 }
26323639 }
3640
+
26333641 cFileSystemPane FSPane;
26343642
26353643 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2639,7 +3647,7 @@
26393647
26403648 freezematerial = true;
26413649 colorField.setFloat(mat.color);
2642
- modulationField.setFloat(mat.modulation);
3650
+ saturationField.setFloat(mat.modulation);
26433651 metalnessField.setFloat(mat.metalness);
26443652 diffuseField.setFloat(mat.diffuse);
26453653 specularField.setFloat(mat.specular);
....@@ -2683,11 +3691,14 @@
26833691 }
26843692 }
26853693 }
3694
+
26863695 freezematerial = false;
26873696 }
26883697
26893698 void SetMaterial(Object3D object)
26903699 {
3700
+ latestObject = object;
3701
+
26913702 cMaterial mat = object.material;
26923703
26933704 if (mat == null)
....@@ -2696,33 +3707,10 @@
26963707 return;
26973708 }
26983709
2699
- multiplyToggle.setSelected(mat.multiply);
2700
-
2701
- assert (object.projectedVertices != null);
2702
-
2703
- if (object.projectedVertices.length <= 2)
2704
- {
2705
- // Side effect...
2706
- Object3D.cVector2[] keep = object.projectedVertices;
2707
- object.projectedVertices = new Object3D.cVector2[3];
2708
- for (int i = 0; i < 3; i++)
2709
- {
2710
- if (i < keep.length)
2711
- {
2712
- object.projectedVertices[i] = keep[i];
2713
- } else
2714
- {
2715
- object.projectedVertices[i] = new Object3D.cVector2();
2716
- }
2717
- /*
2718
- if(keep.length == 0)
2719
- object.projectedVertices[0] = new Object3D.cVector2();
2720
- else
2721
- object.projectedVertices[0] = keep[0];
2722
- object.projectedVertices[1] = new Object3D.cVector2();
2723
- */
2724
- }
2725
- }
3710
+ if (multiplyToggle != null)
3711
+ multiplyToggle.setSelected(mat.multiply);
3712
+
3713
+ AllocProjectedVertices(object);
27263714
27273715 SetMaterial(mat, object.projectedVertices);
27283716 }
....@@ -2798,12 +3786,17 @@
27983786 // }
27993787
28003788 /**/
2801
- if (deselect)
3789
+ if (deselect || child == null)
28023790 {
28033791 //group.deselectAll();
28043792 //freeze = true;
28053793 GetTree().clearSelection();
28063794 //freeze = false;
3795
+
3796
+ if (child == null)
3797
+ {
3798
+ return;
3799
+ }
28073800 }
28083801
28093802 //group.addSelectee(child);
....@@ -2837,6 +3830,17 @@
28373830 public void itemStateChanged(ItemEvent event)
28383831 {
28393832 // System.out.println("Propagate = " + propagate);
3833
+ if (event.getSource() == pinButton)
3834
+ {
3835
+ copy.pinned ^= true;
3836
+ if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy))
3837
+ {
3838
+ ((GroupEditor)copy.editWindow).listUI.remove(copy);
3839
+ copy.CloseUI();
3840
+ //copy.editWindow.refreshContents();
3841
+ }
3842
+ }
3843
+ else
28403844 if (event.getSource() == propagateToggle)
28413845 {
28423846 propagate ^= true;
....@@ -2872,7 +3876,7 @@
28723876 cameraView.ToggleDL();
28733877 cameraView.repaint();
28743878 return;
2875
- } else if (event.getSource() == toggleTextureItem)
3879
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
28763880 {
28773881 cameraView.ToggleTexture();
28783882 // june 2013 copy.HardTouch();
....@@ -2911,9 +3915,9 @@
29113915 frame.validate();
29123916
29133917 return;
2914
- } else if (event.getSource() == toggleRandomItem)
3918
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29153919 {
2916
- cameraView.ToggleRandom();
3920
+ cameraView.ToggleSwitch();
29173921 cameraView.repaint();
29183922 return;
29193923 } else if (event.getSource() == toggleHandleItem)
....@@ -2941,12 +3945,17 @@
29413945 } else if (event.getSource() == liveCB)
29423946 {
29433947 copy.live ^= true;
3948
+ objEditor.refreshContents(true); // To show item colors
3949
+ return;
3950
+ } else if (event.getSource() == selectableCB)
3951
+ {
3952
+ copy.dontselect ^= true;
29443953 return;
29453954 } else if (event.getSource() == hideCB)
29463955 {
29473956 copy.hide ^= true;
29483957 copy.Touch(); // display list issue
2949
- objEditor.refreshContents();
3958
+ objEditor.refreshContents(true); // To show item colors
29503959 return;
29513960 } else if (event.getSource() == link2masterCB)
29523961 {
....@@ -2956,6 +3965,7 @@
29563965 if (event.getSource() == randomCB)
29573966 {
29583967 copy.random ^= true;
3968
+ objEditor.refreshContents();
29593969 return;
29603970 }
29613971 if (event.getSource() == speedupCB)
....@@ -2979,8 +3989,9 @@
29793989
29803990 public void actionPerformed(ActionEvent event)
29813991 {
3992
+ Object source = event.getSource();
29823993 // SCRIPT DIALOG
2983
- if (event.getSource() == okbutton)
3994
+ if (source == okbutton)
29843995 {
29853996 textpanel.setVisible(false);
29863997 textpanel.remove(textarea);
....@@ -2992,7 +4003,7 @@
29924003 textarea = null;
29934004 textpanel = null;
29944005 }
2995
- if (event.getSource() == cancelbutton)
4006
+ if (source == cancelbutton)
29964007 {
29974008 textpanel.setVisible(false);
29984009 textpanel.remove(textarea);
....@@ -3004,50 +4015,50 @@
30044015 //applySelf();
30054016 //client.refreshEditWindow();
30064017 //refreshContents();
3007
- if (event.getSource() == nameField)
4018
+ if (source == nameField)
30084019 {
30094020 //System.out.println("ObjEditor " + event);
30104021 applySelf0(true);
30114022 //parent.applySelf();
3012
- objEditor.refreshContents();
3013
- } else if (event.getSource() == resetButton)
4023
+ // conflicts with requestFocus objEditor.refreshContents();
4024
+ } else if (source == resetButton)
30144025 {
30154026 CameraPane.fullreset = true;
30164027 copy.Reset(); // ResetMeshes();
30174028 copy.Touch();
30184029 objEditor.refreshContents();
3019
- } else if (event.getSource() == stepItem)
4030
+ } else if (source == stepItem)
30204031 {
30214032 //cameraView.ONESTEP = true;
30224033 Globals.ONESTEP = true;
30234034 cameraView.repaint();
30244035 return;
3025
- } else if (event.getSource() == stepButton)
4036
+ } else if (source == stepButton)
30264037 {
30274038 copy.Step();
30284039 copy.Touch();
30294040 objEditor.refreshContents();
3030
- } else if (event.getSource() == slowerButton)
4041
+ } else if (source == slowerButton)
30314042 {
30324043 copy.Slower();
30334044 copy.Touch();
30344045 objEditor.refreshContents();
3035
- } else if (event.getSource() == fasterButton)
4046
+ } else if (source == fasterButton)
30364047 {
30374048 copy.Faster();
30384049 copy.Touch();
30394050 objEditor.refreshContents();
3040
- } else if (event.getSource() == remarkButton)
4051
+ } else if (source == remarkButton)
30414052 {
30424053 copy.Remark();
30434054 copy.Touch();
30444055 objEditor.refreshContents();
3045
- } else if (event.getSource() == stepAllButton)
4056
+ } else if (source == stepAllButton)
30464057 {
30474058 copy.StepAll();
30484059 copy.Touch();
30494060 objEditor.refreshContents();
3050
- } else if (event.getSource() == resetAllButton)
4061
+ } else if (source == resetAllButton)
30514062 {
30524063 //CameraPane.fullreset = true;
30534064 copy.ResetAll(); // ResetMeshes();
....@@ -3080,53 +4091,79 @@
30804091 // Close();
30814092 // }
30824093 // else
3083
- if (event.getSource() == resetSlidersButton)
4094
+ if (source == resetSlidersButton)
30844095 {
30854096 ResetSliders();
3086
- } else if (event.getSource() == clearMaterialButton)
4097
+ } else if (source == clearMaterialButton)
30874098 {
30884099 ClearMaterial();
3089
- } else if (event.getSource() == createMaterialButton)
4100
+ } else if (source == createMaterialButton)
30904101 {
30914102 CreateMaterial();
3092
- } else if (event.getSource() == clearPanelButton)
4103
+ } else if (source == clearPanelButton)
30934104 {
30944105 copy.ClearUI();
30954106 refreshContents(true);
3096
- } /*
3097
- }
3098
-
3099
- public boolean action(Event event, Object arg)
3100
- {
3101
- */ else if (event.getSource() == closeItem)
4107
+ } else if (source == importGFDItem)
4108
+ {
4109
+ ImportGFD();
4110
+ } else
4111
+ if (source == importVRMLX3DItem)
4112
+ {
4113
+ ImportVRMLX3D();
4114
+ } else
4115
+ if (source == import3DSItem)
4116
+ {
4117
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
4118
+ } else
4119
+ if (source == importOBJItem)
4120
+ {
4121
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
4122
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
4123
+ browser.setVisible(true);
4124
+ String filename = browser.getFile();
4125
+ if (filename != null && filename.length() > 0)
4126
+ {
4127
+ String fullname = browser.getDirectory() + filename;
4128
+ makeSomething(ReadOBJ(fullname), true);
4129
+ }
4130
+ } else
4131
+ if (source == closeItem)
31024132 {
31034133 Close();
31044134 //return true;
3105
- } else if (event.getSource() == loadItem)
4135
+ } else if (source == openItem)
31064136 {
3107
- load();
4137
+ Open();
31084138 //return true;
3109
- } else if (event.getSource() == saveItem)
4139
+ } else if (source == newItem)
4140
+ {
4141
+ New();
4142
+ } else if (source == saveItem)
31104143 {
31114144 save();
31124145 //return true;
3113
- } else if (event.getSource() == saveAsItem)
4146
+ } else if (source == saveAsItem)
31144147 {
31154148 saveAs();
31164149 //return true;
3117
- } else if (event.getSource() == reexportItem)
4150
+ } else if (source == reexportItem)
31184151 {
31194152 reexport();
31204153 //return true;
3121
- } else if (event.getSource() == exportAsItem)
4154
+ } else if (source == exportAsItem)
31224155 {
31234156 export();
31244157 //return true;
3125
- } else if (event.getSource() == povItem)
4158
+ } else if (source == povItem)
31264159 {
31274160 generatePOV();
31284161 //return true;
3129
- } else if (event.getSource() == zBufferItem)
4162
+ } else if (event.getSource() == archiveItem)
4163
+ {
4164
+ cTools.Archive(frame);
4165
+ return;
4166
+ } else if (source == zBufferItem)
31304167 {
31314168 try
31324169 {
....@@ -3148,21 +4185,8 @@
31484185 cameraView.repaint();
31494186 //return true;
31504187 }
3151
- */ else if (event.getSource() == editCameraItem)
3152
- {
3153
- cameraView.ProtectCamera();
3154
- cameraView.repaint();
3155
- return;
3156
- } else if (event.getSource() == revertCameraItem)
3157
- {
3158
- cameraView.RevertCamera();
3159
- cameraView.repaint();
3160
- return;
3161
-// } else if (event.getSource() == textureButton)
3162
-// {
3163
-// return; // true;
3164
- } else // combos...
3165
- if (event.getSource() == texresMenu)
4188
+ */ else // combos...
4189
+ if (source == texresMenu)
31664190 {
31674191 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
31684192 copy.texres = texresMenu.getSelectedIndex();
....@@ -3174,12 +4198,503 @@
31744198 }
31754199 }
31764200
4201
+ void New()
4202
+ {
4203
+ while (copy.Size() > 0)
4204
+ {
4205
+ copy.remove(0);
4206
+ }
4207
+
4208
+ copy.selection.clear();
4209
+
4210
+ if (copy == Grafreed.grafreed.universe)
4211
+ {
4212
+ CreateCameras();
4213
+ cameraView.SetCamera(GetCamera(copy, 0));
4214
+ }
4215
+ ResetModel();
4216
+ objEditor.refreshContents();
4217
+ }
4218
+
4219
+ static public byte[] Compress(Object3D o)
4220
+ {
4221
+ // Slower to actually compress.
4222
+ try
4223
+ {
4224
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4225
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
4226
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
4227
+
4228
+ Object3D parent = o.parent;
4229
+ o.parent = null;
4230
+
4231
+ out.writeObject(o);
4232
+
4233
+ o.parent = parent;
4234
+
4235
+ out.flush();
4236
+
4237
+ baos //zstream
4238
+ .close();
4239
+ out.close();
4240
+
4241
+ byte[] bytes = baos.toByteArray();
4242
+
4243
+ System.out.println("save #bytes = " + bytes.length);
4244
+ return bytes;
4245
+ } catch (Exception e)
4246
+ {
4247
+ System.err.println(e);
4248
+ return null;
4249
+ }
4250
+ }
4251
+
4252
+ static public Object Uncompress(byte[] bytes)
4253
+ {
4254
+ System.out.println("restore #bytes = " + bytes.length);
4255
+ try
4256
+ {
4257
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4258
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
4259
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
4260
+ Object obj = in.readObject();
4261
+
4262
+ bais //istream
4263
+ .close();
4264
+ in.close();
4265
+
4266
+ return obj;
4267
+ } catch (Exception e)
4268
+ {
4269
+ System.err.println(e);
4270
+ return null;
4271
+ }
4272
+ }
4273
+
4274
+ static public Object clone(Object o)
4275
+ {
4276
+ try
4277
+ {
4278
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4279
+ ObjectOutputStream out = new ObjectOutputStream(baos);
4280
+
4281
+ out.writeObject(o);
4282
+
4283
+ out.flush();
4284
+ out.close();
4285
+
4286
+ byte[] bytes = baos.toByteArray();
4287
+
4288
+ System.out.println("clone = " + bytes.length);
4289
+
4290
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4291
+ ObjectInputStream in = new ObjectInputStream(bais);
4292
+ Object obj = in.readObject();
4293
+ in.close();
4294
+
4295
+ return obj;
4296
+ } catch (Exception e)
4297
+ {
4298
+ System.err.println(e);
4299
+ return null;
4300
+ }
4301
+ }
4302
+
4303
+ cRadio GetCurrentTab()
4304
+ {
4305
+ cRadio ab;
4306
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4307
+ {
4308
+ ab = (cRadio)e.nextElement();
4309
+ if(ab.GetObject() == copy)
4310
+ {
4311
+ return ab;
4312
+ }
4313
+ }
4314
+
4315
+ return null;
4316
+ }
4317
+
4318
+
4319
+ public void Save()
4320
+ {
4321
+ //Save(true);
4322
+ Replace();
4323
+ SetVersionStates();
4324
+ }
4325
+
4326
+ private boolean Equal(byte[] compress, byte[] name)
4327
+ {
4328
+ if (compress.length != name.length)
4329
+ {
4330
+ return false;
4331
+ }
4332
+
4333
+ for (int i=compress.length; --i>=0;)
4334
+ {
4335
+ if (compress[i] != name[i])
4336
+ return false;
4337
+ }
4338
+
4339
+ return true;
4340
+ }
4341
+
4342
+ void DeleteVersion()
4343
+ {
4344
+ for (int i = copy.versionindex; i < copy.versionlist.length-1; i++)
4345
+ {
4346
+ copy.versionlist[i] = copy.versionlist[i+1];
4347
+ }
4348
+
4349
+ if (copy.versionlist[copy.versionindex] == null)
4350
+ copy.versionindex -= 1;
4351
+
4352
+ if (copy.versionindex != -1)
4353
+ CopyChanged();
4354
+
4355
+ SetVersionStates();
4356
+ }
4357
+
4358
+ public boolean Save(boolean user)
4359
+ {
4360
+ System.err.println("Save");
4361
+ Replace();
4362
+
4363
+ //cRadio tab = GetCurrentTab();
4364
+
4365
+ Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
4366
+
4367
+ boolean thesame = false;
4368
+
4369
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
4370
+// {
4371
+// thesame = true;
4372
+// }
4373
+
4374
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
4375
+ if (!thesame)
4376
+ {
4377
+ for (int i = copy.versionlist.length; --i > copy.versionindex+1;)
4378
+ {
4379
+ copy.versionlist[i] = copy.versionlist[i-1];
4380
+ }
4381
+
4382
+ //tab.user[tab.versionindex] = user;
4383
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
4384
+
4385
+ copy.versionlist[++copy.versionindex] = compress;
4386
+
4387
+ // if (increment)
4388
+ // tab.versionindex++;
4389
+ }
4390
+
4391
+ //copy.RestoreBigData(versiontable);
4392
+
4393
+ //assert(hashtable.isEmpty());
4394
+
4395
+// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
4396
+// {
4397
+// //tab.user[i] = false;
4398
+// copy.versionlist[i] = null;
4399
+// }
4400
+
4401
+ SetVersionStates();
4402
+
4403
+ // test save
4404
+ if (false)
4405
+ {
4406
+ try
4407
+ {
4408
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
4409
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
4410
+
4411
+ p.writeObject(copy);
4412
+
4413
+ p.flush();
4414
+
4415
+ ostream.close();
4416
+ } catch (Exception e)
4417
+ {
4418
+ e.printStackTrace();
4419
+ }
4420
+ }
4421
+
4422
+ return !thesame;
4423
+ }
4424
+
4425
+ boolean flashIt = true;
4426
+
4427
+ void RefreshSelection()
4428
+ {
4429
+ Object3D selection = new Object3D();
4430
+
4431
+ for (int i = 0; i < copy.selection.size(); i++)
4432
+ {
4433
+ Object3D elem = copy.selection.elementAt(i);
4434
+
4435
+ Object3D obj = copy.GetObject(elem.GetUUID());
4436
+
4437
+ if (obj == null)
4438
+ {
4439
+ copy.selection.remove(i--);
4440
+ }
4441
+ else
4442
+ {
4443
+ selection.add(obj);
4444
+ copy.selection.setElementAt(obj, i);
4445
+ }
4446
+ }
4447
+
4448
+ flashIt = false;
4449
+ GetTree().clearSelection();
4450
+ for (int i = 0; i < selection.size(); i++)
4451
+ GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath());
4452
+ flashIt = true;
4453
+
4454
+ //refreshContents(false);
4455
+ }
4456
+
4457
+ void CopyChanged()
4458
+ {
4459
+ Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
4460
+
4461
+ SetVersionStates();
4462
+
4463
+ boolean temp = CameraPane.SWITCH;
4464
+ CameraPane.SWITCH = false;
4465
+
4466
+ copy.ExtractBigData(Grafreed.grafreed.universe.versiontable);
4467
+
4468
+ copy.clear();
4469
+
4470
+ copy.skyboxname = obj.skyboxname;
4471
+ copy.skyboxext = obj.skyboxext;
4472
+
4473
+ for (int i=0; i<obj.Size(); i++)
4474
+ {
4475
+ copy.add(obj.get(i));
4476
+ }
4477
+
4478
+ copy.RestoreBigData(Grafreed.grafreed.universe.versiontable);
4479
+
4480
+ CameraPane.SWITCH = temp;
4481
+
4482
+ RefreshSelection();
4483
+ //assert(hashtable.isEmpty());
4484
+
4485
+ copy.Touch();
4486
+
4487
+ ResetModel();
4488
+ copy.HardTouch(); // recompile?
4489
+
4490
+ cRadio ab;
4491
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4492
+ {
4493
+ ab = (cRadio)e.nextElement();
4494
+ Object3D test = copy.GetObject(ab.object.GetUUID());
4495
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
4496
+ if (test != null)
4497
+ {
4498
+ test.editWindow = ab.object.editWindow;
4499
+ ab.object = test;
4500
+ }
4501
+ }
4502
+
4503
+ refreshContents(true);
4504
+ }
4505
+
4506
+ cButton previousVersionButton;
4507
+ cButton restoreButton;
4508
+ cButton replaceButton;
4509
+ cButton nextVersionButton;
4510
+ cButton saveVersionButton;
4511
+ cButton deleteVersionButton;
4512
+
4513
+ boolean muteSlider;
4514
+
4515
+ int VersionCount()
4516
+ {
4517
+ int count = 0;
4518
+
4519
+ for (int i = copy.versionlist.length; --i >= 0;)
4520
+ {
4521
+ if (copy.versionlist[i] != null)
4522
+ count++;
4523
+ }
4524
+
4525
+ return count;
4526
+ }
4527
+
4528
+ public cGridBag versionSliderPane;
4529
+
4530
+ void SetVersionStates()
4531
+ {
4532
+ //if (true)
4533
+ // return;
4534
+
4535
+ //cRadio tab = GetCurrentTab();
4536
+
4537
+ if (copy.versionlist == null)
4538
+ {
4539
+ saveVersionButton.setEnabled(false);
4540
+ restoreButton.setEnabled(false);
4541
+ replaceButton.setEnabled(false);
4542
+ previousVersionButton.setEnabled(false);
4543
+ nextVersionButton.setEnabled(false);
4544
+ deleteVersionButton.setEnabled(false);
4545
+ versionSliderPane.setVisible(false);
4546
+ }
4547
+ else
4548
+ {
4549
+ restoreButton.setEnabled(copy.versionindex != -1);
4550
+ replaceButton.setEnabled(copy.versionindex != -1);
4551
+
4552
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4553
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4554
+
4555
+ deleteVersionButton.setEnabled(copy.versionindex != -1);
4556
+ //copy.versionlist[copy.versionindex + 1] != null);
4557
+
4558
+ muteSlider = true;
4559
+ versionSlider.setMinimum(0);
4560
+ versionSlider.setMaximum(VersionCount() - 1);
4561
+ versionSlider.setInteger(copy.versionindex);
4562
+ versionSlider.setEnabled(copy.versionindex != -1);
4563
+ muteSlider = false;
4564
+
4565
+ versionSliderPane.setVisible(true);
4566
+ }
4567
+ }
4568
+
4569
+ public boolean PreviousVersion()
4570
+ {
4571
+ // Option?
4572
+ Replace();
4573
+
4574
+ System.err.println("Undo");
4575
+
4576
+ //cRadio tab = GetCurrentTab();
4577
+
4578
+ if (copy.versionindex == 0)
4579
+ {
4580
+ java.awt.Toolkit.getDefaultToolkit().beep();
4581
+ return false;
4582
+ }
4583
+
4584
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
4585
+// {
4586
+// if (Save(false))
4587
+// tab.versionindex -= 1;
4588
+// else
4589
+// {
4590
+// if (tab.versionindex <= 0)
4591
+// return false;
4592
+// else
4593
+// tab.versionindex -= 1;
4594
+// }
4595
+// }
4596
+
4597
+ copy.versionindex -= 1;
4598
+
4599
+ CopyChanged();
4600
+
4601
+ return true;
4602
+ }
4603
+
4604
+ public boolean Restore()
4605
+ {
4606
+ System.err.println("Restore");
4607
+
4608
+ //cRadio tab = GetCurrentTab();
4609
+
4610
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4611
+ {
4612
+ java.awt.Toolkit.getDefaultToolkit().beep();
4613
+ return false;
4614
+ }
4615
+
4616
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4617
+ CopyChanged();
4618
+
4619
+ return true;
4620
+ }
4621
+
4622
+ public boolean Replace()
4623
+ {
4624
+ //System.err.println("Replace");
4625
+
4626
+ //cRadio tab = GetCurrentTab();
4627
+
4628
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4629
+ {
4630
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
4631
+ return false;
4632
+ }
4633
+
4634
+ copy.versionlist[copy.versionindex] = Duplicate(copy);
4635
+
4636
+ return true;
4637
+ }
4638
+
4639
+ public void NextVersion()
4640
+ {
4641
+ // Option?
4642
+ Replace();
4643
+
4644
+ //cRadio tab = GetCurrentTab();
4645
+
4646
+ if (copy.versionlist[copy.versionindex + 1] == null)
4647
+ {
4648
+ java.awt.Toolkit.getDefaultToolkit().beep();
4649
+ return;
4650
+ }
4651
+
4652
+ copy.versionindex += 1;
4653
+
4654
+ CopyChanged();
4655
+
4656
+ //if (!tab.user[tab.versionindex])
4657
+ // tab.graphs[tab.versionindex] = null;
4658
+ }
4659
+
4660
+ void ImportGFD()
4661
+ {
4662
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4663
+ browser.show();
4664
+ String filename = browser.getFile();
4665
+ if (filename != null && filename.length() > 0)
4666
+ {
4667
+ String fullname = browser.getDirectory() + filename;
4668
+
4669
+ //Object3D readobj =
4670
+ objEditor.ReadGFD(fullname, objEditor);
4671
+ //makeSomething(readobj);
4672
+ }
4673
+ }
4674
+
4675
+ void ImportVRMLX3D()
4676
+ {
4677
+ if (Grafreed.standAlone)
4678
+ {
4679
+ /**/
4680
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4681
+ browser.show();
4682
+ String filename = browser.getFile();
4683
+ if (filename != null && filename.length() > 0)
4684
+ {
4685
+ String fullname = browser.getDirectory() + filename;
4686
+ LoadVRMLX3D(fullname);
4687
+ }
4688
+ /**/
4689
+ }
4690
+ }
4691
+
31774692 void ToggleAnimation()
31784693 {
31794694 if (!Globals.ANIMATION)
31804695 {
31814696 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3182
- browser.show();
4697
+ browser.setVisible(true);
31834698 String filename = browser.getFile();
31844699 if (filename != null && filename.length() > 0)
31854700 {
....@@ -3189,8 +4704,8 @@
31894704
31904705 Globals.ANIMATION ^= true;
31914706
3192
- GrafreeD.wav.cursor = 0;
3193
- GrafreeD.wav.loop = 0;
4707
+ Grafreed.wav.cursor = 0;
4708
+ Grafreed.wav.loop = 0;
31944709 }
31954710 } else
31964711 {
....@@ -3240,7 +4755,7 @@
32404755 void CreateMaterial()
32414756 {
32424757 //copy.ClearMaterial(); // PATCH
3243
- copy.CreateMaterialS(multiplyToggle.isSelected());
4758
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32444759 if (copy.selection.size() > 0)
32454760 //SetMaterial(copy);
32464761 {
....@@ -3291,7 +4806,7 @@
32914806 assert false;
32924807 }
32934808
3294
- void EditSelection()
4809
+ void EditSelection(boolean newWindow)
32954810 {
32964811 }
32974812
....@@ -3299,11 +4814,11 @@
32994814 {
33004815 copy.ResetBlockLoop(); // temporary problem
33014816
3302
- boolean random = CameraPane.RANDOM;
3303
- CameraPane.RANDOM = false; // parse everything
4817
+ boolean random = CameraPane.SWITCH;
4818
+ CameraPane.SWITCH = false; // parse everything
33044819 copy.ResetDisplayList();
33054820 copy.HardTouch();
3306
- CameraPane.RANDOM = random;
4821
+ CameraPane.SWITCH = random;
33074822 }
33084823
33094824 // public void applySelf()
....@@ -3333,6 +4848,12 @@
33334848 // else
33344849 // applySelf(true);
33354850 // }
4851
+
4852
+ boolean Equal(double a, double b)
4853
+ {
4854
+ return Math.abs(a - b) < 0.001;
4855
+ }
4856
+
33364857 void applySelf0(boolean name)
33374858 {
33384859 if (name)
....@@ -3350,7 +4871,7 @@
33504871 //copy.material = new cMaterial(copy.GetMaterial());
33514872
33524873 current.color = (float) colorField.getFloat();
3353
- current.modulation = (float) modulationField.getFloat();
4874
+ current.modulation = (float) saturationField.getFloat();
33544875 current.metalness = (float) metalnessField.getFloat();
33554876 current.diffuse = (float) diffuseField.getFloat();
33564877 current.specular = (float) specularField.getFloat();
....@@ -3377,6 +4898,59 @@
33774898 {
33784899 //System.out.println("Propagate = " + propagate);
33794900 copy.UpdateMaterial(anchor, current, propagate);
4901
+
4902
+ if (copy.material != null)
4903
+ {
4904
+ cMaterial mat = copy.material;
4905
+
4906
+ if (!Equal(colorField.getFloat(), mat.color))
4907
+ colorField.SetToolTipValue((mat.color));
4908
+ if (!Equal(saturationField.getFloat(), mat.modulation))
4909
+ saturationField.SetToolTipValue((mat.modulation));
4910
+ if (!Equal(metalnessField.getFloat(), mat.metalness))
4911
+ metalnessField.SetToolTipValue((mat.metalness));
4912
+ if (!Equal(diffuseField.getFloat(), mat.diffuse))
4913
+ diffuseField.SetToolTipValue((mat.diffuse));
4914
+ if (!Equal(specularField.getFloat(), mat.specular))
4915
+ specularField.SetToolTipValue((mat.specular));
4916
+ if (!Equal(shininessField.getFloat(), mat.shininess))
4917
+ shininessField.SetToolTipValue((mat.shininess));
4918
+ if (!Equal(shiftField.getFloat(), mat.shift))
4919
+ shiftField.SetToolTipValue((mat.shift));
4920
+ if (!Equal(ambientField.getFloat(), mat.ambient))
4921
+ ambientField.SetToolTipValue((mat.ambient));
4922
+ if (!Equal(lightareaField.getFloat(), mat.lightarea))
4923
+ lightareaField.SetToolTipValue((mat.lightarea));
4924
+ if (!Equal(diffusenessField.getFloat(), mat.factor))
4925
+ diffusenessField.SetToolTipValue((mat.factor));
4926
+ if (!Equal(velvetField.getFloat(), mat.velvet))
4927
+ velvetField.SetToolTipValue((mat.velvet));
4928
+ if (!Equal(sheenField.getFloat(), mat.sheen))
4929
+ sheenField.SetToolTipValue((mat.sheen));
4930
+ if (!Equal(subsurfaceField.getFloat(), mat.subsurface))
4931
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4932
+ if (!Equal(backlitField.getFloat(), mat.bump))
4933
+ backlitField.SetToolTipValue((mat.bump));
4934
+ if (!Equal(anisoField.getFloat(), mat.aniso))
4935
+ anisoField.SetToolTipValue((mat.aniso));
4936
+ if (!Equal(anisoVField.getFloat(), mat.anisoV))
4937
+ anisoVField.SetToolTipValue((mat.anisoV));
4938
+ if (!Equal(cameraField.getFloat(), mat.cameralight))
4939
+ cameraField.SetToolTipValue((mat.cameralight));
4940
+ if (!Equal(selfshadowField.getFloat(), mat.diffuseness))
4941
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4942
+ if (!Equal(shadowField.getFloat(), mat.shadow))
4943
+ shadowField.SetToolTipValue((mat.shadow));
4944
+ if (!Equal(textureField.getFloat(), mat.texture))
4945
+ textureField.SetToolTipValue((mat.texture));
4946
+ if (!Equal(opacityField.getFloat(), mat.opacity))
4947
+ opacityField.SetToolTipValue((mat.opacity));
4948
+ if (!Equal(fakedepthField.getFloat(), mat.fakedepth))
4949
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4950
+ if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))
4951
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
4952
+ }
4953
+
33804954 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
33814955 {
33824956 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3405,9 +4979,28 @@
34054979 //copy.Touch();
34064980 }
34074981
4982
+ cNumberSlider versionSlider;
4983
+
34084984 public void stateChanged(ChangeEvent e)
34094985 {
3410
- // assert(false);
4986
+ // assert(false);
4987
+ if (e.getSource() == versionSlider)
4988
+ {
4989
+ if (muteSlider)
4990
+ return;
4991
+
4992
+ Replace();
4993
+
4994
+ int version = versionSlider.getInteger();
4995
+
4996
+ if (version != -1 && copy.versionlist[version] != null)
4997
+ {
4998
+ copy.versionindex = version;
4999
+ CopyChanged();
5000
+ }
5001
+
5002
+ return;
5003
+ }
34115004
34125005 if (freezematerial)
34135006 {
....@@ -3421,6 +5014,7 @@
34215014 || e.getSource() == apertureField
34225015 || e.getSource() == shadowblurField)
34235016 {
5017
+ new Exception().printStackTrace();
34245018 System.exit(0);
34255019 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34265020 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3442,6 +5036,12 @@
34425036 {
34435037 //System.out.println("stateChanged = " + this);
34445038 materialtouched = true;
5039
+
5040
+ if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001)
5041
+ {
5042
+ saturationField.setFloat(1);
5043
+ }
5044
+
34455045 applySelf();
34465046 //System.out.println("this = " + this);
34475047 //System.out.println("PARENT = " + parent);
....@@ -3491,7 +5091,7 @@
34915091 }
34925092
34935093 if (normalpushField != null)
3494
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
5094
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
34955095 }
34965096
34975097 void SnapObject()
....@@ -3741,6 +5341,7 @@
37415341 {
37425342 if (GetTree() != null)
37435343 {
5344
+ GetTree().revalidate();
37445345 GetTree().repaint();
37455346 }
37465347
....@@ -3749,12 +5350,19 @@
37495350 ctrlPanel.validate(); // ? new
37505351 ctrlPanel.repaint();
37515352 }
5353
+
5354
+ if (previousVersionButton != null && copy.versionlist != null)
5355
+ SetVersionStates();
5356
+
5357
+ cameraView.requestFocusInWindow();
37525358 }
37535359
37545360 static TweenManager tweenManager = new TweenManager();
37555361
37565362 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37575363 {
5364
+ if (Globals.REPLACEONMAKE) // && resetmodel)
5365
+ Save();
37585366 //Tween.set(thing, 0).target(1).start(tweenManager);
37595367 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37605368 // if (thing instanceof GenericJointDemo)
....@@ -3778,7 +5386,7 @@
37785386 // group = (Composite) group.get(0);
37795387 // }
37805388
3781
- System.out.println("makeSomething of " + thing);
5389
+ //System.out.println("makeSomething of " + thing);
37825390
37835391 /*
37845392 if (deselect && jList != null)
....@@ -3841,6 +5449,12 @@
38415449 {
38425450 ResetModel();
38435451 Select(thing.GetTreePath(), true, false); // unselect... false);
5452
+
5453
+ if (thing.Size() == 0)
5454
+ {
5455
+ //EditSelection(false);
5456
+ }
5457
+
38445458 refreshContents();
38455459 }
38465460
....@@ -3958,6 +5572,7 @@
39585572 }
39595573 }
39605574 }
5575
+
39615576 LoadGFDThread loadGFDThread;
39625577
39635578 void ReadGFD(String fullname, iCallBack cb)
....@@ -3977,8 +5592,10 @@
39775592
39785593 try
39795594 {
5595
+ // Try compressed version first.
39805596 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
3981
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5597
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
5598
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
39825599
39835600 readobj = (Object3D) p.readObject();
39845601 istream.close();
....@@ -3986,7 +5603,22 @@
39865603 readobj.ResetDisplayList();
39875604 } catch (Exception e)
39885605 {
3989
- e.printStackTrace();
5606
+ if (!e.toString().contains("GZIP"))
5607
+ e.printStackTrace();
5608
+
5609
+ try
5610
+ {
5611
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
5612
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5613
+
5614
+ readobj = (Object3D) p.readObject();
5615
+ istream.close();
5616
+
5617
+ readobj.ResetDisplayList();
5618
+ } catch (Exception e2)
5619
+ {
5620
+ e2.printStackTrace();
5621
+ }
39905622 }
39915623 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
39925624 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4032,6 +5664,12 @@
40325664
40335665 void LoadIt(Object obj)
40345666 {
5667
+ if (obj == null)
5668
+ {
5669
+ // Invalid file
5670
+ return;
5671
+ }
5672
+
40355673 System.out.println("Loaded " + obj);
40365674 //new Exception().printStackTrace();
40375675 Object3D readobj = (Object3D) obj;
....@@ -4041,10 +5679,14 @@
40415679
40425680 if (readobj != null)
40435681 {
5682
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
5683
+ // Save();
40445684 try
40455685 {
40465686 //readobj.deepCopySelf(copy);
40475687 copy.clear(); // june 2014
5688
+ copy.skyboxname = readobj.skyboxname;
5689
+ copy.skyboxext = readobj.skyboxext;
40485690 for (int i = 0; i < readobj.size(); i++)
40495691 {
40505692 Object3D child = readobj.get(i); // reserve(i);
....@@ -4085,6 +5727,7 @@
40855727 }
40865728 } catch (ClassCastException e)
40875729 {
5730
+ e.printStackTrace();
40885731 assert (false);
40895732 Composite c = (Composite) copy;
40905733 c.children.clear();
....@@ -4095,17 +5738,32 @@
40955738 c.addChild(csg);
40965739 }
40975740
5741
+ copy.versionlist = readobj.versionlist;
5742
+ copy.versionindex = readobj.versionindex;
5743
+ copy.versiontable = readobj.versiontable;
5744
+
5745
+ if (copy.versionlist == null)
5746
+ {
5747
+ // Backward compatibility
5748
+ copy.versionlist = new Object3D[100];
5749
+ copy.versionindex = -1;
5750
+
5751
+ //Save(true);
5752
+ }
5753
+
5754
+ //? SetUndoStates();
5755
+
40985756 ResetModel();
40995757 copy.HardTouch(); // recompile?
41005758 refreshContents();
41015759 }
41025760 }
41035761
4104
- void load() // throws ClassNotFoundException
5762
+ void Open() // throws ClassNotFoundException
41055763 {
4106
- if (GrafreeD.standAlone)
5764
+ if (Grafreed.standAlone)
41075765 {
4108
- FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
5766
+ FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD);
41095767 browser.show();
41105768 String filename = browser.getFile();
41115769 if (filename != null && filename.length() > 0)
....@@ -4182,6 +5840,8 @@
41825840
41835841 void save()
41845842 {
5843
+ Replace();
5844
+
41855845 if (lastname == null)
41865846 {
41875847 return;
....@@ -4190,11 +5850,13 @@
41905850 try
41915851 {
41925852 FileOutputStream ostream = new FileOutputStream(lastname);
4193
- ObjectOutputStream p = new ObjectOutputStream(ostream);
5853
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5854
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
41945855
41955856 p.writeObject(copy);
41965857 p.flush();
41975858
5859
+ zstream.close();
41985860 ostream.close();
41995861
42005862 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4202,19 +5864,23 @@
42025864 //ps.print(buffer.toString());
42035865 } catch (IOException e)
42045866 {
5867
+ e.printStackTrace();
42055868 }
42065869 }
5870
+
42075871 String lastname;
42085872
42095873 void saveAs()
42105874 {
4211
- if (GrafreeD.standAlone)
5875
+ if (Grafreed.standAlone)
42125876 {
42135877 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42145878 browser.setVisible(true);
42155879 String filename = browser.getFile();
42165880 if (filename != null && filename.length() > 0)
42175881 {
5882
+ if (!filename.endsWith(".gfd"))
5883
+ filename += ".gfd";
42185884 lastname = browser.getDirectory() + filename;
42195885 save();
42205886 }
....@@ -4313,13 +5979,13 @@
43135979 try
43145980 {
43155981 FileOutputStream ostream = new FileOutputStream(filename);
4316
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4317
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
5982
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5983
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43185984
43195985 Object3D objectparent = obj.parent;
43205986 obj.parent = null;
43215987
4322
- Object3D object = (Object3D) GrafreeD.clone(obj);
5988
+ Object3D object = (Object3D) Grafreed.clone(obj);
43235989
43245990 obj.parent = objectparent;
43255991
....@@ -4331,8 +5997,8 @@
43315997 p.writeObject(object);
43325998 p.flush();
43335999
6000
+ zstream.close();
43346001 ostream.close();
4335
- // zstream.close();
43366002
43376003 // group.selection.get(0).parent = parent;
43386004 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4353,7 +6019,7 @@
43536019 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43546020 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43556021 copy.generatePOV(buffer);
4356
- if (GrafreeD.standAlone)
6022
+ if (Grafreed.standAlone)
43576023 {
43586024 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43596025 browser.show();
....@@ -4379,21 +6045,20 @@
43796045 Object3D client;
43806046 Object3D copy;
43816047 MenuBar menuBar;
4382
- Menu windowMenu;
4383
- MenuItem loadItem;
6048
+ Menu fileMenu;
6049
+ MenuItem newItem;
6050
+ MenuItem openItem;
43846051 MenuItem saveItem;
43856052 MenuItem saveAsItem;
43866053 MenuItem exportAsItem;
43876054 MenuItem reexportItem;
43886055 MenuItem povItem;
43896056 MenuItem closeItem;
4390
- Menu cameraMenu;
6057
+
43916058 CheckboxMenuItem zBufferItem;
43926059 //MenuItem normalLensItem;
4393
- MenuItem editCameraItem;
4394
- MenuItem revertCameraItem;
4395
- CheckboxMenuItem toggleLiveItem;
43966060 MenuItem stepItem;
6061
+ CheckboxMenuItem toggleLiveItem;
43976062 CheckboxMenuItem toggleFullScreenItem;
43986063 CheckboxMenuItem toggleTimelineItem;
43996064 CheckboxMenuItem toggleRenderItem;
....@@ -4402,25 +6067,41 @@
44026067 CheckboxMenuItem toggleFootContactItem;
44036068 CheckboxMenuItem toggleDLItem;
44046069 CheckboxMenuItem toggleTextureItem;
4405
- CheckboxMenuItem toggleRandomItem;
6070
+ CheckboxMenuItem toggleSwitchItem;
44066071 CheckboxMenuItem toggleRootItem;
44076072 CheckboxMenuItem animationItem;
6073
+ MenuItem archiveItem;
44086074 CheckboxMenuItem toggleHandleItem;
44096075 CheckboxMenuItem togglePaintItem;
44106076 JSplitPane mainPanel;
44116077 JScrollPane scrollpane;
6078
+
44126079 JPanel toolbarPanel;
4413
- JPanel treePanel;
6080
+
6081
+ cGridBag treePanel;
6082
+
44146083 JPanel radioPanel;
44156084 ButtonGroup buttonGroup;
4416
- cGridBag ctrlPanel;
6085
+
6086
+ cGridBag toolboxPanel;
6087
+ cGridBag skyboxPanel;
44176088 cGridBag materialPanel;
6089
+ cGridBag ctrlPanel;
6090
+
44186091 JScrollPane infoPanel;
6092
+
44196093 cGridBag optionsPanel;
6094
+
44206095 JTabbedPane objectPanel;
6096
+ boolean materialFlushed;
6097
+ Object3D latestObject;
6098
+
6099
+ cGridBag transformPanel;
44216100 cGridBag XYZPanel;
6101
+
44226102 JSplitPane gridPanel;
44236103 JSplitPane bigPanel;
6104
+
44246105 cGridBag bigThree;
44256106 cGridBag scenePanel;
44266107 cGridBag centralPanel;
....@@ -4478,7 +6159,7 @@
44786159 JLabel colorLabel;
44796160 cNumberSlider colorField;
44806161 JLabel modulationLabel;
4481
- cNumberSlider modulationField;
6162
+ cNumberSlider saturationField;
44826163 JLabel metalnessLabel;
44836164 cNumberSlider metalnessField;
44846165 JLabel diffuseLabel;
....@@ -4509,6 +6190,7 @@
45096190 cNumberSlider anisoField;
45106191 JLabel anisoVLabel;
45116192 cNumberSlider anisoVField;
6193
+
45126194 JLabel cameraLabel;
45136195 cNumberSlider cameraField;
45146196 JLabel selfshadowLabel;
....@@ -4523,6 +6205,7 @@
45236205 cNumberSlider fakedepthField;
45246206 JLabel shadowbiasLabel;
45256207 cNumberSlider shadowbiasField;
6208
+
45266209 JLabel bumpLabel;
45276210 cNumberSlider bumpField;
45286211 JLabel noiseLabel;
....@@ -4535,8 +6218,13 @@
45356218 cNumberSlider fogField;
45366219 JLabel opacityPowerLabel;
45376220 cNumberSlider opacityPowerField;
4538
- JTree jTree;
6221
+ cTree jTree;
45396222 //ObjectUI parent;
45406223
45416224 cNumberSlider normalpushField;
6225
+
6226
+ private MenuItem importGFDItem;
6227
+ private MenuItem importVRMLX3DItem;
6228
+ private MenuItem import3DSItem;
6229
+ private MenuItem importOBJItem;
45426230 }