Normand Briere
2019-06-16 b33ef80d78f01a6a61f4248b1bb7deaade42d503
ObjEditor.java
....@@ -143,6 +143,8 @@
143143 //nameField.removeActionListener(this);
144144 // objEditor.ctrlPanel.remove(nameField);
145145
146
+ objEditor.ctrlPanel.remove(namePanel);
147
+
146148 if (!GroupEditor.allparams)
147149 return;
148150
....@@ -165,7 +167,6 @@
165167 // objEditor.ctrlPanel.remove(fasterButton);
166168 // objEditor.ctrlPanel.remove(remarkButton);
167169
168
- objEditor.ctrlPanel.remove(namePanel);
169170 objEditor.ctrlPanel.remove(setupPanel);
170171 objEditor.ctrlPanel.remove(commandsPanel);
171172 objEditor.ctrlPanel.remove(pushPanel);
....@@ -275,24 +276,40 @@
275276 void SetupMenu()
276277 {
277278 frame.setMenuBar(menuBar = new MenuBar());
278
- menuBar.add(windowMenu = new Menu("File"));
279
- windowMenu.add(loadItem = new MenuItem("Load..."));
280
- windowMenu.add("-");
281
- windowMenu.add(saveItem = new MenuItem("Save"));
282
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
279
+ menuBar.add(fileMenu = new Menu("File"));
280
+ fileMenu.add(newItem = new MenuItem("New"));
281
+ fileMenu.add(loadItem = new MenuItem("Open..."));
282
+
283
+ //oe.menuBar.add(menu = new Menu("Include"));
284
+ Menu menu = new Menu("Import");
285
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
286
+ importOBJItem.addActionListener(this);
287
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
288
+ import3DSItem.addActionListener(this);
289
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
290
+ importVRMLX3DItem.addActionListener(this);
291
+ menu.add("-");
292
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
293
+ importGFDItem.addActionListener(this);
294
+ fileMenu.add(menu);
295
+ fileMenu.add("-");
296
+
297
+ fileMenu.add(saveItem = new MenuItem("Save"));
298
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
283299 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
284
- windowMenu.add("-");
285
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
286
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
287
- windowMenu.add("-");
300
+ fileMenu.add("-");
301
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
302
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
303
+ fileMenu.add("-");
288304 if (client.parent != null)
289305 {
290
- windowMenu.add(closeItem = new MenuItem("Close"));
306
+ fileMenu.add(closeItem = new MenuItem("Close"));
291307 } else
292308 {
293
- windowMenu.add(closeItem = new MenuItem("Exit"));
309
+ fileMenu.add(closeItem = new MenuItem("Exit"));
294310 }
295311
312
+ newItem.addActionListener(this);
296313 loadItem.addActionListener(this);
297314 saveItem.addActionListener(this);
298315 saveAsItem.addActionListener(this);
....@@ -301,65 +318,10 @@
301318 //povItem.addActionListener(this);
302319 closeItem.addActionListener(this);
303320
304
- menuBar.add(cameraMenu = new Menu("View"));
305
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
306
- //zBufferItem.addActionListener(this);
307
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
308
- //normalLensItem.addActionListener(this);
309
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
310
- revertCameraItem.addActionListener(this);
311
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
312
- toggleTimelineItem.addItemListener(this);
313
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
314
- toggleFullScreenItem.addItemListener(this);
315
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
316
- cameraMenu.add("-");
317
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
318
- toggleTextureItem.addItemListener(this);
319
- toggleTextureItem.setState(CameraPane.textureon);
320
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
321
- toggleLiveItem.addItemListener(this);
322
- toggleLiveItem.setState(Globals.isLIVE());
323
- cameraMenu.add(stepItem = new MenuItem("Step"));
324
- stepItem.addActionListener(this);
325
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
326
-// toggleDLItem.addItemListener(this);
327
-// toggleDLItem.setState(false);
328
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
329
- toggleRenderItem.addItemListener(this);
330
- toggleRenderItem.setState(!CameraPane.frozen);
331
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
332
- toggleDebugItem.addItemListener(this);
333
- toggleDebugItem.setState(CameraPane.DEBUG);
334
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
335
- toggleFrustumItem.addItemListener(this);
336
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
337
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
338
- toggleFootContactItem.addItemListener(this);
339
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
340
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
341
- toggleRandomItem.addItemListener(this);
342
- toggleRandomItem.setState(CameraPane.RANDOM);
343
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
344
- toggleHandleItem.addItemListener(this);
345
- toggleHandleItem.setState(CameraPane.HANDLES);
346
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
347
- togglePaintItem.addItemListener(this);
348
- togglePaintItem.setState(CameraPane.PAINTMODE);
349
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
350
-// toggleRootItem.addItemListener(this);
351
-// toggleRootItem.setState(false);
352
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
353
-// animationItem.addItemListener(this);
354
-// animationItem.setState(CameraPane.ANIMATION);
355
- cameraMenu.add("-");
356
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
357
- editCameraItem.addActionListener(this);
358
-
359321 objectPanel = new JTabbedPane();
360322 toolbarPanel = new JPanel();
361323 toolbarPanel.setName("Toolbar");
362
- treePanel = new JPanel();
324
+ treePanel = new cGridBag();
363325 treePanel.setName("Tree");
364326 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
365327 ctrlPanel.setName("Edit");
....@@ -367,13 +329,15 @@
367329 materialPanel.setName("Material");
368330 /*JTextPane*/
369331 infoarea = createTextPane();
332
+ doc = infoarea.getStyledDocument();
333
+
370334 infoarea.setEditable(true);
371335 SetText();
372336 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
373337 // infoarea.setOpaque(false);
374338 // //infoarea.setForeground(textcolor);
375
- infoarea.setLineWrap(true);
376
- infoarea.setWrapStyleWord(true);
339
+// TEXTAREA infoarea.setLineWrap(true);
340
+// TEXTAREA infoarea.setWrapStyleWord(true);
377341 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
378342 infoPanel.setPreferredSize(new Dimension(50, 200));
379343 infoPanel.setName("Info");
....@@ -384,14 +348,14 @@
384348 mainPanel.setName("Main");
385349 mainPanel.setContinuousLayout(true);
386350 mainPanel.setOneTouchExpandable(true);
387
- mainPanel.setDividerLocation(1.0);
388351 mainPanel.setDividerSize(9);
389
- mainPanel.setResizeWeight(0);
352
+ mainPanel.setDividerLocation(0.5); //1.0);
353
+ mainPanel.setResizeWeight(0.5);
390354
391355 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
392356 //mainPanel.setLayout(new GridBagLayout());
393357 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
394
- treePanel.setLayout(new GridBagLayout());
358
+// treePanel.setLayout(new GridBagLayout());
395359 //ctrlPanel.setLayout(new GridBagLayout());
396360 //materialPanel.setLayout(new GridBagLayout());
397361
....@@ -432,7 +396,7 @@
432396 static String newline = "\n";
433397 protected static final String buttonString = "JButton";
434398 StyledDocument doc;
435
- JTextArea infoarea;
399
+ JTextPane infoarea;
436400
437401 void ClearInfo()
438402 {
....@@ -481,13 +445,13 @@
481445 //SendInfo("Name:", "bold");
482446 if (sel.GetTextures() != null || debug)
483447 {
484
- si.SendInfo(sel.toString(), "bold");
448
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
485449 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
486450 if (sel.Size() > 0)
487451 {
488452 si.SendInfo("#children = " + sel.Size(), "regular");
489453 }
490
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
454
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
491455 if (debug)
492456 {
493457 try
....@@ -499,7 +463,10 @@
499463 }
500464
501465 if (full)
502
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
466
+ {
467
+ si.SendInfo(" BBox min: " + minima, "regular");
468
+ si.SendInfo(" BBox max: " + maxima, "regular");
469
+ }
503470
504471 if (sel.bRep != null)
505472 {
....@@ -526,7 +493,7 @@
526493 }
527494 if (sel.support != null)
528495 {
529
- si.SendInfo(" support: " + sel.support, "regular");
496
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
530497 }
531498 if (sel.scriptnode != null)
532499 {
....@@ -597,6 +564,9 @@
597564 {
598565 CameraPane.pointflow = (PointFlow) sel;
599566 }
567
+
568
+ si.SendInfo("_____________________", "regular");
569
+ si.SendInfo("", "regular");
600570 }
601571 }
602572
....@@ -628,52 +598,52 @@
628598 cameraView.ToggleFullScreen();
629599 }
630600
631
- private JTextArea createTextPane()
601
+ private JTextPane createTextPane()
632602 {
633
- String[] initString =
634
- {
635
- "This is an editable JTextPane, ", //regular
636
- "another ", //italic
637
- "styled ", //bold
638
- "text ", //small
639
- "component, ", //large
640
- "which supports embedded components..." + newline,//regular
641
- " " + newline, //button
642
- "...and embedded icons..." + newline, //regular
643
- " ", //icon
644
- newline + "JTextPane is a subclass of JEditorPane that "
645
- + "uses a StyledEditorKit and StyledDocument, and provides "
646
- + "cover methods for interacting with those objects."
647
- };
603
+// TEXTAREA String[] initString =
604
+// {
605
+// "This is an editable JTextPane, ", //regular
606
+// "another ", //italic
607
+// "styled ", //bold
608
+// "text ", //small
609
+// "component, ", //large
610
+// "which supports embedded components..." + newline,//regular
611
+// " " + newline, //button
612
+// "...and embedded icons..." + newline, //regular
613
+// " ", //icon
614
+// newline + "JTextPane is a subclass of JEditorPane that "
615
+// + "uses a StyledEditorKit and StyledDocument, and provides "
616
+// + "cover methods for interacting with those objects."
617
+// };
618
+//
619
+// String[] initStyles =
620
+// {
621
+// "regular", "italic", "bold", "small", "large",
622
+// "regular", "button", "regular", "icon",
623
+// "regular"
624
+// };
625
+//
626
+// JTextPane textPane = new JTextPane();
627
+// textPane.setEditable(true);
628
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
629
+// addStylesToDocument(doc);
630
+//
631
+// try
632
+// {
633
+// for (int j = 0; j < 2; j++)
634
+// {
635
+// for (int i = 0; i < initString.length; i++)
636
+// {
637
+// doc.insertString(doc.getLength(), initString[i],
638
+// doc.getStyle(initStyles[i]));
639
+// }
640
+// }
641
+// } catch (BadLocationException ble)
642
+// {
643
+// System.err.println("Couldn't insert initial text into text pane.");
644
+// }
648645
649
- String[] initStyles =
650
- {
651
- "regular", "italic", "bold", "small", "large",
652
- "regular", "button", "regular", "icon",
653
- "regular"
654
- };
655
-
656
- JTextPane textPane = new JTextPane();
657
- textPane.setEditable(true);
658
- /*StyledDocument*/ doc = textPane.getStyledDocument();
659
- addStylesToDocument(doc);
660
-
661
- try
662
- {
663
- for (int j = 0; j < 2; j++)
664
- {
665
- for (int i = 0; i < initString.length; i++)
666
- {
667
- doc.insertString(doc.getLength(), initString[i],
668
- doc.getStyle(initStyles[i]));
669
- }
670
- }
671
- } catch (BadLocationException ble)
672
- {
673
- System.err.println("Couldn't insert initial text into text pane.");
674
- }
675
-
676
- return new JTextArea(); // textPane;
646
+ return new JTextPane(); // textPane;
677647 }
678648
679649 protected void addStylesToDocument(StyledDocument doc)
....@@ -726,7 +696,7 @@
726696 protected static ImageIcon createImageIcon(String path,
727697 String description)
728698 {
729
- java.net.URL imgURL = GrafreeD.class.getResource(path);
699
+ java.net.URL imgURL = Grafreed.class.getResource(path);
730700 if (imgURL != null)
731701 {
732702 return new ImageIcon(imgURL, description);
....@@ -758,6 +728,7 @@
758728 // NumberSlider vDivsField;
759729 // JCheckBox endcaps;
760730 JCheckBox liveCB;
731
+ JCheckBox selectCB;
761732 JCheckBox hideCB;
762733 JCheckBox link2masterCB;
763734 JCheckBox markCB;
....@@ -943,10 +914,6 @@
943914
944915 void SetupUI2(ObjEditor oe)
945916 {
946
-// oe.aConstraints.weightx = 0;
947
-// oe.aConstraints.weighty = 0;
948
-// oe.aConstraints.gridx = 0;
949
-// oe.aConstraints.gridy = 0;
950917 //SetupName(oe);
951918
952919 namePanel = new cGridBag();
....@@ -963,32 +930,52 @@
963930 setupPanel = new cGridBag().setVertical(false);
964931
965932 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
966
- link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
967
- hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
933
+ liveCB.setToolTipText("Animate object");
934
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
935
+ selectCB.setToolTipText("Make object selectable");
968936 // Return();
937
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
938
+ hideCB.setToolTipText("Hide object");
969939 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
970
- rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind);
971
- randomCB = AddCheckBox(setupPanel, "Rand", copy.random);
940
+ markCB.setToolTipText("Set the animation target transform");
941
+
942
+ rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
943
+ rewindCB.setToolTipText("Rewind animation");
944
+
945
+ randomCB = AddCheckBox(setupPanel, "Random", copy.random);
946
+ randomCB.setToolTipText("Option for switch node");
972947
948
+ if (Globals.ADVANCED)
949
+ {
950
+ link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
951
+ link2masterCB.setToolTipText("Attach to support");
952
+ speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
953
+ speedupCB.setToolTipText("Option motion capture");
954
+ }
955
+
973956 oe.ctrlPanel.add(setupPanel);
974957 oe.ctrlPanel.Return();
975958
976959 commandsPanel = new cGridBag().setVertical(false);
977960
978961 resetButton = AddButton(commandsPanel, "Reset");
962
+ resetButton.setToolTipText("Jump to frame zero");
979963 stepButton = AddButton(commandsPanel, "Step");
964
+ stepButton.setToolTipText("Step one frame");
980965 // resetAllButton = AddButton(oe, "Reset All");
981966 // stepAllButton = AddButton(oe, "Step All");
982
- speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
983967 // Return();
984968 slowerButton = AddButton(commandsPanel, "Slow");
969
+ slowerButton.setToolTipText("Decrease animation speed");
985970 fasterButton = AddButton(commandsPanel, "Fast");
971
+ fasterButton.setToolTipText("Increase animation speed");
986972 remarkButton = AddButton(commandsPanel, "Remark");
973
+ remarkButton.setToolTipText("Set the current transform as the target");
987974
988975 oe.ctrlPanel.add(commandsPanel);
989976 oe.ctrlPanel.Return();
990977
991
- pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
978
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
992979 normalpushField = (cNumberSlider)pushPanel.getComponent(1);
993980 //Return();
994981
....@@ -1290,7 +1277,7 @@
12901277 scrollpane.addMouseWheelListener(this); // Default not fast enough
12911278
12921279 /*JTabbedPane*/ scenePanel = new cGridBag();
1293
- scenePanel.preferredWidth = 7;
1280
+ scenePanel.preferredWidth = 6;
12941281
12951282 JTabbedPane tabbedPane = new JTabbedPane();
12961283 tabbedPane.add(scrollpane);
....@@ -1396,8 +1383,8 @@
13961383
13971384 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13981385
1399
- frame.setSize(1024, 768);
1400
- frame.show();
1386
+ frame.setSize(1280, 860);
1387
+ frame.setVisible(true);
14011388
14021389 gridPanel.setDividerLocation(1.0);
14031390
....@@ -1436,17 +1423,25 @@
14361423
14371424 cGridBag editBar = new cGridBag().setVertical(false);
14381425
1439
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
1426
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1427
+ createMaterialButton.setToolTipText("Create material");
14401428
14411429 /*
14421430 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14431431 */
14441432
1445
- editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints);
1446
- editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints);
1447
- editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1448
- editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1433
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1434
+ clearMaterialButton.setToolTipText("Clear material");
1435
+
1436
+ if (Globals.ADVANCED)
1437
+ {
1438
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1439
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1440
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1441
+ }
14491442
1443
+ editBar.preferredHeight = 15;
1444
+
14501445 panel.add(editBar);
14511446
14521447 /**/
....@@ -1712,12 +1707,15 @@
17121707 opacityPowerField.addChangeListener(this);
17131708 /**/
17141709
1715
- resetSlidersButton.addActionListener(this);
17161710 clearMaterialButton.addActionListener(this);
17171711 createMaterialButton.addActionListener(this);
1718
-
1719
- propagateToggle.addItemListener(this);
1720
- multiplyToggle.addItemListener(this);
1712
+
1713
+ if (Globals.ADVANCED)
1714
+ {
1715
+ resetSlidersButton.addActionListener(this);
1716
+ propagateToggle.addItemListener(this);
1717
+ multiplyToggle.addItemListener(this);
1718
+ }
17211719 }
17221720
17231721 void DropFile(java.io.File[] files, boolean textures)
....@@ -1888,7 +1886,7 @@
18881886
18891887 //? flashIt = false;
18901888 CameraPane pane = (CameraPane) cameraView;
1891
- pane.clickStart(location.x, location.y, 0);
1889
+ pane.clickStart(location.x, location.y, 0, 0);
18921890 pane.clickEnd(location.x, location.y, 0, true);
18931891
18941892 if (group.selection.size() == 1)
....@@ -1937,6 +1935,7 @@
19371935 e2.printStackTrace();
19381936 }
19391937 }
1938
+
19401939 LoadJMEThread loadThread;
19411940
19421941 class LoadJMEThread extends Thread
....@@ -1994,6 +1993,7 @@
19941993 //LoadFile0(filename, converter);
19951994 }
19961995 }
1996
+
19971997 LoadOBJThread loadObjThread;
19981998
19991999 class LoadOBJThread extends Thread
....@@ -2072,19 +2072,19 @@
20722072
20732073 void LoadObjFile(String fullname)
20742074 {
2075
- /*
2075
+ System.out.println("Loading " + fullname);
2076
+ /**/
20762077 //lastFilename = fullname;
20772078 if(loadObjThread == null)
20782079 {
2079
- loadObjThread = new LoadOBJThread();
2080
- loadObjThread.start();
2080
+ loadObjThread = new LoadOBJThread();
2081
+ loadObjThread.start();
20812082 }
20822083
20832084 loadObjThread.add(fullname);
2084
- */
2085
+ /**/
20852086
2086
- System.out.println("Loading " + fullname);
2087
- makeSomething(new FileObject(fullname, true), true);
2087
+ //makeSomething(new FileObject(fullname, true), true);
20882088 }
20892089
20902090 void LoadGFDFile(String fullname)
....@@ -2345,11 +2345,11 @@
23452345
23462346 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23472347 {
2348
- if (GrafreeD.standAlone)
2348
+ if (Grafreed.standAlone)
23492349 {
23502350 /**/
23512351 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2352
- browser.show();
2352
+ browser.setVisible(true);
23532353 String filename = browser.getFile();
23542354 if (filename != null && filename.length() > 0)
23552355 {
....@@ -2709,7 +2709,8 @@
27092709 return;
27102710 }
27112711
2712
- multiplyToggle.setSelected(mat.multiply);
2712
+ if (multiplyToggle != null)
2713
+ multiplyToggle.setSelected(mat.multiply);
27132714
27142715 assert (object.projectedVertices != null);
27152716
....@@ -2924,9 +2925,9 @@
29242925 frame.validate();
29252926
29262927 return;
2927
- } else if (event.getSource() == toggleRandomItem)
2928
+ } else if (event.getSource() == toggleSwitchItem)
29282929 {
2929
- cameraView.ToggleRandom();
2930
+ cameraView.ToggleSwitch();
29302931 cameraView.repaint();
29312932 return;
29322933 } else if (event.getSource() == toggleHandleItem)
....@@ -2955,6 +2956,10 @@
29552956 {
29562957 copy.live ^= true;
29572958 return;
2959
+ } else if (event.getSource() == selectCB)
2960
+ {
2961
+ copy.dontselect ^= true;
2962
+ return;
29582963 } else if (event.getSource() == hideCB)
29592964 {
29602965 copy.hide ^= true;
....@@ -2969,6 +2974,7 @@
29692974 if (event.getSource() == randomCB)
29702975 {
29712976 copy.random ^= true;
2977
+ objEditor.refreshContents();
29722978 return;
29732979 }
29742980 if (event.getSource() == speedupCB)
....@@ -2992,8 +2998,9 @@
29922998
29932999 public void actionPerformed(ActionEvent event)
29943000 {
3001
+ Object source = event.getSource();
29953002 // SCRIPT DIALOG
2996
- if (event.getSource() == okbutton)
3003
+ if (source == okbutton)
29973004 {
29983005 textpanel.setVisible(false);
29993006 textpanel.remove(textarea);
....@@ -3005,7 +3012,7 @@
30053012 textarea = null;
30063013 textpanel = null;
30073014 }
3008
- if (event.getSource() == cancelbutton)
3015
+ if (source == cancelbutton)
30093016 {
30103017 textpanel.setVisible(false);
30113018 textpanel.remove(textarea);
....@@ -3017,50 +3024,50 @@
30173024 //applySelf();
30183025 //client.refreshEditWindow();
30193026 //refreshContents();
3020
- if (event.getSource() == nameField)
3027
+ if (source == nameField)
30213028 {
30223029 //System.out.println("ObjEditor " + event);
30233030 applySelf0(true);
30243031 //parent.applySelf();
30253032 objEditor.refreshContents();
3026
- } else if (event.getSource() == resetButton)
3033
+ } else if (source == resetButton)
30273034 {
30283035 CameraPane.fullreset = true;
30293036 copy.Reset(); // ResetMeshes();
30303037 copy.Touch();
30313038 objEditor.refreshContents();
3032
- } else if (event.getSource() == stepItem)
3039
+ } else if (source == stepItem)
30333040 {
30343041 //cameraView.ONESTEP = true;
30353042 Globals.ONESTEP = true;
30363043 cameraView.repaint();
30373044 return;
3038
- } else if (event.getSource() == stepButton)
3045
+ } else if (source == stepButton)
30393046 {
30403047 copy.Step();
30413048 copy.Touch();
30423049 objEditor.refreshContents();
3043
- } else if (event.getSource() == slowerButton)
3050
+ } else if (source == slowerButton)
30443051 {
30453052 copy.Slower();
30463053 copy.Touch();
30473054 objEditor.refreshContents();
3048
- } else if (event.getSource() == fasterButton)
3055
+ } else if (source == fasterButton)
30493056 {
30503057 copy.Faster();
30513058 copy.Touch();
30523059 objEditor.refreshContents();
3053
- } else if (event.getSource() == remarkButton)
3060
+ } else if (source == remarkButton)
30543061 {
30553062 copy.Remark();
30563063 copy.Touch();
30573064 objEditor.refreshContents();
3058
- } else if (event.getSource() == stepAllButton)
3065
+ } else if (source == stepAllButton)
30593066 {
30603067 copy.StepAll();
30613068 copy.Touch();
30623069 objEditor.refreshContents();
3063
- } else if (event.getSource() == resetAllButton)
3070
+ } else if (source == resetAllButton)
30643071 {
30653072 //CameraPane.fullreset = true;
30663073 copy.ResetAll(); // ResetMeshes();
....@@ -3093,53 +3100,75 @@
30933100 // Close();
30943101 // }
30953102 // else
3096
- if (event.getSource() == resetSlidersButton)
3103
+ if (source == resetSlidersButton)
30973104 {
30983105 ResetSliders();
3099
- } else if (event.getSource() == clearMaterialButton)
3106
+ } else if (source == clearMaterialButton)
31003107 {
31013108 ClearMaterial();
3102
- } else if (event.getSource() == createMaterialButton)
3109
+ } else if (source == createMaterialButton)
31033110 {
31043111 CreateMaterial();
3105
- } else if (event.getSource() == clearPanelButton)
3112
+ } else if (source == clearPanelButton)
31063113 {
31073114 copy.ClearUI();
31083115 refreshContents(true);
3109
- } /*
3110
- }
3111
-
3112
- public boolean action(Event event, Object arg)
3113
- {
3114
- */ else if (event.getSource() == closeItem)
3116
+ } else if (source == importGFDItem)
3117
+ {
3118
+ ImportGFD();
3119
+ } else
3120
+ if (source == importVRMLX3DItem)
3121
+ {
3122
+ ImportVRMLX3D();
3123
+ } else
3124
+ if (source == import3DSItem)
3125
+ {
3126
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3127
+ } else
3128
+ if (source == importOBJItem)
3129
+ {
3130
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3131
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3132
+ browser.setVisible(true);
3133
+ String filename = browser.getFile();
3134
+ if (filename != null && filename.length() > 0)
3135
+ {
3136
+ String fullname = browser.getDirectory() + filename;
3137
+ makeSomething(ReadOBJ(fullname), true);
3138
+ }
3139
+ } else
3140
+ if (source == closeItem)
31153141 {
31163142 Close();
31173143 //return true;
3118
- } else if (event.getSource() == loadItem)
3144
+ } else if (source == loadItem)
31193145 {
31203146 load();
31213147 //return true;
3122
- } else if (event.getSource() == saveItem)
3148
+ } else if (source == newItem)
3149
+ {
3150
+ New();
3151
+ } else if (source == saveItem)
31233152 {
31243153 save();
31253154 //return true;
3126
- } else if (event.getSource() == saveAsItem)
3155
+ } else if (source == saveAsItem)
31273156 {
31283157 saveAs();
31293158 //return true;
3130
- } else if (event.getSource() == reexportItem)
3159
+ } else if (source == reexportItem)
31313160 {
31323161 reexport();
31333162 //return true;
3134
- } else if (event.getSource() == exportAsItem)
3163
+ } else if (source == exportAsItem)
31353164 {
31363165 export();
31373166 //return true;
3138
- } else if (event.getSource() == povItem)
3167
+ } else if (source == povItem)
31393168 {
31403169 generatePOV();
31413170 //return true;
3142
- } else if (event.getSource() == zBufferItem)
3171
+ } else if (source == zBufferItem)
31433172 {
31443173 try
31453174 {
....@@ -3161,21 +3190,8 @@
31613190 cameraView.repaint();
31623191 //return true;
31633192 }
3164
- */ else if (event.getSource() == editCameraItem)
3165
- {
3166
- cameraView.ProtectCamera();
3167
- cameraView.repaint();
3168
- return;
3169
- } else if (event.getSource() == revertCameraItem)
3170
- {
3171
- cameraView.RevertCamera();
3172
- cameraView.repaint();
3173
- return;
3174
-// } else if (event.getSource() == textureButton)
3175
-// {
3176
-// return; // true;
3177
- } else // combos...
3178
- if (event.getSource() == texresMenu)
3193
+ */ else // combos...
3194
+ if (source == texresMenu)
31793195 {
31803196 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
31813197 copy.texres = texresMenu.getSelectedIndex();
....@@ -3187,12 +3203,268 @@
31873203 }
31883204 }
31893205
3206
+ void New()
3207
+ {
3208
+ while (copy.Size() > 1)
3209
+ {
3210
+ copy.remove(1);
3211
+ }
3212
+
3213
+ ResetModel();
3214
+ objEditor.refreshContents();
3215
+ }
3216
+
3217
+ static public byte[] Compress(Object3D o)
3218
+ {
3219
+ try
3220
+ {
3221
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3222
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3223
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
3224
+
3225
+ Object3D parent = o.parent;
3226
+ o.parent = null;
3227
+
3228
+ out.writeObject(o);
3229
+
3230
+ o.parent = parent;
3231
+
3232
+ out.flush();
3233
+
3234
+ zstream.close();
3235
+ out.close();
3236
+
3237
+ return baos.toByteArray();
3238
+ } catch (Exception e)
3239
+ {
3240
+ System.err.println(e);
3241
+ return null;
3242
+ }
3243
+ }
3244
+
3245
+ static public Object Uncompress(byte[] bytes)
3246
+ {
3247
+ System.out.println("#bytes = " + bytes.length);
3248
+ try
3249
+ {
3250
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3251
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3252
+ ObjectInputStream in = new ObjectInputStream(istream);
3253
+ Object obj = in.readObject();
3254
+ in.close();
3255
+
3256
+ return obj;
3257
+ } catch (Exception e)
3258
+ {
3259
+ System.err.println(e);
3260
+ return null;
3261
+ }
3262
+ }
3263
+
3264
+ static public Object clone(Object o)
3265
+ {
3266
+ try
3267
+ {
3268
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3269
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3270
+
3271
+ out.writeObject(o);
3272
+
3273
+ out.flush();
3274
+ out.close();
3275
+
3276
+ byte[] bytes = baos.toByteArray();
3277
+
3278
+ System.out.println("clone = " + bytes.length);
3279
+
3280
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3281
+ ObjectInputStream in = new ObjectInputStream(bais);
3282
+ Object obj = in.readObject();
3283
+ in.close();
3284
+
3285
+ return obj;
3286
+ } catch (Exception e)
3287
+ {
3288
+ System.err.println(e);
3289
+ return null;
3290
+ }
3291
+ }
3292
+
3293
+ cRadio GetCurrentTab()
3294
+ {
3295
+ cRadio ab;
3296
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3297
+ {
3298
+ ab = (cRadio)e.nextElement();
3299
+ if(ab.GetObject() == copy)
3300
+ {
3301
+ return ab;
3302
+ }
3303
+ }
3304
+
3305
+ return null;
3306
+ }
3307
+
3308
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3309
+
3310
+ public void Save()
3311
+ {
3312
+ cRadio tab = GetCurrentTab();
3313
+
3314
+ boolean temp = CameraPane.SWITCH;
3315
+ CameraPane.SWITCH = false;
3316
+
3317
+ copy.ExtractBigData(hashtable);
3318
+
3319
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3320
+ tab.graphs[tab.undoindex++] = Compress(copy);
3321
+
3322
+ copy.RestoreBigData(hashtable);
3323
+
3324
+ CameraPane.SWITCH = temp;
3325
+
3326
+ //assert(hashtable.isEmpty());
3327
+
3328
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
3329
+ {
3330
+ tab.graphs[i] = null;
3331
+ }
3332
+
3333
+ // test save
3334
+ if (false)
3335
+ {
3336
+ try
3337
+ {
3338
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3339
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3340
+
3341
+ p.writeObject(copy);
3342
+
3343
+ p.flush();
3344
+
3345
+ ostream.close();
3346
+ } catch (Exception e)
3347
+ {
3348
+ e.printStackTrace();
3349
+ }
3350
+ }
3351
+ }
3352
+
3353
+ void CopyChanged(Object3D obj)
3354
+ {
3355
+ boolean temp = CameraPane.SWITCH;
3356
+ CameraPane.SWITCH = false;
3357
+
3358
+ copy.ExtractBigData(hashtable);
3359
+
3360
+ copy.clear();
3361
+
3362
+ for (int i=0; i<obj.Size(); i++)
3363
+ {
3364
+ copy.add(obj.get(i));
3365
+ }
3366
+
3367
+ copy.RestoreBigData(hashtable);
3368
+
3369
+ CameraPane.SWITCH = temp;
3370
+
3371
+ //assert(hashtable.isEmpty());
3372
+
3373
+ copy.Touch();
3374
+
3375
+ ResetModel();
3376
+ copy.HardTouch(); // recompile?
3377
+
3378
+ cRadio ab;
3379
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3380
+ {
3381
+ ab = (cRadio)e.nextElement();
3382
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3383
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3384
+ if (test != null)
3385
+ {
3386
+ test.editWindow = ab.object.editWindow;
3387
+ ab.object = test;
3388
+ }
3389
+ }
3390
+
3391
+ refreshContents();
3392
+ }
3393
+
3394
+ public void Undo()
3395
+ {
3396
+ cRadio tab = GetCurrentTab();
3397
+
3398
+ if (tab.undoindex == 0)
3399
+ {
3400
+ java.awt.Toolkit.getDefaultToolkit().beep();
3401
+ return;
3402
+ }
3403
+
3404
+ if (tab.graphs[tab.undoindex] == null)
3405
+ {
3406
+ Save();
3407
+ tab.undoindex -= 1;
3408
+ }
3409
+
3410
+ tab.undoindex -= 1;
3411
+
3412
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3413
+ }
3414
+
3415
+ public void Redo()
3416
+ {
3417
+ cRadio tab = GetCurrentTab();
3418
+
3419
+ if (tab.graphs[tab.undoindex + 1] == null)
3420
+ {
3421
+ java.awt.Toolkit.getDefaultToolkit().beep();
3422
+ return;
3423
+ }
3424
+
3425
+ tab.undoindex += 1;
3426
+
3427
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3428
+ }
3429
+
3430
+ void ImportGFD()
3431
+ {
3432
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
3433
+ browser.show();
3434
+ String filename = browser.getFile();
3435
+ if (filename != null && filename.length() > 0)
3436
+ {
3437
+ String fullname = browser.getDirectory() + filename;
3438
+
3439
+ //Object3D readobj =
3440
+ objEditor.ReadGFD(fullname, objEditor);
3441
+ //makeSomething(readobj);
3442
+ }
3443
+ }
3444
+
3445
+ void ImportVRMLX3D()
3446
+ {
3447
+ if (Grafreed.standAlone)
3448
+ {
3449
+ /**/
3450
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3451
+ browser.show();
3452
+ String filename = browser.getFile();
3453
+ if (filename != null && filename.length() > 0)
3454
+ {
3455
+ String fullname = browser.getDirectory() + filename;
3456
+ LoadVRMLX3D(fullname);
3457
+ }
3458
+ /**/
3459
+ }
3460
+ }
3461
+
31903462 void ToggleAnimation()
31913463 {
31923464 if (!Globals.ANIMATION)
31933465 {
31943466 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3195
- browser.show();
3467
+ browser.setVisible(true);
31963468 String filename = browser.getFile();
31973469 if (filename != null && filename.length() > 0)
31983470 {
....@@ -3202,8 +3474,8 @@
32023474
32033475 Globals.ANIMATION ^= true;
32043476
3205
- GrafreeD.wav.cursor = 0;
3206
- GrafreeD.wav.loop = 0;
3477
+ Grafreed.wav.cursor = 0;
3478
+ Grafreed.wav.loop = 0;
32073479 }
32083480 } else
32093481 {
....@@ -3224,7 +3496,6 @@
32243496 callee.refreshContents();
32253497 } else
32263498 {
3227
- new Exception().printStackTrace();
32283499 System.exit(0);
32293500 }
32303501 }
....@@ -3254,7 +3525,7 @@
32543525 void CreateMaterial()
32553526 {
32563527 //copy.ClearMaterial(); // PATCH
3257
- copy.CreateMaterialS(multiplyToggle.isSelected());
3528
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32583529 if (copy.selection.size() > 0)
32593530 //SetMaterial(copy);
32603531 {
....@@ -3313,11 +3584,11 @@
33133584 {
33143585 copy.ResetBlockLoop(); // temporary problem
33153586
3316
- boolean random = CameraPane.RANDOM;
3317
- CameraPane.RANDOM = false; // parse everything
3587
+ boolean random = CameraPane.SWITCH;
3588
+ CameraPane.SWITCH = false; // parse everything
33183589 copy.ResetDisplayList();
33193590 copy.HardTouch();
3320
- CameraPane.RANDOM = random;
3591
+ CameraPane.SWITCH = random;
33213592 }
33223593
33233594 // public void applySelf()
....@@ -3391,6 +3662,36 @@
33913662 {
33923663 //System.out.println("Propagate = " + propagate);
33933664 copy.UpdateMaterial(anchor, current, propagate);
3665
+
3666
+ if (copy.material != null)
3667
+ {
3668
+ cMaterial mat = copy.material;
3669
+
3670
+ colorField.SetToolTipValue((mat.color));
3671
+ modulationField.SetToolTipValue((mat.modulation));
3672
+ metalnessField.SetToolTipValue((mat.metalness));
3673
+ diffuseField.SetToolTipValue((mat.diffuse));
3674
+ specularField.SetToolTipValue((mat.specular));
3675
+ shininessField.SetToolTipValue((mat.shininess));
3676
+ shiftField.SetToolTipValue((mat.shift));
3677
+ ambientField.SetToolTipValue((mat.ambient));
3678
+ lightareaField.SetToolTipValue((mat.lightarea));
3679
+ diffusenessField.SetToolTipValue((mat.factor));
3680
+ velvetField.SetToolTipValue((mat.velvet));
3681
+ sheenField.SetToolTipValue((mat.sheen));
3682
+ subsurfaceField.SetToolTipValue((mat.subsurface));
3683
+ backlitField.SetToolTipValue((mat.bump));
3684
+ anisoField.SetToolTipValue((mat.aniso));
3685
+ anisoVField.SetToolTipValue((mat.anisoV));
3686
+ cameraField.SetToolTipValue((mat.cameralight));
3687
+ selfshadowField.SetToolTipValue((mat.diffuseness));
3688
+ shadowField.SetToolTipValue((mat.shadow));
3689
+ textureField.SetToolTipValue((mat.texture));
3690
+ opacityField.SetToolTipValue((mat.opacity));
3691
+ fakedepthField.SetToolTipValue((mat.fakedepth));
3692
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
3693
+ }
3694
+
33943695 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
33953696 {
33963697 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3506,7 +3807,7 @@
35063807 }
35073808
35083809 if (normalpushField != null)
3509
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
3810
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35103811 }
35113812
35123813 void SnapObject()
....@@ -3770,6 +4071,7 @@
37704071
37714072 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37724073 {
4074
+ Save();
37734075 //Tween.set(thing, 0).target(1).start(tweenManager);
37744076 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37754077 // if (thing instanceof GenericJointDemo)
....@@ -3973,6 +4275,7 @@
39734275 }
39744276 }
39754277 }
4278
+
39764279 LoadGFDThread loadGFDThread;
39774280
39784281 void ReadGFD(String fullname, iCallBack cb)
....@@ -3993,7 +4296,8 @@
39934296 try
39944297 {
39954298 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
3996
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4299
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4300
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
39974301
39984302 readobj = (Object3D) p.readObject();
39994303 istream.close();
....@@ -4001,7 +4305,20 @@
40014305 readobj.ResetDisplayList();
40024306 } catch (Exception e)
40034307 {
4004
- e.printStackTrace();
4308
+ //e.printStackTrace();
4309
+ try
4310
+ {
4311
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4312
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4313
+
4314
+ readobj = (Object3D) p.readObject();
4315
+ istream.close();
4316
+
4317
+ readobj.ResetDisplayList();
4318
+ } catch (Exception e2)
4319
+ {
4320
+ e2.printStackTrace();
4321
+ }
40054322 }
40064323 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40074324 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4056,6 +4373,7 @@
40564373
40574374 if (readobj != null)
40584375 {
4376
+ Save();
40594377 try
40604378 {
40614379 //readobj.deepCopySelf(copy);
....@@ -4118,7 +4436,7 @@
41184436
41194437 void load() // throws ClassNotFoundException
41204438 {
4121
- if (GrafreeD.standAlone)
4439
+ if (Grafreed.standAlone)
41224440 {
41234441 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
41244442 browser.show();
....@@ -4205,11 +4523,13 @@
42054523 try
42064524 {
42074525 FileOutputStream ostream = new FileOutputStream(lastname);
4208
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4526
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4527
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42094528
42104529 p.writeObject(copy);
42114530 p.flush();
42124531
4532
+ zstream.close();
42134533 ostream.close();
42144534
42154535 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4219,11 +4539,12 @@
42194539 {
42204540 }
42214541 }
4542
+
42224543 String lastname;
42234544
42244545 void saveAs()
42254546 {
4226
- if (GrafreeD.standAlone)
4547
+ if (Grafreed.standAlone)
42274548 {
42284549 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42294550 browser.setVisible(true);
....@@ -4328,13 +4649,13 @@
43284649 try
43294650 {
43304651 FileOutputStream ostream = new FileOutputStream(filename);
4331
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4332
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4652
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4653
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43334654
43344655 Object3D objectparent = obj.parent;
43354656 obj.parent = null;
43364657
4337
- Object3D object = (Object3D) GrafreeD.clone(obj);
4658
+ Object3D object = (Object3D) Grafreed.clone(obj);
43384659
43394660 obj.parent = objectparent;
43404661
....@@ -4346,8 +4667,8 @@
43464667 p.writeObject(object);
43474668 p.flush();
43484669
4670
+ zstream.close();
43494671 ostream.close();
4350
- // zstream.close();
43514672
43524673 // group.selection.get(0).parent = parent;
43534674 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4368,7 +4689,7 @@
43684689 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43694690 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43704691 copy.generatePOV(buffer);
4371
- if (GrafreeD.standAlone)
4692
+ if (Grafreed.standAlone)
43724693 {
43734694 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43744695 browser.show();
....@@ -4394,7 +4715,8 @@
43944715 Object3D client;
43954716 Object3D copy;
43964717 MenuBar menuBar;
4397
- Menu windowMenu;
4718
+ Menu fileMenu;
4719
+ MenuItem newItem;
43984720 MenuItem loadItem;
43994721 MenuItem saveItem;
44004722 MenuItem saveAsItem;
....@@ -4402,11 +4724,9 @@
44024724 MenuItem reexportItem;
44034725 MenuItem povItem;
44044726 MenuItem closeItem;
4405
- Menu cameraMenu;
4727
+
44064728 CheckboxMenuItem zBufferItem;
44074729 //MenuItem normalLensItem;
4408
- MenuItem editCameraItem;
4409
- MenuItem revertCameraItem;
44104730 MenuItem stepItem;
44114731 CheckboxMenuItem toggleLiveItem;
44124732 CheckboxMenuItem toggleFullScreenItem;
....@@ -4417,7 +4737,7 @@
44174737 CheckboxMenuItem toggleFootContactItem;
44184738 CheckboxMenuItem toggleDLItem;
44194739 CheckboxMenuItem toggleTextureItem;
4420
- CheckboxMenuItem toggleRandomItem;
4740
+ CheckboxMenuItem toggleSwitchItem;
44214741 CheckboxMenuItem toggleRootItem;
44224742 CheckboxMenuItem animationItem;
44234743 CheckboxMenuItem toggleHandleItem;
....@@ -4425,7 +4745,7 @@
44254745 JSplitPane mainPanel;
44264746 JScrollPane scrollpane;
44274747 JPanel toolbarPanel;
4428
- JPanel treePanel;
4748
+ cGridBag treePanel;
44294749 JPanel radioPanel;
44304750 ButtonGroup buttonGroup;
44314751 cGridBag ctrlPanel;
....@@ -4554,4 +4874,9 @@
45544874 //ObjectUI parent;
45554875
45564876 cNumberSlider normalpushField;
4877
+
4878
+ private MenuItem importGFDItem;
4879
+ private MenuItem importVRMLX3DItem;
4880
+ private MenuItem import3DSItem;
4881
+ private MenuItem importOBJItem;
45574882 }