Normand Briere
2019-08-01 c99d954f5e2bffa601c599142371cfeb45630f40
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.
....@@ -38,64 +41,78 @@
3841 JFrame frame;
3942
4043 static ObjEditor theFrame;
44
+
45
+ public cGridBag GetSeparator()
46
+ {
47
+ cGridBag separator = new cGridBag();
48
+ separator.add(new JSeparator());
49
+ separator.preferredHeight = 5;
50
+ return separator;
51
+ }
4152
4253 cButton GetButton(String name, boolean border)
4354 {
44
- try
45
- {
46
- ImageIcon icon = GetIcon(name);
47
- return new cButton(icon, border);
48
- }
49
- catch (Exception e)
50
- {
51
- return new cButton(name, border);
52
- }
55
+ ImageIcon icon = GetIcon(name);
56
+ return new cButton(icon, border);
57
+ }
58
+
59
+ cLabel GetLabel(String name, boolean border)
60
+ {
61
+ //ImageIcon icon = GetIcon(name);
62
+ return new cLabel(GetImage(name), border);
5363 }
5464
5565 cToggleButton GetToggleButton(String name, boolean border)
5666 {
57
- try
58
- {
59
- ImageIcon icon = GetIcon(name);
60
- return new cToggleButton(icon, border);
61
- }
62
- catch (Exception e)
63
- {
64
- return new cToggleButton(name, border);
65
- }
67
+ ImageIcon icon = GetIcon(name);
68
+ return new cToggleButton(icon, border);
6669 }
6770
6871 cCheckBox GetCheckBox(String name, boolean border)
6972 {
73
+ ImageIcon icon = GetIcon(name);
74
+ return new cCheckBox(icon, border);
75
+ }
76
+
77
+ ImageIcon GetIcon(String name)
78
+ {
7079 try
7180 {
72
- ImageIcon icon = GetIcon(name);
73
- return new cCheckBox(icon, border);
81
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
82
+
83
+// if (image.getWidth() > 48 && image.getHeight() > 48)
84
+// {
85
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
86
+// Graphics2D g = resized.createGraphics();
87
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
88
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
89
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
90
+// g.dispose();
91
+//
92
+// image = resized;
93
+// }
94
+
95
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
96
+ return icon;
7497 }
7598 catch (Exception e)
7699 {
77
- return new cCheckBox(name, border);
100
+ return null;
78101 }
79102 }
80
-
81
- private ImageIcon GetIcon(String name) throws IOException
103
+
104
+ BufferedImage GetImage(String name)
82105 {
83
- BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
84
-
85
- if (image.getWidth() != 24 && image.getHeight() != 24)
106
+ try
86107 {
87
- BufferedImage resized = new BufferedImage(24, 24, image.getType());
88
- Graphics2D g = resized.createGraphics();
89
- g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
90
- //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
91
- g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
92
- g.dispose();
93
-
94
- image = resized;
108
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
109
+
110
+ return image;
95111 }
96
-
97
- javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
98
- return icon;
112
+ catch (Exception e)
113
+ {
114
+ return null;
115
+ }
99116 }
100117
101118 // SCRIPT
....@@ -207,7 +224,7 @@
207224
208225 objEditor.ctrlPanel.remove(namePanel);
209226
210
- if (!GroupEditor.allparams)
227
+ if (!allparams)
211228 return;
212229
213230 // objEditor.ctrlPanel.remove(liveCB);
....@@ -279,6 +296,12 @@
279296 client = inClient;
280297 copy = client;
281298
299
+ if (copy.versions == null)
300
+ {
301
+ copy.versions = new byte[100][];
302
+ copy.versionindex = -1;
303
+ }
304
+
282305 // "this" is not called: SetupUI2(objEditor);
283306 }
284307
....@@ -292,6 +315,12 @@
292315 client = inClient;
293316 copy = client;
294317
318
+ if (copy.versions == null)
319
+ {
320
+ copy.versions = new byte[100][];
321
+ copy.versionindex = -1;
322
+ }
323
+
295324 SetupUI2(callee.GetEditor());
296325 }
297326
....@@ -306,7 +335,7 @@
306335 //localCopy.parent = null;
307336
308337 frame = new JFrame();
309
- frame.setUndecorated(true);
338
+ frame.setUndecorated(false);
310339 objEditor = this;
311340 this.callee = callee;
312341
....@@ -324,6 +353,12 @@
324353 copy = localCopy;
325354 copy.editWindow = this;
326355
356
+ if (copy.versions == null)
357
+ {
358
+// copy.versions = new byte[100][];
359
+// copy.versionindex = -1;
360
+ }
361
+
327362 SetupMenu();
328363
329364 //SetupName(objEditor); // new
....@@ -337,12 +372,17 @@
337372 return frame.action(event, obj);
338373 }
339374
375
+ // Cannot work without static
376
+ static boolean allparams = true;
377
+
378
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
379
+
340380 void SetupMenu()
341381 {
342382 frame.setMenuBar(menuBar = new MenuBar());
343383 menuBar.add(fileMenu = new Menu("File"));
344384 fileMenu.add(newItem = new MenuItem("New"));
345
- fileMenu.add(loadItem = new MenuItem("Open..."));
385
+ fileMenu.add(openItem = new MenuItem("Open..."));
346386
347387 //oe.menuBar.add(menu = new Menu("Include"));
348388 Menu menu = new Menu("Import");
....@@ -374,7 +414,7 @@
374414 }
375415
376416 newItem.addActionListener(this);
377
- loadItem.addActionListener(this);
417
+ openItem.addActionListener(this);
378418 saveItem.addActionListener(this);
379419 saveAsItem.addActionListener(this);
380420 exportAsItem.addActionListener(this);
....@@ -398,6 +438,11 @@
398438 //
399439 // materialFlushed = true;
400440 // }
441
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
442
+// {
443
+// if (listUI.size() == 0)
444
+// EditSelection(false);
445
+// }
401446
402447 refreshContents(false); // To refresh Info tab
403448 }
....@@ -406,11 +451,12 @@
406451
407452 toolbarPanel = new JPanel();
408453 toolbarPanel.setName("Toolbar");
454
+
409455 treePanel = new cGridBag();
410456 treePanel.setName("Tree");
411457
412458 editPanel = new cGridBag().setVertical(true);
413
- editPanel.setName("Edit");
459
+ //editPanel.setName("Edit");
414460
415461 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
416462
....@@ -418,11 +464,11 @@
418464 editPanel.add(editCommandsPanel);
419465 editPanel.add(ctrlPanel);
420466
421
- toolboxPanel = new cGridBag().setVertical(false);
422
- toolboxPanel.setName("Toolbox");
467
+ toolboxPanel = new cGridBag().setVertical(true);
468
+ //toolboxPanel.setName("Toolbox");
423469
424470 materialPanel = new cGridBag().setVertical(true);
425
- materialPanel.setName("Material");
471
+ //materialPanel.setName("Material");
426472
427473 /*JTextPane*/
428474 infoarea = createTextPane();
....@@ -430,14 +476,15 @@
430476
431477 infoarea.setEditable(true);
432478 SetText();
479
+
433480 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
434481 // infoarea.setOpaque(false);
435482 // //infoarea.setForeground(textcolor);
436483 // TEXTAREA infoarea.setLineWrap(true);
437484 // TEXTAREA infoarea.setWrapStyleWord(true);
438485 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
439
- infoPanel.setPreferredSize(new Dimension(50, 200));
440
- infoPanel.setName("Info");
486
+ infoPanel.setPreferredSize(new Dimension(1, 1));
487
+ //infoPanel.setName("Info");
441488 //infoPanel.setLayout(new BorderLayout());
442489 //infoPanel.add(createTextPane());
443490
....@@ -448,7 +495,14 @@
448495 mainPanel.setDividerSize(9);
449496 mainPanel.setDividerLocation(0.5); //1.0);
450497 mainPanel.setResizeWeight(0.5);
451
-
498
+
499
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
500
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
501
+ divider.setDividerSize(15);
502
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
503
+
504
+ mainPanel.setUI(new BasicSplitPaneUI());
505
+
452506 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
453507 //mainPanel.setLayout(new GridBagLayout());
454508 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
....@@ -679,8 +733,8 @@
679733 }
680734 }
681735
682
-static GraphicsDevice device = GraphicsEnvironment
683
- .getLocalGraphicsEnvironment().getScreenDevices()[0];
736
+//static GraphicsDevice device = GraphicsEnvironment
737
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
684738
685739 Rectangle keeprect;
686740 cRadio radio;
....@@ -701,10 +755,19 @@
701755 void Minimize()
702756 {
703757 frame.setState(Frame.ICONIFIED);
758
+ frame.validate();
704759 }
705760
761
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
762
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
763
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
706764 void Maximize()
707765 {
766
+ if (CameraPane.FULLSCREEN)
767
+ {
768
+ ToggleFullScreen();
769
+ }
770
+
708771 if (maximized)
709772 {
710773 frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
....@@ -712,22 +775,36 @@
712775 else
713776 {
714777 keeprect = frame.getBounds();
715
- Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
716
- Dimension rect2 = frame.getToolkit().getScreenSize();
717
- frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
778
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
779
+// Dimension rect2 = frame.getToolkit().getScreenSize();
780
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
718781 // frame.setState(Frame.MAXIMIZED_BOTH);
782
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
719783 }
720784
721785 maximized ^= true;
786
+
787
+ frame.validate();
722788 }
789
+
790
+ cButton minButton;
791
+ cButton maxButton;
792
+ cButton fullButton;
723793
724794 void ToggleFullScreen()
725795 {
796
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
797
+
726798 cameraView.ToggleFullScreen();
727799
728800 if (!CameraPane.FULLSCREEN)
729801 {
730802 device.setFullScreenWindow(null);
803
+ frame.dispose();
804
+ frame.setUndecorated(false);
805
+ frame.validate();
806
+ frame.setVisible(true);
807
+
731808 //frame.setVisible(false);
732809 // frame.removeNotify();
733810 // frame.setUndecorated(false);
....@@ -737,7 +814,7 @@
737814 // X frame.getContentPane().remove(/*"Center",*/bigThree);
738815 // X framePanel.add(bigThree);
739816 // X frame.getContentPane().add(/*"Center",*/framePanel);
740
- framePanel.setDividerLocation(1);
817
+ framePanel.setDividerLocation(46);
741818
742819 //frame.setVisible(true);
743820 radio.layout = keepButton;
....@@ -752,7 +829,12 @@
752829 // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
753830 // frame.getToolkit().getScreenSize().height);
754831 //frame.setVisible(false);
832
+
833
+ frame.dispose();
834
+ frame.setUndecorated(true);
755835 device.setFullScreenWindow(frame);
836
+ frame.validate();
837
+ frame.setVisible(true);
756838 // frame.removeNotify();
757839 // frame.setUndecorated(true);
758840 // frame.addNotify();
....@@ -765,7 +847,30 @@
765847 radio.layout.doClick();
766848 //frame.setVisible(true);
767849 }
850
+ frame.validate();
768851 }
852
+
853
+ private byte[] CompressCopy()
854
+ {
855
+ boolean temp = CameraPane.SWITCH;
856
+ CameraPane.SWITCH = false;
857
+
858
+ copy.ExtractBigData(versiontable);
859
+ // if (copy == client)
860
+
861
+ byte[] versions[] = copy.versions;
862
+ copy.versions = null;
863
+
864
+ byte[] compress = Compress(copy);
865
+
866
+ copy.versions = versions;
867
+
868
+ copy.RestoreBigData(versiontable);
869
+
870
+ CameraPane.SWITCH = temp;
871
+
872
+ return compress;
873
+ }
769874
770875 private JTextPane createTextPane()
771876 {
....@@ -897,7 +1002,7 @@
8971002 // NumberSlider vDivsField;
8981003 // JCheckBox endcaps;
8991004 JCheckBox liveCB;
900
- JCheckBox selectCB;
1005
+ JCheckBox selectableCB;
9011006 JCheckBox hideCB;
9021007 JCheckBox link2masterCB;
9031008 JCheckBox markCB;
....@@ -1097,38 +1202,42 @@
10971202 namePanel = new cGridBag();
10981203
10991204 nameField = AddText(namePanel, copy.GetName());
1100
- namePanel.add(nameField);
1205
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11011206 oe.ctrlPanel.add(namePanel);
11021207
11031208 oe.ctrlPanel.Return();
11041209
1105
- if (!GroupEditor.allparams)
1210
+ if (!allparams)
11061211 return;
11071212
11081213 setupPanel = new cGridBag().setVertical(false);
11091214
11101215 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
11111216 liveCB.setToolTipText("Animate object");
1112
- selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1113
- selectCB.setToolTipText("Make object selectable");
1217
+ selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1218
+ selectableCB.setToolTipText("Make object selectable");
11141219 // Return();
1220
+
11151221 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
11161222 hideCB.setToolTipText("Hide object");
11171223 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1118
- markCB.setToolTipText("Set the animation target transform");
1224
+ markCB.setToolTipText("As animation target transform");
1225
+
1226
+ ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
11191227
11201228 setupPanel2 = new cGridBag().setVertical(false);
11211229
11221230 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
11231231 rewindCB.setToolTipText("Rewind animation");
11241232
1125
- randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1126
- randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1233
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1234
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11271235
1236
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1237
+ link2masterCB.setToolTipText("Attach to support");
1238
+
11281239 if (Globals.ADVANCED)
11291240 {
1130
- link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1131
- link2masterCB.setToolTipText("Attach to support");
11321241 speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
11331242 speedupCB.setToolTipText("Option motion capture");
11341243 }
....@@ -1402,6 +1511,7 @@
14021511 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
14031512 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
14041513 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1514
+ //XYZPanel.setName("XYZ");
14051515
14061516 /*
14071517 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1439,13 +1549,29 @@
14391549 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
14401550 //tmp.setName("Edit");
14411551 objectPanel.add(materialPanel);
1442
- objectPanel.add(toolboxPanel);
1552
+ objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1553
+ objectPanel.setToolTipTextAt(0, "Material panel");
1554
+
14431555 // JPanel north = new JPanel(new BorderLayout());
14441556 // north.setName("Edit");
14451557 // north.add(ctrlPanel, BorderLayout.NORTH);
14461558 // objectPanel.add(north);
14471559 objectPanel.add(editPanel);
1448
- objectPanel.add(infoPanel);
1560
+ objectPanel.setIconAt(1, GetIcon("icons/write.png"));
1561
+ objectPanel.setToolTipTextAt(1, "Edit panel");
1562
+
1563
+ //if (Globals.ADVANCED)
1564
+ objectPanel.add(infoPanel);
1565
+ objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1566
+ objectPanel.setToolTipTextAt(2, "Info panel");
1567
+
1568
+ objectPanel.add(XYZPanel);
1569
+ objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
1570
+ objectPanel.setToolTipTextAt(3, "XYZ/RGB panel");
1571
+
1572
+ objectPanel.add(toolboxPanel);
1573
+ objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
1574
+ objectPanel.setToolTipTextAt(4, "Objects/backgrounds panel");
14491575
14501576 /*
14511577 aConstraints.gridx = 0;
....@@ -1454,7 +1580,7 @@
14541580 aConstraints.gridy += 1;
14551581 aConstraints.gridwidth = 1;
14561582 mainPanel.add(objectPanel, aConstraints);
1457
- */
1583
+ */
14581584
14591585 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
14601586 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1466,7 +1592,7 @@
14661592 scrollpane.addMouseWheelListener(this); // Default not fast enough
14671593
14681594 /*JTabbedPane*/ scenePanel = new cGridBag();
1469
- scenePanel.preferredWidth = 6;
1595
+ scenePanel.preferredWidth = 5;
14701596
14711597 JTabbedPane tabbedPane = new JTabbedPane();
14721598 tabbedPane.add(scrollpane);
....@@ -1544,7 +1670,7 @@
15441670 bigThree = new cGridBag();
15451671 bigThree.addComponent(scenePanel);
15461672 bigThree.addComponent(centralPanel);
1547
- bigThree.addComponent(XYZPanel);
1673
+ //bigThree.addComponent(XYZPanel);
15481674
15491675 // // SIDE EFFECT!!!
15501676 // aConstraints.gridx = 0;
....@@ -1553,9 +1679,9 @@
15531679 // aConstraints.gridheight = 1;
15541680
15551681 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1556
- framePanel.setContinuousLayout(true);
1557
- framePanel.setOneTouchExpandable(true);
1558
- framePanel.setDividerLocation(0.8);
1682
+ framePanel.setContinuousLayout(false);
1683
+ framePanel.setOneTouchExpandable(false);
1684
+ //.setDividerLocation(0.8);
15591685 //framePanel.setDividerSize(15);
15601686 //framePanel.setResizeWeight(0.15);
15611687 framePanel.setName("Frame");
....@@ -1574,17 +1700,17 @@
15741700
15751701 frame.setSize(1280, 860);
15761702
1577
- frame.validate();
1578
- frame.setVisible(true);
1579
-
15801703 cameraView.requestFocusInWindow();
15811704
15821705 gridPanel.setDividerLocation(1.0);
1706
+
1707
+ frame.validate();
1708
+
1709
+ frame.setVisible(true);
15831710
15841711 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
15851712 frame.addWindowListener(new WindowAdapter()
15861713 {
1587
-
15881714 public void windowClosing(WindowEvent e)
15891715 {
15901716 Close();
....@@ -1646,45 +1772,48 @@
16461772 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16471773
16481774 cGridBag colorSection = new cGridBag().setVertical(true);
1775
+
1776
+ cGridBag huepanel = new cGridBag();
1777
+ cGridBag huelabel = new cGridBag();
1778
+ huelabel.add(GetLabel("icons/hue.png", false));
1779
+ huelabel.preferredWidth = 20;
1780
+ huepanel.add(new cGridBag()); // Label
1781
+ huepanel.add(huelabel); // Field/slider
1782
+
1783
+ huepanel.preferredHeight = 7;
1784
+
1785
+ colorSection.add(huepanel);
16491786
16501787 cGridBag color = new cGridBag();
1651
- color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1652
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1653
- color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1788
+
1789
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1790
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1791
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
1792
+
16541793 //colorField.preferredWidth = 200;
16551794 colorSection.add(color);
16561795
16571796 cGridBag modulation = new cGridBag();
16581797 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
16591798 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1660
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1799
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
16611800 colorSection.add(modulation);
16621801
1802
+ cGridBag opacity = new cGridBag();
1803
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1804
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1805
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
1806
+ colorSection.add(opacity);
1807
+
1808
+ colorSection.add(GetSeparator());
1809
+
16631810 cGridBag texture = new cGridBag();
16641811 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
16651812 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16661813 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16671814 colorSection.add(texture);
16681815
1669
- cGridBag anisoU = new cGridBag();
1670
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1671
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1672
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1673
- colorSection.add(anisoU);
1674
-
1675
- cGridBag anisoV = new cGridBag();
1676
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1677
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1678
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1679
- colorSection.add(anisoV);
1680
-
1681
- cGridBag shadowbias = new cGridBag();
1682
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1683
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1684
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1685
- colorSection.add(shadowbias);
1686
-
1687
- panel.add(new JSeparator());
1816
+ panel.add(GetSeparator());
16881817
16891818 panel.add(colorSection);
16901819
....@@ -1734,7 +1863,13 @@
17341863 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
17351864 diffuseSection.add(fakedepth);
17361865
1737
- panel.add(new JSeparator());
1866
+ cGridBag shadowbias = new cGridBag();
1867
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1868
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1869
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1870
+ diffuseSection.add(shadowbias);
1871
+
1872
+ panel.add(GetSeparator());
17381873
17391874 panel.add(diffuseSection);
17401875
....@@ -1784,42 +1919,48 @@
17841919 // aConstraints.gridy += 1;
17851920 // aConstraints.gridwidth = 1;
17861921
1922
+ cGridBag anisoU = new cGridBag();
1923
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1924
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1925
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1926
+ specularSection.add(anisoU);
17871927
1788
- panel.add(new JSeparator());
1928
+ cGridBag anisoV = new cGridBag();
1929
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1930
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1931
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1932
+ specularSection.add(anisoV);
1933
+
1934
+
1935
+ panel.add(GetSeparator());
17891936
17901937 panel.add(specularSection);
17911938
17921939 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17931940
1794
- cGridBag globalSection = new cGridBag().setVertical(true);
1941
+ //cGridBag globalSection = new cGridBag().setVertical(true);
17951942
17961943 cGridBag camera = new cGridBag();
17971944 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
17981945 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17991946 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1800
- globalSection.add(camera);
1947
+ colorSection.add(camera);
18011948
18021949 cGridBag ambient = new cGridBag();
18031950 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
18041951 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18051952 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1806
- globalSection.add(ambient);
1953
+ colorSection.add(ambient);
18071954
18081955 cGridBag backlit = new cGridBag();
18091956 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
18101957 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18111958 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1812
- globalSection.add(backlit);
1959
+ colorSection.add(backlit);
18131960
1814
- cGridBag opacity = new cGridBag();
1815
- opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1816
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1817
- opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1818
- globalSection.add(opacity);
1819
-
1820
- panel.add(new JSeparator());
1961
+ //panel.add(new JSeparator());
18211962
1822
- panel.add(globalSection);
1963
+ //panel.add(globalSection);
18231964
18241965 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18251966
....@@ -1861,7 +2002,7 @@
18612002 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
18622003 textureSection.add(opacityPower);
18632004
1864
- panel.add(new JSeparator());
2005
+ panel.add(GetSeparator());
18652006
18662007 panel.add(textureSection);
18672008
....@@ -1926,8 +2067,9 @@
19262067 // 3D models
19272068 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
19282069 {
1929
- lastConverter = new com.jmex.model.converters.MaxToJme();
1930
- LoadFile(filename, lastConverter);
2070
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2071
+ //LoadFile(filename, lastConverter);
2072
+ LoadObjFile(filename); // New 3ds loader
19312073 continue;
19322074 }
19332075 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -2653,6 +2795,7 @@
26532795 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
26542796 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
26552797 }
2798
+
26562799 //cJME.count++;
26572800 //cJME.count %= 12;
26582801 if (gc)
....@@ -2836,6 +2979,7 @@
28362979 }
28372980 }
28382981 }
2982
+
28392983 cFileSystemPane FSPane;
28402984
28412985 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2889,6 +3033,7 @@
28893033 }
28903034 }
28913035 }
3036
+
28923037 freezematerial = false;
28933038 }
28943039
....@@ -3007,12 +3152,17 @@
30073152 // }
30083153
30093154 /**/
3010
- if (deselect)
3155
+ if (deselect || child == null)
30113156 {
30123157 //group.deselectAll();
30133158 //freeze = true;
30143159 GetTree().clearSelection();
30153160 //freeze = false;
3161
+
3162
+ if (child == null)
3163
+ {
3164
+ return;
3165
+ }
30163166 }
30173167
30183168 //group.addSelectee(child);
....@@ -3151,7 +3301,7 @@
31513301 {
31523302 copy.live ^= true;
31533303 return;
3154
- } else if (event.getSource() == selectCB)
3304
+ } else if (event.getSource() == selectableCB)
31553305 {
31563306 copy.dontselect ^= true;
31573307 return;
....@@ -3336,9 +3486,9 @@
33363486 {
33373487 Close();
33383488 //return true;
3339
- } else if (source == loadItem)
3489
+ } else if (source == openItem)
33403490 {
3341
- load();
3491
+ Open();
33423492 //return true;
33433493 } else if (source == newItem)
33443494 {
....@@ -3363,6 +3513,10 @@
33633513 {
33643514 generatePOV();
33653515 //return true;
3516
+ } else if (event.getSource() == archiveItem)
3517
+ {
3518
+ cTools.Archive(frame);
3519
+ return;
33663520 } else if (source == zBufferItem)
33673521 {
33683522 try
....@@ -3414,8 +3568,8 @@
34143568 try
34153569 {
34163570 ByteArrayOutputStream baos = new ByteArrayOutputStream();
3417
- java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3418
- ObjectOutputStream out = new ObjectOutputStream(zstream);
3571
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3572
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
34193573
34203574 Object3D parent = o.parent;
34213575 o.parent = null;
....@@ -3426,10 +3580,14 @@
34263580
34273581 out.flush();
34283582
3429
- zstream.close();
3583
+ baos //zstream
3584
+ .close();
34303585 out.close();
34313586
3432
- return baos.toByteArray();
3587
+ byte[] bytes = baos.toByteArray();
3588
+
3589
+ System.out.println("save #bytes = " + bytes.length);
3590
+ return bytes;
34333591 } catch (Exception e)
34343592 {
34353593 System.err.println(e);
....@@ -3439,13 +3597,16 @@
34393597
34403598 static public Object Uncompress(byte[] bytes)
34413599 {
3442
- System.out.println("#bytes = " + bytes.length);
3600
+ System.out.println("restore #bytes = " + bytes.length);
34433601 try
34443602 {
34453603 ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3446
- java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3447
- ObjectInputStream in = new ObjectInputStream(istream);
3604
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3605
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
34483606 Object obj = in.readObject();
3607
+
3608
+ bais //istream
3609
+ .close();
34493610 in.close();
34503611
34513612 return obj;
....@@ -3500,39 +3661,77 @@
35003661 return null;
35013662 }
35023663
3503
- java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
35043664
35053665 public void Save()
3666
+ {
3667
+ //Save(true);
3668
+ Replace();
3669
+ }
3670
+
3671
+ private boolean Equal(byte[] compress, byte[] name)
3672
+ {
3673
+ if (compress.length != name.length)
3674
+ {
3675
+ return false;
3676
+ }
3677
+
3678
+ for (int i=compress.length; --i>=0;)
3679
+ {
3680
+ if (compress[i] != name[i])
3681
+ return false;
3682
+ }
3683
+
3684
+ return true;
3685
+ }
3686
+
3687
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
3688
+
3689
+ public boolean Save(boolean user)
35063690 {
35073691 System.err.println("Save");
35083692
35093693 cRadio tab = GetCurrentTab();
35103694
3511
- boolean temp = CameraPane.SWITCH;
3512
- CameraPane.SWITCH = false;
3695
+ byte[] compress = CompressCopy(); // Saved version. No need for "Replace".
35133696
3514
- copy.ExtractBigData(hashtable);
3697
+ boolean thesame = false;
3698
+
3699
+ // Quick heuristic using length. Works only when stream is compressed.
3700
+ if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3701
+ {
3702
+ thesame = true;
3703
+ }
35153704
35163705 //EditorFrame.m_MainFrame.requestFocusInWindow();
3517
- tab.graphs[tab.undoindex++] = Compress(copy);
3518
-
3519
- copy.RestoreBigData(hashtable);
3520
-
3521
- CameraPane.SWITCH = temp;
3522
-
3523
- //assert(hashtable.isEmpty());
3524
-
3525
- for (int i = tab.undoindex; i < tab.graphs.length; i++)
3706
+ if (!thesame)
35263707 {
3527
- tab.graphs[i] = null;
3708
+ //tab.user[tab.versionindex] = user;
3709
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
3710
+
3711
+ copy.versions[++copy.versionindex] = compress;
3712
+
3713
+ // if (increment)
3714
+ // tab.versionindex++;
35283715 }
35293716
3717
+ //copy.RestoreBigData(versiontable);
3718
+
3719
+ //assert(hashtable.isEmpty());
3720
+
3721
+ for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3722
+ {
3723
+ //tab.user[i] = false;
3724
+ copy.versions[i] = null;
3725
+ }
3726
+
3727
+ SetUndoStates();
3728
+
35303729 // test save
35313730 if (false)
35323731 {
35333732 try
35343733 {
3535
- FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
3734
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
35363735 ObjectOutputStream p = new ObjectOutputStream(ostream);
35373736
35383737 p.writeObject(copy);
....@@ -3545,23 +3744,30 @@
35453744 e.printStackTrace();
35463745 }
35473746 }
3747
+
3748
+ return !thesame;
35483749 }
35493750
35503751 void CopyChanged(Object3D obj)
35513752 {
3753
+ SetUndoStates();
3754
+
35523755 boolean temp = CameraPane.SWITCH;
35533756 CameraPane.SWITCH = false;
35543757
3555
- copy.ExtractBigData(hashtable);
3758
+ copy.ExtractBigData(versiontable);
35563759
35573760 copy.clear();
35583761
3762
+ copy.skyboxname = obj.skyboxname;
3763
+ copy.skyboxext = obj.skyboxext;
3764
+
35593765 for (int i=0; i<obj.Size(); i++)
35603766 {
35613767 copy.add(obj.get(i));
35623768 }
35633769
3564
- copy.RestoreBigData(hashtable);
3770
+ copy.RestoreBigData(versiontable);
35653771
35663772 CameraPane.SWITCH = temp;
35673773
....@@ -3588,42 +3794,130 @@
35883794 refreshContents();
35893795 }
35903796
3591
- public void Undo()
3797
+ cButton undoButton;
3798
+ cButton restoreButton;
3799
+ cButton replaceButton;
3800
+ cButton redoButton;
3801
+
3802
+ boolean muteSlider;
3803
+
3804
+ int VersionCount()
35923805 {
3806
+ int count = 0;
3807
+
3808
+ for (int i = copy.versions.length; --i >= 0;)
3809
+ {
3810
+ if (copy.versions[i] != null)
3811
+ count++;
3812
+ }
3813
+
3814
+ return count;
3815
+ }
3816
+
3817
+ void SetUndoStates()
3818
+ {
3819
+ cRadio tab = GetCurrentTab();
3820
+
3821
+ restoreButton.setEnabled(copy.versionindex != -1);
3822
+ replaceButton.setEnabled(copy.versionindex != -1);
3823
+
3824
+ undoButton.setEnabled(copy.versionindex > 0);
3825
+ redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
3826
+
3827
+ muteSlider = true;
3828
+ versionSlider.setMaximum(VersionCount() - 1);
3829
+ versionSlider.setInteger(copy.versionindex);
3830
+ muteSlider = false;
3831
+ }
3832
+
3833
+ public boolean Undo()
3834
+ {
3835
+ // Option?
3836
+ Replace();
3837
+
35933838 System.err.println("Undo");
35943839
35953840 cRadio tab = GetCurrentTab();
35963841
3597
- if (tab.undoindex == 0)
3842
+ if (copy.versionindex == 0)
35983843 {
35993844 java.awt.Toolkit.getDefaultToolkit().beep();
3600
- return;
3845
+ return false;
36013846 }
36023847
3603
- if (tab.graphs[tab.undoindex] == null)
3848
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
3849
+// {
3850
+// if (Save(false))
3851
+// tab.versionindex -= 1;
3852
+// else
3853
+// {
3854
+// if (tab.versionindex <= 0)
3855
+// return false;
3856
+// else
3857
+// tab.versionindex -= 1;
3858
+// }
3859
+// }
3860
+
3861
+ copy.versionindex -= 1;
3862
+
3863
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3864
+
3865
+ return true;
3866
+ }
3867
+
3868
+ public boolean Restore()
3869
+ {
3870
+ System.err.println("Restore");
3871
+
3872
+ cRadio tab = GetCurrentTab();
3873
+
3874
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
36043875 {
3605
- Save();
3606
- tab.undoindex -= 1;
3876
+ java.awt.Toolkit.getDefaultToolkit().beep();
3877
+ return false;
36073878 }
36083879
3609
- tab.undoindex -= 1;
3880
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3881
+
3882
+ return true;
3883
+ }
36103884
3611
- CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3885
+ public boolean Replace()
3886
+ {
3887
+ System.err.println("Replace");
3888
+
3889
+ cRadio tab = GetCurrentTab();
3890
+
3891
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3892
+ {
3893
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
3894
+ return false;
3895
+ }
3896
+
3897
+ copy.versions[copy.versionindex] = CompressCopy();
3898
+
3899
+ return true;
36123900 }
36133901
36143902 public void Redo()
36153903 {
3904
+ // Option?
3905
+ Replace();
3906
+
36163907 cRadio tab = GetCurrentTab();
36173908
3618
- if (tab.graphs[tab.undoindex + 1] == null)
3909
+ if (copy.versions[copy.versionindex + 1] == null)
36193910 {
36203911 java.awt.Toolkit.getDefaultToolkit().beep();
36213912 return;
36223913 }
36233914
3624
- tab.undoindex += 1;
3915
+ copy.versionindex += 1;
36253916
3626
- CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
3917
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3918
+
3919
+ //if (!tab.user[tab.versionindex])
3920
+ // tab.graphs[tab.versionindex] = null;
36273921 }
36283922
36293923 void ImportGFD()
....@@ -3919,9 +4213,25 @@
39194213 //copy.Touch();
39204214 }
39214215
4216
+ cNumberSlider versionSlider;
4217
+
39224218 public void stateChanged(ChangeEvent e)
39234219 {
39244220 // assert(false);
4221
+ if (e.getSource() == versionSlider)
4222
+ {
4223
+ if (muteSlider)
4224
+ return;
4225
+
4226
+ int version = versionSlider.getInteger();
4227
+
4228
+ if (copy.versions[version] != null)
4229
+ {
4230
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version]));
4231
+ }
4232
+
4233
+ return;
4234
+ }
39254235
39264236 if (freezematerial)
39274237 {
....@@ -4270,7 +4580,7 @@
42704580
42714581 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
42724582 {
4273
- if (Globals.SAVEONMAKE) // && resetmodel)
4583
+ if (Globals.REPLACEONMAKE) // && resetmodel)
42744584 Save();
42754585 //Tween.set(thing, 0).target(1).start(tweenManager);
42764586 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
....@@ -4512,7 +4822,9 @@
45124822 readobj.ResetDisplayList();
45134823 } catch (Exception e)
45144824 {
4515
- //e.printStackTrace();
4825
+ if (!e.toString().contains("GZIP"))
4826
+ e.printStackTrace();
4827
+
45164828 try
45174829 {
45184830 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
....@@ -4586,12 +4898,14 @@
45864898
45874899 if (readobj != null)
45884900 {
4589
- if (Globals.SAVEONMAKE)
4590
- Save();
4901
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
4902
+ // Save();
45914903 try
45924904 {
45934905 //readobj.deepCopySelf(copy);
45944906 copy.clear(); // june 2014
4907
+ copy.skyboxname = readobj.skyboxname;
4908
+ copy.skyboxext = readobj.skyboxext;
45954909 for (int i = 0; i < readobj.size(); i++)
45964910 {
45974911 Object3D child = readobj.get(i); // reserve(i);
....@@ -4632,6 +4946,7 @@
46324946 }
46334947 } catch (ClassCastException e)
46344948 {
4949
+ e.printStackTrace();
46354950 assert (false);
46364951 Composite c = (Composite) copy;
46374952 c.children.clear();
....@@ -4642,13 +4957,24 @@
46424957 c.addChild(csg);
46434958 }
46444959
4960
+ copy.versions = readobj.versions;
4961
+ copy.versionindex = readobj.versionindex;
4962
+
4963
+ if (copy.versions == null)
4964
+ {
4965
+ copy.versions = new byte[100][];
4966
+ copy.versionindex = -1;
4967
+ }
4968
+
4969
+ //? SetUndoStates();
4970
+
46454971 ResetModel();
46464972 copy.HardTouch(); // recompile?
46474973 refreshContents();
46484974 }
46494975 }
46504976
4651
- void load() // throws ClassNotFoundException
4977
+ void Open() // throws ClassNotFoundException
46524978 {
46534979 if (Grafreed.standAlone)
46544980 {
....@@ -4751,6 +5077,7 @@
47515077 //ps.print(buffer.toString());
47525078 } catch (IOException e)
47535079 {
5080
+ e.printStackTrace();
47545081 }
47555082 }
47565083
....@@ -4765,6 +5092,8 @@
47655092 String filename = browser.getFile();
47665093 if (filename != null && filename.length() > 0)
47675094 {
5095
+ if (!filename.endsWith(".gfd"))
5096
+ filename += ".gfd";
47685097 lastname = browser.getDirectory() + filename;
47695098 save();
47705099 }
....@@ -4931,7 +5260,7 @@
49315260 MenuBar menuBar;
49325261 Menu fileMenu;
49335262 MenuItem newItem;
4934
- MenuItem loadItem;
5263
+ MenuItem openItem;
49355264 MenuItem saveItem;
49365265 MenuItem saveAsItem;
49375266 MenuItem exportAsItem;
....@@ -4954,6 +5283,7 @@
49545283 CheckboxMenuItem toggleSwitchItem;
49555284 CheckboxMenuItem toggleRootItem;
49565285 CheckboxMenuItem animationItem;
5286
+ MenuItem archiveItem;
49575287 CheckboxMenuItem toggleHandleItem;
49585288 CheckboxMenuItem togglePaintItem;
49595289 JSplitPane mainPanel;