Normand Briere
2019-08-19 22e8ab6479334206f97b0093f6c5ffd14610cce3
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,55 @@
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
+ if (Globals.ADVANCED)
464
+ {
465
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
466
+ importVRMLX3DItem.addActionListener(this);
467
+ }
468
+ menu.add("-");
469
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
470
+ importGFDItem.addActionListener(this);
471
+ fileMenu.add(menu);
472
+ fileMenu.add("-");
473
+
474
+ fileMenu.add(saveItem = new MenuItem("Save"));
475
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
277476 //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("-");
477
+ fileMenu.add("-");
478
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
479
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
480
+ fileMenu.add("-");
282481 if (client.parent != null)
283482 {
284
- windowMenu.add(closeItem = new MenuItem("Close"));
483
+ fileMenu.add(closeItem = new MenuItem("Close"));
285484 } else
286485 {
287
- windowMenu.add(closeItem = new MenuItem("Exit"));
486
+ fileMenu.add(closeItem = new MenuItem("Exit"));
288487 }
289488
290
- loadItem.addActionListener(this);
489
+ newItem.addActionListener(this);
490
+ openItem.addActionListener(this);
291491 saveItem.addActionListener(this);
292492 saveAsItem.addActionListener(this);
293493 exportAsItem.addActionListener(this);
....@@ -295,82 +495,103 @@
295495 //povItem.addActionListener(this);
296496 closeItem.addActionListener(this);
297497
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
-
353498 objectPanel = new JTabbedPane();
499
+
500
+ ChangeListener changeListener = new ChangeListener()
501
+ {
502
+ //String name;
503
+
504
+ public void stateChanged(ChangeEvent changeEvent)
505
+ {
506
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
507
+// {
508
+// if (latestObject != null)
509
+// {
510
+// refreshContents(true);
511
+// SetMaterial(latestObject);
512
+// }
513
+//
514
+// materialFlushed = true;
515
+// }
516
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
517
+// {
518
+// if (listUI.size() == 0)
519
+// EditSelection(false);
520
+// }
521
+
522
+// if (objectPanel.getSelectedIndex() == 4)
523
+// {
524
+// name = copy.skyboxname;
525
+//
526
+// if (name == null)
527
+// {
528
+// name = "";
529
+// }
530
+//
531
+// copy.skyboxname = "cubemaps/default-skyboxes/rgb";
532
+// copy.skyboxext = "jpg";
533
+// }
534
+// else
535
+// {
536
+// if (name != null)
537
+// {
538
+// if (name.equals(""))
539
+// {
540
+// copy.skyboxname = null;
541
+// copy.skyboxext = null;
542
+// }
543
+// else
544
+// {
545
+// copy.skyboxname = name;
546
+// }
547
+// }
548
+// }
549
+ cameraView.transformMode = objectPanel.getSelectedIndex() == 4;
550
+
551
+// refreshContents(false); // To refresh Info tab
552
+ cameraView.repaint();
553
+ }
554
+ };
555
+ objectPanel.addChangeListener(changeListener);
556
+
354557 toolbarPanel = new JPanel();
355558 toolbarPanel.setName("Toolbar");
356
- treePanel = new JPanel();
559
+
560
+ treePanel = new cGridBag();
357561 treePanel.setName("Tree");
358
- ctrlPanel = new cGridBag(); // new GridBagLayout());
359
- ctrlPanel.setName("Edit");
360
- materialPanel = new cGridBag().setVertical(true);
361
- materialPanel.setName("Material");
562
+
563
+ editPanel = new cGridBag().setVertical(true);
564
+ //editPanel.setName("Edit");
565
+
566
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
567
+
568
+ editCommandsPanel = new cGridBag();
569
+ editPanel.add(editCommandsPanel);
570
+ editPanel.add(ctrlPanel);
571
+
572
+ toolboxPanel = new cGridBag().setVertical(true);
573
+ //toolboxPanel.setName("Toolbox");
574
+
575
+ skyboxPanel = new cGridBag().setVertical(true);
576
+
577
+ materialPanel = new cGridBag().setVertical(false);
578
+ //materialPanel.setName("Material");
579
+
362580 /*JTextPane*/
363581 infoarea = createTextPane();
582
+ doc = infoarea.getStyledDocument();
583
+
364584 infoarea.setEditable(true);
365585 SetText();
586
+
366587 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
367588 // infoarea.setOpaque(false);
368589 // //infoarea.setForeground(textcolor);
369
- infoarea.setLineWrap(true);
370
- infoarea.setWrapStyleWord(true);
590
+// TEXTAREA infoarea.setLineWrap(true);
591
+// TEXTAREA infoarea.setWrapStyleWord(true);
371592 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");
593
+ infoPanel.setPreferredSize(new Dimension(1, 1));
594
+ //infoPanel.setName("Info");
374595 //infoPanel.setLayout(new BorderLayout());
375596 //infoPanel.add(createTextPane());
376597
....@@ -378,15 +599,22 @@
378599 mainPanel.setName("Main");
379600 mainPanel.setContinuousLayout(true);
380601 mainPanel.setOneTouchExpandable(true);
381
- mainPanel.setDividerLocation(1.0);
382602 mainPanel.setDividerSize(9);
383
- mainPanel.setResizeWeight(0);
384
-
603
+ mainPanel.setDividerLocation(0.5); //1.0);
604
+ mainPanel.setResizeWeight(0.5);
605
+
606
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
607
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
608
+ divider.setDividerSize(15);
609
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
610
+
611
+ mainPanel.setUI(new BasicSplitPaneUI());
612
+
385613 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
386614 //mainPanel.setLayout(new GridBagLayout());
387615 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388
- treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
616
+// treePanel.setLayout(new GridBagLayout());
617
+ //ctrlPanel.setLayout(new GridBagLayout());
390618 //materialPanel.setLayout(new GridBagLayout());
391619
392620 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
....@@ -426,7 +654,7 @@
426654 static String newline = "\n";
427655 protected static final String buttonString = "JButton";
428656 StyledDocument doc;
429
- JTextArea infoarea;
657
+ JTextPane infoarea;
430658
431659 void ClearInfo()
432660 {
....@@ -449,10 +677,10 @@
449677 e.printStackTrace();
450678 }
451679
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();
680
+// String selection = infoarea.getText();
681
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
682
+// java.awt.datatransfer.Clipboard clipboard =
683
+// Toolkit.getDefaultToolkit().getSystemClipboard();
456684 //clipboard.setContents(data, data);
457685 }
458686
....@@ -475,13 +703,13 @@
475703 //SendInfo("Name:", "bold");
476704 if (sel.GetTextures() != null || debug)
477705 {
478
- si.SendInfo(sel.toString(), "bold");
706
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
479707 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
480708 if (sel.Size() > 0)
481709 {
482710 si.SendInfo("#children = " + sel.Size(), "regular");
483711 }
484
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
712
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
485713 if (debug)
486714 {
487715 try
....@@ -493,7 +721,10 @@
493721 }
494722
495723 if (full)
496
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
724
+ {
725
+ si.SendInfo(" BBox min: " + minima, "regular");
726
+ si.SendInfo(" BBox max: " + maxima, "regular");
727
+ }
497728
498729 if (sel.bRep != null)
499730 {
....@@ -520,7 +751,7 @@
520751 }
521752 if (sel.support != null)
522753 {
523
- si.SendInfo(" support: " + sel.support, "regular");
754
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
524755 }
525756 if (sel.scriptnode != null)
526757 {
....@@ -591,6 +822,9 @@
591822 {
592823 CameraPane.pointflow = (PointFlow) sel;
593824 }
825
+
826
+ si.SendInfo("_____________________", "regular");
827
+ si.SendInfo("", "regular");
594828 }
595829 }
596830
....@@ -606,68 +840,216 @@
606840 }
607841 }
608842
843
+//static GraphicsDevice device = GraphicsEnvironment
844
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
845
+
846
+ Rectangle keeprect;
847
+ cRadio radio;
848
+
849
+cButton keepButton;
850
+ cButton twoButton; // Full 3D
851
+ cButton sixButton;
852
+ cButton threeButton;
853
+ cButton sevenButton;
854
+ cButton fourButton; // full panel
855
+ cButton oneButton; // full XYZ
856
+ //cButton currentLayout;
857
+
858
+ boolean maximized;
859
+
860
+ cButton fullscreenLayout;
861
+ cButton expandedLayout;
862
+
863
+ void Minimize()
864
+ {
865
+ frame.setState(Frame.ICONIFIED);
866
+ frame.validate();
867
+ }
868
+
869
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
870
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
871
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
872
+ void Maximize()
873
+ {
874
+ if (CameraPane.FULLSCREEN)
875
+ {
876
+ ToggleFullScreen();
877
+ }
878
+
879
+ if (maximized)
880
+ {
881
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
882
+ }
883
+ else
884
+ {
885
+ keeprect = frame.getBounds();
886
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
887
+// Dimension rect2 = frame.getToolkit().getScreenSize();
888
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
889
+// frame.setState(Frame.MAXIMIZED_BOTH);
890
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
891
+ }
892
+
893
+ maximized ^= true;
894
+
895
+ frame.validate();
896
+ }
897
+
898
+ cButton minButton;
899
+ cButton maxButton;
900
+ cButton fullButton;
901
+ cButton collapseButton;
902
+ cButton maximize3DButton;
903
+
609904 void ToggleFullScreen()
610905 {
611
- if (CameraPane.FULLSCREEN)
906
+ GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
907
+
908
+ cameraView.ToggleFullScreen();
909
+
910
+ if (!CameraPane.FULLSCREEN)
612911 {
613
- frame.getContentPane().remove(/*"Center",*/bigThree);
614
- framePanel.add(bigThree);
615
- frame.getContentPane().add(/*"Center",*/framePanel);
912
+ device.setFullScreenWindow(null);
913
+ frame.dispose();
914
+ frame.setUndecorated(false);
915
+ frame.validate();
916
+ frame.setVisible(true);
917
+
918
+ //frame.setVisible(false);
919
+// frame.removeNotify();
920
+// frame.setUndecorated(false);
921
+// frame.addNotify();
922
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
923
+
924
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
925
+// X framePanel.add(bigThree);
926
+// X frame.getContentPane().add(/*"Center",*/framePanel);
927
+// framePanel.setDividerLocation(46); // icons are 24x24
928
+
929
+ //frame.setVisible(true);
930
+// radio.layout = keepButton;
931
+ //theFrame = null;
932
+ keepButton = null;
933
+// radio.layout.doClick();
934
+
616935 } else
617936 {
618
- frame.getContentPane().remove(/*"Center",*/framePanel);
619
- framePanel.remove(bigThree);
620
- frame.getContentPane().add(/*"Center",*/bigThree);
937
+ keepButton = radio.layout;
938
+ //keeprect = frame.getBounds();
939
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
940
+// frame.getToolkit().getScreenSize().height);
941
+ //frame.setVisible(false);
942
+
943
+ frame.dispose();
944
+ frame.setUndecorated(true);
945
+ device.setFullScreenWindow(frame);
946
+ frame.validate();
947
+ frame.setVisible(true);
948
+// frame.removeNotify();
949
+// frame.setUndecorated(true);
950
+// frame.addNotify();
951
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
952
+// X framePanel.remove(bigThree);
953
+// X frame.getContentPane().add(/*"Center",*/bigThree);
954
+// framePanel.setDividerLocation(0);
955
+
956
+// radio.layout = fullscreenLayout;
957
+// radio.layout.doClick();
958
+ //frame.setVisible(true);
621959 }
622
- cameraView.ToggleFullScreen();
960
+ frame.validate();
961
+
962
+ cameraView.requestFocusInWindow();
623963 }
624964
625
- private JTextArea createTextPane()
965
+ void CollapseToolbar()
966
+ {
967
+ framePanel.setDividerLocation(0);
968
+ //frame.validate();
969
+
970
+ cameraView.requestFocusInWindow();
971
+ }
972
+
973
+ private Object3D Duplicate(Object3D object)
626974 {
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
- };
975
+ boolean temp = CameraPane.SWITCH;
976
+ CameraPane.SWITCH = false;
977
+
978
+ if (Grafreed.grafreed.universe.versiontable == null)
979
+ Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
980
+
981
+ object.ExtractBigData(Grafreed.grafreed.universe.versiontable);
982
+ // if (copy == client)
983
+
984
+ Object3D versions[] = object.versionlist;
985
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe
986
+ object.versionlist = null;
987
+ object.versiontable = null;
988
+
989
+ Object3D parent = object.parent;
990
+ object.parent = null;
991
+
992
+ //byte[] compress = Compress(copy);
993
+ Object3D compress = (Object3D)Grafreed.clone(object);
994
+
995
+ object.parent = parent;
996
+
997
+ object.versionlist = versions;
998
+ object.versiontable = versiontable; // if Grafreed.grafreed.universe
999
+
1000
+ object.RestoreBigData(Grafreed.grafreed.universe.versiontable);
1001
+
1002
+ CameraPane.SWITCH = temp;
1003
+
1004
+ return compress;
1005
+ }
6421006
643
- String[] initStyles =
644
- {
645
- "regular", "italic", "bold", "small", "large",
646
- "regular", "button", "regular", "icon",
647
- "regular"
648
- };
1007
+ private JTextPane createTextPane()
1008
+ {
1009
+// TEXTAREA String[] initString =
1010
+// {
1011
+// "This is an editable JTextPane, ", //regular
1012
+// "another ", //italic
1013
+// "styled ", //bold
1014
+// "text ", //small
1015
+// "component, ", //large
1016
+// "which supports embedded components..." + newline,//regular
1017
+// " " + newline, //button
1018
+// "...and embedded icons..." + newline, //regular
1019
+// " ", //icon
1020
+// newline + "JTextPane is a subclass of JEditorPane that "
1021
+// + "uses a StyledEditorKit and StyledDocument, and provides "
1022
+// + "cover methods for interacting with those objects."
1023
+// };
1024
+//
1025
+// String[] initStyles =
1026
+// {
1027
+// "regular", "italic", "bold", "small", "large",
1028
+// "regular", "button", "regular", "icon",
1029
+// "regular"
1030
+// };
1031
+//
1032
+// JTextPane textPane = new JTextPane();
1033
+// textPane.setEditable(true);
1034
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
1035
+// addStylesToDocument(doc);
1036
+//
1037
+// try
1038
+// {
1039
+// for (int j = 0; j < 2; j++)
1040
+// {
1041
+// for (int i = 0; i < initString.length; i++)
1042
+// {
1043
+// doc.insertString(doc.getLength(), initString[i],
1044
+// doc.getStyle(initStyles[i]));
1045
+// }
1046
+// }
1047
+// } catch (BadLocationException ble)
1048
+// {
1049
+// System.err.println("Couldn't insert initial text into text pane.");
1050
+// }
6491051
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;
1052
+ return new JTextPane(); // textPane;
6711053 }
6721054
6731055 protected void addStylesToDocument(StyledDocument doc)
....@@ -720,7 +1102,7 @@
7201102 protected static ImageIcon createImageIcon(String path,
7211103 String description)
7221104 {
723
- java.net.URL imgURL = GrafreeD.class.getResource(path);
1105
+ java.net.URL imgURL = Grafreed.class.getResource(path);
7241106 if (imgURL != null)
7251107 {
7261108 return new ImageIcon(imgURL, description);
....@@ -743,6 +1125,7 @@
7431125 {
7441126 SetupMaterial(materialPanel);
7451127 }
1128
+
7461129 //SetupName();
7471130 //SetupViews();
7481131 }
....@@ -752,6 +1135,7 @@
7521135 // NumberSlider vDivsField;
7531136 // JCheckBox endcaps;
7541137 JCheckBox liveCB;
1138
+ JCheckBox selectableCB;
7551139 JCheckBox hideCB;
7561140 JCheckBox link2masterCB;
7571141 JCheckBox markCB;
....@@ -759,7 +1143,12 @@
7591143 JCheckBox speedupCB;
7601144 JCheckBox rewindCB;
7611145 JCheckBox flipVCB;
1146
+
1147
+ cCheckBox toggleTextureCB;
1148
+ cCheckBox toggleSwitchCB;
1149
+
7621150 JComboBox texresMenu;
1151
+
7631152 JButton resetButton;
7641153 JButton stepButton;
7651154 JButton stepAllButton;
....@@ -767,54 +1156,48 @@
7671156 JButton slowerButton;
7681157 JButton fasterButton;
7691158 JButton remarkButton;
1159
+
1160
+ cGridBag editPanel;
1161
+ cGridBag editCommandsPanel;
1162
+
1163
+ cGridBag namePanel;
1164
+ cGridBag setupPanel;
1165
+ cGridBag setupPanel2;
1166
+ cGridBag objectCommandsPanel;
1167
+ cGridBag pushPanel;
1168
+ cGridBag fillPanel;
7701169
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
1170
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
7721171 {
7731172 JCheckBox cb;
7741173
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);
1174
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7801175 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
7841176
7851177 return cb;
7861178 }
7871179
788
- cButton AddButton(ObjEditor oe, String label)
1180
+ cButton AddButton(cGridBag panel, String label)
7891181 {
7901182 cButton cb;
7911183
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);
1184
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
7971185 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
8011186
8021187 return cb;
8031188 }
8041189
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
1190
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
8061191 {
8071192 JComboBox combo;
8081193
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;
1194
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8121195 combo.addActionListener(this);
8131196
8141197 return combo;
8151198 }
8161199
817
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, double min, double max, double current, double pow)
1200
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
8181201 {
8191202 cGridBag control = new cGridBag();
8201203
....@@ -826,12 +1209,12 @@
8261209 control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8271210 combo.setFloat(current);
8281211
829
- ctrlPanel.add(control);
1212
+ panel.add(control);
8301213
831
- return combo;
1214
+ return control;
8321215 }
8331216
834
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, int min, int max, int current)
1217
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
8351218 {
8361219 cGridBag control = new cGridBag();
8371220
....@@ -839,25 +1222,21 @@
8391222
8401223 JLabel jlabel = new JLabel(label);
8411224 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);
1225
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1226
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8441227 combo.setInteger(current);
8451228
846
- ctrlPanel.add(control);
1229
+ panel.add(control);
8471230
848
- return combo;
1231
+ return control;
8491232 }
8501233
8511234 JTextArea AddText(cGridBag ctrlPanel, String name)
8521235 {
8531236 JTextArea text;
8541237
855
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
856
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
8571238 ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8581239 text.addCaretListener(this);
859
- aConstraints.gridx += 1;
860
- aConstraints.gridwidth = 1;
8611240
8621241 return text;
8631242 }
....@@ -896,7 +1275,7 @@
8961275
8971276 /*
8981277 */
899
- void Return() // ObjEditor oe)
1278
+ void Return0() // ObjEditor oe)
9001279 {
9011280 aConstraints.gridy += 1;
9021281 aConstraints.gridx = 0;
....@@ -951,37 +1330,92 @@
9511330
9521331 void SetupUI2(ObjEditor oe)
9531332 {
954
-// oe.aConstraints.weightx = 0;
955
-// oe.aConstraints.weighty = 0;
956
-// oe.aConstraints.gridx = 0;
957
-// oe.aConstraints.gridy = 0;
958
- SetupName(oe);
1333
+ //SetupName(oe);
9591334
960
- if (!GroupEditor.allparams)
1335
+ namePanel = new cGridBag();
1336
+
1337
+ //if (copy.pinned)
1338
+ {
1339
+ pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF);
1340
+ pinButton.setSelected(copy.pinned);
1341
+ cGridBag t = new cGridBag();
1342
+ t.preferredWidth = 2;
1343
+ t.add(pinButton);
1344
+ namePanel.add(t);
1345
+
1346
+ pinButton.addItemListener(this);
1347
+ }
1348
+
1349
+ nameField = AddText(namePanel, copy.GetName());
1350
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
1351
+ oe.ctrlPanel.add(namePanel);
1352
+
1353
+ oe.ctrlPanel.Return();
1354
+
1355
+ if (!allparams)
9611356 return;
9621357
963
- liveCB = AddCheckBox(oe, "Live", copy.live);
964
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
965
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1358
+ setupPanel = new cGridBag().setVertical(false);
1359
+
1360
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1361
+ liveCB.setToolTipText("Animate object");
1362
+ markCB = AddCheckBox(setupPanel, "Anim", copy.marked);
1363
+ markCB.setToolTipText("Set target transform");
1364
+ selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1365
+ selectableCB.setToolTipText("Make object selectable");
9661366 // 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");
1367
+
1368
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1369
+ hideCB.setToolTipText("Hide object");
1370
+
1371
+ ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
1372
+
1373
+ setupPanel2 = new cGridBag().setVertical(false);
1374
+
1375
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1376
+ rewindCB.setToolTipText("Rewind animation");
1377
+
1378
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1379
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
1380
+
1381
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1382
+ link2masterCB.setToolTipText("Attach to support");
1383
+
1384
+ if (Globals.ADVANCED)
1385
+ {
1386
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1387
+ speedupCB.setToolTipText("Option motion capture");
1388
+ }
1389
+
1390
+ oe.ctrlPanel.add(setupPanel);
1391
+ oe.ctrlPanel.Return();
1392
+ oe.ctrlPanel.add(setupPanel2);
1393
+ oe.ctrlPanel.Return();
1394
+
1395
+ objectCommandsPanel = new cGridBag().setVertical(false);
1396
+
1397
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1398
+ resetButton.setToolTipText("Jump to frame zero");
1399
+ stepButton = AddButton(objectCommandsPanel, "Step");
1400
+ stepButton.setToolTipText("Step one frame");
9731401 // resetAllButton = AddButton(oe, "Reset All");
9741402 // stepAllButton = AddButton(oe, "Step All");
975
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9761403 // Return();
977
- slowerButton = AddButton(oe, "Slow");
978
- fasterButton = AddButton(oe, "Fast");
979
- remarkButton = AddButton(oe, "Rem");
1404
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1405
+ slowerButton.setToolTipText("Decrease animation speed");
1406
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1407
+ fasterButton.setToolTipText("Increase animation speed");
1408
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1409
+ remarkButton.setToolTipText("Set the current transform as the target");
9801410
981
- //Return();
1411
+ oe.ctrlPanel.add(objectCommandsPanel);
1412
+ oe.ctrlPanel.Return();
9821413
983
- //normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
1414
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1415
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
9841416 //Return();
1417
+
1418
+ oe.ctrlPanel.Return();
9851419
9861420 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871421 // ObjEditor.aConstraints.gridx += 1;
....@@ -1076,7 +1510,7 @@
10761510 oe.aConstraints.gridwidth = 1;
10771511 /**/
10781512 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1513
+ oe.ctrlPanel.Return();
10801514
10811515 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821516 //textureButton.setEnabled(false);
....@@ -1134,22 +1568,9 @@
11341568
11351569 if (cam == null || !(copy.get(0) instanceof cGroup))
11361570 {
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);
1571
+ if (Globals.DEBUG)
1572
+ System.out.println("CREATE CAMERAS");
1573
+ cams = CreateCameras();
11531574 } else
11541575 {
11551576 cams = (cGroup) copy.get(0);
....@@ -1180,8 +1601,11 @@
11801601 //worldPanel.setName("World");
11811602 centralPanel = new cGridBag();
11821603 centralPanel.preferredWidth = 20;
1183
- timelinePanel = new JPanel(new BorderLayout());
1184
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1604
+
1605
+ if (Globals.ADVANCED)
1606
+ {
1607
+ timelinePanel = new JPanel(new BorderLayout());
1608
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11851609
11861610 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
11871611 cameraPanel.setContinuousLayout(true);
....@@ -1190,7 +1614,10 @@
11901614 // cameraPanel.setDividerSize(9);
11911615 cameraPanel.setResizeWeight(1.0);
11921616
1617
+ }
1618
+
11931619 centralPanel.add(cameraView);
1620
+ centralPanel.setFocusable(true);
11941621 //frame.setJMenuBar(timelineMenubar);
11951622 //centralPanel.add(timelinePanel);
11961623
....@@ -1209,6 +1636,45 @@
12091636 //frontView.object = copy;
12101637 //sideView.object = copy;
12111638
1639
+ transformPanel = new cGridBag().setVertical(true);
1640
+
1641
+ cGridBag resetTransformPanel = new cGridBag();
1642
+
1643
+ resetTransformPanel.preferredHeight = 2;
1644
+
1645
+ cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF);
1646
+ resetTransform.setToolTipText("Reset Translation, Rotation and Scale");
1647
+ resetTransform.addMouseListener(new MouseAdapter()
1648
+ {
1649
+ public void mouseClicked(MouseEvent e)
1650
+ {
1651
+ ResetTransform();
1652
+ }
1653
+ });
1654
+ resetTransformPanel.add(resetTransform);
1655
+
1656
+ resetTransform = GetButton("T only", !Globals.NIMBUSLAF);
1657
+ resetTransform.setToolTipText("Reset Translation only");
1658
+ resetTransform.addMouseListener(new MouseAdapter()
1659
+ {
1660
+ public void mouseClicked(MouseEvent e)
1661
+ {
1662
+ ResetTransform(1);
1663
+ }
1664
+ });
1665
+ resetTransformPanel.add(resetTransform);
1666
+
1667
+ resetTransform = GetButton("RS only", !Globals.NIMBUSLAF);
1668
+ resetTransform.setToolTipText("Reset Rotation and Scale only");
1669
+ resetTransform.addMouseListener(new MouseAdapter()
1670
+ {
1671
+ public void mouseClicked(MouseEvent e)
1672
+ {
1673
+ ResetTransform(2);
1674
+ }
1675
+ });
1676
+ resetTransformPanel.add(resetTransform);
1677
+
12121678 XYZPanel = new cGridBag().setVertical(true);
12131679 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12141680
....@@ -1216,7 +1682,11 @@
12161682 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
12171683 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
12181684 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1685
+ //XYZPanel.setName("XYZ");
12191686
1687
+ transformPanel.add(resetTransformPanel);
1688
+ transformPanel.add(XYZPanel);
1689
+
12201690 /*
12211691 gridPanel = new JPanel(); //new BorderLayout());
12221692 gridPanel.setLayout(new GridLayout(1, 2));
....@@ -1224,12 +1694,12 @@
12241694 gridPanel.add(cameraView);
12251695 gridPanel.add(XYZPanel);
12261696 */
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);
1697
+// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1698
+// gridPanel.setContinuousLayout(true);
1699
+// gridPanel.setOneTouchExpandable(true);
1700
+// gridPanel.setDividerLocation(1.0);
1701
+// gridPanel.setDividerSize(9);
1702
+// gridPanel.setResizeWeight(0.85);
12331703
12341704 // aConstraints.weighty = 0;
12351705 //System.out.println("THIS = " + this);
....@@ -1252,13 +1722,34 @@
12521722
12531723 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12541724 //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);
1725
+ objectPanel.add(skyboxPanel);
1726
+ objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg"));
1727
+ objectPanel.setToolTipTextAt(0, "Backgrounds");
1728
+
1729
+ objectPanel.add(toolboxPanel);
1730
+ objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
1731
+ objectPanel.setToolTipTextAt(1, "Objects & textures");
12611732
1733
+ objectPanel.add(materialPanel);
1734
+ objectPanel.setIconAt(2, GetIcon("icons/material.png"));
1735
+ objectPanel.setToolTipTextAt(2, "Material");
1736
+
1737
+// JPanel north = new JPanel(new BorderLayout());
1738
+// north.setName("Edit");
1739
+// north.add(ctrlPanel, BorderLayout.NORTH);
1740
+// objectPanel.add(north);
1741
+ objectPanel.add(editPanel);
1742
+ objectPanel.setIconAt(3, GetIcon("icons/writewhite.png"));
1743
+ objectPanel.setToolTipTextAt(3, "Edit controls");
1744
+
1745
+ objectPanel.add(transformPanel);
1746
+ objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1747
+ objectPanel.setToolTipTextAt(4, "TRS transform");
1748
+
1749
+ patchMaterial = true;
1750
+ cameraView.patchMaterial = this;
1751
+ objectPanel.setSelectedIndex(2);
1752
+
12621753 /*
12631754 aConstraints.gridx = 0;
12641755 aConstraints.gridwidth = 1;
....@@ -1266,7 +1757,7 @@
12661757 aConstraints.gridy += 1;
12671758 aConstraints.gridwidth = 1;
12681759 mainPanel.add(objectPanel, aConstraints);
1269
- */
1760
+ */
12701761
12711762 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12721763 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1278,22 +1769,119 @@
12781769 scrollpane.addMouseWheelListener(this); // Default not fast enough
12791770
12801771 /*JTabbedPane*/ scenePanel = new cGridBag();
1281
- scenePanel.preferredWidth = 7;
1772
+ scenePanel.preferredWidth = 6;
12821773
12831774 JTabbedPane tabbedPane = new JTabbedPane();
12841775 tabbedPane.add(scrollpane);
12851776
1286
- tabbedPane.add(FSPane = new cFileSystemPane(this));
1287
-
1288
- optionsPanel = new cGridBag().setVertical(true);
1777
+ optionsPanel = new cGridBag().setVertical(false);
12891778
12901779 optionsPanel.setName("Options");
12911780
12921781 AddOptions(optionsPanel); //, aConstraints);
12931782
1783
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
1784
+
12941785 tabbedPane.add(optionsPanel);
12951786
12961787 scenePanel.add(tabbedPane);
1788
+
1789
+ cGridBag creditsPanel = new cGridBag().setVertical(true);
1790
+ creditsPanel.setName("Credits");
1791
+
1792
+ cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1793
+ creditsPanel.add(ogaLabel);
1794
+
1795
+ cButton creditButton;
1796
+ creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
1797
+ creditButton.setToolTipText("https://opengameart.org");
1798
+
1799
+ creditButton.addMouseListener(new MouseAdapter()
1800
+ {
1801
+ public void mouseClicked(MouseEvent e)
1802
+ {
1803
+ try
1804
+ {
1805
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
1806
+ } catch (Exception e1)
1807
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1808
+ {
1809
+ e1.printStackTrace();
1810
+ }
1811
+ }
1812
+ });
1813
+
1814
+ ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF);
1815
+ creditsPanel.add(ogaLabel);
1816
+
1817
+ creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF));
1818
+ creditButton.setToolTipText("https://3delicious.net");
1819
+
1820
+ creditButton.addMouseListener(new MouseAdapter()
1821
+ {
1822
+ public void mouseClicked(MouseEvent e)
1823
+ {
1824
+ try
1825
+ {
1826
+ Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net"));
1827
+ } catch (Exception e1)
1828
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1829
+ {
1830
+ e1.printStackTrace();
1831
+ }
1832
+ }
1833
+ });
1834
+
1835
+ creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF));
1836
+ creditButton.setToolTipText("https://archive3d.net");
1837
+
1838
+ creditButton.addMouseListener(new MouseAdapter()
1839
+ {
1840
+ public void mouseClicked(MouseEvent e)
1841
+ {
1842
+ try
1843
+ {
1844
+ Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net"));
1845
+ } catch (Exception e1)
1846
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1847
+ {
1848
+ e1.printStackTrace();
1849
+ }
1850
+ }
1851
+ });
1852
+
1853
+ creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF));
1854
+ creditButton.setToolTipText("https://turbosquid.com");
1855
+
1856
+ creditButton.addMouseListener(new MouseAdapter()
1857
+ {
1858
+ public void mouseClicked(MouseEvent e)
1859
+ {
1860
+ try
1861
+ {
1862
+ Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free"));
1863
+ } catch (Exception e1)
1864
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1865
+ {
1866
+ e1.printStackTrace();
1867
+ }
1868
+ }
1869
+ });
1870
+
1871
+ for (int i=6; --i>=0;)
1872
+ {
1873
+ creditsPanel.add(new cGridBag());
1874
+ }
1875
+
1876
+ tabbedPane.add(creditsPanel);
1877
+ tabbedPane.setToolTipTextAt(3, "Credits");
1878
+
1879
+ if (Globals.ADVANCED)
1880
+ {
1881
+ tabbedPane.add(infoPanel);
1882
+ tabbedPane.setIconAt(4, GetIcon("icons/info.png"));
1883
+ tabbedPane.setToolTipTextAt(4, "Information");
1884
+ }
12971885
12981886 /*
12991887 cTree jTree = new cTree(null);
....@@ -1315,13 +1903,13 @@
13151903 jtp.add(tree);
13161904 */
13171905
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");
1906
+// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1907
+// bigPanel.setContinuousLayout(true);
1908
+// bigPanel.setOneTouchExpandable(true);
1909
+// bigPanel.setDividerLocation(0.8);
1910
+// bigPanel.setDividerSize(15);
1911
+// bigPanel.setResizeWeight(0.15);
1912
+// bigPanel.setName("Scene");
13251913
13261914 //bigPanel.setLayout(new BorderLayout());
13271915 //bigPanel.setSize(new Dimension(10,10));
....@@ -1356,7 +1944,7 @@
13561944 bigThree = new cGridBag();
13571945 bigThree.addComponent(scenePanel);
13581946 bigThree.addComponent(centralPanel);
1359
- bigThree.addComponent(XYZPanel);
1947
+ //bigThree.addComponent(XYZPanel);
13601948
13611949 // // SIDE EFFECT!!!
13621950 // aConstraints.gridx = 0;
....@@ -1365,16 +1953,33 @@
13651953 // aConstraints.gridheight = 1;
13661954
13671955 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1368
- framePanel.setContinuousLayout(true);
1369
- framePanel.setOneTouchExpandable(true);
1370
- framePanel.setDividerLocation(0.8);
1956
+
1957
+ framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,
1958
+ new java.beans.PropertyChangeListener()
1959
+ {
1960
+ public void propertyChange(java.beans.PropertyChangeEvent pce)
1961
+ {
1962
+ if ((Integer)pce.getOldValue() == 1)
1963
+ {
1964
+ if (radio.layout != expandedLayout)
1965
+ {
1966
+ radio.layout = expandedLayout;
1967
+ radio.layout.doClick();
1968
+ }
1969
+ }
1970
+ }
1971
+ });
1972
+
1973
+ framePanel.setContinuousLayout(false);
1974
+ framePanel.setOneTouchExpandable(false);
1975
+ //.setDividerLocation(0.8);
13711976 //framePanel.setDividerSize(15);
13721977 //framePanel.setResizeWeight(0.15);
13731978 framePanel.setName("Frame");
13741979
13751980 frame.getContentPane().setLayout(new BorderLayout());
13761981 /**/
1377
- JTabbedPane worldPane = new JTabbedPane();
1982
+ //JTabbedPane worldPane = new JTabbedPane();
13781983 //worldPane.add(bigPanel);
13791984 //worldPane.add(worldPanel);
13801985 /**/
....@@ -1384,15 +1989,19 @@
13841989
13851990 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13861991
1387
- frame.setSize(1024, 768);
1388
- frame.show();
1992
+ frame.setSize(1280, 860);
1993
+
1994
+ cameraView.requestFocusInWindow();
1995
+
1996
+// gridPanel.setDividerLocation(1.0);
1997
+
1998
+ frame.validate();
13891999
1390
- gridPanel.setDividerLocation(1.0);
2000
+ frame.setVisible(true);
13912001
13922002 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
13932003 frame.addWindowListener(new WindowAdapter()
13942004 {
1395
-
13962005 public void windowClosing(WindowEvent e)
13972006 {
13982007 Close();
....@@ -1415,27 +2024,449 @@
14152024 ctrlPanel.removeAll();
14162025 }
14172026
1418
- void SetupMaterial(cGridBag ctrlPanel)
2027
+ void SetupMaterial(cGridBag materialpanel)
14192028 {
1420
- /*
2029
+ cGridBag presetpanel = new cGridBag().setVertical(true);
2030
+
2031
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF);
2032
+ skin.setToolTipText("Skin");
2033
+ skin.addMouseListener(new MouseAdapter()
2034
+ {
2035
+ public void mouseClicked(MouseEvent e)
2036
+ {
2037
+ Object3D object = Grafreed.materials.versionlist[0].get(0);
2038
+ cMaterial material = object.material;
2039
+
2040
+ // Skin
2041
+ colorField.setFloat(material.color);
2042
+ float saturation = material.modulation;
2043
+
2044
+ if (!cameraView.Skinshader)
2045
+ {
2046
+ saturation /= 1.5;
2047
+ }
2048
+
2049
+ saturationField.setFloat(saturation);
2050
+
2051
+ subsurfaceField.setFloat(material.subsurface);
2052
+ selfshadowField.setFloat(material.diffuseness);
2053
+ diffusenessField.setFloat(material.factor);
2054
+ shininessField.setFloat(material.shininess);
2055
+ shadowbiasField.setFloat(material.shadowbias);
2056
+ diffuseField.setFloat(material.diffuse);
2057
+ specularField.setFloat(material.specular);
2058
+
2059
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2060
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2061
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2062
+
2063
+ materialtouched = true;
2064
+ applySelf();
2065
+ }
2066
+ });
2067
+ presetpanel.add(skin);
2068
+
2069
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF);
2070
+ lambert.setToolTipText("Diffuse");
2071
+ lambert.addMouseListener(new MouseAdapter()
2072
+ {
2073
+ public void mouseClicked(MouseEvent e)
2074
+ {
2075
+ Object3D object = Grafreed.materials.versionlist[2].get(0);
2076
+ cMaterial material = object.material;
2077
+
2078
+ diffusenessField.setFloat(material.factor);
2079
+ selfshadowField.setFloat(material.diffuseness);
2080
+
2081
+ materialtouched = true;
2082
+ applySelf();
2083
+ }
2084
+ });
2085
+ presetpanel.add(lambert);
2086
+
2087
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF);
2088
+ diffuse2.setToolTipText("Diffuse2");
2089
+ diffuse2.addMouseListener(new MouseAdapter()
2090
+ {
2091
+ public void mouseClicked(MouseEvent e)
2092
+ {
2093
+ Object3D object = Grafreed.materials.versionlist[3].get(0);
2094
+ cMaterial material = object.material;
2095
+
2096
+ diffusenessField.setFloat(material.factor);
2097
+ selfshadowField.setFloat(material.diffuseness);
2098
+
2099
+ materialtouched = true;
2100
+ applySelf();
2101
+ }
2102
+ });
2103
+ presetpanel.add(diffuse2);
2104
+
2105
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF);
2106
+ diffusemoon.setToolTipText("Moon");
2107
+ diffusemoon.addMouseListener(new MouseAdapter()
2108
+ {
2109
+ public void mouseClicked(MouseEvent e)
2110
+ {
2111
+ Object3D object = Grafreed.materials.versionlist[4].get(0);
2112
+ cMaterial material = object.material;
2113
+
2114
+ diffusenessField.setFloat(material.factor);
2115
+ selfshadowField.setFloat(material.diffuseness);
2116
+
2117
+ materialtouched = true;
2118
+ applySelf();
2119
+ }
2120
+ });
2121
+ presetpanel.add(diffusemoon);
2122
+
2123
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF);
2124
+ diffusemoon2.setToolTipText("Moon2");
2125
+ diffusemoon2.addMouseListener(new MouseAdapter()
2126
+ {
2127
+ public void mouseClicked(MouseEvent e)
2128
+ {
2129
+ Object3D object = Grafreed.materials.versionlist[5].get(0);
2130
+ cMaterial material = object.material;
2131
+
2132
+ diffusenessField.setFloat(material.factor);
2133
+ selfshadowField.setFloat(material.diffuseness);
2134
+
2135
+ materialtouched = true;
2136
+ applySelf();
2137
+ }
2138
+ });
2139
+ presetpanel.add(diffusemoon2);
2140
+
2141
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF);
2142
+ diffusemoon3.setToolTipText("Moon3");
2143
+ diffusemoon3.addMouseListener(new MouseAdapter()
2144
+ {
2145
+ public void mouseClicked(MouseEvent e)
2146
+ {
2147
+ Object3D object = Grafreed.materials.versionlist[6].get(0);
2148
+ cMaterial material = object.material;
2149
+
2150
+ diffusenessField.setFloat(material.factor);
2151
+ selfshadowField.setFloat(material.diffuseness);
2152
+
2153
+ materialtouched = true;
2154
+ applySelf();
2155
+ }
2156
+ });
2157
+ presetpanel.add(diffusemoon3);
2158
+
2159
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF);
2160
+ diffusesheen.setToolTipText("Sheen");
2161
+ diffusesheen.addMouseListener(new MouseAdapter()
2162
+ {
2163
+ public void mouseClicked(MouseEvent e)
2164
+ {
2165
+ Object3D object = Grafreed.materials.versionlist[7].get(0);
2166
+ cMaterial material = object.material;
2167
+
2168
+ sheenField.setFloat(material.sheen);
2169
+
2170
+ materialtouched = true;
2171
+ applySelf();
2172
+ }
2173
+ });
2174
+ presetpanel.add(diffusesheen);
2175
+
2176
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF);
2177
+ rough.setToolTipText("Rough metal");
2178
+ rough.addMouseListener(new MouseAdapter()
2179
+ {
2180
+ public void mouseClicked(MouseEvent e)
2181
+ {
2182
+ Object3D object = Grafreed.materials.versionlist[1].get(0);
2183
+ cMaterial material = object.material;
2184
+
2185
+ shininessField.setFloat(material.shininess);
2186
+ velvetField.setFloat(material.velvet);
2187
+
2188
+ materialtouched = true;
2189
+ applySelf();
2190
+ }
2191
+ });
2192
+ presetpanel.add(rough);
2193
+
2194
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF);
2195
+ rough2.setToolTipText("Medium metal");
2196
+ rough2.addMouseListener(new MouseAdapter()
2197
+ {
2198
+ public void mouseClicked(MouseEvent e)
2199
+ {
2200
+ Object3D object = Grafreed.materials.versionlist[13].get(0);
2201
+ cMaterial material = object.material;
2202
+
2203
+ shininessField.setFloat(material.shininess);
2204
+ lightareaField.setFloat(material.lightarea);
2205
+
2206
+ materialtouched = true;
2207
+ applySelf();
2208
+ }
2209
+ });
2210
+ presetpanel.add(rough2);
2211
+
2212
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF);
2213
+ shini0.setToolTipText("Shiny");
2214
+ shini0.addMouseListener(new MouseAdapter()
2215
+ {
2216
+ public void mouseClicked(MouseEvent e)
2217
+ {
2218
+ Object3D object = Grafreed.materials.versionlist[14].get(0);
2219
+ cMaterial material = object.material;
2220
+
2221
+ shininessField.setFloat(material.shininess);
2222
+ lightareaField.setFloat(material.lightarea);
2223
+
2224
+ materialtouched = true;
2225
+ applySelf();
2226
+ }
2227
+ });
2228
+ presetpanel.add(shini0);
2229
+
2230
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF);
2231
+ shini1.setToolTipText("Shiny2");
2232
+ shini1.addMouseListener(new MouseAdapter()
2233
+ {
2234
+ public void mouseClicked(MouseEvent e)
2235
+ {
2236
+ Object3D object = Grafreed.materials.versionlist[11].get(0);
2237
+ cMaterial material = object.material;
2238
+
2239
+ shininessField.setFloat(material.shininess);
2240
+ lightareaField.setFloat(material.lightarea);
2241
+
2242
+ materialtouched = true;
2243
+ applySelf();
2244
+ }
2245
+ });
2246
+ presetpanel.add(shini1);
2247
+
2248
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF);
2249
+ shini2.setToolTipText("Shiny3");
2250
+ shini2.addMouseListener(new MouseAdapter()
2251
+ {
2252
+ public void mouseClicked(MouseEvent e)
2253
+ {
2254
+ Object3D object = Grafreed.materials.versionlist[12].get(0);
2255
+ cMaterial material = object.material;
2256
+
2257
+ shininessField.setFloat(material.shininess);
2258
+ lightareaField.setFloat(material.lightarea);
2259
+
2260
+ materialtouched = true;
2261
+ applySelf();
2262
+ }
2263
+ });
2264
+ presetpanel.add(shini2);
2265
+
2266
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF);
2267
+ aniso.setToolTipText("AnisoU");
2268
+ aniso.addMouseListener(new MouseAdapter()
2269
+ {
2270
+ public void mouseClicked(MouseEvent e)
2271
+ {
2272
+ Object3D object = Grafreed.materials.versionlist[8].get(0);
2273
+ cMaterial material = object.material;
2274
+
2275
+ anisoField.setFloat(material.aniso);
2276
+ anisoVField.setFloat(material.anisoV);
2277
+
2278
+ materialtouched = true;
2279
+ applySelf();
2280
+ }
2281
+ });
2282
+ presetpanel.add(aniso);
2283
+
2284
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF);
2285
+ aniso2.setToolTipText("AnisoV");
2286
+ aniso2.addMouseListener(new MouseAdapter()
2287
+ {
2288
+ public void mouseClicked(MouseEvent e)
2289
+ {
2290
+ Object3D object = Grafreed.materials.versionlist[9].get(0);
2291
+ cMaterial material = object.material;
2292
+
2293
+ anisoField.setFloat(material.aniso);
2294
+ anisoVField.setFloat(material.anisoV);
2295
+
2296
+ materialtouched = true;
2297
+ applySelf();
2298
+ }
2299
+ });
2300
+ presetpanel.add(aniso2);
2301
+
2302
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF);
2303
+ aniso3.setToolTipText("AnisoUV");
2304
+ aniso3.addMouseListener(new MouseAdapter()
2305
+ {
2306
+ public void mouseClicked(MouseEvent e)
2307
+ {
2308
+ Object3D object = Grafreed.materials.versionlist[10].get(0);
2309
+ cMaterial material = object.material;
2310
+
2311
+ anisoField.setFloat(material.aniso);
2312
+ anisoVField.setFloat(material.anisoV);
2313
+
2314
+ materialtouched = true;
2315
+ applySelf();
2316
+ }
2317
+ });
2318
+ presetpanel.add(aniso3);
2319
+
2320
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF);
2321
+ velvet0.setToolTipText("Velvet");
2322
+ velvet0.addMouseListener(new MouseAdapter()
2323
+ {
2324
+ public void mouseClicked(MouseEvent e)
2325
+ {
2326
+ Object3D object = Grafreed.materials.versionlist[15].get(0);
2327
+ cMaterial material = object.material;
2328
+
2329
+ diffusenessField.setFloat(material.factor);
2330
+ selfshadowField.setFloat(material.diffuseness);
2331
+ sheenField.setFloat(material.sheen);
2332
+ shininessField.setFloat(material.shininess);
2333
+ velvetField.setFloat(material.velvet);
2334
+ shiftField.setFloat(material.shift);
2335
+
2336
+ materialtouched = true;
2337
+ applySelf();
2338
+ }
2339
+ });
2340
+ presetpanel.add(velvet0);
2341
+
2342
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF);
2343
+ bump0.setToolTipText("Bump texture");
2344
+ bump0.addMouseListener(new MouseAdapter()
2345
+ {
2346
+ public void mouseClicked(MouseEvent e)
2347
+ {
2348
+ Object3D object = Grafreed.materials.versionlist[16].get(0);
2349
+ cMaterial material = object.material;
2350
+
2351
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2352
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2353
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2354
+
2355
+ materialtouched = true;
2356
+ applySelf();
2357
+ }
2358
+ });
2359
+ presetpanel.add(bump0);
2360
+
2361
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF);
2362
+ borderShader.setToolTipText("Border fade");
2363
+ borderShader.addMouseListener(new MouseAdapter()
2364
+ {
2365
+ public void mouseClicked(MouseEvent e)
2366
+ {
2367
+ borderfadeField.setFloat(0.5);
2368
+ opacityField.setFloat(0.75);
2369
+
2370
+ materialtouched = true;
2371
+ applySelf();
2372
+ }
2373
+ });
2374
+ presetpanel.add(borderShader);
2375
+
2376
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF);
2377
+ halo.setToolTipText("Halo");
2378
+ halo.addMouseListener(new MouseAdapter()
2379
+ {
2380
+ public void mouseClicked(MouseEvent e)
2381
+ {
2382
+ Object3D object = Grafreed.materials.versionlist[17].get(0);
2383
+ cMaterial material = object.material;
2384
+
2385
+ opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0);
2386
+
2387
+ materialtouched = true;
2388
+ applySelf();
2389
+ }
2390
+ });
2391
+ presetpanel.add(halo);
2392
+
2393
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF);
2394
+ candle.setToolTipText("Candle");
2395
+ candle.addMouseListener(new MouseAdapter()
2396
+ {
2397
+ public void mouseClicked(MouseEvent e)
2398
+ {
2399
+ Object3D object = Grafreed.materials.versionlist[18].get(0);
2400
+ cMaterial material = object.material;
2401
+
2402
+ subsurfaceField.setFloat(material.subsurface);
2403
+ shadowbiasField.setFloat(material.shadowbias);
2404
+ ambientField.setFloat(material.ambient);
2405
+ specularField.setFloat(material.specular);
2406
+ lightareaField.setFloat(material.lightarea);
2407
+ shininessField.setFloat(material.shininess);
2408
+
2409
+ materialtouched = true;
2410
+ applySelf();
2411
+ }
2412
+ });
2413
+ presetpanel.add(candle);
2414
+
2415
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF);
2416
+ shadowShader.setToolTipText("Shadow");
2417
+ shadowShader.addMouseListener(new MouseAdapter()
2418
+ {
2419
+ public void mouseClicked(MouseEvent e)
2420
+ {
2421
+ diffuseField.setFloat(0.001);
2422
+ ambientField.setFloat(0.001);
2423
+ cameraField.setFloat(0.001);
2424
+ specularField.setFloat(0.001);
2425
+ fakedepthField.setFloat(0.001);
2426
+ opacityField.setFloat(0.6);
2427
+
2428
+ materialtouched = true;
2429
+ applySelf();
2430
+ }
2431
+ });
2432
+ presetpanel.add(shadowShader);
2433
+
2434
+ cGridBag panel = new cGridBag().setVertical(true);
2435
+
2436
+ presetpanel.preferredWidth = 1;
2437
+
2438
+ materialpanel.add(presetpanel);
2439
+ materialpanel.add(panel);
2440
+
2441
+ panel.preferredWidth = 8;
2442
+
2443
+ /*
14212444 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14222445 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1423
- */
2446
+ */
14242447
14252448 cGridBag editBar = new cGridBag().setVertical(false);
14262449
1427
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
2450
+ editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints);
2451
+ createMaterialButton.setToolTipText("Create material");
14282452
14292453 /*
14302454 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14312455 */
14322456
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);
2457
+ editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints);
2458
+ clearMaterialButton.setToolTipText("Clear material");
2459
+
2460
+ if (Globals.ADVANCED)
2461
+ {
2462
+ editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints);
2463
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
2464
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
2465
+ }
14372466
1438
- ctrlPanel.add(editBar);
2467
+ editBar.preferredHeight = 15;
2468
+
2469
+ panel.add(editBar);
14392470
14402471 /**/
14412472 //aConstraints.weighty = 0;
....@@ -1446,47 +2477,63 @@
14462477 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14472478
14482479 cGridBag colorSection = new cGridBag().setVertical(true);
2480
+
2481
+ cGridBag huepanel = new cGridBag();
2482
+ cGridBag huelabel = new cGridBag();
2483
+ cLabel hue = GetLabel("icons/hue.png", false);
2484
+ hue.fit = true;
2485
+
2486
+ hue.addMouseListener(new MouseAdapter()
2487
+ {
2488
+ public void mousePressed(MouseEvent e)
2489
+ {
2490
+ int x = e.getX();
2491
+
2492
+ colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth());
2493
+ }
2494
+ });
2495
+
2496
+ huelabel.add(hue);
2497
+ huelabel.preferredWidth = 20;
2498
+ huepanel.add(new cGridBag()); // Label
2499
+ huepanel.add(huelabel); // Field/slider
2500
+
2501
+ huepanel.preferredHeight = 7;
2502
+
2503
+ colorSection.add(huepanel);
14492504
14502505 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);
2506
+
2507
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
2508
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2509
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2510
+
14542511 //colorField.preferredWidth = 200;
14552512 colorSection.add(color);
14562513
14572514 cGridBag modulation = new cGridBag();
14582515 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
14592516 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1460
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2517
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
14612518 colorSection.add(modulation);
14622519
2520
+ cGridBag opacity = new cGridBag();
2521
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
2522
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2523
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2524
+ colorSection.add(opacity);
2525
+
2526
+ colorSection.add(GetSeparator());
2527
+
14632528 cGridBag texture = new cGridBag();
14642529 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
14652530 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
14662531 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
14672532 colorSection.add(texture);
14682533
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());
2534
+ panel.add(GetSeparator());
14882535
1489
- ctrlPanel.add(colorSection);
2536
+ panel.add(colorSection);
14902537
14912538 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14922539
....@@ -1534,9 +2581,15 @@
15342581 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15352582 diffuseSection.add(fakedepth);
15362583
1537
- ctrlPanel.add(new JSeparator());
2584
+ cGridBag shadowbias = new cGridBag();
2585
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
2586
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2587
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2588
+ diffuseSection.add(shadowbias);
2589
+
2590
+ panel.add(GetSeparator());
15382591
1539
- ctrlPanel.add(diffuseSection);
2592
+ panel.add(diffuseSection);
15402593
15412594 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15422595
....@@ -1572,7 +2625,7 @@
15722625 velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15732626 specularSection.add(velvet);
15742627
1575
- shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1);
2628
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
15762629 //Return();
15772630 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
15782631 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
....@@ -1584,42 +2637,48 @@
15842637 // aConstraints.gridy += 1;
15852638 // aConstraints.gridwidth = 1;
15862639
2640
+ cGridBag anisoU = new cGridBag();
2641
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
2642
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2643
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2644
+ specularSection.add(anisoU);
15872645
1588
- ctrlPanel.add(new JSeparator());
2646
+ cGridBag anisoV = new cGridBag();
2647
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
2648
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2649
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2650
+ specularSection.add(anisoV);
2651
+
2652
+
2653
+ panel.add(GetSeparator());
15892654
1590
- ctrlPanel.add(specularSection);
2655
+ panel.add(specularSection);
15912656
15922657 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15932658
1594
- cGridBag globalSection = new cGridBag().setVertical(true);
2659
+ //cGridBag globalSection = new cGridBag().setVertical(true);
15952660
15962661 cGridBag camera = new cGridBag();
15972662 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
15982663 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
15992664 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1600
- globalSection.add(camera);
2665
+ colorSection.add(camera);
16012666
16022667 cGridBag ambient = new cGridBag();
16032668 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
16042669 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16052670 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1606
- globalSection.add(ambient);
2671
+ colorSection.add(ambient);
16072672
16082673 cGridBag backlit = new cGridBag();
16092674 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
16102675 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16112676 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1612
- globalSection.add(backlit);
2677
+ colorSection.add(backlit);
16132678
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());
2679
+ //panel.add(new JSeparator());
16212680
1622
- ctrlPanel.add(globalSection);
2681
+ //panel.add(globalSection);
16232682
16242683 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16252684
....@@ -1661,9 +2720,9 @@
16612720 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
16622721 textureSection.add(opacityPower);
16632722
1664
- ctrlPanel.add(new JSeparator());
2723
+ panel.add(GetSeparator());
16652724
1666
- ctrlPanel.add(textureSection);
2725
+ panel.add(textureSection);
16672726
16682727 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16692728
....@@ -1700,12 +2759,15 @@
17002759 opacityPowerField.addChangeListener(this);
17012760 /**/
17022761
1703
- resetSlidersButton.addActionListener(this);
17042762 clearMaterialButton.addActionListener(this);
17052763 createMaterialButton.addActionListener(this);
1706
-
1707
- propagateToggle.addItemListener(this);
1708
- multiplyToggle.addItemListener(this);
2764
+
2765
+ if (Globals.ADVANCED)
2766
+ {
2767
+ resetSlidersButton.addActionListener(this);
2768
+ propagateToggle.addItemListener(this);
2769
+ multiplyToggle.addItemListener(this);
2770
+ }
17092771 }
17102772
17112773 void DropFile(java.io.File[] files, boolean textures)
....@@ -1723,8 +2785,9 @@
17232785 // 3D models
17242786 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
17252787 {
1726
- lastConverter = new com.jmex.model.converters.MaxToJme();
1727
- LoadFile(filename, lastConverter);
2788
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2789
+ //LoadFile(filename, lastConverter);
2790
+ LoadObjFile(filename); // New 3ds loader
17282791 continue;
17292792 }
17302793 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -1876,7 +2939,7 @@
18762939
18772940 //? flashIt = false;
18782941 CameraPane pane = (CameraPane) cameraView;
1879
- pane.clickStart(location.x, location.y, 0);
2942
+ pane.clickStart(location.x, location.y, 0, 0);
18802943 pane.clickEnd(location.x, location.y, 0, true);
18812944
18822945 if (group.selection.size() == 1)
....@@ -1925,6 +2988,7 @@
19252988 e2.printStackTrace();
19262989 }
19272990 }
2991
+
19282992 LoadJMEThread loadThread;
19292993
19302994 class LoadJMEThread extends Thread
....@@ -1982,6 +3046,7 @@
19823046 //LoadFile0(filename, converter);
19833047 }
19843048 }
3049
+
19853050 LoadOBJThread loadObjThread;
19863051
19873052 class LoadOBJThread extends Thread
....@@ -2060,19 +3125,19 @@
20603125
20613126 void LoadObjFile(String fullname)
20623127 {
2063
- /*
3128
+ System.out.println("Loading " + fullname);
3129
+ /**/
20643130 //lastFilename = fullname;
20653131 if(loadObjThread == null)
20663132 {
2067
- loadObjThread = new LoadOBJThread();
2068
- loadObjThread.start();
3133
+ loadObjThread = new LoadOBJThread();
3134
+ loadObjThread.start();
20693135 }
20703136
20713137 loadObjThread.add(fullname);
2072
- */
3138
+ /**/
20733139
2074
- System.out.println("Loading " + fullname);
2075
- makeSomething(new FileObject(fullname, true), true);
3140
+ //makeSomething(new FileObject(fullname, true), true);
20763141 }
20773142
20783143 void LoadGFDFile(String fullname)
....@@ -2333,11 +3398,11 @@
23333398
23343399 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23353400 {
2336
- if (GrafreeD.standAlone)
3401
+ if (Grafreed.standAlone)
23373402 {
23383403 /**/
23393404 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2340
- browser.show();
3405
+ browser.setVisible(true);
23413406 String filename = browser.getFile();
23423407 if (filename != null && filename.length() > 0)
23433408 {
....@@ -2448,6 +3513,7 @@
24483513 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
24493514 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
24503515 }
3516
+
24513517 //cJME.count++;
24523518 //cJME.count %= 12;
24533519 if (gc)
....@@ -2482,6 +3548,7 @@
24823548 }
24833549 if (input == null)
24843550 {
3551
+ new Exception().printStackTrace();
24853552 System.exit(0);
24863553 }
24873554
....@@ -2630,6 +3697,7 @@
26303697 }
26313698 }
26323699 }
3700
+
26333701 cFileSystemPane FSPane;
26343702
26353703 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2639,7 +3707,7 @@
26393707
26403708 freezematerial = true;
26413709 colorField.setFloat(mat.color);
2642
- modulationField.setFloat(mat.modulation);
3710
+ saturationField.setFloat(mat.modulation);
26433711 metalnessField.setFloat(mat.metalness);
26443712 diffuseField.setFloat(mat.diffuse);
26453713 specularField.setFloat(mat.specular);
....@@ -2683,11 +3751,14 @@
26833751 }
26843752 }
26853753 }
3754
+
26863755 freezematerial = false;
26873756 }
26883757
26893758 void SetMaterial(Object3D object)
26903759 {
3760
+ latestObject = object;
3761
+
26913762 cMaterial mat = object.material;
26923763
26933764 if (mat == null)
....@@ -2696,33 +3767,10 @@
26963767 return;
26973768 }
26983769
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
- }
3770
+ if (multiplyToggle != null)
3771
+ multiplyToggle.setSelected(mat.multiply);
3772
+
3773
+ AllocProjectedVertices(object);
27263774
27273775 SetMaterial(mat, object.projectedVertices);
27283776 }
....@@ -2798,12 +3846,17 @@
27983846 // }
27993847
28003848 /**/
2801
- if (deselect)
3849
+ if (deselect || child == null)
28023850 {
28033851 //group.deselectAll();
28043852 //freeze = true;
28053853 GetTree().clearSelection();
28063854 //freeze = false;
3855
+
3856
+ if (child == null)
3857
+ {
3858
+ return;
3859
+ }
28073860 }
28083861
28093862 //group.addSelectee(child);
....@@ -2837,6 +3890,17 @@
28373890 public void itemStateChanged(ItemEvent event)
28383891 {
28393892 // System.out.println("Propagate = " + propagate);
3893
+ if (event.getSource() == pinButton)
3894
+ {
3895
+ copy.pinned ^= true;
3896
+ if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy))
3897
+ {
3898
+ ((GroupEditor)copy.editWindow).listUI.remove(copy);
3899
+ copy.CloseUI();
3900
+ //copy.editWindow.refreshContents();
3901
+ }
3902
+ }
3903
+ else
28403904 if (event.getSource() == propagateToggle)
28413905 {
28423906 propagate ^= true;
....@@ -2872,7 +3936,7 @@
28723936 cameraView.ToggleDL();
28733937 cameraView.repaint();
28743938 return;
2875
- } else if (event.getSource() == toggleTextureItem)
3939
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
28763940 {
28773941 cameraView.ToggleTexture();
28783942 // june 2013 copy.HardTouch();
....@@ -2911,9 +3975,9 @@
29113975 frame.validate();
29123976
29133977 return;
2914
- } else if (event.getSource() == toggleRandomItem)
3978
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29153979 {
2916
- cameraView.ToggleRandom();
3980
+ cameraView.ToggleSwitch();
29173981 cameraView.repaint();
29183982 return;
29193983 } else if (event.getSource() == toggleHandleItem)
....@@ -2941,12 +4005,17 @@
29414005 } else if (event.getSource() == liveCB)
29424006 {
29434007 copy.live ^= true;
4008
+ objEditor.refreshContents(true); // To show item colors
4009
+ return;
4010
+ } else if (event.getSource() == selectableCB)
4011
+ {
4012
+ copy.dontselect ^= true;
29444013 return;
29454014 } else if (event.getSource() == hideCB)
29464015 {
29474016 copy.hide ^= true;
29484017 copy.Touch(); // display list issue
2949
- objEditor.refreshContents();
4018
+ objEditor.refreshContents(true); // To show item colors
29504019 return;
29514020 } else if (event.getSource() == link2masterCB)
29524021 {
....@@ -2956,6 +4025,7 @@
29564025 if (event.getSource() == randomCB)
29574026 {
29584027 copy.random ^= true;
4028
+ objEditor.refreshContents();
29594029 return;
29604030 }
29614031 if (event.getSource() == speedupCB)
....@@ -2979,8 +4049,9 @@
29794049
29804050 public void actionPerformed(ActionEvent event)
29814051 {
4052
+ Object source = event.getSource();
29824053 // SCRIPT DIALOG
2983
- if (event.getSource() == okbutton)
4054
+ if (source == okbutton)
29844055 {
29854056 textpanel.setVisible(false);
29864057 textpanel.remove(textarea);
....@@ -2992,7 +4063,7 @@
29924063 textarea = null;
29934064 textpanel = null;
29944065 }
2995
- if (event.getSource() == cancelbutton)
4066
+ if (source == cancelbutton)
29964067 {
29974068 textpanel.setVisible(false);
29984069 textpanel.remove(textarea);
....@@ -3004,50 +4075,50 @@
30044075 //applySelf();
30054076 //client.refreshEditWindow();
30064077 //refreshContents();
3007
- if (event.getSource() == nameField)
4078
+ if (source == nameField)
30084079 {
30094080 //System.out.println("ObjEditor " + event);
30104081 applySelf0(true);
30114082 //parent.applySelf();
3012
- objEditor.refreshContents();
3013
- } else if (event.getSource() == resetButton)
4083
+ // conflicts with requestFocus objEditor.refreshContents();
4084
+ } else if (source == resetButton)
30144085 {
30154086 CameraPane.fullreset = true;
30164087 copy.Reset(); // ResetMeshes();
30174088 copy.Touch();
30184089 objEditor.refreshContents();
3019
- } else if (event.getSource() == stepItem)
4090
+ } else if (source == stepItem)
30204091 {
30214092 //cameraView.ONESTEP = true;
30224093 Globals.ONESTEP = true;
30234094 cameraView.repaint();
30244095 return;
3025
- } else if (event.getSource() == stepButton)
4096
+ } else if (source == stepButton)
30264097 {
30274098 copy.Step();
30284099 copy.Touch();
30294100 objEditor.refreshContents();
3030
- } else if (event.getSource() == slowerButton)
4101
+ } else if (source == slowerButton)
30314102 {
30324103 copy.Slower();
30334104 copy.Touch();
30344105 objEditor.refreshContents();
3035
- } else if (event.getSource() == fasterButton)
4106
+ } else if (source == fasterButton)
30364107 {
30374108 copy.Faster();
30384109 copy.Touch();
30394110 objEditor.refreshContents();
3040
- } else if (event.getSource() == remarkButton)
4111
+ } else if (source == remarkButton)
30414112 {
30424113 copy.Remark();
30434114 copy.Touch();
30444115 objEditor.refreshContents();
3045
- } else if (event.getSource() == stepAllButton)
4116
+ } else if (source == stepAllButton)
30464117 {
30474118 copy.StepAll();
30484119 copy.Touch();
30494120 objEditor.refreshContents();
3050
- } else if (event.getSource() == resetAllButton)
4121
+ } else if (source == resetAllButton)
30514122 {
30524123 //CameraPane.fullreset = true;
30534124 copy.ResetAll(); // ResetMeshes();
....@@ -3080,53 +4151,79 @@
30804151 // Close();
30814152 // }
30824153 // else
3083
- if (event.getSource() == resetSlidersButton)
4154
+ if (source == resetSlidersButton)
30844155 {
30854156 ResetSliders();
3086
- } else if (event.getSource() == clearMaterialButton)
4157
+ } else if (source == clearMaterialButton)
30874158 {
30884159 ClearMaterial();
3089
- } else if (event.getSource() == createMaterialButton)
4160
+ } else if (source == createMaterialButton)
30904161 {
30914162 CreateMaterial();
3092
- } else if (event.getSource() == clearPanelButton)
4163
+ } else if (source == clearPanelButton)
30934164 {
30944165 copy.ClearUI();
30954166 refreshContents(true);
3096
- } /*
3097
- }
3098
-
3099
- public boolean action(Event event, Object arg)
3100
- {
3101
- */ else if (event.getSource() == closeItem)
4167
+ } else if (source == importGFDItem)
4168
+ {
4169
+ ImportGFD();
4170
+ } else
4171
+ if (source == importVRMLX3DItem)
4172
+ {
4173
+ ImportVRMLX3D();
4174
+ } else
4175
+ if (source == import3DSItem)
4176
+ {
4177
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
4178
+ } else
4179
+ if (source == importOBJItem)
4180
+ {
4181
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
4182
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
4183
+ browser.setVisible(true);
4184
+ String filename = browser.getFile();
4185
+ if (filename != null && filename.length() > 0)
4186
+ {
4187
+ String fullname = browser.getDirectory() + filename;
4188
+ makeSomething(ReadOBJ(fullname), true);
4189
+ }
4190
+ } else
4191
+ if (source == closeItem)
31024192 {
31034193 Close();
31044194 //return true;
3105
- } else if (event.getSource() == loadItem)
4195
+ } else if (source == openItem)
31064196 {
3107
- load();
4197
+ Open();
31084198 //return true;
3109
- } else if (event.getSource() == saveItem)
4199
+ } else if (source == newItem)
4200
+ {
4201
+ New();
4202
+ } else if (source == saveItem)
31104203 {
31114204 save();
31124205 //return true;
3113
- } else if (event.getSource() == saveAsItem)
4206
+ } else if (source == saveAsItem)
31144207 {
31154208 saveAs();
31164209 //return true;
3117
- } else if (event.getSource() == reexportItem)
4210
+ } else if (source == reexportItem)
31184211 {
31194212 reexport();
31204213 //return true;
3121
- } else if (event.getSource() == exportAsItem)
4214
+ } else if (source == exportAsItem)
31224215 {
31234216 export();
31244217 //return true;
3125
- } else if (event.getSource() == povItem)
4218
+ } else if (source == povItem)
31264219 {
31274220 generatePOV();
31284221 //return true;
3129
- } else if (event.getSource() == zBufferItem)
4222
+ } else if (event.getSource() == archiveItem)
4223
+ {
4224
+ cTools.Archive(frame);
4225
+ return;
4226
+ } else if (source == zBufferItem)
31304227 {
31314228 try
31324229 {
....@@ -3148,21 +4245,8 @@
31484245 cameraView.repaint();
31494246 //return true;
31504247 }
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)
4248
+ */ else // combos...
4249
+ if (source == texresMenu)
31664250 {
31674251 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
31684252 copy.texres = texresMenu.getSelectedIndex();
....@@ -3174,12 +4258,503 @@
31744258 }
31754259 }
31764260
4261
+ void New()
4262
+ {
4263
+ while (copy.Size() > 0)
4264
+ {
4265
+ copy.remove(0);
4266
+ }
4267
+
4268
+ copy.selection.clear();
4269
+
4270
+ if (copy == Grafreed.grafreed.universe)
4271
+ {
4272
+ CreateCameras();
4273
+ cameraView.SetCamera(GetCamera(copy, 0));
4274
+ }
4275
+ ResetModel();
4276
+ objEditor.refreshContents();
4277
+ }
4278
+
4279
+ static public byte[] Compress(Object3D o)
4280
+ {
4281
+ // Slower to actually compress.
4282
+ try
4283
+ {
4284
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4285
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
4286
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
4287
+
4288
+ Object3D parent = o.parent;
4289
+ o.parent = null;
4290
+
4291
+ out.writeObject(o);
4292
+
4293
+ o.parent = parent;
4294
+
4295
+ out.flush();
4296
+
4297
+ baos //zstream
4298
+ .close();
4299
+ out.close();
4300
+
4301
+ byte[] bytes = baos.toByteArray();
4302
+
4303
+ System.out.println("save #bytes = " + bytes.length);
4304
+ return bytes;
4305
+ } catch (Exception e)
4306
+ {
4307
+ System.err.println(e);
4308
+ return null;
4309
+ }
4310
+ }
4311
+
4312
+ static public Object Uncompress(byte[] bytes)
4313
+ {
4314
+ System.out.println("restore #bytes = " + bytes.length);
4315
+ try
4316
+ {
4317
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4318
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
4319
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
4320
+ Object obj = in.readObject();
4321
+
4322
+ bais //istream
4323
+ .close();
4324
+ in.close();
4325
+
4326
+ return obj;
4327
+ } catch (Exception e)
4328
+ {
4329
+ System.err.println(e);
4330
+ return null;
4331
+ }
4332
+ }
4333
+
4334
+ static public Object clone(Object o)
4335
+ {
4336
+ try
4337
+ {
4338
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4339
+ ObjectOutputStream out = new ObjectOutputStream(baos);
4340
+
4341
+ out.writeObject(o);
4342
+
4343
+ out.flush();
4344
+ out.close();
4345
+
4346
+ byte[] bytes = baos.toByteArray();
4347
+
4348
+ System.out.println("clone = " + bytes.length);
4349
+
4350
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4351
+ ObjectInputStream in = new ObjectInputStream(bais);
4352
+ Object obj = in.readObject();
4353
+ in.close();
4354
+
4355
+ return obj;
4356
+ } catch (Exception e)
4357
+ {
4358
+ System.err.println(e);
4359
+ return null;
4360
+ }
4361
+ }
4362
+
4363
+ cRadio GetCurrentTab()
4364
+ {
4365
+ cRadio ab;
4366
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4367
+ {
4368
+ ab = (cRadio)e.nextElement();
4369
+ if(ab.GetObject() == copy)
4370
+ {
4371
+ return ab;
4372
+ }
4373
+ }
4374
+
4375
+ return null;
4376
+ }
4377
+
4378
+
4379
+ public void Save()
4380
+ {
4381
+ //Save(true);
4382
+ Replace();
4383
+ SetVersionStates();
4384
+ }
4385
+
4386
+ private boolean Equal(byte[] compress, byte[] name)
4387
+ {
4388
+ if (compress.length != name.length)
4389
+ {
4390
+ return false;
4391
+ }
4392
+
4393
+ for (int i=compress.length; --i>=0;)
4394
+ {
4395
+ if (compress[i] != name[i])
4396
+ return false;
4397
+ }
4398
+
4399
+ return true;
4400
+ }
4401
+
4402
+ void DeleteVersion()
4403
+ {
4404
+ for (int i = copy.versionindex; i < copy.versionlist.length-1; i++)
4405
+ {
4406
+ copy.versionlist[i] = copy.versionlist[i+1];
4407
+ }
4408
+
4409
+ if (copy.versionlist[copy.versionindex] == null)
4410
+ copy.versionindex -= 1;
4411
+
4412
+ if (copy.versionindex != -1)
4413
+ CopyChanged();
4414
+
4415
+ SetVersionStates();
4416
+ }
4417
+
4418
+ public boolean Save(boolean user)
4419
+ {
4420
+ System.err.println("Save");
4421
+ Replace();
4422
+
4423
+ //cRadio tab = GetCurrentTab();
4424
+
4425
+ Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
4426
+
4427
+ boolean thesame = false;
4428
+
4429
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
4430
+// {
4431
+// thesame = true;
4432
+// }
4433
+
4434
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
4435
+ if (!thesame)
4436
+ {
4437
+ for (int i = copy.versionlist.length; --i > copy.versionindex+1;)
4438
+ {
4439
+ copy.versionlist[i] = copy.versionlist[i-1];
4440
+ }
4441
+
4442
+ //tab.user[tab.versionindex] = user;
4443
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
4444
+
4445
+ copy.versionlist[++copy.versionindex] = compress;
4446
+
4447
+ // if (increment)
4448
+ // tab.versionindex++;
4449
+ }
4450
+
4451
+ //copy.RestoreBigData(versiontable);
4452
+
4453
+ //assert(hashtable.isEmpty());
4454
+
4455
+// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
4456
+// {
4457
+// //tab.user[i] = false;
4458
+// copy.versionlist[i] = null;
4459
+// }
4460
+
4461
+ SetVersionStates();
4462
+
4463
+ // test save
4464
+ if (false)
4465
+ {
4466
+ try
4467
+ {
4468
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
4469
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
4470
+
4471
+ p.writeObject(copy);
4472
+
4473
+ p.flush();
4474
+
4475
+ ostream.close();
4476
+ } catch (Exception e)
4477
+ {
4478
+ e.printStackTrace();
4479
+ }
4480
+ }
4481
+
4482
+ return !thesame;
4483
+ }
4484
+
4485
+ boolean flashIt = true;
4486
+
4487
+ void RefreshSelection()
4488
+ {
4489
+ Object3D selection = new Object3D();
4490
+
4491
+ for (int i = 0; i < copy.selection.size(); i++)
4492
+ {
4493
+ Object3D elem = copy.selection.elementAt(i);
4494
+
4495
+ Object3D obj = copy.GetObject(elem.GetUUID());
4496
+
4497
+ if (obj == null)
4498
+ {
4499
+ copy.selection.remove(i--);
4500
+ }
4501
+ else
4502
+ {
4503
+ selection.add(obj);
4504
+ copy.selection.setElementAt(obj, i);
4505
+ }
4506
+ }
4507
+
4508
+ flashIt = false;
4509
+ GetTree().clearSelection();
4510
+ for (int i = 0; i < selection.size(); i++)
4511
+ GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath());
4512
+ flashIt = true;
4513
+
4514
+ //refreshContents(false);
4515
+ }
4516
+
4517
+ void CopyChanged()
4518
+ {
4519
+ Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
4520
+
4521
+ SetVersionStates();
4522
+
4523
+ boolean temp = CameraPane.SWITCH;
4524
+ CameraPane.SWITCH = false;
4525
+
4526
+ copy.ExtractBigData(Grafreed.grafreed.universe.versiontable);
4527
+
4528
+ copy.clear();
4529
+
4530
+ copy.skyboxname = obj.skyboxname;
4531
+ copy.skyboxext = obj.skyboxext;
4532
+
4533
+ for (int i=0; i<obj.Size(); i++)
4534
+ {
4535
+ copy.add(obj.get(i));
4536
+ }
4537
+
4538
+ copy.RestoreBigData(Grafreed.grafreed.universe.versiontable);
4539
+
4540
+ CameraPane.SWITCH = temp;
4541
+
4542
+ RefreshSelection();
4543
+ //assert(hashtable.isEmpty());
4544
+
4545
+ copy.Touch();
4546
+
4547
+ ResetModel();
4548
+ copy.HardTouch(); // recompile?
4549
+
4550
+ cRadio ab;
4551
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4552
+ {
4553
+ ab = (cRadio)e.nextElement();
4554
+ Object3D test = copy.GetObject(ab.object.GetUUID());
4555
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
4556
+ if (test != null)
4557
+ {
4558
+ test.editWindow = ab.object.editWindow;
4559
+ ab.object = test;
4560
+ }
4561
+ }
4562
+
4563
+ refreshContents(true);
4564
+ }
4565
+
4566
+ cButton previousVersionButton;
4567
+ cButton restoreButton;
4568
+ cButton replaceButton;
4569
+ cButton nextVersionButton;
4570
+ cButton saveVersionButton;
4571
+ cButton deleteVersionButton;
4572
+
4573
+ boolean muteSlider;
4574
+
4575
+ int VersionCount()
4576
+ {
4577
+ int count = 0;
4578
+
4579
+ for (int i = copy.versionlist.length; --i >= 0;)
4580
+ {
4581
+ if (copy.versionlist[i] != null)
4582
+ count++;
4583
+ }
4584
+
4585
+ return count;
4586
+ }
4587
+
4588
+ public cGridBag versionSliderPane;
4589
+
4590
+ void SetVersionStates()
4591
+ {
4592
+ //if (true)
4593
+ // return;
4594
+
4595
+ //cRadio tab = GetCurrentTab();
4596
+
4597
+ if (copy.versionlist == null)
4598
+ {
4599
+ saveVersionButton.setEnabled(false);
4600
+ restoreButton.setEnabled(false);
4601
+ replaceButton.setEnabled(false);
4602
+ previousVersionButton.setEnabled(false);
4603
+ nextVersionButton.setEnabled(false);
4604
+ deleteVersionButton.setEnabled(false);
4605
+ versionSliderPane.setVisible(false);
4606
+ }
4607
+ else
4608
+ {
4609
+ restoreButton.setEnabled(copy.versionindex != -1);
4610
+ replaceButton.setEnabled(copy.versionindex != -1);
4611
+
4612
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4613
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4614
+
4615
+ deleteVersionButton.setEnabled(copy.versionindex != -1);
4616
+ //copy.versionlist[copy.versionindex + 1] != null);
4617
+
4618
+ muteSlider = true;
4619
+ versionSlider.setMinimum(0);
4620
+ versionSlider.setMaximum(VersionCount() - 1);
4621
+ versionSlider.setInteger(copy.versionindex);
4622
+ versionSlider.setEnabled(copy.versionindex != -1);
4623
+ muteSlider = false;
4624
+
4625
+ versionSliderPane.setVisible(true);
4626
+ }
4627
+ }
4628
+
4629
+ public boolean PreviousVersion()
4630
+ {
4631
+ // Option?
4632
+ Replace();
4633
+
4634
+ System.err.println("Undo");
4635
+
4636
+ //cRadio tab = GetCurrentTab();
4637
+
4638
+ if (copy.versionindex == 0)
4639
+ {
4640
+ java.awt.Toolkit.getDefaultToolkit().beep();
4641
+ return false;
4642
+ }
4643
+
4644
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
4645
+// {
4646
+// if (Save(false))
4647
+// tab.versionindex -= 1;
4648
+// else
4649
+// {
4650
+// if (tab.versionindex <= 0)
4651
+// return false;
4652
+// else
4653
+// tab.versionindex -= 1;
4654
+// }
4655
+// }
4656
+
4657
+ copy.versionindex -= 1;
4658
+
4659
+ CopyChanged();
4660
+
4661
+ return true;
4662
+ }
4663
+
4664
+ public boolean Restore()
4665
+ {
4666
+ System.err.println("Restore");
4667
+
4668
+ //cRadio tab = GetCurrentTab();
4669
+
4670
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4671
+ {
4672
+ java.awt.Toolkit.getDefaultToolkit().beep();
4673
+ return false;
4674
+ }
4675
+
4676
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4677
+ CopyChanged();
4678
+
4679
+ return true;
4680
+ }
4681
+
4682
+ public boolean Replace()
4683
+ {
4684
+ //System.err.println("Replace");
4685
+
4686
+ //cRadio tab = GetCurrentTab();
4687
+
4688
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4689
+ {
4690
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
4691
+ return false;
4692
+ }
4693
+
4694
+ copy.versionlist[copy.versionindex] = Duplicate(copy);
4695
+
4696
+ return true;
4697
+ }
4698
+
4699
+ public void NextVersion()
4700
+ {
4701
+ // Option?
4702
+ Replace();
4703
+
4704
+ //cRadio tab = GetCurrentTab();
4705
+
4706
+ if (copy.versionlist[copy.versionindex + 1] == null)
4707
+ {
4708
+ java.awt.Toolkit.getDefaultToolkit().beep();
4709
+ return;
4710
+ }
4711
+
4712
+ copy.versionindex += 1;
4713
+
4714
+ CopyChanged();
4715
+
4716
+ //if (!tab.user[tab.versionindex])
4717
+ // tab.graphs[tab.versionindex] = null;
4718
+ }
4719
+
4720
+ void ImportGFD()
4721
+ {
4722
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4723
+ browser.show();
4724
+ String filename = browser.getFile();
4725
+ if (filename != null && filename.length() > 0)
4726
+ {
4727
+ String fullname = browser.getDirectory() + filename;
4728
+
4729
+ //Object3D readobj =
4730
+ objEditor.ReadGFD(fullname, objEditor);
4731
+ //makeSomething(readobj);
4732
+ }
4733
+ }
4734
+
4735
+ void ImportVRMLX3D()
4736
+ {
4737
+ if (Grafreed.standAlone)
4738
+ {
4739
+ /**/
4740
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4741
+ browser.show();
4742
+ String filename = browser.getFile();
4743
+ if (filename != null && filename.length() > 0)
4744
+ {
4745
+ String fullname = browser.getDirectory() + filename;
4746
+ LoadVRMLX3D(fullname);
4747
+ }
4748
+ /**/
4749
+ }
4750
+ }
4751
+
31774752 void ToggleAnimation()
31784753 {
31794754 if (!Globals.ANIMATION)
31804755 {
31814756 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3182
- browser.show();
4757
+ browser.setVisible(true);
31834758 String filename = browser.getFile();
31844759 if (filename != null && filename.length() > 0)
31854760 {
....@@ -3189,8 +4764,8 @@
31894764
31904765 Globals.ANIMATION ^= true;
31914766
3192
- GrafreeD.wav.cursor = 0;
3193
- GrafreeD.wav.loop = 0;
4767
+ Grafreed.wav.cursor = 0;
4768
+ Grafreed.wav.loop = 0;
31944769 }
31954770 } else
31964771 {
....@@ -3240,7 +4815,7 @@
32404815 void CreateMaterial()
32414816 {
32424817 //copy.ClearMaterial(); // PATCH
3243
- copy.CreateMaterialS(multiplyToggle.isSelected());
4818
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32444819 if (copy.selection.size() > 0)
32454820 //SetMaterial(copy);
32464821 {
....@@ -3291,7 +4866,7 @@
32914866 assert false;
32924867 }
32934868
3294
- void EditSelection()
4869
+ void EditSelection(boolean newWindow)
32954870 {
32964871 }
32974872
....@@ -3299,11 +4874,11 @@
32994874 {
33004875 copy.ResetBlockLoop(); // temporary problem
33014876
3302
- boolean random = CameraPane.RANDOM;
3303
- CameraPane.RANDOM = false; // parse everything
4877
+ boolean random = CameraPane.SWITCH;
4878
+ CameraPane.SWITCH = false; // parse everything
33044879 copy.ResetDisplayList();
33054880 copy.HardTouch();
3306
- CameraPane.RANDOM = random;
4881
+ CameraPane.SWITCH = random;
33074882 }
33084883
33094884 // public void applySelf()
....@@ -3333,6 +4908,12 @@
33334908 // else
33344909 // applySelf(true);
33354910 // }
4911
+
4912
+ boolean Equal(double a, double b)
4913
+ {
4914
+ return Math.abs(a - b) < 0.001;
4915
+ }
4916
+
33364917 void applySelf0(boolean name)
33374918 {
33384919 if (name)
....@@ -3350,7 +4931,7 @@
33504931 //copy.material = new cMaterial(copy.GetMaterial());
33514932
33524933 current.color = (float) colorField.getFloat();
3353
- current.modulation = (float) modulationField.getFloat();
4934
+ current.modulation = (float) saturationField.getFloat();
33544935 current.metalness = (float) metalnessField.getFloat();
33554936 current.diffuse = (float) diffuseField.getFloat();
33564937 current.specular = (float) specularField.getFloat();
....@@ -3377,6 +4958,59 @@
33774958 {
33784959 //System.out.println("Propagate = " + propagate);
33794960 copy.UpdateMaterial(anchor, current, propagate);
4961
+
4962
+ if (copy.material != null)
4963
+ {
4964
+ cMaterial mat = copy.material;
4965
+
4966
+ if (!Equal(colorField.getFloat(), mat.color))
4967
+ colorField.SetToolTipValue((mat.color));
4968
+ if (!Equal(saturationField.getFloat(), mat.modulation))
4969
+ saturationField.SetToolTipValue((mat.modulation));
4970
+ if (!Equal(metalnessField.getFloat(), mat.metalness))
4971
+ metalnessField.SetToolTipValue((mat.metalness));
4972
+ if (!Equal(diffuseField.getFloat(), mat.diffuse))
4973
+ diffuseField.SetToolTipValue((mat.diffuse));
4974
+ if (!Equal(specularField.getFloat(), mat.specular))
4975
+ specularField.SetToolTipValue((mat.specular));
4976
+ if (!Equal(shininessField.getFloat(), mat.shininess))
4977
+ shininessField.SetToolTipValue((mat.shininess));
4978
+ if (!Equal(shiftField.getFloat(), mat.shift))
4979
+ shiftField.SetToolTipValue((mat.shift));
4980
+ if (!Equal(ambientField.getFloat(), mat.ambient))
4981
+ ambientField.SetToolTipValue((mat.ambient));
4982
+ if (!Equal(lightareaField.getFloat(), mat.lightarea))
4983
+ lightareaField.SetToolTipValue((mat.lightarea));
4984
+ if (!Equal(diffusenessField.getFloat(), mat.factor))
4985
+ diffusenessField.SetToolTipValue((mat.factor));
4986
+ if (!Equal(velvetField.getFloat(), mat.velvet))
4987
+ velvetField.SetToolTipValue((mat.velvet));
4988
+ if (!Equal(sheenField.getFloat(), mat.sheen))
4989
+ sheenField.SetToolTipValue((mat.sheen));
4990
+ if (!Equal(subsurfaceField.getFloat(), mat.subsurface))
4991
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4992
+ if (!Equal(backlitField.getFloat(), mat.bump))
4993
+ backlitField.SetToolTipValue((mat.bump));
4994
+ if (!Equal(anisoField.getFloat(), mat.aniso))
4995
+ anisoField.SetToolTipValue((mat.aniso));
4996
+ if (!Equal(anisoVField.getFloat(), mat.anisoV))
4997
+ anisoVField.SetToolTipValue((mat.anisoV));
4998
+ if (!Equal(cameraField.getFloat(), mat.cameralight))
4999
+ cameraField.SetToolTipValue((mat.cameralight));
5000
+ if (!Equal(selfshadowField.getFloat(), mat.diffuseness))
5001
+ selfshadowField.SetToolTipValue((mat.diffuseness));
5002
+ if (!Equal(shadowField.getFloat(), mat.shadow))
5003
+ shadowField.SetToolTipValue((mat.shadow));
5004
+ if (!Equal(textureField.getFloat(), mat.texture))
5005
+ textureField.SetToolTipValue((mat.texture));
5006
+ if (!Equal(opacityField.getFloat(), mat.opacity))
5007
+ opacityField.SetToolTipValue((mat.opacity));
5008
+ if (!Equal(fakedepthField.getFloat(), mat.fakedepth))
5009
+ fakedepthField.SetToolTipValue((mat.fakedepth));
5010
+ if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))
5011
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
5012
+ }
5013
+
33805014 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
33815015 {
33825016 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3405,9 +5039,28 @@
34055039 //copy.Touch();
34065040 }
34075041
5042
+ cNumberSlider versionSlider;
5043
+
34085044 public void stateChanged(ChangeEvent e)
34095045 {
3410
- // assert(false);
5046
+ // assert(false);
5047
+ if (e.getSource() == versionSlider)
5048
+ {
5049
+ if (muteSlider)
5050
+ return;
5051
+
5052
+ Replace();
5053
+
5054
+ int version = versionSlider.getInteger();
5055
+
5056
+ if (version != -1 && copy.versionlist[version] != null)
5057
+ {
5058
+ copy.versionindex = version;
5059
+ CopyChanged();
5060
+ }
5061
+
5062
+ return;
5063
+ }
34115064
34125065 if (freezematerial)
34135066 {
....@@ -3421,6 +5074,7 @@
34215074 || e.getSource() == apertureField
34225075 || e.getSource() == shadowblurField)
34235076 {
5077
+ new Exception().printStackTrace();
34245078 System.exit(0);
34255079 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34265080 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3442,6 +5096,12 @@
34425096 {
34435097 //System.out.println("stateChanged = " + this);
34445098 materialtouched = true;
5099
+
5100
+ if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001)
5101
+ {
5102
+ saturationField.setFloat(1);
5103
+ }
5104
+
34455105 applySelf();
34465106 //System.out.println("this = " + this);
34475107 //System.out.println("PARENT = " + parent);
....@@ -3491,7 +5151,7 @@
34915151 }
34925152
34935153 if (normalpushField != null)
3494
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
5154
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
34955155 }
34965156
34975157 void SnapObject()
....@@ -3741,6 +5401,7 @@
37415401 {
37425402 if (GetTree() != null)
37435403 {
5404
+ GetTree().revalidate();
37445405 GetTree().repaint();
37455406 }
37465407
....@@ -3749,12 +5410,19 @@
37495410 ctrlPanel.validate(); // ? new
37505411 ctrlPanel.repaint();
37515412 }
5413
+
5414
+ if (previousVersionButton != null && copy.versionlist != null)
5415
+ SetVersionStates();
5416
+
5417
+ cameraView.requestFocusInWindow();
37525418 }
37535419
37545420 static TweenManager tweenManager = new TweenManager();
37555421
37565422 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37575423 {
5424
+ if (Globals.REPLACEONMAKE) // && resetmodel)
5425
+ Save();
37585426 //Tween.set(thing, 0).target(1).start(tweenManager);
37595427 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37605428 // if (thing instanceof GenericJointDemo)
....@@ -3778,7 +5446,7 @@
37785446 // group = (Composite) group.get(0);
37795447 // }
37805448
3781
- System.out.println("makeSomething of " + thing);
5449
+ //System.out.println("makeSomething of " + thing);
37825450
37835451 /*
37845452 if (deselect && jList != null)
....@@ -3841,6 +5509,12 @@
38415509 {
38425510 ResetModel();
38435511 Select(thing.GetTreePath(), true, false); // unselect... false);
5512
+
5513
+ if (thing.Size() == 0)
5514
+ {
5515
+ //EditSelection(false);
5516
+ }
5517
+
38445518 refreshContents();
38455519 }
38465520
....@@ -3958,6 +5632,7 @@
39585632 }
39595633 }
39605634 }
5635
+
39615636 LoadGFDThread loadGFDThread;
39625637
39635638 void ReadGFD(String fullname, iCallBack cb)
....@@ -3977,8 +5652,10 @@
39775652
39785653 try
39795654 {
5655
+ // Try compressed version first.
39805656 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
3981
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5657
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
5658
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
39825659
39835660 readobj = (Object3D) p.readObject();
39845661 istream.close();
....@@ -3986,7 +5663,22 @@
39865663 readobj.ResetDisplayList();
39875664 } catch (Exception e)
39885665 {
3989
- e.printStackTrace();
5666
+ if (!e.toString().contains("GZIP"))
5667
+ e.printStackTrace();
5668
+
5669
+ try
5670
+ {
5671
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
5672
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5673
+
5674
+ readobj = (Object3D) p.readObject();
5675
+ istream.close();
5676
+
5677
+ readobj.ResetDisplayList();
5678
+ } catch (Exception e2)
5679
+ {
5680
+ e2.printStackTrace();
5681
+ }
39905682 }
39915683 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
39925684 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4032,6 +5724,12 @@
40325724
40335725 void LoadIt(Object obj)
40345726 {
5727
+ if (obj == null)
5728
+ {
5729
+ // Invalid file
5730
+ return;
5731
+ }
5732
+
40355733 System.out.println("Loaded " + obj);
40365734 //new Exception().printStackTrace();
40375735 Object3D readobj = (Object3D) obj;
....@@ -4041,10 +5739,14 @@
40415739
40425740 if (readobj != null)
40435741 {
5742
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
5743
+ // Save();
40445744 try
40455745 {
40465746 //readobj.deepCopySelf(copy);
40475747 copy.clear(); // june 2014
5748
+ copy.skyboxname = readobj.skyboxname;
5749
+ copy.skyboxext = readobj.skyboxext;
40485750 for (int i = 0; i < readobj.size(); i++)
40495751 {
40505752 Object3D child = readobj.get(i); // reserve(i);
....@@ -4085,6 +5787,7 @@
40855787 }
40865788 } catch (ClassCastException e)
40875789 {
5790
+ e.printStackTrace();
40885791 assert (false);
40895792 Composite c = (Composite) copy;
40905793 c.children.clear();
....@@ -4095,17 +5798,32 @@
40955798 c.addChild(csg);
40965799 }
40975800
5801
+ copy.versionlist = readobj.versionlist;
5802
+ copy.versionindex = readobj.versionindex;
5803
+ copy.versiontable = readobj.versiontable;
5804
+
5805
+ if (copy.versionlist == null)
5806
+ {
5807
+ // Backward compatibility
5808
+ copy.versionlist = new Object3D[100];
5809
+ copy.versionindex = -1;
5810
+
5811
+ //Save(true);
5812
+ }
5813
+
5814
+ //? SetUndoStates();
5815
+
40985816 ResetModel();
40995817 copy.HardTouch(); // recompile?
41005818 refreshContents();
41015819 }
41025820 }
41035821
4104
- void load() // throws ClassNotFoundException
5822
+ void Open() // throws ClassNotFoundException
41055823 {
4106
- if (GrafreeD.standAlone)
5824
+ if (Grafreed.standAlone)
41075825 {
4108
- FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
5826
+ FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD);
41095827 browser.show();
41105828 String filename = browser.getFile();
41115829 if (filename != null && filename.length() > 0)
....@@ -4182,6 +5900,8 @@
41825900
41835901 void save()
41845902 {
5903
+ Replace();
5904
+
41855905 if (lastname == null)
41865906 {
41875907 return;
....@@ -4190,11 +5910,13 @@
41905910 try
41915911 {
41925912 FileOutputStream ostream = new FileOutputStream(lastname);
4193
- ObjectOutputStream p = new ObjectOutputStream(ostream);
5913
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5914
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
41945915
41955916 p.writeObject(copy);
41965917 p.flush();
41975918
5919
+ zstream.close();
41985920 ostream.close();
41995921
42005922 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4202,19 +5924,23 @@
42025924 //ps.print(buffer.toString());
42035925 } catch (IOException e)
42045926 {
5927
+ e.printStackTrace();
42055928 }
42065929 }
5930
+
42075931 String lastname;
42085932
42095933 void saveAs()
42105934 {
4211
- if (GrafreeD.standAlone)
5935
+ if (Grafreed.standAlone)
42125936 {
42135937 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42145938 browser.setVisible(true);
42155939 String filename = browser.getFile();
42165940 if (filename != null && filename.length() > 0)
42175941 {
5942
+ if (!filename.endsWith(".gfd"))
5943
+ filename += ".gfd";
42185944 lastname = browser.getDirectory() + filename;
42195945 save();
42205946 }
....@@ -4313,13 +6039,13 @@
43136039 try
43146040 {
43156041 FileOutputStream ostream = new FileOutputStream(filename);
4316
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4317
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
6042
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
6043
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43186044
43196045 Object3D objectparent = obj.parent;
43206046 obj.parent = null;
43216047
4322
- Object3D object = (Object3D) GrafreeD.clone(obj);
6048
+ Object3D object = (Object3D) Grafreed.clone(obj);
43236049
43246050 obj.parent = objectparent;
43256051
....@@ -4331,8 +6057,8 @@
43316057 p.writeObject(object);
43326058 p.flush();
43336059
6060
+ zstream.close();
43346061 ostream.close();
4335
- // zstream.close();
43366062
43376063 // group.selection.get(0).parent = parent;
43386064 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4353,7 +6079,7 @@
43536079 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43546080 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43556081 copy.generatePOV(buffer);
4356
- if (GrafreeD.standAlone)
6082
+ if (Grafreed.standAlone)
43576083 {
43586084 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43596085 browser.show();
....@@ -4379,21 +6105,20 @@
43796105 Object3D client;
43806106 Object3D copy;
43816107 MenuBar menuBar;
4382
- Menu windowMenu;
4383
- MenuItem loadItem;
6108
+ Menu fileMenu;
6109
+ MenuItem newItem;
6110
+ MenuItem openItem;
43846111 MenuItem saveItem;
43856112 MenuItem saveAsItem;
43866113 MenuItem exportAsItem;
43876114 MenuItem reexportItem;
43886115 MenuItem povItem;
43896116 MenuItem closeItem;
4390
- Menu cameraMenu;
6117
+
43916118 CheckboxMenuItem zBufferItem;
43926119 //MenuItem normalLensItem;
4393
- MenuItem editCameraItem;
4394
- MenuItem revertCameraItem;
4395
- CheckboxMenuItem toggleLiveItem;
43966120 MenuItem stepItem;
6121
+ CheckboxMenuItem toggleLiveItem;
43976122 CheckboxMenuItem toggleFullScreenItem;
43986123 CheckboxMenuItem toggleTimelineItem;
43996124 CheckboxMenuItem toggleRenderItem;
....@@ -4402,25 +6127,41 @@
44026127 CheckboxMenuItem toggleFootContactItem;
44036128 CheckboxMenuItem toggleDLItem;
44046129 CheckboxMenuItem toggleTextureItem;
4405
- CheckboxMenuItem toggleRandomItem;
6130
+ CheckboxMenuItem toggleSwitchItem;
44066131 CheckboxMenuItem toggleRootItem;
44076132 CheckboxMenuItem animationItem;
6133
+ MenuItem archiveItem;
44086134 CheckboxMenuItem toggleHandleItem;
44096135 CheckboxMenuItem togglePaintItem;
44106136 JSplitPane mainPanel;
44116137 JScrollPane scrollpane;
6138
+
44126139 JPanel toolbarPanel;
4413
- JPanel treePanel;
6140
+
6141
+ cGridBag treePanel;
6142
+
44146143 JPanel radioPanel;
44156144 ButtonGroup buttonGroup;
4416
- cGridBag ctrlPanel;
6145
+
6146
+ cGridBag toolboxPanel;
6147
+ cGridBag skyboxPanel;
44176148 cGridBag materialPanel;
6149
+ cGridBag ctrlPanel;
6150
+
44186151 JScrollPane infoPanel;
6152
+
44196153 cGridBag optionsPanel;
6154
+
44206155 JTabbedPane objectPanel;
6156
+ boolean materialFlushed;
6157
+ Object3D latestObject;
6158
+
6159
+ cGridBag transformPanel;
44216160 cGridBag XYZPanel;
6161
+
44226162 JSplitPane gridPanel;
44236163 JSplitPane bigPanel;
6164
+
44246165 cGridBag bigThree;
44256166 cGridBag scenePanel;
44266167 cGridBag centralPanel;
....@@ -4478,7 +6219,7 @@
44786219 JLabel colorLabel;
44796220 cNumberSlider colorField;
44806221 JLabel modulationLabel;
4481
- cNumberSlider modulationField;
6222
+ cNumberSlider saturationField;
44826223 JLabel metalnessLabel;
44836224 cNumberSlider metalnessField;
44846225 JLabel diffuseLabel;
....@@ -4509,6 +6250,7 @@
45096250 cNumberSlider anisoField;
45106251 JLabel anisoVLabel;
45116252 cNumberSlider anisoVField;
6253
+
45126254 JLabel cameraLabel;
45136255 cNumberSlider cameraField;
45146256 JLabel selfshadowLabel;
....@@ -4523,6 +6265,7 @@
45236265 cNumberSlider fakedepthField;
45246266 JLabel shadowbiasLabel;
45256267 cNumberSlider shadowbiasField;
6268
+
45266269 JLabel bumpLabel;
45276270 cNumberSlider bumpField;
45286271 JLabel noiseLabel;
....@@ -4535,8 +6278,13 @@
45356278 cNumberSlider fogField;
45366279 JLabel opacityPowerLabel;
45376280 cNumberSlider opacityPowerField;
4538
- JTree jTree;
6281
+ cTree jTree;
45396282 //ObjectUI parent;
45406283
45416284 cNumberSlider normalpushField;
6285
+
6286
+ private MenuItem importGFDItem;
6287
+ private MenuItem importVRMLX3DItem;
6288
+ private MenuItem import3DSItem;
6289
+ private MenuItem importOBJItem;
45426290 }