Normand Briere
2019-07-14 bc829f47837b5a001f911542140b0b8e63c2bb0c
ObjEditor.java
....@@ -15,6 +15,9 @@
1515 //import javax.swing.plaf.ColorUIResource;
1616 //import javax.swing.plaf.metal.DefaultMetalTheme;
1717
18
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
19
+import javax.swing.plaf.basic.BasicSplitPaneUI;
20
+
1821 //import javax.media.opengl.GLCanvas;
1922
2023 import //weka.core.
....@@ -306,7 +309,7 @@
306309 //localCopy.parent = null;
307310
308311 frame = new JFrame();
309
- frame.setUndecorated(true);
312
+ frame.setUndecorated(false);
310313 objEditor = this;
311314 this.callee = callee;
312315
....@@ -347,7 +350,7 @@
347350 frame.setMenuBar(menuBar = new MenuBar());
348351 menuBar.add(fileMenu = new Menu("File"));
349352 fileMenu.add(newItem = new MenuItem("New"));
350
- fileMenu.add(loadItem = new MenuItem("Open..."));
353
+ fileMenu.add(openItem = new MenuItem("Open..."));
351354
352355 //oe.menuBar.add(menu = new Menu("Include"));
353356 Menu menu = new Menu("Import");
....@@ -379,7 +382,7 @@
379382 }
380383
381384 newItem.addActionListener(this);
382
- loadItem.addActionListener(this);
385
+ openItem.addActionListener(this);
383386 saveItem.addActionListener(this);
384387 saveAsItem.addActionListener(this);
385388 exportAsItem.addActionListener(this);
....@@ -446,7 +449,7 @@
446449 // TEXTAREA infoarea.setLineWrap(true);
447450 // TEXTAREA infoarea.setWrapStyleWord(true);
448451 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
449
- infoPanel.setPreferredSize(new Dimension(50, 200));
452
+ infoPanel.setPreferredSize(new Dimension(1, 1));
450453 infoPanel.setName("Info");
451454 //infoPanel.setLayout(new BorderLayout());
452455 //infoPanel.add(createTextPane());
....@@ -458,7 +461,14 @@
458461 mainPanel.setDividerSize(9);
459462 mainPanel.setDividerLocation(0.5); //1.0);
460463 mainPanel.setResizeWeight(0.5);
461
-
464
+
465
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
466
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
467
+ divider.setDividerSize(15);
468
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
469
+
470
+ mainPanel.setUI(new BasicSplitPaneUI());
471
+
462472 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
463473 //mainPanel.setLayout(new GridBagLayout());
464474 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
....@@ -689,8 +699,8 @@
689699 }
690700 }
691701
692
-static GraphicsDevice device = GraphicsEnvironment
693
- .getLocalGraphicsEnvironment().getScreenDevices()[0];
702
+//static GraphicsDevice device = GraphicsEnvironment
703
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
694704
695705 Rectangle keeprect;
696706 cRadio radio;
....@@ -711,10 +721,19 @@
711721 void Minimize()
712722 {
713723 frame.setState(Frame.ICONIFIED);
724
+ frame.validate();
714725 }
715726
727
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
728
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
729
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
716730 void Maximize()
717731 {
732
+ if (CameraPane.FULLSCREEN)
733
+ {
734
+ ToggleFullScreen();
735
+ }
736
+
718737 if (maximized)
719738 {
720739 frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
....@@ -722,22 +741,36 @@
722741 else
723742 {
724743 keeprect = frame.getBounds();
725
- Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
726
- Dimension rect2 = frame.getToolkit().getScreenSize();
727
- frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
744
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
745
+// Dimension rect2 = frame.getToolkit().getScreenSize();
746
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
728747 // frame.setState(Frame.MAXIMIZED_BOTH);
748
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
729749 }
730750
731751 maximized ^= true;
752
+
753
+ frame.validate();
732754 }
755
+
756
+ cButton minButton;
757
+ cButton maxButton;
758
+ cButton fullButton;
733759
734760 void ToggleFullScreen()
735761 {
762
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
763
+
736764 cameraView.ToggleFullScreen();
737765
738766 if (!CameraPane.FULLSCREEN)
739767 {
740768 device.setFullScreenWindow(null);
769
+ frame.dispose();
770
+ frame.setUndecorated(false);
771
+ frame.validate();
772
+ frame.setVisible(true);
773
+
741774 //frame.setVisible(false);
742775 // frame.removeNotify();
743776 // frame.setUndecorated(false);
....@@ -747,7 +780,7 @@
747780 // X frame.getContentPane().remove(/*"Center",*/bigThree);
748781 // X framePanel.add(bigThree);
749782 // X frame.getContentPane().add(/*"Center",*/framePanel);
750
- framePanel.setDividerLocation(1);
783
+ framePanel.setDividerLocation(46);
751784
752785 //frame.setVisible(true);
753786 radio.layout = keepButton;
....@@ -762,7 +795,12 @@
762795 // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
763796 // frame.getToolkit().getScreenSize().height);
764797 //frame.setVisible(false);
798
+
799
+ frame.dispose();
800
+ frame.setUndecorated(true);
765801 device.setFullScreenWindow(frame);
802
+ frame.validate();
803
+ frame.setVisible(true);
766804 // frame.removeNotify();
767805 // frame.setUndecorated(true);
768806 // frame.addNotify();
....@@ -775,6 +813,7 @@
775813 radio.layout.doClick();
776814 //frame.setVisible(true);
777815 }
816
+ frame.validate();
778817 }
779818
780819 private JTextPane createTextPane()
....@@ -1107,7 +1146,7 @@
11071146 namePanel = new cGridBag();
11081147
11091148 nameField = AddText(namePanel, copy.GetName());
1110
- namePanel.add(nameField);
1149
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11111150 oe.ctrlPanel.add(namePanel);
11121151
11131152 oe.ctrlPanel.Return();
....@@ -1125,20 +1164,21 @@
11251164 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
11261165 hideCB.setToolTipText("Hide object");
11271166 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1128
- markCB.setToolTipText("Set the animation target transform");
1167
+ markCB.setToolTipText("As animation target transform");
11291168
11301169 setupPanel2 = new cGridBag().setVertical(false);
11311170
11321171 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
11331172 rewindCB.setToolTipText("Rewind animation");
11341173
1135
- randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1136
- randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1174
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1175
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11371176
1177
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1178
+ link2masterCB.setToolTipText("Attach to support");
1179
+
11381180 if (Globals.ADVANCED)
11391181 {
1140
- link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1141
- link2masterCB.setToolTipText("Attach to support");
11421182 speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
11431183 speedupCB.setToolTipText("Option motion capture");
11441184 }
....@@ -1454,7 +1494,10 @@
14541494 // north.add(ctrlPanel, BorderLayout.NORTH);
14551495 // objectPanel.add(north);
14561496 objectPanel.add(editPanel);
1457
- objectPanel.add(infoPanel);
1497
+
1498
+ //if (Globals.ADVANCED)
1499
+ objectPanel.add(infoPanel);
1500
+
14581501 objectPanel.add(toolboxPanel);
14591502
14601503 /*
....@@ -1563,9 +1606,9 @@
15631606 // aConstraints.gridheight = 1;
15641607
15651608 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1566
- framePanel.setContinuousLayout(true);
1567
- framePanel.setOneTouchExpandable(true);
1568
- framePanel.setDividerLocation(0.8);
1609
+ framePanel.setContinuousLayout(false);
1610
+ framePanel.setOneTouchExpandable(false);
1611
+ //.setDividerLocation(0.8);
15691612 //framePanel.setDividerSize(15);
15701613 //framePanel.setResizeWeight(0.15);
15711614 framePanel.setName("Frame");
....@@ -1584,12 +1627,13 @@
15841627
15851628 frame.setSize(1280, 860);
15861629
1587
- frame.validate();
1588
- frame.setVisible(true);
1589
-
15901630 cameraView.requestFocusInWindow();
15911631
15921632 gridPanel.setDividerLocation(1.0);
1633
+
1634
+ frame.validate();
1635
+
1636
+ frame.setVisible(true);
15931637
15941638 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
15951639 frame.addWindowListener(new WindowAdapter()
....@@ -1676,24 +1720,6 @@
16761720 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16771721 colorSection.add(texture);
16781722
1679
- cGridBag anisoU = new cGridBag();
1680
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1681
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1683
- colorSection.add(anisoU);
1684
-
1685
- cGridBag anisoV = new cGridBag();
1686
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1687
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1689
- colorSection.add(anisoV);
1690
-
1691
- cGridBag shadowbias = new cGridBag();
1692
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1693
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1694
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1695
- colorSection.add(shadowbias);
1696
-
16971723 panel.add(new JSeparator());
16981724
16991725 panel.add(colorSection);
....@@ -1743,6 +1769,12 @@
17431769 fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17441770 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
17451771 diffuseSection.add(fakedepth);
1772
+
1773
+ cGridBag shadowbias = new cGridBag();
1774
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1775
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1776
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1777
+ diffuseSection.add(shadowbias);
17461778
17471779 panel.add(new JSeparator());
17481780
....@@ -1794,6 +1826,18 @@
17941826 // aConstraints.gridy += 1;
17951827 // aConstraints.gridwidth = 1;
17961828
1829
+ cGridBag anisoU = new cGridBag();
1830
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1831
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1832
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1833
+ specularSection.add(anisoU);
1834
+
1835
+ cGridBag anisoV = new cGridBag();
1836
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1837
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1838
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1839
+ specularSection.add(anisoV);
1840
+
17971841
17981842 panel.add(new JSeparator());
17991843
....@@ -1801,35 +1845,35 @@
18011845
18021846 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18031847
1804
- cGridBag globalSection = new cGridBag().setVertical(true);
1848
+ //cGridBag globalSection = new cGridBag().setVertical(true);
18051849
18061850 cGridBag camera = new cGridBag();
18071851 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
18081852 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18091853 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1810
- globalSection.add(camera);
1854
+ colorSection.add(camera);
18111855
18121856 cGridBag ambient = new cGridBag();
18131857 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
18141858 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18151859 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1816
- globalSection.add(ambient);
1860
+ colorSection.add(ambient);
18171861
18181862 cGridBag backlit = new cGridBag();
18191863 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
18201864 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18211865 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1822
- globalSection.add(backlit);
1866
+ colorSection.add(backlit);
18231867
18241868 cGridBag opacity = new cGridBag();
18251869 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
18261870 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18271871 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1828
- globalSection.add(opacity);
1872
+ colorSection.add(opacity);
18291873
1830
- panel.add(new JSeparator());
1874
+ //panel.add(new JSeparator());
18311875
1832
- panel.add(globalSection);
1876
+ //panel.add(globalSection);
18331877
18341878 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18351879
....@@ -1936,8 +1980,9 @@
19361980 // 3D models
19371981 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
19381982 {
1939
- lastConverter = new com.jmex.model.converters.MaxToJme();
1940
- LoadFile(filename, lastConverter);
1983
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
1984
+ //LoadFile(filename, lastConverter);
1985
+ LoadObjFile(filename); // New 3ds loader
19411986 continue;
19421987 }
19431988 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -2663,6 +2708,7 @@
26632708 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
26642709 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
26652710 }
2711
+
26662712 //cJME.count++;
26672713 //cJME.count %= 12;
26682714 if (gc)
....@@ -2846,6 +2892,7 @@
28462892 }
28472893 }
28482894 }
2895
+
28492896 cFileSystemPane FSPane;
28502897
28512898 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2899,6 +2946,7 @@
28992946 }
29002947 }
29012948 }
2949
+
29022950 freezematerial = false;
29032951 }
29042952
....@@ -3017,12 +3065,17 @@
30173065 // }
30183066
30193067 /**/
3020
- if (deselect)
3068
+ if (deselect || child == null)
30213069 {
30223070 //group.deselectAll();
30233071 //freeze = true;
30243072 GetTree().clearSelection();
30253073 //freeze = false;
3074
+
3075
+ if (child == null)
3076
+ {
3077
+ return;
3078
+ }
30263079 }
30273080
30283081 //group.addSelectee(child);
....@@ -3346,9 +3399,9 @@
33463399 {
33473400 Close();
33483401 //return true;
3349
- } else if (source == loadItem)
3402
+ } else if (source == openItem)
33503403 {
3351
- load();
3404
+ Open();
33523405 //return true;
33533406 } else if (source == newItem)
33543407 {
....@@ -3373,6 +3426,10 @@
33733426 {
33743427 generatePOV();
33753428 //return true;
3429
+ } else if (event.getSource() == archiveItem)
3430
+ {
3431
+ cTools.Archive(frame);
3432
+ return;
33763433 } else if (source == zBufferItem)
33773434 {
33783435 try
....@@ -3424,8 +3481,8 @@
34243481 try
34253482 {
34263483 ByteArrayOutputStream baos = new ByteArrayOutputStream();
3427
- java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3428
- ObjectOutputStream out = new ObjectOutputStream(zstream);
3484
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3485
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
34293486
34303487 Object3D parent = o.parent;
34313488 o.parent = null;
....@@ -3436,10 +3493,14 @@
34363493
34373494 out.flush();
34383495
3439
- zstream.close();
3496
+ baos //zstream
3497
+ .close();
34403498 out.close();
34413499
3442
- return baos.toByteArray();
3500
+ byte[] bytes = baos.toByteArray();
3501
+
3502
+ System.out.println("save #bytes = " + bytes.length);
3503
+ return bytes;
34433504 } catch (Exception e)
34443505 {
34453506 System.err.println(e);
....@@ -3449,13 +3510,16 @@
34493510
34503511 static public Object Uncompress(byte[] bytes)
34513512 {
3452
- System.out.println("#bytes = " + bytes.length);
3513
+ System.out.println("restore #bytes = " + bytes.length);
34533514 try
34543515 {
34553516 ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3456
- java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3457
- ObjectInputStream in = new ObjectInputStream(istream);
3517
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3518
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
34583519 Object obj = in.readObject();
3520
+
3521
+ bais //istream
3522
+ .close();
34593523 in.close();
34603524
34613525 return obj;
....@@ -3514,6 +3578,27 @@
35143578
35153579 public void Save()
35163580 {
3581
+ Save(true);
3582
+ }
3583
+
3584
+ private boolean Equal(byte[] compress, byte[] name)
3585
+ {
3586
+ if (compress.length != name.length)
3587
+ {
3588
+ return false;
3589
+ }
3590
+
3591
+ for (int i=compress.length; --i>=0;)
3592
+ {
3593
+ if (compress[i] != name[i])
3594
+ return false;
3595
+ }
3596
+
3597
+ return true;
3598
+ }
3599
+
3600
+ public boolean Save(boolean user)
3601
+ {
35173602 System.err.println("Save");
35183603
35193604 cRadio tab = GetCurrentTab();
....@@ -3523,18 +3608,38 @@
35233608
35243609 copy.ExtractBigData(hashtable);
35253610
3526
- //EditorFrame.m_MainFrame.requestFocusInWindow();
3527
- tab.graphs[tab.undoindex++] = Compress(copy);
3528
-
3529
- copy.RestoreBigData(hashtable);
3611
+ byte[] compress = Compress(copy);
35303612
35313613 CameraPane.SWITCH = temp;
35323614
3615
+ boolean thesame = false;
3616
+
3617
+ // Quick heuristic using length. Works only when stream is compressed.
3618
+ if (tab.undoindex > 0 && tab.graphs[tab.undoindex-1] != null && Equal(compress, tab.graphs[tab.undoindex-1]))
3619
+ {
3620
+ thesame = true;
3621
+ }
3622
+
3623
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3624
+ if (!thesame)
3625
+ {
3626
+ //tab.user[tab.undoindex] = user;
3627
+ boolean increment = tab.graphs[tab.undoindex] == null;
3628
+
3629
+ tab.graphs[tab.undoindex] = compress;
3630
+
3631
+ if (increment)
3632
+ tab.undoindex++;
3633
+ }
3634
+
3635
+ copy.RestoreBigData(hashtable);
3636
+
35333637 //assert(hashtable.isEmpty());
35343638
35353639 for (int i = tab.undoindex; i < tab.graphs.length; i++)
35363640 {
3537
- tab.graphs[i] = null;
3641
+ //tab.user[i] = false;
3642
+ // tab.graphs[i] = null;
35383643 }
35393644
35403645 SetUndoStates();
....@@ -3557,6 +3662,8 @@
35573662 e.printStackTrace();
35583663 }
35593664 }
3665
+
3666
+ return !thesame;
35603667 }
35613668
35623669 void CopyChanged(Object3D obj)
....@@ -3613,7 +3720,7 @@
36133720 redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null);
36143721 }
36153722
3616
- public void Undo()
3723
+ public boolean Undo()
36173724 {
36183725 System.err.println("Undo");
36193726
....@@ -3622,18 +3729,27 @@
36223729 if (tab.undoindex == 0)
36233730 {
36243731 java.awt.Toolkit.getDefaultToolkit().beep();
3625
- return;
3732
+ return false;
36263733 }
36273734
3628
- if (tab.graphs[tab.undoindex] == null)
3735
+ if (tab.graphs[tab.undoindex] == null) // || !tab.user[tab.undoindex])
36293736 {
3630
- Save();
3631
- tab.undoindex -= 1;
3737
+ if (Save(false))
3738
+ tab.undoindex -= 1;
3739
+ else
3740
+ {
3741
+ if (tab.undoindex <= 0)
3742
+ return false;
3743
+ else
3744
+ tab.undoindex -= 1;
3745
+ }
36323746 }
36333747
36343748 tab.undoindex -= 1;
36353749
36363750 CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3751
+
3752
+ return true;
36373753 }
36383754
36393755 public void Redo()
....@@ -3649,6 +3765,9 @@
36493765 tab.undoindex += 1;
36503766
36513767 CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3768
+
3769
+ //if (!tab.user[tab.undoindex])
3770
+ // tab.graphs[tab.undoindex] = null;
36523771 }
36533772
36543773 void ImportGFD()
....@@ -4611,8 +4730,8 @@
46114730
46124731 if (readobj != null)
46134732 {
4614
- if (Globals.SAVEONMAKE)
4615
- Save();
4733
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
4734
+ // Save();
46164735 try
46174736 {
46184737 //readobj.deepCopySelf(copy);
....@@ -4673,7 +4792,7 @@
46734792 }
46744793 }
46754794
4676
- void load() // throws ClassNotFoundException
4795
+ void Open() // throws ClassNotFoundException
46774796 {
46784797 if (Grafreed.standAlone)
46794798 {
....@@ -4958,7 +5077,7 @@
49585077 MenuBar menuBar;
49595078 Menu fileMenu;
49605079 MenuItem newItem;
4961
- MenuItem loadItem;
5080
+ MenuItem openItem;
49625081 MenuItem saveItem;
49635082 MenuItem saveAsItem;
49645083 MenuItem exportAsItem;
....@@ -4981,6 +5100,7 @@
49815100 CheckboxMenuItem toggleSwitchItem;
49825101 CheckboxMenuItem toggleRootItem;
49835102 CheckboxMenuItem animationItem;
5103
+ MenuItem archiveItem;
49845104 CheckboxMenuItem toggleHandleItem;
49855105 CheckboxMenuItem togglePaintItem;
49865106 JSplitPane mainPanel;