Normand Briere
2019-07-01 6600d22461ccc1cb602f238a9ffa83cf07dd830e
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.
....@@ -49,6 +52,19 @@
4952 catch (Exception e)
5053 {
5154 return new cButton(name, border);
55
+ }
56
+ }
57
+
58
+ cToggleButton GetToggleButton(String name, boolean border)
59
+ {
60
+ try
61
+ {
62
+ ImageIcon icon = GetIcon(name);
63
+ return new cToggleButton(icon, border);
64
+ }
65
+ catch (Exception e)
66
+ {
67
+ return new cToggleButton(name, border);
5268 }
5369 }
5470
....@@ -194,7 +210,7 @@
194210
195211 objEditor.ctrlPanel.remove(namePanel);
196212
197
- if (!GroupEditor.allparams)
213
+ if (!allparams)
198214 return;
199215
200216 // objEditor.ctrlPanel.remove(liveCB);
....@@ -293,7 +309,7 @@
293309 //localCopy.parent = null;
294310
295311 frame = new JFrame();
296
- frame.setUndecorated(true);
312
+ frame.setUndecorated(false);
297313 objEditor = this;
298314 this.callee = callee;
299315
....@@ -324,12 +340,17 @@
324340 return frame.action(event, obj);
325341 }
326342
343
+ // Cannot work without static
344
+ static boolean allparams = true;
345
+
346
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
347
+
327348 void SetupMenu()
328349 {
329350 frame.setMenuBar(menuBar = new MenuBar());
330351 menuBar.add(fileMenu = new Menu("File"));
331352 fileMenu.add(newItem = new MenuItem("New"));
332
- fileMenu.add(loadItem = new MenuItem("Open..."));
353
+ fileMenu.add(openItem = new MenuItem("Open..."));
333354
334355 //oe.menuBar.add(menu = new Menu("Include"));
335356 Menu menu = new Menu("Import");
....@@ -361,7 +382,7 @@
361382 }
362383
363384 newItem.addActionListener(this);
364
- loadItem.addActionListener(this);
385
+ openItem.addActionListener(this);
365386 saveItem.addActionListener(this);
366387 saveAsItem.addActionListener(this);
367388 exportAsItem.addActionListener(this);
....@@ -370,6 +391,32 @@
370391 closeItem.addActionListener(this);
371392
372393 objectPanel = new JTabbedPane();
394
+
395
+ ChangeListener changeListener = new ChangeListener()
396
+ {
397
+ public void stateChanged(ChangeEvent changeEvent)
398
+ {
399
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
400
+// {
401
+// if (latestObject != null)
402
+// {
403
+// refreshContents(true);
404
+// SetMaterial(latestObject);
405
+// }
406
+//
407
+// materialFlushed = true;
408
+// }
409
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
410
+// {
411
+// if (listUI.size() == 0)
412
+// EditSelection(false);
413
+// }
414
+
415
+ refreshContents(false); // To refresh Info tab
416
+ }
417
+ };
418
+ objectPanel.addChangeListener(changeListener);
419
+
373420 toolbarPanel = new JPanel();
374421 toolbarPanel.setName("Toolbar");
375422 treePanel = new cGridBag();
....@@ -384,9 +431,12 @@
384431 editPanel.add(editCommandsPanel);
385432 editPanel.add(ctrlPanel);
386433
387
- materialPanel = new cGridBag().setVertical(true);
434
+ toolboxPanel = new cGridBag().setVertical(false);
435
+ toolboxPanel.setName("Toolbox");
388436
437
+ materialPanel = new cGridBag().setVertical(true);
389438 materialPanel.setName("Material");
439
+
390440 /*JTextPane*/
391441 infoarea = createTextPane();
392442 doc = infoarea.getStyledDocument();
....@@ -399,7 +449,7 @@
399449 // TEXTAREA infoarea.setLineWrap(true);
400450 // TEXTAREA infoarea.setWrapStyleWord(true);
401451 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
402
- infoPanel.setPreferredSize(new Dimension(50, 200));
452
+ infoPanel.setPreferredSize(new Dimension(1, 1));
403453 infoPanel.setName("Info");
404454 //infoPanel.setLayout(new BorderLayout());
405455 //infoPanel.add(createTextPane());
....@@ -411,7 +461,14 @@
411461 mainPanel.setDividerSize(9);
412462 mainPanel.setDividerLocation(0.5); //1.0);
413463 mainPanel.setResizeWeight(0.5);
414
-
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
+
415472 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
416473 //mainPanel.setLayout(new GridBagLayout());
417474 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
....@@ -642,8 +699,8 @@
642699 }
643700 }
644701
645
-static GraphicsDevice device = GraphicsEnvironment
646
- .getLocalGraphicsEnvironment().getScreenDevices()[0];
702
+//static GraphicsDevice device = GraphicsEnvironment
703
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
647704
648705 Rectangle keeprect;
649706 cRadio radio;
....@@ -659,13 +716,24 @@
659716
660717 boolean maximized;
661718
719
+ cButton fullscreenLayout;
720
+
662721 void Minimize()
663722 {
664723 frame.setState(Frame.ICONIFIED);
724
+ frame.validate();
665725 }
666726
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={}
667730 void Maximize()
668731 {
732
+ if (CameraPane.FULLSCREEN)
733
+ {
734
+ ToggleFullScreen();
735
+ }
736
+
669737 if (maximized)
670738 {
671739 frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
....@@ -673,20 +741,36 @@
673741 else
674742 {
675743 keeprect = frame.getBounds();
676
- Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
677
- Dimension rect2 = frame.getToolkit().getScreenSize();
678
- 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);
679747 // frame.setState(Frame.MAXIMIZED_BOTH);
748
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
680749 }
681750
682751 maximized ^= true;
752
+
753
+ frame.validate();
683754 }
755
+
756
+ cButton minButton;
757
+ cButton maxButton;
758
+ cButton fullButton;
684759
685760 void ToggleFullScreen()
686761 {
687
- if (CameraPane.FULLSCREEN)
762
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
763
+
764
+ cameraView.ToggleFullScreen();
765
+
766
+ if (!CameraPane.FULLSCREEN)
688767 {
689768 device.setFullScreenWindow(null);
769
+ frame.dispose();
770
+ frame.setUndecorated(false);
771
+ frame.validate();
772
+ frame.setVisible(true);
773
+
690774 //frame.setVisible(false);
691775 // frame.removeNotify();
692776 // frame.setUndecorated(false);
....@@ -696,7 +780,7 @@
696780 // X frame.getContentPane().remove(/*"Center",*/bigThree);
697781 // X framePanel.add(bigThree);
698782 // X frame.getContentPane().add(/*"Center",*/framePanel);
699
- framePanel.setDividerLocation(1);
783
+ framePanel.setDividerLocation(46);
700784
701785 //frame.setVisible(true);
702786 radio.layout = keepButton;
....@@ -711,7 +795,12 @@
711795 // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
712796 // frame.getToolkit().getScreenSize().height);
713797 //frame.setVisible(false);
798
+
799
+ frame.dispose();
800
+ frame.setUndecorated(true);
714801 device.setFullScreenWindow(frame);
802
+ frame.validate();
803
+ frame.setVisible(true);
715804 // frame.removeNotify();
716805 // frame.setUndecorated(true);
717806 // frame.addNotify();
....@@ -720,12 +809,11 @@
720809 // X frame.getContentPane().add(/*"Center",*/bigThree);
721810 framePanel.setDividerLocation(0);
722811
723
- radio.layout = twoButton;
812
+ radio.layout = fullscreenLayout;
724813 radio.layout.doClick();
725814 //frame.setVisible(true);
726815 }
727
-
728
- cameraView.ToggleFullScreen();
816
+ frame.validate();
729817 }
730818
731819 private JTextPane createTextPane()
....@@ -866,7 +954,12 @@
866954 JCheckBox speedupCB;
867955 JCheckBox rewindCB;
868956 JCheckBox flipVCB;
957
+
958
+ cCheckBox toggleTextureCB;
959
+ cCheckBox toggleSwitchCB;
960
+
869961 JComboBox texresMenu;
962
+
870963 JButton resetButton;
871964 JButton stepButton;
872965 JButton stepAllButton;
....@@ -1053,12 +1146,12 @@
10531146 namePanel = new cGridBag();
10541147
10551148 nameField = AddText(namePanel, copy.GetName());
1056
- namePanel.add(nameField);
1149
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
10571150 oe.ctrlPanel.add(namePanel);
10581151
10591152 oe.ctrlPanel.Return();
10601153
1061
- if (!GroupEditor.allparams)
1154
+ if (!allparams)
10621155 return;
10631156
10641157 setupPanel = new cGridBag().setVertical(false);
....@@ -1071,15 +1164,15 @@
10711164 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
10721165 hideCB.setToolTipText("Hide object");
10731166 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1074
- markCB.setToolTipText("Set the animation target transform");
1167
+ markCB.setToolTipText("As animation target transform");
10751168
10761169 setupPanel2 = new cGridBag().setVertical(false);
10771170
10781171 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
10791172 rewindCB.setToolTipText("Rewind animation");
10801173
1081
- randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1082
- 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)");
10831176
10841177 if (Globals.ADVANCED)
10851178 {
....@@ -1400,7 +1493,11 @@
14001493 // north.add(ctrlPanel, BorderLayout.NORTH);
14011494 // objectPanel.add(north);
14021495 objectPanel.add(editPanel);
1403
- objectPanel.add(infoPanel);
1496
+
1497
+ //if (Globals.ADVANCED)
1498
+ objectPanel.add(infoPanel);
1499
+
1500
+ objectPanel.add(toolboxPanel);
14041501
14051502 /*
14061503 aConstraints.gridx = 0;
....@@ -1409,7 +1506,7 @@
14091506 aConstraints.gridy += 1;
14101507 aConstraints.gridwidth = 1;
14111508 mainPanel.add(objectPanel, aConstraints);
1412
- */
1509
+ */
14131510
14141511 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
14151512 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1426,9 +1523,7 @@
14261523 JTabbedPane tabbedPane = new JTabbedPane();
14271524 tabbedPane.add(scrollpane);
14281525
1429
- tabbedPane.add(FSPane = new cFileSystemPane(this));
1430
-
1431
- optionsPanel = new cGridBag().setVertical(true);
1526
+ optionsPanel = new cGridBag().setVertical(false);
14321527
14331528 optionsPanel.setName("Options");
14341529
....@@ -1436,6 +1531,8 @@
14361531
14371532 tabbedPane.add(optionsPanel);
14381533
1534
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
1535
+
14391536 scenePanel.add(tabbedPane);
14401537
14411538 /*
....@@ -1508,9 +1605,9 @@
15081605 // aConstraints.gridheight = 1;
15091606
15101607 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1511
- framePanel.setContinuousLayout(true);
1512
- framePanel.setOneTouchExpandable(true);
1513
- framePanel.setDividerLocation(0.8);
1608
+ framePanel.setContinuousLayout(false);
1609
+ framePanel.setOneTouchExpandable(false);
1610
+ //.setDividerLocation(0.8);
15141611 //framePanel.setDividerSize(15);
15151612 //framePanel.setResizeWeight(0.15);
15161613 framePanel.setName("Frame");
....@@ -1528,11 +1625,14 @@
15281625 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
15291626
15301627 frame.setSize(1280, 860);
1531
- frame.setVisible(true);
1532
-
1628
+
15331629 cameraView.requestFocusInWindow();
15341630
15351631 gridPanel.setDividerLocation(1.0);
1632
+
1633
+ frame.validate();
1634
+
1635
+ frame.setVisible(true);
15361636
15371637 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
15381638 frame.addWindowListener(new WindowAdapter()
....@@ -1619,24 +1719,6 @@
16191719 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16201720 colorSection.add(texture);
16211721
1622
- cGridBag anisoU = new cGridBag();
1623
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1624
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1625
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1626
- colorSection.add(anisoU);
1627
-
1628
- cGridBag anisoV = new cGridBag();
1629
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1630
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1631
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1632
- colorSection.add(anisoV);
1633
-
1634
- cGridBag shadowbias = new cGridBag();
1635
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1636
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1637
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1638
- colorSection.add(shadowbias);
1639
-
16401722 panel.add(new JSeparator());
16411723
16421724 panel.add(colorSection);
....@@ -1686,6 +1768,12 @@
16861768 fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16871769 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
16881770 diffuseSection.add(fakedepth);
1771
+
1772
+ cGridBag shadowbias = new cGridBag();
1773
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1774
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1775
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1776
+ diffuseSection.add(shadowbias);
16891777
16901778 panel.add(new JSeparator());
16911779
....@@ -1737,6 +1825,18 @@
17371825 // aConstraints.gridy += 1;
17381826 // aConstraints.gridwidth = 1;
17391827
1828
+ cGridBag anisoU = new cGridBag();
1829
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1830
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1831
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1832
+ specularSection.add(anisoU);
1833
+
1834
+ cGridBag anisoV = new cGridBag();
1835
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1836
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1837
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1838
+ specularSection.add(anisoV);
1839
+
17401840
17411841 panel.add(new JSeparator());
17421842
....@@ -1744,35 +1844,35 @@
17441844
17451845 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17461846
1747
- cGridBag globalSection = new cGridBag().setVertical(true);
1847
+ //cGridBag globalSection = new cGridBag().setVertical(true);
17481848
17491849 cGridBag camera = new cGridBag();
17501850 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
17511851 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17521852 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1753
- globalSection.add(camera);
1853
+ colorSection.add(camera);
17541854
17551855 cGridBag ambient = new cGridBag();
17561856 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
17571857 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17581858 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1759
- globalSection.add(ambient);
1859
+ colorSection.add(ambient);
17601860
17611861 cGridBag backlit = new cGridBag();
17621862 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
17631863 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17641864 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1765
- globalSection.add(backlit);
1865
+ colorSection.add(backlit);
17661866
17671867 cGridBag opacity = new cGridBag();
17681868 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
17691869 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17701870 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1771
- globalSection.add(opacity);
1871
+ colorSection.add(opacity);
17721872
1773
- panel.add(new JSeparator());
1873
+ //panel.add(new JSeparator());
17741874
1775
- panel.add(globalSection);
1875
+ //panel.add(globalSection);
17761876
17771877 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17781878
....@@ -2847,6 +2947,8 @@
28472947
28482948 void SetMaterial(Object3D object)
28492949 {
2950
+ latestObject = object;
2951
+
28502952 cMaterial mat = object.material;
28512953
28522954 if (mat == null)
....@@ -2958,12 +3060,17 @@
29583060 // }
29593061
29603062 /**/
2961
- if (deselect)
3063
+ if (deselect || child == null)
29623064 {
29633065 //group.deselectAll();
29643066 //freeze = true;
29653067 GetTree().clearSelection();
29663068 //freeze = false;
3069
+
3070
+ if (child == null)
3071
+ {
3072
+ return;
3073
+ }
29673074 }
29683075
29693076 //group.addSelectee(child);
....@@ -3032,7 +3139,7 @@
30323139 cameraView.ToggleDL();
30333140 cameraView.repaint();
30343141 return;
3035
- } else if (event.getSource() == toggleTextureItem)
3142
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
30363143 {
30373144 cameraView.ToggleTexture();
30383145 // june 2013 copy.HardTouch();
....@@ -3071,7 +3178,7 @@
30713178 frame.validate();
30723179
30733180 return;
3074
- } else if (event.getSource() == toggleSwitchItem)
3181
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
30753182 {
30763183 cameraView.ToggleSwitch();
30773184 cameraView.repaint();
....@@ -3287,9 +3394,9 @@
32873394 {
32883395 Close();
32893396 //return true;
3290
- } else if (source == loadItem)
3397
+ } else if (source == openItem)
32913398 {
3292
- load();
3399
+ Open();
32933400 //return true;
32943401 } else if (source == newItem)
32953402 {
....@@ -3314,6 +3421,10 @@
33143421 {
33153422 generatePOV();
33163423 //return true;
3424
+ } else if (event.getSource() == archiveItem)
3425
+ {
3426
+ cTools.Archive(frame);
3427
+ return;
33173428 } else if (source == zBufferItem)
33183429 {
33193430 try
....@@ -3464,8 +3575,10 @@
34643575
34653576 copy.ExtractBigData(hashtable);
34663577
3578
+ byte[] compress = Compress(copy);
3579
+
34673580 //EditorFrame.m_MainFrame.requestFocusInWindow();
3468
- tab.graphs[tab.undoindex++] = Compress(copy);
3581
+ tab.graphs[tab.undoindex++] = compress;
34693582
34703583 copy.RestoreBigData(hashtable);
34713584
....@@ -3478,6 +3591,8 @@
34783591 tab.graphs[i] = null;
34793592 }
34803593
3594
+ SetUndoStates();
3595
+
34813596 // test save
34823597 if (false)
34833598 {
....@@ -3500,6 +3615,8 @@
35003615
35013616 void CopyChanged(Object3D obj)
35023617 {
3618
+ SetUndoStates();
3619
+
35033620 boolean temp = CameraPane.SWITCH;
35043621 CameraPane.SWITCH = false;
35053622
....@@ -3537,6 +3654,17 @@
35373654 }
35383655
35393656 refreshContents();
3657
+ }
3658
+
3659
+ cButton undoButton;
3660
+ cButton redoButton;
3661
+
3662
+ void SetUndoStates()
3663
+ {
3664
+ cRadio tab = GetCurrentTab();
3665
+
3666
+ undoButton.setEnabled(tab.undoindex > 0);
3667
+ redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null);
35403668 }
35413669
35423670 public void Undo()
....@@ -3726,7 +3854,7 @@
37263854 assert false;
37273855 }
37283856
3729
- void EditSelection()
3857
+ void EditSelection(boolean newWindow)
37303858 {
37313859 }
37323860
....@@ -4221,7 +4349,7 @@
42214349
42224350 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
42234351 {
4224
- if (Globals.SAVEONMAKE)
4352
+ if (Globals.SAVEONMAKE) // && resetmodel)
42254353 Save();
42264354 //Tween.set(thing, 0).target(1).start(tweenManager);
42274355 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
....@@ -4309,6 +4437,12 @@
43094437 {
43104438 ResetModel();
43114439 Select(thing.GetTreePath(), true, false); // unselect... false);
4440
+
4441
+ if (thing.Size() == 0)
4442
+ {
4443
+ //EditSelection(false);
4444
+ }
4445
+
43124446 refreshContents();
43134447 }
43144448
....@@ -4593,7 +4727,7 @@
45934727 }
45944728 }
45954729
4596
- void load() // throws ClassNotFoundException
4730
+ void Open() // throws ClassNotFoundException
45974731 {
45984732 if (Grafreed.standAlone)
45994733 {
....@@ -4710,6 +4844,8 @@
47104844 String filename = browser.getFile();
47114845 if (filename != null && filename.length() > 0)
47124846 {
4847
+ if (!filename.endsWith(".gfd"))
4848
+ filename += ".gfd";
47134849 lastname = browser.getDirectory() + filename;
47144850 save();
47154851 }
....@@ -4876,7 +5012,7 @@
48765012 MenuBar menuBar;
48775013 Menu fileMenu;
48785014 MenuItem newItem;
4879
- MenuItem loadItem;
5015
+ MenuItem openItem;
48805016 MenuItem saveItem;
48815017 MenuItem saveAsItem;
48825018 MenuItem exportAsItem;
....@@ -4899,22 +5035,36 @@
48995035 CheckboxMenuItem toggleSwitchItem;
49005036 CheckboxMenuItem toggleRootItem;
49015037 CheckboxMenuItem animationItem;
5038
+ MenuItem archiveItem;
49025039 CheckboxMenuItem toggleHandleItem;
49035040 CheckboxMenuItem togglePaintItem;
49045041 JSplitPane mainPanel;
49055042 JScrollPane scrollpane;
5043
+
49065044 JPanel toolbarPanel;
5045
+
49075046 cGridBag treePanel;
5047
+
49085048 JPanel radioPanel;
49095049 ButtonGroup buttonGroup;
4910
- cGridBag ctrlPanel;
5050
+
5051
+ cGridBag toolboxPanel;
49115052 cGridBag materialPanel;
5053
+ cGridBag ctrlPanel;
5054
+
49125055 JScrollPane infoPanel;
5056
+
49135057 cGridBag optionsPanel;
5058
+
49145059 JTabbedPane objectPanel;
5060
+ boolean materialFlushed;
5061
+ Object3D latestObject;
5062
+
49155063 cGridBag XYZPanel;
5064
+
49165065 JSplitPane gridPanel;
49175066 JSplitPane bigPanel;
5067
+
49185068 cGridBag bigThree;
49195069 cGridBag scenePanel;
49205070 cGridBag centralPanel;
....@@ -5029,7 +5179,7 @@
50295179 cNumberSlider fogField;
50305180 JLabel opacityPowerLabel;
50315181 cNumberSlider opacityPowerField;
5032
- JTree jTree;
5182
+ cTree jTree;
50335183 //ObjectUI parent;
50345184
50355185 cNumberSlider normalpushField;