Normand Briere
2019-07-27 1af7d3700724834e40ad8636bc9a56cdc3b19b15
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 selectableCB;
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,78 @@
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
+ selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1190
+ selectableCB.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
+
1193
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1194
+ hideCB.setToolTipText("Hide object");
1195
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1196
+ markCB.setToolTipText("As animation target transform");
1197
+
1198
+ setupPanel2 = new cGridBag().setVertical(false);
1199
+
1200
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1201
+ rewindCB.setToolTipText("Rewind animation");
1202
+
1203
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1204
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
1205
+
1206
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1207
+ link2masterCB.setToolTipText("Attach to support");
1208
+
1209
+ if (Globals.ADVANCED)
1210
+ {
1211
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1212
+ speedupCB.setToolTipText("Option motion capture");
1213
+ }
1214
+
1215
+ oe.ctrlPanel.add(setupPanel);
1216
+ oe.ctrlPanel.Return();
1217
+ oe.ctrlPanel.add(setupPanel2);
1218
+ oe.ctrlPanel.Return();
1219
+
1220
+ objectCommandsPanel = new cGridBag().setVertical(false);
1221
+
1222
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1223
+ resetButton.setToolTipText("Jump to frame zero");
1224
+ stepButton = AddButton(objectCommandsPanel, "Step");
1225
+ stepButton.setToolTipText("Step one frame");
9731226 // resetAllButton = AddButton(oe, "Reset All");
9741227 // stepAllButton = AddButton(oe, "Step All");
975
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9761228 // Return();
977
- slowerButton = AddButton(oe, "Slow");
978
- fasterButton = AddButton(oe, "Fast");
979
- remarkButton = AddButton(oe, "Rem");
1229
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1230
+ slowerButton.setToolTipText("Decrease animation speed");
1231
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1232
+ fasterButton.setToolTipText("Increase animation speed");
1233
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1234
+ remarkButton.setToolTipText("Set the current transform as the target");
9801235
981
- //Return();
1236
+ oe.ctrlPanel.add(objectCommandsPanel);
1237
+ oe.ctrlPanel.Return();
9821238
983
- //normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1);
1239
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1240
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
9841241 //Return();
1242
+
1243
+ oe.ctrlPanel.Return();
9851244
9861245 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9871246 // ObjEditor.aConstraints.gridx += 1;
....@@ -1076,7 +1335,7 @@
10761335 oe.aConstraints.gridwidth = 1;
10771336 /**/
10781337 nameField = AddText(oe.ctrlPanel, copy.GetName());
1079
- Return();
1338
+ oe.ctrlPanel.Return();
10801339
10811340 //ctrlPanel.add(textureButton = new Button("Texture..."));
10821341 //textureButton.setEnabled(false);
....@@ -1180,8 +1439,11 @@
11801439 //worldPanel.setName("World");
11811440 centralPanel = new cGridBag();
11821441 centralPanel.preferredWidth = 20;
1183
- timelinePanel = new JPanel(new BorderLayout());
1184
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1442
+
1443
+ if (Globals.ADVANCED)
1444
+ {
1445
+ timelinePanel = new JPanel(new BorderLayout());
1446
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11851447
11861448 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
11871449 cameraPanel.setContinuousLayout(true);
....@@ -1190,7 +1452,10 @@
11901452 // cameraPanel.setDividerSize(9);
11911453 cameraPanel.setResizeWeight(1.0);
11921454
1455
+ }
1456
+
11931457 centralPanel.add(cameraView);
1458
+ centralPanel.setFocusable(true);
11941459 //frame.setJMenuBar(timelineMenubar);
11951460 //centralPanel.add(timelinePanel);
11961461
....@@ -1216,6 +1481,7 @@
12161481 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
12171482 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
12181483 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1484
+ //XYZPanel.setName("XYZ");
12191485
12201486 /*
12211487 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1253,11 +1519,23 @@
12531519 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12541520 //tmp.setName("Edit");
12551521 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);
1522
+ objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1523
+// JPanel north = new JPanel(new BorderLayout());
1524
+// north.setName("Edit");
1525
+// north.add(ctrlPanel, BorderLayout.NORTH);
1526
+// objectPanel.add(north);
1527
+ objectPanel.add(editPanel);
1528
+ objectPanel.setIconAt(1, GetIcon("icons/write.png"));
1529
+
1530
+ //if (Globals.ADVANCED)
1531
+ objectPanel.add(infoPanel);
1532
+ objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1533
+
1534
+ objectPanel.add(XYZPanel);
1535
+ objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
1536
+
1537
+ objectPanel.add(toolboxPanel);
1538
+ objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
12611539
12621540 /*
12631541 aConstraints.gridx = 0;
....@@ -1266,7 +1544,7 @@
12661544 aConstraints.gridy += 1;
12671545 aConstraints.gridwidth = 1;
12681546 mainPanel.add(objectPanel, aConstraints);
1269
- */
1547
+ */
12701548
12711549 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12721550 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1278,14 +1556,12 @@
12781556 scrollpane.addMouseWheelListener(this); // Default not fast enough
12791557
12801558 /*JTabbedPane*/ scenePanel = new cGridBag();
1281
- scenePanel.preferredWidth = 7;
1559
+ scenePanel.preferredWidth = 5;
12821560
12831561 JTabbedPane tabbedPane = new JTabbedPane();
12841562 tabbedPane.add(scrollpane);
12851563
1286
- tabbedPane.add(FSPane = new cFileSystemPane(this));
1287
-
1288
- optionsPanel = new cGridBag().setVertical(true);
1564
+ optionsPanel = new cGridBag().setVertical(false);
12891565
12901566 optionsPanel.setName("Options");
12911567
....@@ -1293,6 +1569,8 @@
12931569
12941570 tabbedPane.add(optionsPanel);
12951571
1572
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
1573
+
12961574 scenePanel.add(tabbedPane);
12971575
12981576 /*
....@@ -1354,9 +1632,9 @@
13541632 /**/
13551633
13561634 bigThree = new cGridBag();
1357
- bigThree.addComponent(scenePanel);
13581635 bigThree.addComponent(centralPanel);
1359
- bigThree.addComponent(XYZPanel);
1636
+ bigThree.addComponent(scenePanel);
1637
+ //bigThree.addComponent(XYZPanel);
13601638
13611639 // // SIDE EFFECT!!!
13621640 // aConstraints.gridx = 0;
....@@ -1365,9 +1643,9 @@
13651643 // aConstraints.gridheight = 1;
13661644
13671645 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1368
- framePanel.setContinuousLayout(true);
1369
- framePanel.setOneTouchExpandable(true);
1370
- framePanel.setDividerLocation(0.8);
1646
+ framePanel.setContinuousLayout(false);
1647
+ framePanel.setOneTouchExpandable(false);
1648
+ //.setDividerLocation(0.8);
13711649 //framePanel.setDividerSize(15);
13721650 //framePanel.setResizeWeight(0.15);
13731651 framePanel.setName("Frame");
....@@ -1384,10 +1662,15 @@
13841662
13851663 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13861664
1387
- frame.setSize(1024, 768);
1388
- frame.show();
1389
-
1665
+ frame.setSize(1280, 860);
1666
+
1667
+ cameraView.requestFocusInWindow();
1668
+
13901669 gridPanel.setDividerLocation(1.0);
1670
+
1671
+ frame.validate();
1672
+
1673
+ frame.setVisible(true);
13911674
13921675 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
13931676 frame.addWindowListener(new WindowAdapter()
....@@ -1415,7 +1698,7 @@
14151698 ctrlPanel.removeAll();
14161699 }
14171700
1418
- void SetupMaterial(cGridBag ctrlPanel)
1701
+ void SetupMaterial(cGridBag panel)
14191702 {
14201703 /*
14211704 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
....@@ -1424,18 +1707,26 @@
14241707
14251708 cGridBag editBar = new cGridBag().setVertical(false);
14261709
1427
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
1710
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1711
+ createMaterialButton.setToolTipText("Create material");
14281712
14291713 /*
14301714 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14311715 */
14321716
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);
1717
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1718
+ clearMaterialButton.setToolTipText("Clear material");
1719
+
1720
+ if (Globals.ADVANCED)
1721
+ {
1722
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1723
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1724
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1725
+ }
14371726
1438
- ctrlPanel.add(editBar);
1727
+ editBar.preferredHeight = 15;
1728
+
1729
+ panel.add(editBar);
14391730
14401731 /**/
14411732 //aConstraints.weighty = 0;
....@@ -1466,27 +1757,9 @@
14661757 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
14671758 colorSection.add(texture);
14681759
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());
1760
+ panel.add(new JSeparator());
14881761
1489
- ctrlPanel.add(colorSection);
1762
+ panel.add(colorSection);
14901763
14911764 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14921765
....@@ -1534,9 +1807,15 @@
15341807 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15351808 diffuseSection.add(fakedepth);
15361809
1537
- ctrlPanel.add(new JSeparator());
1810
+ cGridBag shadowbias = new cGridBag();
1811
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1812
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1813
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1814
+ diffuseSection.add(shadowbias);
1815
+
1816
+ panel.add(new JSeparator());
15381817
1539
- ctrlPanel.add(diffuseSection);
1818
+ panel.add(diffuseSection);
15401819
15411820 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15421821
....@@ -1572,7 +1851,7 @@
15721851 velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15731852 specularSection.add(velvet);
15741853
1575
- shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1);
1854
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
15761855 //Return();
15771856 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
15781857 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
....@@ -1584,42 +1863,54 @@
15841863 // aConstraints.gridy += 1;
15851864 // aConstraints.gridwidth = 1;
15861865
1866
+ cGridBag anisoU = new cGridBag();
1867
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1868
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1869
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1870
+ specularSection.add(anisoU);
15871871
1588
- ctrlPanel.add(new JSeparator());
1872
+ cGridBag anisoV = new cGridBag();
1873
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1874
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1875
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1876
+ specularSection.add(anisoV);
1877
+
1878
+
1879
+ panel.add(new JSeparator());
15891880
1590
- ctrlPanel.add(specularSection);
1881
+ panel.add(specularSection);
15911882
15921883 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
15931884
1594
- cGridBag globalSection = new cGridBag().setVertical(true);
1885
+ //cGridBag globalSection = new cGridBag().setVertical(true);
15951886
15961887 cGridBag camera = new cGridBag();
15971888 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
15981889 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
15991890 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1600
- globalSection.add(camera);
1891
+ colorSection.add(camera);
16011892
16021893 cGridBag ambient = new cGridBag();
16031894 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
16041895 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16051896 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1606
- globalSection.add(ambient);
1897
+ colorSection.add(ambient);
16071898
16081899 cGridBag backlit = new cGridBag();
16091900 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
16101901 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16111902 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1612
- globalSection.add(backlit);
1903
+ colorSection.add(backlit);
16131904
16141905 cGridBag opacity = new cGridBag();
16151906 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
16161907 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16171908 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1618
- globalSection.add(opacity);
1909
+ colorSection.add(opacity);
16191910
1620
- ctrlPanel.add(new JSeparator());
1911
+ //panel.add(new JSeparator());
16211912
1622
- ctrlPanel.add(globalSection);
1913
+ //panel.add(globalSection);
16231914
16241915 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16251916
....@@ -1661,9 +1952,9 @@
16611952 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
16621953 textureSection.add(opacityPower);
16631954
1664
- ctrlPanel.add(new JSeparator());
1955
+ panel.add(new JSeparator());
16651956
1666
- ctrlPanel.add(textureSection);
1957
+ panel.add(textureSection);
16671958
16681959 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16691960
....@@ -1700,12 +1991,15 @@
17001991 opacityPowerField.addChangeListener(this);
17011992 /**/
17021993
1703
- resetSlidersButton.addActionListener(this);
17041994 clearMaterialButton.addActionListener(this);
17051995 createMaterialButton.addActionListener(this);
1706
-
1707
- propagateToggle.addItemListener(this);
1708
- multiplyToggle.addItemListener(this);
1996
+
1997
+ if (Globals.ADVANCED)
1998
+ {
1999
+ resetSlidersButton.addActionListener(this);
2000
+ propagateToggle.addItemListener(this);
2001
+ multiplyToggle.addItemListener(this);
2002
+ }
17092003 }
17102004
17112005 void DropFile(java.io.File[] files, boolean textures)
....@@ -1723,8 +2017,9 @@
17232017 // 3D models
17242018 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
17252019 {
1726
- lastConverter = new com.jmex.model.converters.MaxToJme();
1727
- LoadFile(filename, lastConverter);
2020
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2021
+ //LoadFile(filename, lastConverter);
2022
+ LoadObjFile(filename); // New 3ds loader
17282023 continue;
17292024 }
17302025 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -1876,7 +2171,7 @@
18762171
18772172 //? flashIt = false;
18782173 CameraPane pane = (CameraPane) cameraView;
1879
- pane.clickStart(location.x, location.y, 0);
2174
+ pane.clickStart(location.x, location.y, 0, 0);
18802175 pane.clickEnd(location.x, location.y, 0, true);
18812176
18822177 if (group.selection.size() == 1)
....@@ -1925,6 +2220,7 @@
19252220 e2.printStackTrace();
19262221 }
19272222 }
2223
+
19282224 LoadJMEThread loadThread;
19292225
19302226 class LoadJMEThread extends Thread
....@@ -1982,6 +2278,7 @@
19822278 //LoadFile0(filename, converter);
19832279 }
19842280 }
2281
+
19852282 LoadOBJThread loadObjThread;
19862283
19872284 class LoadOBJThread extends Thread
....@@ -2060,19 +2357,19 @@
20602357
20612358 void LoadObjFile(String fullname)
20622359 {
2063
- /*
2360
+ System.out.println("Loading " + fullname);
2361
+ /**/
20642362 //lastFilename = fullname;
20652363 if(loadObjThread == null)
20662364 {
2067
- loadObjThread = new LoadOBJThread();
2068
- loadObjThread.start();
2365
+ loadObjThread = new LoadOBJThread();
2366
+ loadObjThread.start();
20692367 }
20702368
20712369 loadObjThread.add(fullname);
2072
- */
2370
+ /**/
20732371
2074
- System.out.println("Loading " + fullname);
2075
- makeSomething(new FileObject(fullname, true), true);
2372
+ //makeSomething(new FileObject(fullname, true), true);
20762373 }
20772374
20782375 void LoadGFDFile(String fullname)
....@@ -2333,11 +2630,11 @@
23332630
23342631 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23352632 {
2336
- if (GrafreeD.standAlone)
2633
+ if (Grafreed.standAlone)
23372634 {
23382635 /**/
23392636 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2340
- browser.show();
2637
+ browser.setVisible(true);
23412638 String filename = browser.getFile();
23422639 if (filename != null && filename.length() > 0)
23432640 {
....@@ -2448,6 +2745,7 @@
24482745 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
24492746 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
24502747 }
2748
+
24512749 //cJME.count++;
24522750 //cJME.count %= 12;
24532751 if (gc)
....@@ -2482,6 +2780,7 @@
24822780 }
24832781 if (input == null)
24842782 {
2783
+ new Exception().printStackTrace();
24852784 System.exit(0);
24862785 }
24872786
....@@ -2630,6 +2929,7 @@
26302929 }
26312930 }
26322931 }
2932
+
26332933 cFileSystemPane FSPane;
26342934
26352935 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2683,11 +2983,14 @@
26832983 }
26842984 }
26852985 }
2986
+
26862987 freezematerial = false;
26872988 }
26882989
26892990 void SetMaterial(Object3D object)
26902991 {
2992
+ latestObject = object;
2993
+
26912994 cMaterial mat = object.material;
26922995
26932996 if (mat == null)
....@@ -2696,7 +2999,8 @@
26962999 return;
26973000 }
26983001
2699
- multiplyToggle.setSelected(mat.multiply);
3002
+ if (multiplyToggle != null)
3003
+ multiplyToggle.setSelected(mat.multiply);
27003004
27013005 assert (object.projectedVertices != null);
27023006
....@@ -2798,12 +3102,17 @@
27983102 // }
27993103
28003104 /**/
2801
- if (deselect)
3105
+ if (deselect || child == null)
28023106 {
28033107 //group.deselectAll();
28043108 //freeze = true;
28053109 GetTree().clearSelection();
28063110 //freeze = false;
3111
+
3112
+ if (child == null)
3113
+ {
3114
+ return;
3115
+ }
28073116 }
28083117
28093118 //group.addSelectee(child);
....@@ -2872,7 +3181,7 @@
28723181 cameraView.ToggleDL();
28733182 cameraView.repaint();
28743183 return;
2875
- } else if (event.getSource() == toggleTextureItem)
3184
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
28763185 {
28773186 cameraView.ToggleTexture();
28783187 // june 2013 copy.HardTouch();
....@@ -2911,9 +3220,9 @@
29113220 frame.validate();
29123221
29133222 return;
2914
- } else if (event.getSource() == toggleRandomItem)
3223
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29153224 {
2916
- cameraView.ToggleRandom();
3225
+ cameraView.ToggleSwitch();
29173226 cameraView.repaint();
29183227 return;
29193228 } else if (event.getSource() == toggleHandleItem)
....@@ -2942,6 +3251,10 @@
29423251 {
29433252 copy.live ^= true;
29443253 return;
3254
+ } else if (event.getSource() == selectableCB)
3255
+ {
3256
+ copy.dontselect ^= true;
3257
+ return;
29453258 } else if (event.getSource() == hideCB)
29463259 {
29473260 copy.hide ^= true;
....@@ -2956,6 +3269,7 @@
29563269 if (event.getSource() == randomCB)
29573270 {
29583271 copy.random ^= true;
3272
+ objEditor.refreshContents();
29593273 return;
29603274 }
29613275 if (event.getSource() == speedupCB)
....@@ -2979,8 +3293,9 @@
29793293
29803294 public void actionPerformed(ActionEvent event)
29813295 {
3296
+ Object source = event.getSource();
29823297 // SCRIPT DIALOG
2983
- if (event.getSource() == okbutton)
3298
+ if (source == okbutton)
29843299 {
29853300 textpanel.setVisible(false);
29863301 textpanel.remove(textarea);
....@@ -2992,7 +3307,7 @@
29923307 textarea = null;
29933308 textpanel = null;
29943309 }
2995
- if (event.getSource() == cancelbutton)
3310
+ if (source == cancelbutton)
29963311 {
29973312 textpanel.setVisible(false);
29983313 textpanel.remove(textarea);
....@@ -3004,50 +3319,50 @@
30043319 //applySelf();
30053320 //client.refreshEditWindow();
30063321 //refreshContents();
3007
- if (event.getSource() == nameField)
3322
+ if (source == nameField)
30083323 {
30093324 //System.out.println("ObjEditor " + event);
30103325 applySelf0(true);
30113326 //parent.applySelf();
30123327 objEditor.refreshContents();
3013
- } else if (event.getSource() == resetButton)
3328
+ } else if (source == resetButton)
30143329 {
30153330 CameraPane.fullreset = true;
30163331 copy.Reset(); // ResetMeshes();
30173332 copy.Touch();
30183333 objEditor.refreshContents();
3019
- } else if (event.getSource() == stepItem)
3334
+ } else if (source == stepItem)
30203335 {
30213336 //cameraView.ONESTEP = true;
30223337 Globals.ONESTEP = true;
30233338 cameraView.repaint();
30243339 return;
3025
- } else if (event.getSource() == stepButton)
3340
+ } else if (source == stepButton)
30263341 {
30273342 copy.Step();
30283343 copy.Touch();
30293344 objEditor.refreshContents();
3030
- } else if (event.getSource() == slowerButton)
3345
+ } else if (source == slowerButton)
30313346 {
30323347 copy.Slower();
30333348 copy.Touch();
30343349 objEditor.refreshContents();
3035
- } else if (event.getSource() == fasterButton)
3350
+ } else if (source == fasterButton)
30363351 {
30373352 copy.Faster();
30383353 copy.Touch();
30393354 objEditor.refreshContents();
3040
- } else if (event.getSource() == remarkButton)
3355
+ } else if (source == remarkButton)
30413356 {
30423357 copy.Remark();
30433358 copy.Touch();
30443359 objEditor.refreshContents();
3045
- } else if (event.getSource() == stepAllButton)
3360
+ } else if (source == stepAllButton)
30463361 {
30473362 copy.StepAll();
30483363 copy.Touch();
30493364 objEditor.refreshContents();
3050
- } else if (event.getSource() == resetAllButton)
3365
+ } else if (source == resetAllButton)
30513366 {
30523367 //CameraPane.fullreset = true;
30533368 copy.ResetAll(); // ResetMeshes();
....@@ -3080,53 +3395,79 @@
30803395 // Close();
30813396 // }
30823397 // else
3083
- if (event.getSource() == resetSlidersButton)
3398
+ if (source == resetSlidersButton)
30843399 {
30853400 ResetSliders();
3086
- } else if (event.getSource() == clearMaterialButton)
3401
+ } else if (source == clearMaterialButton)
30873402 {
30883403 ClearMaterial();
3089
- } else if (event.getSource() == createMaterialButton)
3404
+ } else if (source == createMaterialButton)
30903405 {
30913406 CreateMaterial();
3092
- } else if (event.getSource() == clearPanelButton)
3407
+ } else if (source == clearPanelButton)
30933408 {
30943409 copy.ClearUI();
30953410 refreshContents(true);
3096
- } /*
3097
- }
3098
-
3099
- public boolean action(Event event, Object arg)
3100
- {
3101
- */ else if (event.getSource() == closeItem)
3411
+ } else if (source == importGFDItem)
3412
+ {
3413
+ ImportGFD();
3414
+ } else
3415
+ if (source == importVRMLX3DItem)
3416
+ {
3417
+ ImportVRMLX3D();
3418
+ } else
3419
+ if (source == import3DSItem)
3420
+ {
3421
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3422
+ } else
3423
+ if (source == importOBJItem)
3424
+ {
3425
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3426
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3427
+ browser.setVisible(true);
3428
+ String filename = browser.getFile();
3429
+ if (filename != null && filename.length() > 0)
3430
+ {
3431
+ String fullname = browser.getDirectory() + filename;
3432
+ makeSomething(ReadOBJ(fullname), true);
3433
+ }
3434
+ } else
3435
+ if (source == closeItem)
31023436 {
31033437 Close();
31043438 //return true;
3105
- } else if (event.getSource() == loadItem)
3439
+ } else if (source == openItem)
31063440 {
3107
- load();
3441
+ Open();
31083442 //return true;
3109
- } else if (event.getSource() == saveItem)
3443
+ } else if (source == newItem)
3444
+ {
3445
+ New();
3446
+ } else if (source == saveItem)
31103447 {
31113448 save();
31123449 //return true;
3113
- } else if (event.getSource() == saveAsItem)
3450
+ } else if (source == saveAsItem)
31143451 {
31153452 saveAs();
31163453 //return true;
3117
- } else if (event.getSource() == reexportItem)
3454
+ } else if (source == reexportItem)
31183455 {
31193456 reexport();
31203457 //return true;
3121
- } else if (event.getSource() == exportAsItem)
3458
+ } else if (source == exportAsItem)
31223459 {
31233460 export();
31243461 //return true;
3125
- } else if (event.getSource() == povItem)
3462
+ } else if (source == povItem)
31263463 {
31273464 generatePOV();
31283465 //return true;
3129
- } else if (event.getSource() == zBufferItem)
3466
+ } else if (event.getSource() == archiveItem)
3467
+ {
3468
+ cTools.Archive(frame);
3469
+ return;
3470
+ } else if (source == zBufferItem)
31303471 {
31313472 try
31323473 {
....@@ -3148,21 +3489,8 @@
31483489 cameraView.repaint();
31493490 //return true;
31503491 }
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)
3492
+ */ else // combos...
3493
+ if (source == texresMenu)
31663494 {
31673495 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
31683496 copy.texres = texresMenu.getSelectedIndex();
....@@ -3174,12 +3502,409 @@
31743502 }
31753503 }
31763504
3505
+ void New()
3506
+ {
3507
+ while (copy.Size() > 1)
3508
+ {
3509
+ copy.remove(1);
3510
+ }
3511
+
3512
+ ResetModel();
3513
+ objEditor.refreshContents();
3514
+ }
3515
+
3516
+ static public byte[] Compress(Object3D o)
3517
+ {
3518
+ try
3519
+ {
3520
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3521
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3522
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
3523
+
3524
+ Object3D parent = o.parent;
3525
+ o.parent = null;
3526
+
3527
+ out.writeObject(o);
3528
+
3529
+ o.parent = parent;
3530
+
3531
+ out.flush();
3532
+
3533
+ baos //zstream
3534
+ .close();
3535
+ out.close();
3536
+
3537
+ byte[] bytes = baos.toByteArray();
3538
+
3539
+ System.out.println("save #bytes = " + bytes.length);
3540
+ return bytes;
3541
+ } catch (Exception e)
3542
+ {
3543
+ System.err.println(e);
3544
+ return null;
3545
+ }
3546
+ }
3547
+
3548
+ static public Object Uncompress(byte[] bytes)
3549
+ {
3550
+ System.out.println("restore #bytes = " + bytes.length);
3551
+ try
3552
+ {
3553
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3554
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3555
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
3556
+ Object obj = in.readObject();
3557
+
3558
+ bais //istream
3559
+ .close();
3560
+ in.close();
3561
+
3562
+ return obj;
3563
+ } catch (Exception e)
3564
+ {
3565
+ System.err.println(e);
3566
+ return null;
3567
+ }
3568
+ }
3569
+
3570
+ static public Object clone(Object o)
3571
+ {
3572
+ try
3573
+ {
3574
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3575
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3576
+
3577
+ out.writeObject(o);
3578
+
3579
+ out.flush();
3580
+ out.close();
3581
+
3582
+ byte[] bytes = baos.toByteArray();
3583
+
3584
+ System.out.println("clone = " + bytes.length);
3585
+
3586
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3587
+ ObjectInputStream in = new ObjectInputStream(bais);
3588
+ Object obj = in.readObject();
3589
+ in.close();
3590
+
3591
+ return obj;
3592
+ } catch (Exception e)
3593
+ {
3594
+ System.err.println(e);
3595
+ return null;
3596
+ }
3597
+ }
3598
+
3599
+ cRadio GetCurrentTab()
3600
+ {
3601
+ cRadio ab;
3602
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3603
+ {
3604
+ ab = (cRadio)e.nextElement();
3605
+ if(ab.GetObject() == copy)
3606
+ {
3607
+ return ab;
3608
+ }
3609
+ }
3610
+
3611
+ return null;
3612
+ }
3613
+
3614
+
3615
+ public void Save()
3616
+ {
3617
+ //Save(true);
3618
+ Replace();
3619
+ }
3620
+
3621
+ private boolean Equal(byte[] compress, byte[] name)
3622
+ {
3623
+ if (compress.length != name.length)
3624
+ {
3625
+ return false;
3626
+ }
3627
+
3628
+ for (int i=compress.length; --i>=0;)
3629
+ {
3630
+ if (compress[i] != name[i])
3631
+ return false;
3632
+ }
3633
+
3634
+ return true;
3635
+ }
3636
+
3637
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
3638
+
3639
+ public boolean Save(boolean user)
3640
+ {
3641
+ System.err.println("Save");
3642
+
3643
+ cRadio tab = GetCurrentTab();
3644
+
3645
+ byte[] compress = CompressCopy();
3646
+
3647
+ boolean thesame = false;
3648
+
3649
+ // Quick heuristic using length. Works only when stream is compressed.
3650
+ if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3651
+ {
3652
+ thesame = true;
3653
+ }
3654
+
3655
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3656
+ if (!thesame)
3657
+ {
3658
+ //tab.user[tab.versionindex] = user;
3659
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
3660
+
3661
+ copy.versions[++copy.versionindex] = compress;
3662
+
3663
+ // if (increment)
3664
+ // tab.versionindex++;
3665
+ }
3666
+
3667
+ //copy.RestoreBigData(versiontable);
3668
+
3669
+ //assert(hashtable.isEmpty());
3670
+
3671
+ for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3672
+ {
3673
+ //tab.user[i] = false;
3674
+ copy.versions[i] = null;
3675
+ }
3676
+
3677
+ SetUndoStates();
3678
+
3679
+ // test save
3680
+ if (false)
3681
+ {
3682
+ try
3683
+ {
3684
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
3685
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3686
+
3687
+ p.writeObject(copy);
3688
+
3689
+ p.flush();
3690
+
3691
+ ostream.close();
3692
+ } catch (Exception e)
3693
+ {
3694
+ e.printStackTrace();
3695
+ }
3696
+ }
3697
+
3698
+ return !thesame;
3699
+ }
3700
+
3701
+ void CopyChanged(Object3D obj)
3702
+ {
3703
+ SetUndoStates();
3704
+
3705
+ boolean temp = CameraPane.SWITCH;
3706
+ CameraPane.SWITCH = false;
3707
+
3708
+ copy.ExtractBigData(versiontable);
3709
+
3710
+ copy.clear();
3711
+
3712
+ for (int i=0; i<obj.Size(); i++)
3713
+ {
3714
+ copy.add(obj.get(i));
3715
+ }
3716
+
3717
+ copy.RestoreBigData(versiontable);
3718
+
3719
+ CameraPane.SWITCH = temp;
3720
+
3721
+ //assert(hashtable.isEmpty());
3722
+
3723
+ copy.Touch();
3724
+
3725
+ ResetModel();
3726
+ copy.HardTouch(); // recompile?
3727
+
3728
+ cRadio ab;
3729
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3730
+ {
3731
+ ab = (cRadio)e.nextElement();
3732
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3733
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3734
+ if (test != null)
3735
+ {
3736
+ test.editWindow = ab.object.editWindow;
3737
+ ab.object = test;
3738
+ }
3739
+ }
3740
+
3741
+ refreshContents();
3742
+ }
3743
+
3744
+ cButton undoButton;
3745
+ cButton restoreButton;
3746
+ cButton replaceButton;
3747
+ cButton redoButton;
3748
+
3749
+ boolean muteSlider;
3750
+
3751
+ int VersionCount()
3752
+ {
3753
+ int count = 0;
3754
+
3755
+ for (int i = copy.versions.length; --i >= 0;)
3756
+ {
3757
+ if (copy.versions[i] != null)
3758
+ count++;
3759
+ }
3760
+
3761
+ return count;
3762
+ }
3763
+
3764
+ void SetUndoStates()
3765
+ {
3766
+ cRadio tab = GetCurrentTab();
3767
+
3768
+ restoreButton.setEnabled(copy.versionindex != -1);
3769
+ replaceButton.setEnabled(copy.versionindex != -1);
3770
+
3771
+ undoButton.setEnabled(copy.versionindex > 0);
3772
+ redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
3773
+
3774
+ muteSlider = true;
3775
+ versionSlider.setMaximum(VersionCount() - 1);
3776
+ versionSlider.setInteger(copy.versionindex);
3777
+ muteSlider = false;
3778
+ }
3779
+
3780
+ public boolean Undo()
3781
+ {
3782
+ // Option?
3783
+ Replace();
3784
+
3785
+ System.err.println("Undo");
3786
+
3787
+ cRadio tab = GetCurrentTab();
3788
+
3789
+ if (copy.versionindex == 0)
3790
+ {
3791
+ java.awt.Toolkit.getDefaultToolkit().beep();
3792
+ return false;
3793
+ }
3794
+
3795
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
3796
+// {
3797
+// if (Save(false))
3798
+// tab.versionindex -= 1;
3799
+// else
3800
+// {
3801
+// if (tab.versionindex <= 0)
3802
+// return false;
3803
+// else
3804
+// tab.versionindex -= 1;
3805
+// }
3806
+// }
3807
+
3808
+ copy.versionindex -= 1;
3809
+
3810
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3811
+
3812
+ return true;
3813
+ }
3814
+
3815
+ public boolean Restore()
3816
+ {
3817
+ System.err.println("Restore");
3818
+
3819
+ cRadio tab = GetCurrentTab();
3820
+
3821
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3822
+ {
3823
+ java.awt.Toolkit.getDefaultToolkit().beep();
3824
+ return false;
3825
+ }
3826
+
3827
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3828
+
3829
+ return true;
3830
+ }
3831
+
3832
+ public boolean Replace()
3833
+ {
3834
+ System.err.println("Replace");
3835
+
3836
+ cRadio tab = GetCurrentTab();
3837
+
3838
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3839
+ {
3840
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
3841
+ return false;
3842
+ }
3843
+
3844
+ copy.versions[copy.versionindex] = CompressCopy();
3845
+
3846
+ return true;
3847
+ }
3848
+
3849
+ public void Redo()
3850
+ {
3851
+ // Option?
3852
+ Replace();
3853
+
3854
+ cRadio tab = GetCurrentTab();
3855
+
3856
+ if (copy.versions[copy.versionindex + 1] == null)
3857
+ {
3858
+ java.awt.Toolkit.getDefaultToolkit().beep();
3859
+ return;
3860
+ }
3861
+
3862
+ copy.versionindex += 1;
3863
+
3864
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3865
+
3866
+ //if (!tab.user[tab.versionindex])
3867
+ // tab.graphs[tab.versionindex] = null;
3868
+ }
3869
+
3870
+ void ImportGFD()
3871
+ {
3872
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
3873
+ browser.show();
3874
+ String filename = browser.getFile();
3875
+ if (filename != null && filename.length() > 0)
3876
+ {
3877
+ String fullname = browser.getDirectory() + filename;
3878
+
3879
+ //Object3D readobj =
3880
+ objEditor.ReadGFD(fullname, objEditor);
3881
+ //makeSomething(readobj);
3882
+ }
3883
+ }
3884
+
3885
+ void ImportVRMLX3D()
3886
+ {
3887
+ if (Grafreed.standAlone)
3888
+ {
3889
+ /**/
3890
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3891
+ browser.show();
3892
+ String filename = browser.getFile();
3893
+ if (filename != null && filename.length() > 0)
3894
+ {
3895
+ String fullname = browser.getDirectory() + filename;
3896
+ LoadVRMLX3D(fullname);
3897
+ }
3898
+ /**/
3899
+ }
3900
+ }
3901
+
31773902 void ToggleAnimation()
31783903 {
31793904 if (!Globals.ANIMATION)
31803905 {
31813906 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3182
- browser.show();
3907
+ browser.setVisible(true);
31833908 String filename = browser.getFile();
31843909 if (filename != null && filename.length() > 0)
31853910 {
....@@ -3189,8 +3914,8 @@
31893914
31903915 Globals.ANIMATION ^= true;
31913916
3192
- GrafreeD.wav.cursor = 0;
3193
- GrafreeD.wav.loop = 0;
3917
+ Grafreed.wav.cursor = 0;
3918
+ Grafreed.wav.loop = 0;
31943919 }
31953920 } else
31963921 {
....@@ -3240,7 +3965,7 @@
32403965 void CreateMaterial()
32413966 {
32423967 //copy.ClearMaterial(); // PATCH
3243
- copy.CreateMaterialS(multiplyToggle.isSelected());
3968
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32443969 if (copy.selection.size() > 0)
32453970 //SetMaterial(copy);
32463971 {
....@@ -3291,7 +4016,7 @@
32914016 assert false;
32924017 }
32934018
3294
- void EditSelection()
4019
+ void EditSelection(boolean newWindow)
32954020 {
32964021 }
32974022
....@@ -3299,11 +4024,11 @@
32994024 {
33004025 copy.ResetBlockLoop(); // temporary problem
33014026
3302
- boolean random = CameraPane.RANDOM;
3303
- CameraPane.RANDOM = false; // parse everything
4027
+ boolean random = CameraPane.SWITCH;
4028
+ CameraPane.SWITCH = false; // parse everything
33044029 copy.ResetDisplayList();
33054030 copy.HardTouch();
3306
- CameraPane.RANDOM = random;
4031
+ CameraPane.SWITCH = random;
33074032 }
33084033
33094034 // public void applySelf()
....@@ -3377,6 +4102,36 @@
33774102 {
33784103 //System.out.println("Propagate = " + propagate);
33794104 copy.UpdateMaterial(anchor, current, propagate);
4105
+
4106
+ if (copy.material != null)
4107
+ {
4108
+ cMaterial mat = copy.material;
4109
+
4110
+ colorField.SetToolTipValue((mat.color));
4111
+ modulationField.SetToolTipValue((mat.modulation));
4112
+ metalnessField.SetToolTipValue((mat.metalness));
4113
+ diffuseField.SetToolTipValue((mat.diffuse));
4114
+ specularField.SetToolTipValue((mat.specular));
4115
+ shininessField.SetToolTipValue((mat.shininess));
4116
+ shiftField.SetToolTipValue((mat.shift));
4117
+ ambientField.SetToolTipValue((mat.ambient));
4118
+ lightareaField.SetToolTipValue((mat.lightarea));
4119
+ diffusenessField.SetToolTipValue((mat.factor));
4120
+ velvetField.SetToolTipValue((mat.velvet));
4121
+ sheenField.SetToolTipValue((mat.sheen));
4122
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4123
+ backlitField.SetToolTipValue((mat.bump));
4124
+ anisoField.SetToolTipValue((mat.aniso));
4125
+ anisoVField.SetToolTipValue((mat.anisoV));
4126
+ cameraField.SetToolTipValue((mat.cameralight));
4127
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4128
+ shadowField.SetToolTipValue((mat.shadow));
4129
+ textureField.SetToolTipValue((mat.texture));
4130
+ opacityField.SetToolTipValue((mat.opacity));
4131
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4132
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
4133
+ }
4134
+
33804135 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
33814136 {
33824137 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3405,9 +4160,25 @@
34054160 //copy.Touch();
34064161 }
34074162
4163
+ cNumberSlider versionSlider;
4164
+
34084165 public void stateChanged(ChangeEvent e)
34094166 {
34104167 // assert(false);
4168
+ if (e.getSource() == versionSlider)
4169
+ {
4170
+ if (muteSlider)
4171
+ return;
4172
+
4173
+ int version = versionSlider.getInteger();
4174
+
4175
+ if (copy.versions[version] != null)
4176
+ {
4177
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version]));
4178
+ }
4179
+
4180
+ return;
4181
+ }
34114182
34124183 if (freezematerial)
34134184 {
....@@ -3421,6 +4192,7 @@
34214192 || e.getSource() == apertureField
34224193 || e.getSource() == shadowblurField)
34234194 {
4195
+ new Exception().printStackTrace();
34244196 System.exit(0);
34254197 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34264198 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3491,7 +4263,7 @@
34914263 }
34924264
34934265 if (normalpushField != null)
3494
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
4266
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
34954267 }
34964268
34974269 void SnapObject()
....@@ -3755,6 +4527,8 @@
37554527
37564528 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37574529 {
4530
+ if (Globals.REPLACEONMAKE) // && resetmodel)
4531
+ Save();
37584532 //Tween.set(thing, 0).target(1).start(tweenManager);
37594533 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37604534 // if (thing instanceof GenericJointDemo)
....@@ -3841,6 +4615,12 @@
38414615 {
38424616 ResetModel();
38434617 Select(thing.GetTreePath(), true, false); // unselect... false);
4618
+
4619
+ if (thing.Size() == 0)
4620
+ {
4621
+ //EditSelection(false);
4622
+ }
4623
+
38444624 refreshContents();
38454625 }
38464626
....@@ -3958,6 +4738,7 @@
39584738 }
39594739 }
39604740 }
4741
+
39614742 LoadGFDThread loadGFDThread;
39624743
39634744 void ReadGFD(String fullname, iCallBack cb)
....@@ -3977,8 +4758,10 @@
39774758
39784759 try
39794760 {
4761
+ // Try compressed version first.
39804762 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
3981
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4763
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4764
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
39824765
39834766 readobj = (Object3D) p.readObject();
39844767 istream.close();
....@@ -3986,7 +4769,22 @@
39864769 readobj.ResetDisplayList();
39874770 } catch (Exception e)
39884771 {
3989
- e.printStackTrace();
4772
+ if (!e.toString().contains("GZIP"))
4773
+ e.printStackTrace();
4774
+
4775
+ try
4776
+ {
4777
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4778
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4779
+
4780
+ readobj = (Object3D) p.readObject();
4781
+ istream.close();
4782
+
4783
+ readobj.ResetDisplayList();
4784
+ } catch (Exception e2)
4785
+ {
4786
+ e2.printStackTrace();
4787
+ }
39904788 }
39914789 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
39924790 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4032,6 +4830,12 @@
40324830
40334831 void LoadIt(Object obj)
40344832 {
4833
+ if (obj == null)
4834
+ {
4835
+ // Invalid file
4836
+ return;
4837
+ }
4838
+
40354839 System.out.println("Loaded " + obj);
40364840 //new Exception().printStackTrace();
40374841 Object3D readobj = (Object3D) obj;
....@@ -4041,6 +4845,8 @@
40414845
40424846 if (readobj != null)
40434847 {
4848
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
4849
+ // Save();
40444850 try
40454851 {
40464852 //readobj.deepCopySelf(copy);
....@@ -4085,6 +4891,7 @@
40854891 }
40864892 } catch (ClassCastException e)
40874893 {
4894
+ e.printStackTrace();
40884895 assert (false);
40894896 Composite c = (Composite) copy;
40904897 c.children.clear();
....@@ -4095,15 +4902,26 @@
40954902 c.addChild(csg);
40964903 }
40974904
4905
+ copy.versions = readobj.versions;
4906
+ copy.versionindex = readobj.versionindex;
4907
+
4908
+ if (copy.versions == null)
4909
+ {
4910
+ copy.versions = new byte[100][];
4911
+ copy.versionindex = -1;
4912
+ }
4913
+
4914
+ //? SetUndoStates();
4915
+
40984916 ResetModel();
40994917 copy.HardTouch(); // recompile?
41004918 refreshContents();
41014919 }
41024920 }
41034921
4104
- void load() // throws ClassNotFoundException
4922
+ void Open() // throws ClassNotFoundException
41054923 {
4106
- if (GrafreeD.standAlone)
4924
+ if (Grafreed.standAlone)
41074925 {
41084926 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
41094927 browser.show();
....@@ -4190,11 +5008,13 @@
41905008 try
41915009 {
41925010 FileOutputStream ostream = new FileOutputStream(lastname);
4193
- ObjectOutputStream p = new ObjectOutputStream(ostream);
5011
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5012
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
41945013
41955014 p.writeObject(copy);
41965015 p.flush();
41975016
5017
+ zstream.close();
41985018 ostream.close();
41995019
42005020 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4202,19 +5022,23 @@
42025022 //ps.print(buffer.toString());
42035023 } catch (IOException e)
42045024 {
5025
+ e.printStackTrace();
42055026 }
42065027 }
5028
+
42075029 String lastname;
42085030
42095031 void saveAs()
42105032 {
4211
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
42125034 {
42135035 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42145036 browser.setVisible(true);
42155037 String filename = browser.getFile();
42165038 if (filename != null && filename.length() > 0)
42175039 {
5040
+ if (!filename.endsWith(".gfd"))
5041
+ filename += ".gfd";
42185042 lastname = browser.getDirectory() + filename;
42195043 save();
42205044 }
....@@ -4313,13 +5137,13 @@
43135137 try
43145138 {
43155139 FileOutputStream ostream = new FileOutputStream(filename);
4316
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4317
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
5140
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5141
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43185142
43195143 Object3D objectparent = obj.parent;
43205144 obj.parent = null;
43215145
4322
- Object3D object = (Object3D) GrafreeD.clone(obj);
5146
+ Object3D object = (Object3D) Grafreed.clone(obj);
43235147
43245148 obj.parent = objectparent;
43255149
....@@ -4331,8 +5155,8 @@
43315155 p.writeObject(object);
43325156 p.flush();
43335157
5158
+ zstream.close();
43345159 ostream.close();
4335
- // zstream.close();
43365160
43375161 // group.selection.get(0).parent = parent;
43385162 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4353,7 +5177,7 @@
43535177 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43545178 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43555179 copy.generatePOV(buffer);
4356
- if (GrafreeD.standAlone)
5180
+ if (Grafreed.standAlone)
43575181 {
43585182 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43595183 browser.show();
....@@ -4379,21 +5203,20 @@
43795203 Object3D client;
43805204 Object3D copy;
43815205 MenuBar menuBar;
4382
- Menu windowMenu;
4383
- MenuItem loadItem;
5206
+ Menu fileMenu;
5207
+ MenuItem newItem;
5208
+ MenuItem openItem;
43845209 MenuItem saveItem;
43855210 MenuItem saveAsItem;
43865211 MenuItem exportAsItem;
43875212 MenuItem reexportItem;
43885213 MenuItem povItem;
43895214 MenuItem closeItem;
4390
- Menu cameraMenu;
5215
+
43915216 CheckboxMenuItem zBufferItem;
43925217 //MenuItem normalLensItem;
4393
- MenuItem editCameraItem;
4394
- MenuItem revertCameraItem;
4395
- CheckboxMenuItem toggleLiveItem;
43965218 MenuItem stepItem;
5219
+ CheckboxMenuItem toggleLiveItem;
43975220 CheckboxMenuItem toggleFullScreenItem;
43985221 CheckboxMenuItem toggleTimelineItem;
43995222 CheckboxMenuItem toggleRenderItem;
....@@ -4402,25 +5225,39 @@
44025225 CheckboxMenuItem toggleFootContactItem;
44035226 CheckboxMenuItem toggleDLItem;
44045227 CheckboxMenuItem toggleTextureItem;
4405
- CheckboxMenuItem toggleRandomItem;
5228
+ CheckboxMenuItem toggleSwitchItem;
44065229 CheckboxMenuItem toggleRootItem;
44075230 CheckboxMenuItem animationItem;
5231
+ MenuItem archiveItem;
44085232 CheckboxMenuItem toggleHandleItem;
44095233 CheckboxMenuItem togglePaintItem;
44105234 JSplitPane mainPanel;
44115235 JScrollPane scrollpane;
5236
+
44125237 JPanel toolbarPanel;
4413
- JPanel treePanel;
5238
+
5239
+ cGridBag treePanel;
5240
+
44145241 JPanel radioPanel;
44155242 ButtonGroup buttonGroup;
4416
- cGridBag ctrlPanel;
5243
+
5244
+ cGridBag toolboxPanel;
44175245 cGridBag materialPanel;
5246
+ cGridBag ctrlPanel;
5247
+
44185248 JScrollPane infoPanel;
5249
+
44195250 cGridBag optionsPanel;
5251
+
44205252 JTabbedPane objectPanel;
5253
+ boolean materialFlushed;
5254
+ Object3D latestObject;
5255
+
44215256 cGridBag XYZPanel;
5257
+
44225258 JSplitPane gridPanel;
44235259 JSplitPane bigPanel;
5260
+
44245261 cGridBag bigThree;
44255262 cGridBag scenePanel;
44265263 cGridBag centralPanel;
....@@ -4535,8 +5372,13 @@
45355372 cNumberSlider fogField;
45365373 JLabel opacityPowerLabel;
45375374 cNumberSlider opacityPowerField;
4538
- JTree jTree;
5375
+ cTree jTree;
45395376 //ObjectUI parent;
45405377
45415378 cNumberSlider normalpushField;
5379
+
5380
+ private MenuItem importGFDItem;
5381
+ private MenuItem importVRMLX3DItem;
5382
+ private MenuItem import3DSItem;
5383
+ private MenuItem importOBJItem;
45425384 }