Normand Briere
2019-07-19 e79247ef52a0bbb3864d46bb1e2c716005b3ecf3
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
....@@ -35,6 +39,53 @@
3539
3640 GroupEditor callee;
3741 JFrame frame;
42
+
43
+ static ObjEditor theFrame;
44
+
45
+ cButton GetButton(String name, boolean border)
46
+ {
47
+ ImageIcon icon = GetIcon(name);
48
+ return new cButton(icon, border);
49
+ }
50
+
51
+ cToggleButton GetToggleButton(String name, boolean border)
52
+ {
53
+ ImageIcon icon = GetIcon(name);
54
+ return new cToggleButton(icon, border);
55
+ }
56
+
57
+ cCheckBox GetCheckBox(String name, boolean border)
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cCheckBox(icon, border);
61
+ }
62
+
63
+ private ImageIcon GetIcon(String name)
64
+ {
65
+ try
66
+ {
67
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
68
+
69
+ if (image.getWidth() != 24 && image.getHeight() != 24)
70
+ {
71
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
72
+ Graphics2D g = resized.createGraphics();
73
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
74
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
75
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
76
+ g.dispose();
77
+
78
+ image = resized;
79
+ }
80
+
81
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
82
+ return icon;
83
+ }
84
+ catch (Exception e)
85
+ {
86
+ return null;
87
+ }
88
+ }
3889
3990 // SCRIPT
4091
....@@ -138,34 +189,42 @@
138189 public void closeUI()
139190 {
140191 //new Exception().printStackTrace();
141
- System.out.println("this = " + this);
142
- System.out.println("objEditor = " + objEditor);
192
+// System.out.println("this = " + this);
193
+// System.out.println("objEditor = " + objEditor);
143194 //nameField.removeActionListener(this);
144
- objEditor.ctrlPanel.remove(nameField);
195
+// objEditor.ctrlPanel.remove(nameField);
145196
146
- if (!GroupEditor.allparams)
197
+ objEditor.ctrlPanel.remove(namePanel);
198
+
199
+ if (!allparams)
147200 return;
148201
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);
202
+// objEditor.ctrlPanel.remove(liveCB);
203
+// objEditor.ctrlPanel.remove(hideCB);
204
+// objEditor.ctrlPanel.remove(markCB);
205
+//
206
+// objEditor.ctrlPanel.remove(randomCB);
207
+// objEditor.ctrlPanel.remove(speedupCB);
208
+// objEditor.ctrlPanel.remove(rewindCB);
209
+//
210
+// objEditor.ctrlPanel.remove(resetButton);
211
+// objEditor.ctrlPanel.remove(stepButton);
212
+//// objEditor.ctrlPanel.remove(stepAllButton);
213
+//// objEditor.ctrlPanel.remove(resetAllButton);
214
+// objEditor.ctrlPanel.remove(link2masterCB);
215
+// //objEditor.ctrlPanel.remove(flipVCB);
216
+// //objEditor.ctrlPanel.remove(texresMenu);
217
+// objEditor.ctrlPanel.remove(slowerButton);
218
+// objEditor.ctrlPanel.remove(fasterButton);
219
+// objEditor.ctrlPanel.remove(remarkButton);
167220
168
- Remove(normalpushField);
221
+ objEditor.ctrlPanel.remove(setupPanel);
222
+ objEditor.ctrlPanel.remove(setupPanel2);
223
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
224
+ objEditor.ctrlPanel.remove(pushPanel);
225
+ //objEditor.ctrlPanel.remove(fillPanel);
226
+
227
+ //Remove(normalpushField);
169228 }
170229
171230 public ObjEditor GetEditor()
....@@ -209,6 +268,12 @@
209268 client = inClient;
210269 copy = client;
211270
271
+ if (copy.versions == null)
272
+ {
273
+ copy.versions = new byte[100][];
274
+ copy.versionindex = -1;
275
+ }
276
+
212277 // "this" is not called: SetupUI2(objEditor);
213278 }
214279
....@@ -222,6 +287,12 @@
222287 client = inClient;
223288 copy = client;
224289
290
+ if (copy.versions == null)
291
+ {
292
+ copy.versions = new byte[100][];
293
+ copy.versionindex = -1;
294
+ }
295
+
225296 SetupUI2(callee.GetEditor());
226297 }
227298
....@@ -236,6 +307,7 @@
236307 //localCopy.parent = null;
237308
238309 frame = new JFrame();
310
+ frame.setUndecorated(false);
239311 objEditor = this;
240312 this.callee = callee;
241313
....@@ -253,6 +325,12 @@
253325 copy = localCopy;
254326 copy.editWindow = this;
255327
328
+ if (copy.versions == null)
329
+ {
330
+ copy.versions = new byte[100][];
331
+ copy.versionindex = -1;
332
+ }
333
+
256334 SetupMenu();
257335
258336 //SetupName(objEditor); // new
....@@ -266,28 +344,49 @@
266344 return frame.action(event, obj);
267345 }
268346
347
+ // Cannot work without static
348
+ static boolean allparams = true;
349
+
350
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
351
+
269352 void SetupMenu()
270353 {
271354 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..."));
355
+ menuBar.add(fileMenu = new Menu("File"));
356
+ fileMenu.add(newItem = new MenuItem("New"));
357
+ fileMenu.add(openItem = new MenuItem("Open..."));
358
+
359
+ //oe.menuBar.add(menu = new Menu("Include"));
360
+ Menu menu = new Menu("Import");
361
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
362
+ importOBJItem.addActionListener(this);
363
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
364
+ import3DSItem.addActionListener(this);
365
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
366
+ importVRMLX3DItem.addActionListener(this);
367
+ menu.add("-");
368
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
369
+ importGFDItem.addActionListener(this);
370
+ fileMenu.add(menu);
371
+ fileMenu.add("-");
372
+
373
+ fileMenu.add(saveItem = new MenuItem("Save"));
374
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
277375 //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("-");
376
+ fileMenu.add("-");
377
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
378
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
379
+ fileMenu.add("-");
282380 if (client.parent != null)
283381 {
284
- windowMenu.add(closeItem = new MenuItem("Close"));
382
+ fileMenu.add(closeItem = new MenuItem("Close"));
285383 } else
286384 {
287
- windowMenu.add(closeItem = new MenuItem("Exit"));
385
+ fileMenu.add(closeItem = new MenuItem("Exit"));
288386 }
289387
290
- loadItem.addActionListener(this);
388
+ newItem.addActionListener(this);
389
+ openItem.addActionListener(this);
291390 saveItem.addActionListener(this);
292391 saveAsItem.addActionListener(this);
293392 exportAsItem.addActionListener(this);
....@@ -295,82 +394,69 @@
295394 //povItem.addActionListener(this);
296395 closeItem.addActionListener(this);
297396
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
-
353397 objectPanel = new JTabbedPane();
398
+
399
+ ChangeListener changeListener = new ChangeListener()
400
+ {
401
+ public void stateChanged(ChangeEvent changeEvent)
402
+ {
403
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
404
+// {
405
+// if (latestObject != null)
406
+// {
407
+// refreshContents(true);
408
+// SetMaterial(latestObject);
409
+// }
410
+//
411
+// materialFlushed = true;
412
+// }
413
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
414
+// {
415
+// if (listUI.size() == 0)
416
+// EditSelection(false);
417
+// }
418
+
419
+ refreshContents(false); // To refresh Info tab
420
+ }
421
+ };
422
+ objectPanel.addChangeListener(changeListener);
423
+
354424 toolbarPanel = new JPanel();
355425 toolbarPanel.setName("Toolbar");
356
- treePanel = new JPanel();
426
+
427
+ treePanel = new cGridBag();
357428 treePanel.setName("Tree");
358
- ctrlPanel = new cGridBag(); // new GridBagLayout());
359
- ctrlPanel.setName("Edit");
429
+
430
+ editPanel = new cGridBag().setVertical(true);
431
+ //editPanel.setName("Edit");
432
+
433
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
434
+
435
+ editCommandsPanel = new cGridBag();
436
+ editPanel.add(editCommandsPanel);
437
+ editPanel.add(ctrlPanel);
438
+
439
+ toolboxPanel = new cGridBag().setVertical(false);
440
+ //toolboxPanel.setName("Toolbox");
441
+
360442 materialPanel = new cGridBag().setVertical(true);
361
- materialPanel.setName("Material");
443
+ //materialPanel.setName("Material");
444
+
362445 /*JTextPane*/
363446 infoarea = createTextPane();
447
+ doc = infoarea.getStyledDocument();
448
+
364449 infoarea.setEditable(true);
365450 SetText();
451
+
366452 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
367453 // infoarea.setOpaque(false);
368454 // //infoarea.setForeground(textcolor);
369
- infoarea.setLineWrap(true);
370
- infoarea.setWrapStyleWord(true);
455
+// TEXTAREA infoarea.setLineWrap(true);
456
+// TEXTAREA infoarea.setWrapStyleWord(true);
371457 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");
458
+ infoPanel.setPreferredSize(new Dimension(1, 1));
459
+ //infoPanel.setName("Info");
374460 //infoPanel.setLayout(new BorderLayout());
375461 //infoPanel.add(createTextPane());
376462
....@@ -378,15 +464,22 @@
378464 mainPanel.setName("Main");
379465 mainPanel.setContinuousLayout(true);
380466 mainPanel.setOneTouchExpandable(true);
381
- mainPanel.setDividerLocation(1.0);
382467 mainPanel.setDividerSize(9);
383
- mainPanel.setResizeWeight(0);
384
-
468
+ mainPanel.setDividerLocation(0.5); //1.0);
469
+ mainPanel.setResizeWeight(0.5);
470
+
471
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
472
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
473
+ divider.setDividerSize(15);
474
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
475
+
476
+ mainPanel.setUI(new BasicSplitPaneUI());
477
+
385478 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
386479 //mainPanel.setLayout(new GridBagLayout());
387480 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
388
- treePanel.setLayout(new GridBagLayout());
389
- ctrlPanel.setLayout(new GridBagLayout());
481
+// treePanel.setLayout(new GridBagLayout());
482
+ //ctrlPanel.setLayout(new GridBagLayout());
390483 //materialPanel.setLayout(new GridBagLayout());
391484
392485 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
....@@ -426,7 +519,7 @@
426519 static String newline = "\n";
427520 protected static final String buttonString = "JButton";
428521 StyledDocument doc;
429
- JTextArea infoarea;
522
+ JTextPane infoarea;
430523
431524 void ClearInfo()
432525 {
....@@ -449,10 +542,10 @@
449542 e.printStackTrace();
450543 }
451544
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();
545
+// String selection = infoarea.getText();
546
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
547
+// java.awt.datatransfer.Clipboard clipboard =
548
+// Toolkit.getDefaultToolkit().getSystemClipboard();
456549 //clipboard.setContents(data, data);
457550 }
458551
....@@ -475,13 +568,13 @@
475568 //SendInfo("Name:", "bold");
476569 if (sel.GetTextures() != null || debug)
477570 {
478
- si.SendInfo(sel.toString(), "bold");
571
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
479572 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
480573 if (sel.Size() > 0)
481574 {
482575 si.SendInfo("#children = " + sel.Size(), "regular");
483576 }
484
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
577
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
485578 if (debug)
486579 {
487580 try
....@@ -493,7 +586,10 @@
493586 }
494587
495588 if (full)
496
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
589
+ {
590
+ si.SendInfo(" BBox min: " + minima, "regular");
591
+ si.SendInfo(" BBox max: " + maxima, "regular");
592
+ }
497593
498594 if (sel.bRep != null)
499595 {
....@@ -520,7 +616,7 @@
520616 }
521617 if (sel.support != null)
522618 {
523
- si.SendInfo(" support: " + sel.support, "regular");
619
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
524620 }
525621 if (sel.scriptnode != null)
526622 {
....@@ -591,6 +687,9 @@
591687 {
592688 CameraPane.pointflow = (PointFlow) sel;
593689 }
690
+
691
+ si.SendInfo("_____________________", "regular");
692
+ si.SendInfo("", "regular");
594693 }
595694 }
596695
....@@ -606,68 +705,191 @@
606705 }
607706 }
608707
708
+//static GraphicsDevice device = GraphicsEnvironment
709
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
710
+
711
+ Rectangle keeprect;
712
+ cRadio radio;
713
+
714
+cButton keepButton;
715
+ cButton twoButton; // Full 3D
716
+ cButton sixButton;
717
+ cButton threeButton;
718
+ cButton sevenButton;
719
+ cButton fourButton; // full panel
720
+ cButton oneButton; // full XYZ
721
+ //cButton currentLayout;
722
+
723
+ boolean maximized;
724
+
725
+ cButton fullscreenLayout;
726
+
727
+ void Minimize()
728
+ {
729
+ frame.setState(Frame.ICONIFIED);
730
+ frame.validate();
731
+ }
732
+
733
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
734
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
735
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
736
+ void Maximize()
737
+ {
738
+ if (CameraPane.FULLSCREEN)
739
+ {
740
+ ToggleFullScreen();
741
+ }
742
+
743
+ if (maximized)
744
+ {
745
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
746
+ }
747
+ else
748
+ {
749
+ keeprect = frame.getBounds();
750
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
751
+// Dimension rect2 = frame.getToolkit().getScreenSize();
752
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
753
+// frame.setState(Frame.MAXIMIZED_BOTH);
754
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
755
+ }
756
+
757
+ maximized ^= true;
758
+
759
+ frame.validate();
760
+ }
761
+
762
+ cButton minButton;
763
+ cButton maxButton;
764
+ cButton fullButton;
765
+
609766 void ToggleFullScreen()
610767 {
611
- if (CameraPane.FULLSCREEN)
768
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
769
+
770
+ cameraView.ToggleFullScreen();
771
+
772
+ if (!CameraPane.FULLSCREEN)
612773 {
613
- frame.getContentPane().remove(/*"Center",*/bigThree);
614
- framePanel.add(bigThree);
615
- frame.getContentPane().add(/*"Center",*/framePanel);
774
+ device.setFullScreenWindow(null);
775
+ frame.dispose();
776
+ frame.setUndecorated(false);
777
+ frame.validate();
778
+ frame.setVisible(true);
779
+
780
+ //frame.setVisible(false);
781
+// frame.removeNotify();
782
+// frame.setUndecorated(false);
783
+// frame.addNotify();
784
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
785
+
786
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
787
+// X framePanel.add(bigThree);
788
+// X frame.getContentPane().add(/*"Center",*/framePanel);
789
+ framePanel.setDividerLocation(46);
790
+
791
+ //frame.setVisible(true);
792
+ radio.layout = keepButton;
793
+ //theFrame = null;
794
+ keepButton = null;
795
+ radio.layout.doClick();
796
+
616797 } else
617798 {
618
- frame.getContentPane().remove(/*"Center",*/framePanel);
619
- framePanel.remove(bigThree);
620
- frame.getContentPane().add(/*"Center",*/bigThree);
799
+ keepButton = radio.layout;
800
+ //keeprect = frame.getBounds();
801
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
802
+// frame.getToolkit().getScreenSize().height);
803
+ //frame.setVisible(false);
804
+
805
+ frame.dispose();
806
+ frame.setUndecorated(true);
807
+ device.setFullScreenWindow(frame);
808
+ frame.validate();
809
+ frame.setVisible(true);
810
+// frame.removeNotify();
811
+// frame.setUndecorated(true);
812
+// frame.addNotify();
813
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
814
+// X framePanel.remove(bigThree);
815
+// X frame.getContentPane().add(/*"Center",*/bigThree);
816
+ framePanel.setDividerLocation(0);
817
+
818
+ radio.layout = fullscreenLayout;
819
+ radio.layout.doClick();
820
+ //frame.setVisible(true);
621821 }
622
- cameraView.ToggleFullScreen();
822
+ frame.validate();
623823 }
624824
625
- private JTextArea createTextPane()
825
+ private byte[] CompressCopy()
626826 {
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
- };
827
+ boolean temp = CameraPane.SWITCH;
828
+ CameraPane.SWITCH = false;
829
+
830
+ copy.ExtractBigData(versiontable);
831
+ // if (copy == client)
832
+
833
+ byte[] versions[] = copy.versions;
834
+ copy.versions = null;
835
+
836
+ byte[] compress = Compress(copy);
837
+
838
+ copy.versions = versions;
839
+
840
+ copy.RestoreBigData(versiontable);
841
+
842
+ CameraPane.SWITCH = temp;
843
+
844
+ return compress;
845
+ }
642846
643
- String[] initStyles =
644
- {
645
- "regular", "italic", "bold", "small", "large",
646
- "regular", "button", "regular", "icon",
647
- "regular"
648
- };
847
+ private JTextPane createTextPane()
848
+ {
849
+// TEXTAREA String[] initString =
850
+// {
851
+// "This is an editable JTextPane, ", //regular
852
+// "another ", //italic
853
+// "styled ", //bold
854
+// "text ", //small
855
+// "component, ", //large
856
+// "which supports embedded components..." + newline,//regular
857
+// " " + newline, //button
858
+// "...and embedded icons..." + newline, //regular
859
+// " ", //icon
860
+// newline + "JTextPane is a subclass of JEditorPane that "
861
+// + "uses a StyledEditorKit and StyledDocument, and provides "
862
+// + "cover methods for interacting with those objects."
863
+// };
864
+//
865
+// String[] initStyles =
866
+// {
867
+// "regular", "italic", "bold", "small", "large",
868
+// "regular", "button", "regular", "icon",
869
+// "regular"
870
+// };
871
+//
872
+// JTextPane textPane = new JTextPane();
873
+// textPane.setEditable(true);
874
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
875
+// addStylesToDocument(doc);
876
+//
877
+// try
878
+// {
879
+// for (int j = 0; j < 2; j++)
880
+// {
881
+// for (int i = 0; i < initString.length; i++)
882
+// {
883
+// doc.insertString(doc.getLength(), initString[i],
884
+// doc.getStyle(initStyles[i]));
885
+// }
886
+// }
887
+// } catch (BadLocationException ble)
888
+// {
889
+// System.err.println("Couldn't insert initial text into text pane.");
890
+// }
649891
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;
892
+ return new JTextPane(); // textPane;
671893 }
672894
673895 protected void addStylesToDocument(StyledDocument doc)
....@@ -720,7 +942,7 @@
720942 protected static ImageIcon createImageIcon(String path,
721943 String description)
722944 {
723
- java.net.URL imgURL = GrafreeD.class.getResource(path);
945
+ java.net.URL imgURL = Grafreed.class.getResource(path);
724946 if (imgURL != null)
725947 {
726948 return new ImageIcon(imgURL, description);
....@@ -752,6 +974,7 @@
752974 // NumberSlider vDivsField;
753975 // JCheckBox endcaps;
754976 JCheckBox liveCB;
977
+ JCheckBox selectCB;
755978 JCheckBox hideCB;
756979 JCheckBox link2masterCB;
757980 JCheckBox markCB;
....@@ -759,7 +982,12 @@
759982 JCheckBox speedupCB;
760983 JCheckBox rewindCB;
761984 JCheckBox flipVCB;
985
+
986
+ cCheckBox toggleTextureCB;
987
+ cCheckBox toggleSwitchCB;
988
+
762989 JComboBox texresMenu;
990
+
763991 JButton resetButton;
764992 JButton stepButton;
765993 JButton stepAllButton;
....@@ -767,54 +995,48 @@
767995 JButton slowerButton;
768996 JButton fasterButton;
769997 JButton remarkButton;
998
+
999
+ cGridBag editPanel;
1000
+ cGridBag editCommandsPanel;
1001
+
1002
+ cGridBag namePanel;
1003
+ cGridBag setupPanel;
1004
+ cGridBag setupPanel2;
1005
+ cGridBag objectCommandsPanel;
1006
+ cGridBag pushPanel;
1007
+ cGridBag fillPanel;
7701008
771
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
1009
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
7721010 {
7731011 JCheckBox cb;
7741012
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);
1013
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7801014 cb.addItemListener(this);
781
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
782
- oe.aConstraints.gridwidth = 1;
783
- oe.aConstraints.gridx += 1;
7841015
7851016 return cb;
7861017 }
7871018
788
- cButton AddButton(ObjEditor oe, String label)
1019
+ cButton AddButton(cGridBag panel, String label)
7891020 {
7901021 cButton cb;
7911022
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);
1023
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
7971024 cb.addActionListener(this);
798
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
799
- oe.aConstraints.gridwidth = 1;
800
- oe.aConstraints.gridx += 1;
8011025
8021026 return cb;
8031027 }
8041028
805
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
1029
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
8061030 {
8071031 JComboBox combo;
8081032
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;
1033
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8121034 combo.addActionListener(this);
8131035
8141036 return combo;
8151037 }
8161038
817
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, double min, double max, double current, double pow)
1039
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
8181040 {
8191041 cGridBag control = new cGridBag();
8201042
....@@ -826,12 +1048,12 @@
8261048 control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8271049 combo.setFloat(current);
8281050
829
- ctrlPanel.add(control);
1051
+ panel.add(control);
8301052
831
- return combo;
1053
+ return control;
8321054 }
8331055
834
- cNumberSlider AddSlider(cGridBag ctrlPanel, String label, int min, int max, int current)
1056
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
8351057 {
8361058 cGridBag control = new cGridBag();
8371059
....@@ -839,25 +1061,21 @@
8391061
8401062 JLabel jlabel = new JLabel(label);
8411063 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);
1064
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1065
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8441066 combo.setInteger(current);
8451067
846
- ctrlPanel.add(control);
1068
+ panel.add(control);
8471069
848
- return combo;
1070
+ return control;
8491071 }
8501072
8511073 JTextArea AddText(cGridBag ctrlPanel, String name)
8521074 {
8531075 JTextArea text;
8541076
855
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
856
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
8571077 ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8581078 text.addCaretListener(this);
859
- aConstraints.gridx += 1;
860
- aConstraints.gridwidth = 1;
8611079
8621080 return text;
8631081 }
....@@ -896,7 +1114,7 @@
8961114
8971115 /*
8981116 */
899
- void Return() // ObjEditor oe)
1117
+ void Return0() // ObjEditor oe)
9001118 {
9011119 aConstraints.gridy += 1;
9021120 aConstraints.gridx = 0;
....@@ -951,37 +1169,77 @@
9511169
9521170 void SetupUI2(ObjEditor oe)
9531171 {
954
-// oe.aConstraints.weightx = 0;
955
-// oe.aConstraints.weighty = 0;
956
-// oe.aConstraints.gridx = 0;
957
-// oe.aConstraints.gridy = 0;
958
- SetupName(oe);
1172
+ //SetupName(oe);
9591173
960
- if (!GroupEditor.allparams)
1174
+ namePanel = new cGridBag();
1175
+
1176
+ nameField = AddText(namePanel, copy.GetName());
1177
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
1178
+ oe.ctrlPanel.add(namePanel);
1179
+
1180
+ oe.ctrlPanel.Return();
1181
+
1182
+ if (!allparams)
9611183 return;
9621184
963
- liveCB = AddCheckBox(oe, "Live", copy.live);
964
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
965
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1185
+ setupPanel = new cGridBag().setVertical(false);
1186
+
1187
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1188
+ liveCB.setToolTipText("Animate object");
1189
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1190
+ selectCB.setToolTipText("Make object selectable");
9661191 // 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");
1192
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1193
+ hideCB.setToolTipText("Hide object");
1194
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1195
+ markCB.setToolTipText("As animation target transform");
1196
+
1197
+ setupPanel2 = new cGridBag().setVertical(false);
1198
+
1199
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1200
+ rewindCB.setToolTipText("Rewind animation");
1201
+
1202
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1203
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
1204
+
1205
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1206
+ link2masterCB.setToolTipText("Attach to support");
1207
+
1208
+ if (Globals.ADVANCED)
1209
+ {
1210
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1211
+ speedupCB.setToolTipText("Option motion capture");
1212
+ }
1213
+
1214
+ oe.ctrlPanel.add(setupPanel);
1215
+ oe.ctrlPanel.Return();
1216
+ oe.ctrlPanel.add(setupPanel2);
1217
+ oe.ctrlPanel.Return();
1218
+
1219
+ objectCommandsPanel = new cGridBag().setVertical(false);
1220
+
1221
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1222
+ resetButton.setToolTipText("Jump to frame zero");
1223
+ stepButton = AddButton(objectCommandsPanel, "Step");
1224
+ stepButton.setToolTipText("Step one frame");
9731225 // resetAllButton = AddButton(oe, "Reset All");
9741226 // stepAllButton = AddButton(oe, "Step All");
975
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9761227 // Return();
977
- slowerButton = AddButton(oe, "Slow");
978
- fasterButton = AddButton(oe, "Fast");
979
- remarkButton = AddButton(oe, "Rem");
1228
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1229
+ slowerButton.setToolTipText("Decrease animation speed");
1230
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1231
+ fasterButton.setToolTipText("Increase animation speed");
1232
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1233
+ remarkButton.setToolTipText("Set the current transform as the target");
9801234
981
- //Return();
1235
+ oe.ctrlPanel.add(objectCommandsPanel);
1236
+ oe.ctrlPanel.Return();
9821237
983
- //normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
1238
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1239
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
9841240 //Return();
1241
+
1242
+ oe.ctrlPanel.Return();
9851243
9861244 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871245 // ObjEditor.aConstraints.gridx += 1;
....@@ -1076,7 +1334,7 @@
10761334 oe.aConstraints.gridwidth = 1;
10771335 /**/
10781336 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1337
+ oe.ctrlPanel.Return();
10801338
10811339 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821340 //textureButton.setEnabled(false);
....@@ -1180,8 +1438,11 @@
11801438 //worldPanel.setName("World");
11811439 centralPanel = new cGridBag();
11821440 centralPanel.preferredWidth = 20;
1183
- timelinePanel = new JPanel(new BorderLayout());
1184
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1441
+
1442
+ if (Globals.ADVANCED)
1443
+ {
1444
+ timelinePanel = new JPanel(new BorderLayout());
1445
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11851446
11861447 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
11871448 cameraPanel.setContinuousLayout(true);
....@@ -1190,7 +1451,10 @@
11901451 // cameraPanel.setDividerSize(9);
11911452 cameraPanel.setResizeWeight(1.0);
11921453
1454
+ }
1455
+
11931456 centralPanel.add(cameraView);
1457
+ centralPanel.setFocusable(true);
11941458 //frame.setJMenuBar(timelineMenubar);
11951459 //centralPanel.add(timelinePanel);
11961460
....@@ -1216,6 +1480,7 @@
12161480 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
12171481 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
12181482 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1483
+ //XYZPanel.setName("XYZ");
12191484
12201485 /*
12211486 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1253,11 +1518,23 @@
12531518 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12541519 //tmp.setName("Edit");
12551520 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);
1521
+ objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1522
+// JPanel north = new JPanel(new BorderLayout());
1523
+// north.setName("Edit");
1524
+// north.add(ctrlPanel, BorderLayout.NORTH);
1525
+// objectPanel.add(north);
1526
+ objectPanel.add(editPanel);
1527
+ objectPanel.setIconAt(1, GetIcon("icons/write.png"));
1528
+
1529
+ //if (Globals.ADVANCED)
1530
+ objectPanel.add(infoPanel);
1531
+ objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1532
+
1533
+ objectPanel.add(XYZPanel);
1534
+ objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
1535
+
1536
+ objectPanel.add(toolboxPanel);
1537
+ objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
12611538
12621539 /*
12631540 aConstraints.gridx = 0;
....@@ -1266,7 +1543,7 @@
12661543 aConstraints.gridy += 1;
12671544 aConstraints.gridwidth = 1;
12681545 mainPanel.add(objectPanel, aConstraints);
1269
- */
1546
+ */
12701547
12711548 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12721549 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1278,14 +1555,12 @@
12781555 scrollpane.addMouseWheelListener(this); // Default not fast enough
12791556
12801557 /*JTabbedPane*/ scenePanel = new cGridBag();
1281
- scenePanel.preferredWidth = 7;
1558
+ scenePanel.preferredWidth = 5;
12821559
12831560 JTabbedPane tabbedPane = new JTabbedPane();
12841561 tabbedPane.add(scrollpane);
12851562
1286
- tabbedPane.add(FSPane = new cFileSystemPane(this));
1287
-
1288
- optionsPanel = new cGridBag().setVertical(true);
1563
+ optionsPanel = new cGridBag().setVertical(false);
12891564
12901565 optionsPanel.setName("Options");
12911566
....@@ -1293,6 +1568,8 @@
12931568
12941569 tabbedPane.add(optionsPanel);
12951570
1571
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
1572
+
12961573 scenePanel.add(tabbedPane);
12971574
12981575 /*
....@@ -1356,7 +1633,7 @@
13561633 bigThree = new cGridBag();
13571634 bigThree.addComponent(scenePanel);
13581635 bigThree.addComponent(centralPanel);
1359
- bigThree.addComponent(XYZPanel);
1636
+ //bigThree.addComponent(XYZPanel);
13601637
13611638 // // SIDE EFFECT!!!
13621639 // aConstraints.gridx = 0;
....@@ -1365,9 +1642,9 @@
13651642 // aConstraints.gridheight = 1;
13661643
13671644 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1368
- framePanel.setContinuousLayout(true);
1369
- framePanel.setOneTouchExpandable(true);
1370
- framePanel.setDividerLocation(0.8);
1645
+ framePanel.setContinuousLayout(false);
1646
+ framePanel.setOneTouchExpandable(false);
1647
+ //.setDividerLocation(0.8);
13711648 //framePanel.setDividerSize(15);
13721649 //framePanel.setResizeWeight(0.15);
13731650 framePanel.setName("Frame");
....@@ -1384,10 +1661,15 @@
13841661
13851662 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13861663
1387
- frame.setSize(1024, 768);
1388
- frame.show();
1389
-
1664
+ frame.setSize(1280, 860);
1665
+
1666
+ cameraView.requestFocusInWindow();
1667
+
13901668 gridPanel.setDividerLocation(1.0);
1669
+
1670
+ frame.validate();
1671
+
1672
+ frame.setVisible(true);
13911673
13921674 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
13931675 frame.addWindowListener(new WindowAdapter()
....@@ -1415,7 +1697,7 @@
14151697 ctrlPanel.removeAll();
14161698 }
14171699
1418
- void SetupMaterial(cGridBag ctrlPanel)
1700
+ void SetupMaterial(cGridBag panel)
14191701 {
14201702 /*
14211703 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
....@@ -1424,18 +1706,26 @@
14241706
14251707 cGridBag editBar = new cGridBag().setVertical(false);
14261708
1427
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
1709
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1710
+ createMaterialButton.setToolTipText("Create material");
14281711
14291712 /*
14301713 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14311714 */
14321715
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);
1716
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1717
+ clearMaterialButton.setToolTipText("Clear material");
1718
+
1719
+ if (Globals.ADVANCED)
1720
+ {
1721
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1722
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1723
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1724
+ }
14371725
1438
- ctrlPanel.add(editBar);
1726
+ editBar.preferredHeight = 15;
1727
+
1728
+ panel.add(editBar);
14391729
14401730 /**/
14411731 //aConstraints.weighty = 0;
....@@ -1466,27 +1756,9 @@
14661756 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
14671757 colorSection.add(texture);
14681758
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());
1759
+ panel.add(new JSeparator());
14881760
1489
- ctrlPanel.add(colorSection);
1761
+ panel.add(colorSection);
14901762
14911763 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14921764
....@@ -1534,9 +1806,15 @@
15341806 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15351807 diffuseSection.add(fakedepth);
15361808
1537
- ctrlPanel.add(new JSeparator());
1809
+ cGridBag shadowbias = new cGridBag();
1810
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1811
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1812
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1813
+ diffuseSection.add(shadowbias);
1814
+
1815
+ panel.add(new JSeparator());
15381816
1539
- ctrlPanel.add(diffuseSection);
1817
+ panel.add(diffuseSection);
15401818
15411819 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15421820
....@@ -1572,7 +1850,7 @@
15721850 velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15731851 specularSection.add(velvet);
15741852
1575
- shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1);
1853
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
15761854 //Return();
15771855 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
15781856 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
....@@ -1584,42 +1862,54 @@
15841862 // aConstraints.gridy += 1;
15851863 // aConstraints.gridwidth = 1;
15861864
1865
+ cGridBag anisoU = new cGridBag();
1866
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1867
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1868
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1869
+ specularSection.add(anisoU);
15871870
1588
- ctrlPanel.add(new JSeparator());
1871
+ cGridBag anisoV = new cGridBag();
1872
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1873
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1874
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1875
+ specularSection.add(anisoV);
1876
+
1877
+
1878
+ panel.add(new JSeparator());
15891879
1590
- ctrlPanel.add(specularSection);
1880
+ panel.add(specularSection);
15911881
15921882 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15931883
1594
- cGridBag globalSection = new cGridBag().setVertical(true);
1884
+ //cGridBag globalSection = new cGridBag().setVertical(true);
15951885
15961886 cGridBag camera = new cGridBag();
15971887 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
15981888 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
15991889 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1600
- globalSection.add(camera);
1890
+ colorSection.add(camera);
16011891
16021892 cGridBag ambient = new cGridBag();
16031893 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
16041894 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16051895 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1606
- globalSection.add(ambient);
1896
+ colorSection.add(ambient);
16071897
16081898 cGridBag backlit = new cGridBag();
16091899 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
16101900 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16111901 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1612
- globalSection.add(backlit);
1902
+ colorSection.add(backlit);
16131903
16141904 cGridBag opacity = new cGridBag();
16151905 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
16161906 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16171907 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1618
- globalSection.add(opacity);
1908
+ colorSection.add(opacity);
16191909
1620
- ctrlPanel.add(new JSeparator());
1910
+ //panel.add(new JSeparator());
16211911
1622
- ctrlPanel.add(globalSection);
1912
+ //panel.add(globalSection);
16231913
16241914 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16251915
....@@ -1661,9 +1951,9 @@
16611951 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
16621952 textureSection.add(opacityPower);
16631953
1664
- ctrlPanel.add(new JSeparator());
1954
+ panel.add(new JSeparator());
16651955
1666
- ctrlPanel.add(textureSection);
1956
+ panel.add(textureSection);
16671957
16681958 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16691959
....@@ -1700,12 +1990,15 @@
17001990 opacityPowerField.addChangeListener(this);
17011991 /**/
17021992
1703
- resetSlidersButton.addActionListener(this);
17041993 clearMaterialButton.addActionListener(this);
17051994 createMaterialButton.addActionListener(this);
1706
-
1707
- propagateToggle.addItemListener(this);
1708
- multiplyToggle.addItemListener(this);
1995
+
1996
+ if (Globals.ADVANCED)
1997
+ {
1998
+ resetSlidersButton.addActionListener(this);
1999
+ propagateToggle.addItemListener(this);
2000
+ multiplyToggle.addItemListener(this);
2001
+ }
17092002 }
17102003
17112004 void DropFile(java.io.File[] files, boolean textures)
....@@ -1723,8 +2016,9 @@
17232016 // 3D models
17242017 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
17252018 {
1726
- lastConverter = new com.jmex.model.converters.MaxToJme();
1727
- LoadFile(filename, lastConverter);
2019
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2020
+ //LoadFile(filename, lastConverter);
2021
+ LoadObjFile(filename); // New 3ds loader
17282022 continue;
17292023 }
17302024 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -1876,7 +2170,7 @@
18762170
18772171 //? flashIt = false;
18782172 CameraPane pane = (CameraPane) cameraView;
1879
- pane.clickStart(location.x, location.y, 0);
2173
+ pane.clickStart(location.x, location.y, 0, 0);
18802174 pane.clickEnd(location.x, location.y, 0, true);
18812175
18822176 if (group.selection.size() == 1)
....@@ -1925,6 +2219,7 @@
19252219 e2.printStackTrace();
19262220 }
19272221 }
2222
+
19282223 LoadJMEThread loadThread;
19292224
19302225 class LoadJMEThread extends Thread
....@@ -1982,6 +2277,7 @@
19822277 //LoadFile0(filename, converter);
19832278 }
19842279 }
2280
+
19852281 LoadOBJThread loadObjThread;
19862282
19872283 class LoadOBJThread extends Thread
....@@ -2060,19 +2356,19 @@
20602356
20612357 void LoadObjFile(String fullname)
20622358 {
2063
- /*
2359
+ System.out.println("Loading " + fullname);
2360
+ /**/
20642361 //lastFilename = fullname;
20652362 if(loadObjThread == null)
20662363 {
2067
- loadObjThread = new LoadOBJThread();
2068
- loadObjThread.start();
2364
+ loadObjThread = new LoadOBJThread();
2365
+ loadObjThread.start();
20692366 }
20702367
20712368 loadObjThread.add(fullname);
2072
- */
2369
+ /**/
20732370
2074
- System.out.println("Loading " + fullname);
2075
- makeSomething(new FileObject(fullname, true), true);
2371
+ //makeSomething(new FileObject(fullname, true), true);
20762372 }
20772373
20782374 void LoadGFDFile(String fullname)
....@@ -2333,11 +2629,11 @@
23332629
23342630 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23352631 {
2336
- if (GrafreeD.standAlone)
2632
+ if (Grafreed.standAlone)
23372633 {
23382634 /**/
23392635 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2340
- browser.show();
2636
+ browser.setVisible(true);
23412637 String filename = browser.getFile();
23422638 if (filename != null && filename.length() > 0)
23432639 {
....@@ -2448,6 +2744,7 @@
24482744 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
24492745 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
24502746 }
2747
+
24512748 //cJME.count++;
24522749 //cJME.count %= 12;
24532750 if (gc)
....@@ -2482,6 +2779,7 @@
24822779 }
24832780 if (input == null)
24842781 {
2782
+ new Exception().printStackTrace();
24852783 System.exit(0);
24862784 }
24872785
....@@ -2630,6 +2928,7 @@
26302928 }
26312929 }
26322930 }
2931
+
26332932 cFileSystemPane FSPane;
26342933
26352934 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2683,11 +2982,14 @@
26832982 }
26842983 }
26852984 }
2985
+
26862986 freezematerial = false;
26872987 }
26882988
26892989 void SetMaterial(Object3D object)
26902990 {
2991
+ latestObject = object;
2992
+
26912993 cMaterial mat = object.material;
26922994
26932995 if (mat == null)
....@@ -2696,7 +2998,8 @@
26962998 return;
26972999 }
26983000
2699
- multiplyToggle.setSelected(mat.multiply);
3001
+ if (multiplyToggle != null)
3002
+ multiplyToggle.setSelected(mat.multiply);
27003003
27013004 assert (object.projectedVertices != null);
27023005
....@@ -2798,12 +3101,17 @@
27983101 // }
27993102
28003103 /**/
2801
- if (deselect)
3104
+ if (deselect || child == null)
28023105 {
28033106 //group.deselectAll();
28043107 //freeze = true;
28053108 GetTree().clearSelection();
28063109 //freeze = false;
3110
+
3111
+ if (child == null)
3112
+ {
3113
+ return;
3114
+ }
28073115 }
28083116
28093117 //group.addSelectee(child);
....@@ -2872,7 +3180,7 @@
28723180 cameraView.ToggleDL();
28733181 cameraView.repaint();
28743182 return;
2875
- } else if (event.getSource() == toggleTextureItem)
3183
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
28763184 {
28773185 cameraView.ToggleTexture();
28783186 // june 2013 copy.HardTouch();
....@@ -2911,9 +3219,9 @@
29113219 frame.validate();
29123220
29133221 return;
2914
- } else if (event.getSource() == toggleRandomItem)
3222
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29153223 {
2916
- cameraView.ToggleRandom();
3224
+ cameraView.ToggleSwitch();
29173225 cameraView.repaint();
29183226 return;
29193227 } else if (event.getSource() == toggleHandleItem)
....@@ -2942,6 +3250,10 @@
29423250 {
29433251 copy.live ^= true;
29443252 return;
3253
+ } else if (event.getSource() == selectCB)
3254
+ {
3255
+ copy.dontselect ^= true;
3256
+ return;
29453257 } else if (event.getSource() == hideCB)
29463258 {
29473259 copy.hide ^= true;
....@@ -2956,6 +3268,7 @@
29563268 if (event.getSource() == randomCB)
29573269 {
29583270 copy.random ^= true;
3271
+ objEditor.refreshContents();
29593272 return;
29603273 }
29613274 if (event.getSource() == speedupCB)
....@@ -2979,8 +3292,9 @@
29793292
29803293 public void actionPerformed(ActionEvent event)
29813294 {
3295
+ Object source = event.getSource();
29823296 // SCRIPT DIALOG
2983
- if (event.getSource() == okbutton)
3297
+ if (source == okbutton)
29843298 {
29853299 textpanel.setVisible(false);
29863300 textpanel.remove(textarea);
....@@ -2992,7 +3306,7 @@
29923306 textarea = null;
29933307 textpanel = null;
29943308 }
2995
- if (event.getSource() == cancelbutton)
3309
+ if (source == cancelbutton)
29963310 {
29973311 textpanel.setVisible(false);
29983312 textpanel.remove(textarea);
....@@ -3004,50 +3318,50 @@
30043318 //applySelf();
30053319 //client.refreshEditWindow();
30063320 //refreshContents();
3007
- if (event.getSource() == nameField)
3321
+ if (source == nameField)
30083322 {
30093323 //System.out.println("ObjEditor " + event);
30103324 applySelf0(true);
30113325 //parent.applySelf();
30123326 objEditor.refreshContents();
3013
- } else if (event.getSource() == resetButton)
3327
+ } else if (source == resetButton)
30143328 {
30153329 CameraPane.fullreset = true;
30163330 copy.Reset(); // ResetMeshes();
30173331 copy.Touch();
30183332 objEditor.refreshContents();
3019
- } else if (event.getSource() == stepItem)
3333
+ } else if (source == stepItem)
30203334 {
30213335 //cameraView.ONESTEP = true;
30223336 Globals.ONESTEP = true;
30233337 cameraView.repaint();
30243338 return;
3025
- } else if (event.getSource() == stepButton)
3339
+ } else if (source == stepButton)
30263340 {
30273341 copy.Step();
30283342 copy.Touch();
30293343 objEditor.refreshContents();
3030
- } else if (event.getSource() == slowerButton)
3344
+ } else if (source == slowerButton)
30313345 {
30323346 copy.Slower();
30333347 copy.Touch();
30343348 objEditor.refreshContents();
3035
- } else if (event.getSource() == fasterButton)
3349
+ } else if (source == fasterButton)
30363350 {
30373351 copy.Faster();
30383352 copy.Touch();
30393353 objEditor.refreshContents();
3040
- } else if (event.getSource() == remarkButton)
3354
+ } else if (source == remarkButton)
30413355 {
30423356 copy.Remark();
30433357 copy.Touch();
30443358 objEditor.refreshContents();
3045
- } else if (event.getSource() == stepAllButton)
3359
+ } else if (source == stepAllButton)
30463360 {
30473361 copy.StepAll();
30483362 copy.Touch();
30493363 objEditor.refreshContents();
3050
- } else if (event.getSource() == resetAllButton)
3364
+ } else if (source == resetAllButton)
30513365 {
30523366 //CameraPane.fullreset = true;
30533367 copy.ResetAll(); // ResetMeshes();
....@@ -3080,53 +3394,79 @@
30803394 // Close();
30813395 // }
30823396 // else
3083
- if (event.getSource() == resetSlidersButton)
3397
+ if (source == resetSlidersButton)
30843398 {
30853399 ResetSliders();
3086
- } else if (event.getSource() == clearMaterialButton)
3400
+ } else if (source == clearMaterialButton)
30873401 {
30883402 ClearMaterial();
3089
- } else if (event.getSource() == createMaterialButton)
3403
+ } else if (source == createMaterialButton)
30903404 {
30913405 CreateMaterial();
3092
- } else if (event.getSource() == clearPanelButton)
3406
+ } else if (source == clearPanelButton)
30933407 {
30943408 copy.ClearUI();
30953409 refreshContents(true);
3096
- } /*
3097
- }
3098
-
3099
- public boolean action(Event event, Object arg)
3100
- {
3101
- */ else if (event.getSource() == closeItem)
3410
+ } else if (source == importGFDItem)
3411
+ {
3412
+ ImportGFD();
3413
+ } else
3414
+ if (source == importVRMLX3DItem)
3415
+ {
3416
+ ImportVRMLX3D();
3417
+ } else
3418
+ if (source == import3DSItem)
3419
+ {
3420
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3421
+ } else
3422
+ if (source == importOBJItem)
3423
+ {
3424
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3425
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3426
+ browser.setVisible(true);
3427
+ String filename = browser.getFile();
3428
+ if (filename != null && filename.length() > 0)
3429
+ {
3430
+ String fullname = browser.getDirectory() + filename;
3431
+ makeSomething(ReadOBJ(fullname), true);
3432
+ }
3433
+ } else
3434
+ if (source == closeItem)
31023435 {
31033436 Close();
31043437 //return true;
3105
- } else if (event.getSource() == loadItem)
3438
+ } else if (source == openItem)
31063439 {
3107
- load();
3440
+ Open();
31083441 //return true;
3109
- } else if (event.getSource() == saveItem)
3442
+ } else if (source == newItem)
3443
+ {
3444
+ New();
3445
+ } else if (source == saveItem)
31103446 {
31113447 save();
31123448 //return true;
3113
- } else if (event.getSource() == saveAsItem)
3449
+ } else if (source == saveAsItem)
31143450 {
31153451 saveAs();
31163452 //return true;
3117
- } else if (event.getSource() == reexportItem)
3453
+ } else if (source == reexportItem)
31183454 {
31193455 reexport();
31203456 //return true;
3121
- } else if (event.getSource() == exportAsItem)
3457
+ } else if (source == exportAsItem)
31223458 {
31233459 export();
31243460 //return true;
3125
- } else if (event.getSource() == povItem)
3461
+ } else if (source == povItem)
31263462 {
31273463 generatePOV();
31283464 //return true;
3129
- } else if (event.getSource() == zBufferItem)
3465
+ } else if (event.getSource() == archiveItem)
3466
+ {
3467
+ cTools.Archive(frame);
3468
+ return;
3469
+ } else if (source == zBufferItem)
31303470 {
31313471 try
31323472 {
....@@ -3148,21 +3488,8 @@
31483488 cameraView.repaint();
31493489 //return true;
31503490 }
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)
3491
+ */ else // combos...
3492
+ if (source == texresMenu)
31663493 {
31673494 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
31683495 copy.texres = texresMenu.getSelectedIndex();
....@@ -3174,12 +3501,409 @@
31743501 }
31753502 }
31763503
3504
+ void New()
3505
+ {
3506
+ while (copy.Size() > 1)
3507
+ {
3508
+ copy.remove(1);
3509
+ }
3510
+
3511
+ ResetModel();
3512
+ objEditor.refreshContents();
3513
+ }
3514
+
3515
+ static public byte[] Compress(Object3D o)
3516
+ {
3517
+ try
3518
+ {
3519
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3520
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3521
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
3522
+
3523
+ Object3D parent = o.parent;
3524
+ o.parent = null;
3525
+
3526
+ out.writeObject(o);
3527
+
3528
+ o.parent = parent;
3529
+
3530
+ out.flush();
3531
+
3532
+ baos //zstream
3533
+ .close();
3534
+ out.close();
3535
+
3536
+ byte[] bytes = baos.toByteArray();
3537
+
3538
+ System.out.println("save #bytes = " + bytes.length);
3539
+ return bytes;
3540
+ } catch (Exception e)
3541
+ {
3542
+ System.err.println(e);
3543
+ return null;
3544
+ }
3545
+ }
3546
+
3547
+ static public Object Uncompress(byte[] bytes)
3548
+ {
3549
+ System.out.println("restore #bytes = " + bytes.length);
3550
+ try
3551
+ {
3552
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3553
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3554
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
3555
+ Object obj = in.readObject();
3556
+
3557
+ bais //istream
3558
+ .close();
3559
+ in.close();
3560
+
3561
+ return obj;
3562
+ } catch (Exception e)
3563
+ {
3564
+ System.err.println(e);
3565
+ return null;
3566
+ }
3567
+ }
3568
+
3569
+ static public Object clone(Object o)
3570
+ {
3571
+ try
3572
+ {
3573
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3574
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3575
+
3576
+ out.writeObject(o);
3577
+
3578
+ out.flush();
3579
+ out.close();
3580
+
3581
+ byte[] bytes = baos.toByteArray();
3582
+
3583
+ System.out.println("clone = " + bytes.length);
3584
+
3585
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3586
+ ObjectInputStream in = new ObjectInputStream(bais);
3587
+ Object obj = in.readObject();
3588
+ in.close();
3589
+
3590
+ return obj;
3591
+ } catch (Exception e)
3592
+ {
3593
+ System.err.println(e);
3594
+ return null;
3595
+ }
3596
+ }
3597
+
3598
+ cRadio GetCurrentTab()
3599
+ {
3600
+ cRadio ab;
3601
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3602
+ {
3603
+ ab = (cRadio)e.nextElement();
3604
+ if(ab.GetObject() == copy)
3605
+ {
3606
+ return ab;
3607
+ }
3608
+ }
3609
+
3610
+ return null;
3611
+ }
3612
+
3613
+
3614
+ public void Save()
3615
+ {
3616
+ //Save(true);
3617
+ Replace();
3618
+ }
3619
+
3620
+ private boolean Equal(byte[] compress, byte[] name)
3621
+ {
3622
+ if (compress.length != name.length)
3623
+ {
3624
+ return false;
3625
+ }
3626
+
3627
+ for (int i=compress.length; --i>=0;)
3628
+ {
3629
+ if (compress[i] != name[i])
3630
+ return false;
3631
+ }
3632
+
3633
+ return true;
3634
+ }
3635
+
3636
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
3637
+
3638
+ public boolean Save(boolean user)
3639
+ {
3640
+ System.err.println("Save");
3641
+
3642
+ cRadio tab = GetCurrentTab();
3643
+
3644
+ byte[] compress = CompressCopy();
3645
+
3646
+ boolean thesame = false;
3647
+
3648
+ // Quick heuristic using length. Works only when stream is compressed.
3649
+ if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3650
+ {
3651
+ thesame = true;
3652
+ }
3653
+
3654
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3655
+ if (!thesame)
3656
+ {
3657
+ //tab.user[tab.versionindex] = user;
3658
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
3659
+
3660
+ copy.versions[++copy.versionindex] = compress;
3661
+
3662
+ // if (increment)
3663
+ // tab.versionindex++;
3664
+ }
3665
+
3666
+ //copy.RestoreBigData(versiontable);
3667
+
3668
+ //assert(hashtable.isEmpty());
3669
+
3670
+ for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3671
+ {
3672
+ //tab.user[i] = false;
3673
+ copy.versions[i] = null;
3674
+ }
3675
+
3676
+ SetUndoStates();
3677
+
3678
+ // test save
3679
+ if (false)
3680
+ {
3681
+ try
3682
+ {
3683
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
3684
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3685
+
3686
+ p.writeObject(copy);
3687
+
3688
+ p.flush();
3689
+
3690
+ ostream.close();
3691
+ } catch (Exception e)
3692
+ {
3693
+ e.printStackTrace();
3694
+ }
3695
+ }
3696
+
3697
+ return !thesame;
3698
+ }
3699
+
3700
+ void CopyChanged(Object3D obj)
3701
+ {
3702
+ SetUndoStates();
3703
+
3704
+ boolean temp = CameraPane.SWITCH;
3705
+ CameraPane.SWITCH = false;
3706
+
3707
+ copy.ExtractBigData(versiontable);
3708
+
3709
+ copy.clear();
3710
+
3711
+ for (int i=0; i<obj.Size(); i++)
3712
+ {
3713
+ copy.add(obj.get(i));
3714
+ }
3715
+
3716
+ copy.RestoreBigData(versiontable);
3717
+
3718
+ CameraPane.SWITCH = temp;
3719
+
3720
+ //assert(hashtable.isEmpty());
3721
+
3722
+ copy.Touch();
3723
+
3724
+ ResetModel();
3725
+ copy.HardTouch(); // recompile?
3726
+
3727
+ cRadio ab;
3728
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3729
+ {
3730
+ ab = (cRadio)e.nextElement();
3731
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3732
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3733
+ if (test != null)
3734
+ {
3735
+ test.editWindow = ab.object.editWindow;
3736
+ ab.object = test;
3737
+ }
3738
+ }
3739
+
3740
+ refreshContents();
3741
+ }
3742
+
3743
+ cButton undoButton;
3744
+ cButton restoreButton;
3745
+ cButton replaceButton;
3746
+ cButton redoButton;
3747
+
3748
+ boolean muteSlider;
3749
+
3750
+ int VersionCount()
3751
+ {
3752
+ int count = 0;
3753
+
3754
+ for (int i = copy.versions.length; --i >= 0;)
3755
+ {
3756
+ if (copy.versions[i] != null)
3757
+ count++;
3758
+ }
3759
+
3760
+ return count;
3761
+ }
3762
+
3763
+ void SetUndoStates()
3764
+ {
3765
+ cRadio tab = GetCurrentTab();
3766
+
3767
+ restoreButton.setEnabled(copy.versionindex != -1);
3768
+ replaceButton.setEnabled(copy.versionindex != -1);
3769
+
3770
+ undoButton.setEnabled(copy.versionindex > 0);
3771
+ redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
3772
+
3773
+ muteSlider = true;
3774
+ versionSlider.setMaximum(VersionCount() - 1);
3775
+ versionSlider.setInteger(copy.versionindex);
3776
+ muteSlider = false;
3777
+ }
3778
+
3779
+ public boolean Undo()
3780
+ {
3781
+ // Option?
3782
+ Replace();
3783
+
3784
+ System.err.println("Undo");
3785
+
3786
+ cRadio tab = GetCurrentTab();
3787
+
3788
+ if (copy.versionindex == 0)
3789
+ {
3790
+ java.awt.Toolkit.getDefaultToolkit().beep();
3791
+ return false;
3792
+ }
3793
+
3794
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
3795
+// {
3796
+// if (Save(false))
3797
+// tab.versionindex -= 1;
3798
+// else
3799
+// {
3800
+// if (tab.versionindex <= 0)
3801
+// return false;
3802
+// else
3803
+// tab.versionindex -= 1;
3804
+// }
3805
+// }
3806
+
3807
+ copy.versionindex -= 1;
3808
+
3809
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3810
+
3811
+ return true;
3812
+ }
3813
+
3814
+ public boolean Restore()
3815
+ {
3816
+ System.err.println("Restore");
3817
+
3818
+ cRadio tab = GetCurrentTab();
3819
+
3820
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3821
+ {
3822
+ java.awt.Toolkit.getDefaultToolkit().beep();
3823
+ return false;
3824
+ }
3825
+
3826
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3827
+
3828
+ return true;
3829
+ }
3830
+
3831
+ public boolean Replace()
3832
+ {
3833
+ System.err.println("Replace");
3834
+
3835
+ cRadio tab = GetCurrentTab();
3836
+
3837
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3838
+ {
3839
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
3840
+ return false;
3841
+ }
3842
+
3843
+ copy.versions[copy.versionindex] = CompressCopy();
3844
+
3845
+ return true;
3846
+ }
3847
+
3848
+ public void Redo()
3849
+ {
3850
+ // Option?
3851
+ Replace();
3852
+
3853
+ cRadio tab = GetCurrentTab();
3854
+
3855
+ if (copy.versions[copy.versionindex + 1] == null)
3856
+ {
3857
+ java.awt.Toolkit.getDefaultToolkit().beep();
3858
+ return;
3859
+ }
3860
+
3861
+ copy.versionindex += 1;
3862
+
3863
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3864
+
3865
+ //if (!tab.user[tab.versionindex])
3866
+ // tab.graphs[tab.versionindex] = null;
3867
+ }
3868
+
3869
+ void ImportGFD()
3870
+ {
3871
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
3872
+ browser.show();
3873
+ String filename = browser.getFile();
3874
+ if (filename != null && filename.length() > 0)
3875
+ {
3876
+ String fullname = browser.getDirectory() + filename;
3877
+
3878
+ //Object3D readobj =
3879
+ objEditor.ReadGFD(fullname, objEditor);
3880
+ //makeSomething(readobj);
3881
+ }
3882
+ }
3883
+
3884
+ void ImportVRMLX3D()
3885
+ {
3886
+ if (Grafreed.standAlone)
3887
+ {
3888
+ /**/
3889
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3890
+ browser.show();
3891
+ String filename = browser.getFile();
3892
+ if (filename != null && filename.length() > 0)
3893
+ {
3894
+ String fullname = browser.getDirectory() + filename;
3895
+ LoadVRMLX3D(fullname);
3896
+ }
3897
+ /**/
3898
+ }
3899
+ }
3900
+
31773901 void ToggleAnimation()
31783902 {
31793903 if (!Globals.ANIMATION)
31803904 {
31813905 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3182
- browser.show();
3906
+ browser.setVisible(true);
31833907 String filename = browser.getFile();
31843908 if (filename != null && filename.length() > 0)
31853909 {
....@@ -3189,8 +3913,8 @@
31893913
31903914 Globals.ANIMATION ^= true;
31913915
3192
- GrafreeD.wav.cursor = 0;
3193
- GrafreeD.wav.loop = 0;
3916
+ Grafreed.wav.cursor = 0;
3917
+ Grafreed.wav.loop = 0;
31943918 }
31953919 } else
31963920 {
....@@ -3240,7 +3964,7 @@
32403964 void CreateMaterial()
32413965 {
32423966 //copy.ClearMaterial(); // PATCH
3243
- copy.CreateMaterialS(multiplyToggle.isSelected());
3967
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32443968 if (copy.selection.size() > 0)
32453969 //SetMaterial(copy);
32463970 {
....@@ -3291,7 +4015,7 @@
32914015 assert false;
32924016 }
32934017
3294
- void EditSelection()
4018
+ void EditSelection(boolean newWindow)
32954019 {
32964020 }
32974021
....@@ -3299,11 +4023,11 @@
32994023 {
33004024 copy.ResetBlockLoop(); // temporary problem
33014025
3302
- boolean random = CameraPane.RANDOM;
3303
- CameraPane.RANDOM = false; // parse everything
4026
+ boolean random = CameraPane.SWITCH;
4027
+ CameraPane.SWITCH = false; // parse everything
33044028 copy.ResetDisplayList();
33054029 copy.HardTouch();
3306
- CameraPane.RANDOM = random;
4030
+ CameraPane.SWITCH = random;
33074031 }
33084032
33094033 // public void applySelf()
....@@ -3377,6 +4101,36 @@
33774101 {
33784102 //System.out.println("Propagate = " + propagate);
33794103 copy.UpdateMaterial(anchor, current, propagate);
4104
+
4105
+ if (copy.material != null)
4106
+ {
4107
+ cMaterial mat = copy.material;
4108
+
4109
+ colorField.SetToolTipValue((mat.color));
4110
+ modulationField.SetToolTipValue((mat.modulation));
4111
+ metalnessField.SetToolTipValue((mat.metalness));
4112
+ diffuseField.SetToolTipValue((mat.diffuse));
4113
+ specularField.SetToolTipValue((mat.specular));
4114
+ shininessField.SetToolTipValue((mat.shininess));
4115
+ shiftField.SetToolTipValue((mat.shift));
4116
+ ambientField.SetToolTipValue((mat.ambient));
4117
+ lightareaField.SetToolTipValue((mat.lightarea));
4118
+ diffusenessField.SetToolTipValue((mat.factor));
4119
+ velvetField.SetToolTipValue((mat.velvet));
4120
+ sheenField.SetToolTipValue((mat.sheen));
4121
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4122
+ backlitField.SetToolTipValue((mat.bump));
4123
+ anisoField.SetToolTipValue((mat.aniso));
4124
+ anisoVField.SetToolTipValue((mat.anisoV));
4125
+ cameraField.SetToolTipValue((mat.cameralight));
4126
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4127
+ shadowField.SetToolTipValue((mat.shadow));
4128
+ textureField.SetToolTipValue((mat.texture));
4129
+ opacityField.SetToolTipValue((mat.opacity));
4130
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4131
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
4132
+ }
4133
+
33804134 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
33814135 {
33824136 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3405,9 +4159,25 @@
34054159 //copy.Touch();
34064160 }
34074161
4162
+ cNumberSlider versionSlider;
4163
+
34084164 public void stateChanged(ChangeEvent e)
34094165 {
34104166 // assert(false);
4167
+ if (e.getSource() == versionSlider)
4168
+ {
4169
+ if (muteSlider)
4170
+ return;
4171
+
4172
+ int version = versionSlider.getInteger();
4173
+
4174
+ if (copy.versions[version] != null)
4175
+ {
4176
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version]));
4177
+ }
4178
+
4179
+ return;
4180
+ }
34114181
34124182 if (freezematerial)
34134183 {
....@@ -3421,6 +4191,7 @@
34214191 || e.getSource() == apertureField
34224192 || e.getSource() == shadowblurField)
34234193 {
4194
+ new Exception().printStackTrace();
34244195 System.exit(0);
34254196 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34264197 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3491,7 +4262,7 @@
34914262 }
34924263
34934264 if (normalpushField != null)
3494
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
4265
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
34954266 }
34964267
34974268 void SnapObject()
....@@ -3755,6 +4526,8 @@
37554526
37564527 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37574528 {
4529
+ if (Globals.REPLACEONMAKE) // && resetmodel)
4530
+ Save();
37584531 //Tween.set(thing, 0).target(1).start(tweenManager);
37594532 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37604533 // if (thing instanceof GenericJointDemo)
....@@ -3841,6 +4614,12 @@
38414614 {
38424615 ResetModel();
38434616 Select(thing.GetTreePath(), true, false); // unselect... false);
4617
+
4618
+ if (thing.Size() == 0)
4619
+ {
4620
+ //EditSelection(false);
4621
+ }
4622
+
38444623 refreshContents();
38454624 }
38464625
....@@ -3958,6 +4737,7 @@
39584737 }
39594738 }
39604739 }
4740
+
39614741 LoadGFDThread loadGFDThread;
39624742
39634743 void ReadGFD(String fullname, iCallBack cb)
....@@ -3977,8 +4757,10 @@
39774757
39784758 try
39794759 {
4760
+ // Try compressed version first.
39804761 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
3981
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4762
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4763
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
39824764
39834765 readobj = (Object3D) p.readObject();
39844766 istream.close();
....@@ -3986,7 +4768,20 @@
39864768 readobj.ResetDisplayList();
39874769 } catch (Exception e)
39884770 {
3989
- e.printStackTrace();
4771
+ //e.printStackTrace();
4772
+ try
4773
+ {
4774
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4775
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4776
+
4777
+ readobj = (Object3D) p.readObject();
4778
+ istream.close();
4779
+
4780
+ readobj.ResetDisplayList();
4781
+ } catch (Exception e2)
4782
+ {
4783
+ e2.printStackTrace();
4784
+ }
39904785 }
39914786 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
39924787 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4032,6 +4827,12 @@
40324827
40334828 void LoadIt(Object obj)
40344829 {
4830
+ if (obj == null)
4831
+ {
4832
+ // Invalid file
4833
+ return;
4834
+ }
4835
+
40354836 System.out.println("Loaded " + obj);
40364837 //new Exception().printStackTrace();
40374838 Object3D readobj = (Object3D) obj;
....@@ -4041,6 +4842,8 @@
40414842
40424843 if (readobj != null)
40434844 {
4845
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
4846
+ // Save();
40444847 try
40454848 {
40464849 //readobj.deepCopySelf(copy);
....@@ -4095,15 +4898,26 @@
40954898 c.addChild(csg);
40964899 }
40974900
4901
+ copy.versions = readobj.versions;
4902
+ copy.versionindex = readobj.versionindex;
4903
+
4904
+ if (copy.versions == null)
4905
+ {
4906
+ copy.versions = new byte[100][];
4907
+ copy.versionindex = -1;
4908
+ }
4909
+
4910
+ //? SetUndoStates();
4911
+
40984912 ResetModel();
40994913 copy.HardTouch(); // recompile?
41004914 refreshContents();
41014915 }
41024916 }
41034917
4104
- void load() // throws ClassNotFoundException
4918
+ void Open() // throws ClassNotFoundException
41054919 {
4106
- if (GrafreeD.standAlone)
4920
+ if (Grafreed.standAlone)
41074921 {
41084922 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
41094923 browser.show();
....@@ -4190,11 +5004,13 @@
41905004 try
41915005 {
41925006 FileOutputStream ostream = new FileOutputStream(lastname);
4193
- ObjectOutputStream p = new ObjectOutputStream(ostream);
5007
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5008
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
41945009
41955010 p.writeObject(copy);
41965011 p.flush();
41975012
5013
+ zstream.close();
41985014 ostream.close();
41995015
42005016 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4204,17 +5020,20 @@
42045020 {
42055021 }
42065022 }
5023
+
42075024 String lastname;
42085025
42095026 void saveAs()
42105027 {
4211
- if (GrafreeD.standAlone)
5028
+ if (Grafreed.standAlone)
42125029 {
42135030 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42145031 browser.setVisible(true);
42155032 String filename = browser.getFile();
42165033 if (filename != null && filename.length() > 0)
42175034 {
5035
+ if (!filename.endsWith(".gfd"))
5036
+ filename += ".gfd";
42185037 lastname = browser.getDirectory() + filename;
42195038 save();
42205039 }
....@@ -4313,13 +5132,13 @@
43135132 try
43145133 {
43155134 FileOutputStream ostream = new FileOutputStream(filename);
4316
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4317
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
5135
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5136
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43185137
43195138 Object3D objectparent = obj.parent;
43205139 obj.parent = null;
43215140
4322
- Object3D object = (Object3D) GrafreeD.clone(obj);
5141
+ Object3D object = (Object3D) Grafreed.clone(obj);
43235142
43245143 obj.parent = objectparent;
43255144
....@@ -4331,8 +5150,8 @@
43315150 p.writeObject(object);
43325151 p.flush();
43335152
5153
+ zstream.close();
43345154 ostream.close();
4335
- // zstream.close();
43365155
43375156 // group.selection.get(0).parent = parent;
43385157 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4353,7 +5172,7 @@
43535172 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43545173 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43555174 copy.generatePOV(buffer);
4356
- if (GrafreeD.standAlone)
5175
+ if (Grafreed.standAlone)
43575176 {
43585177 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43595178 browser.show();
....@@ -4379,21 +5198,20 @@
43795198 Object3D client;
43805199 Object3D copy;
43815200 MenuBar menuBar;
4382
- Menu windowMenu;
4383
- MenuItem loadItem;
5201
+ Menu fileMenu;
5202
+ MenuItem newItem;
5203
+ MenuItem openItem;
43845204 MenuItem saveItem;
43855205 MenuItem saveAsItem;
43865206 MenuItem exportAsItem;
43875207 MenuItem reexportItem;
43885208 MenuItem povItem;
43895209 MenuItem closeItem;
4390
- Menu cameraMenu;
5210
+
43915211 CheckboxMenuItem zBufferItem;
43925212 //MenuItem normalLensItem;
4393
- MenuItem editCameraItem;
4394
- MenuItem revertCameraItem;
4395
- CheckboxMenuItem toggleLiveItem;
43965213 MenuItem stepItem;
5214
+ CheckboxMenuItem toggleLiveItem;
43975215 CheckboxMenuItem toggleFullScreenItem;
43985216 CheckboxMenuItem toggleTimelineItem;
43995217 CheckboxMenuItem toggleRenderItem;
....@@ -4402,25 +5220,39 @@
44025220 CheckboxMenuItem toggleFootContactItem;
44035221 CheckboxMenuItem toggleDLItem;
44045222 CheckboxMenuItem toggleTextureItem;
4405
- CheckboxMenuItem toggleRandomItem;
5223
+ CheckboxMenuItem toggleSwitchItem;
44065224 CheckboxMenuItem toggleRootItem;
44075225 CheckboxMenuItem animationItem;
5226
+ MenuItem archiveItem;
44085227 CheckboxMenuItem toggleHandleItem;
44095228 CheckboxMenuItem togglePaintItem;
44105229 JSplitPane mainPanel;
44115230 JScrollPane scrollpane;
5231
+
44125232 JPanel toolbarPanel;
4413
- JPanel treePanel;
5233
+
5234
+ cGridBag treePanel;
5235
+
44145236 JPanel radioPanel;
44155237 ButtonGroup buttonGroup;
4416
- cGridBag ctrlPanel;
5238
+
5239
+ cGridBag toolboxPanel;
44175240 cGridBag materialPanel;
5241
+ cGridBag ctrlPanel;
5242
+
44185243 JScrollPane infoPanel;
5244
+
44195245 cGridBag optionsPanel;
5246
+
44205247 JTabbedPane objectPanel;
5248
+ boolean materialFlushed;
5249
+ Object3D latestObject;
5250
+
44215251 cGridBag XYZPanel;
5252
+
44225253 JSplitPane gridPanel;
44235254 JSplitPane bigPanel;
5255
+
44245256 cGridBag bigThree;
44255257 cGridBag scenePanel;
44265258 cGridBag centralPanel;
....@@ -4535,8 +5367,13 @@
45355367 cNumberSlider fogField;
45365368 JLabel opacityPowerLabel;
45375369 cNumberSlider opacityPowerField;
4538
- JTree jTree;
5370
+ cTree jTree;
45395371 //ObjectUI parent;
45405372
45415373 cNumberSlider normalpushField;
5374
+
5375
+ private MenuItem importGFDItem;
5376
+ private MenuItem importVRMLX3DItem;
5377
+ private MenuItem import3DSItem;
5378
+ private MenuItem importOBJItem;
45425379 }