Normand Briere
2019-08-18 480ad70047e54b2b92f974e6c2ac5a6c0bdc5a5c
ObjEditor.java
....@@ -72,6 +72,21 @@
7272 }
7373 }
7474
75
+ public Composite CreateCameras()
76
+ {
77
+ Composite cams = new cTemplate();
78
+ cams.name = "Cameras";
79
+ copy.insertElementAt(cams, 0);
80
+
81
+ cams.addChild(new Camera());
82
+ cams.addChild(new Camera(1));
83
+ cams.addChild(new Camera(2));
84
+ cams.addChild(new Camera(3));
85
+ cams.addChild(new Camera(4));
86
+
87
+ return cams;
88
+ }
89
+
7590 public cGridBag GetSeparator()
7691 {
7792 cGridBag separator = new cGridBag();
....@@ -83,7 +98,10 @@
8398 cButton GetButton(String name, boolean border)
8499 {
85100 ImageIcon icon = GetIcon(name);
86
- return new cButton(icon, border);
101
+ if (icon != null || name.contains("/"))
102
+ return new cButton(icon, border);
103
+ else
104
+ return new cButton(name, border);
87105 }
88106
89107 cLabel GetLabel(String name, boolean border)
....@@ -965,8 +983,13 @@
965983 object.versionlist = null;
966984 object.versiontable = null;
967985
986
+ Object3D parent = object.parent;
987
+ object.parent = null;
988
+
968989 //byte[] compress = Compress(copy);
969990 Object3D compress = (Object3D)Grafreed.clone(object);
991
+
992
+ object.parent = parent;
970993
971994 object.versionlist = versions;
972995 object.versiontable = versiontable; // if Grafreed.grafreed.universe
....@@ -1310,7 +1333,7 @@
13101333
13111334 //if (copy.pinned)
13121335 {
1313
- pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1336
+ pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF);
13141337 pinButton.setSelected(copy.pinned);
13151338 cGridBag t = new cGridBag();
13161339 t.preferredWidth = 2;
....@@ -1542,23 +1565,9 @@
15421565
15431566 if (cam == null || !(copy.get(0) instanceof cGroup))
15441567 {
1545
- if (Globals.DEBUG)
1546
- System.out.println("CREATE CAMERAS");
1547
- cams = new cTemplate();
1548
- cams.name = "Cameras";
1549
- copy.insertElementAt(cams, 0);
1550
- //cams.parent = copy;
1551
-
1552
- cam = new Camera(); // LA.newVector(3, 2, 1));
1553
- cams.addChild(cam);
1554
- cam = new Camera(1);
1555
- cams.addChild(cam);
1556
- cam = new Camera(2);
1557
- cams.addChild(cam);
1558
- cam = new Camera(3);
1559
- cams.addChild(cam);
1560
- cam = new Camera(4); // Light
1561
- cams.addChild(cam);
1568
+ if (Globals.DEBUG)
1569
+ System.out.println("CREATE CAMERAS");
1570
+ cams = CreateCameras();
15621571 } else
15631572 {
15641573 cams = (cGroup) copy.get(0);
....@@ -1624,6 +1633,45 @@
16241633 //frontView.object = copy;
16251634 //sideView.object = copy;
16261635
1636
+ transformPanel = new cGridBag().setVertical(true);
1637
+
1638
+ cGridBag resetTransformPanel = new cGridBag();
1639
+
1640
+ resetTransformPanel.preferredHeight = 2;
1641
+
1642
+ cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF);
1643
+ resetTransform.setToolTipText("Reset Translation, Rotation and Scale");
1644
+ resetTransform.addMouseListener(new MouseAdapter()
1645
+ {
1646
+ public void mouseClicked(MouseEvent e)
1647
+ {
1648
+ ResetTransform();
1649
+ }
1650
+ });
1651
+ resetTransformPanel.add(resetTransform);
1652
+
1653
+ resetTransform = GetButton("T only", !Globals.NIMBUSLAF);
1654
+ resetTransform.setToolTipText("Reset Translation only");
1655
+ resetTransform.addMouseListener(new MouseAdapter()
1656
+ {
1657
+ public void mouseClicked(MouseEvent e)
1658
+ {
1659
+ ResetTransform(1);
1660
+ }
1661
+ });
1662
+ resetTransformPanel.add(resetTransform);
1663
+
1664
+ resetTransform = GetButton("RS only", !Globals.NIMBUSLAF);
1665
+ resetTransform.setToolTipText("Reset Rotation and Scale only");
1666
+ resetTransform.addMouseListener(new MouseAdapter()
1667
+ {
1668
+ public void mouseClicked(MouseEvent e)
1669
+ {
1670
+ ResetTransform(2);
1671
+ }
1672
+ });
1673
+ resetTransformPanel.add(resetTransform);
1674
+
16271675 XYZPanel = new cGridBag().setVertical(true);
16281676 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
16291677
....@@ -1633,6 +1681,9 @@
16331681 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
16341682 //XYZPanel.setName("XYZ");
16351683
1684
+ transformPanel.add(resetTransformPanel);
1685
+ transformPanel.add(XYZPanel);
1686
+
16361687 /*
16371688 gridPanel = new JPanel(); //new BorderLayout());
16381689 gridPanel.setLayout(new GridLayout(1, 2));
....@@ -1640,12 +1691,12 @@
16401691 gridPanel.add(cameraView);
16411692 gridPanel.add(XYZPanel);
16421693 */
1643
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1644
- gridPanel.setContinuousLayout(true);
1645
- gridPanel.setOneTouchExpandable(true);
1646
- gridPanel.setDividerLocation(1.0);
1647
- gridPanel.setDividerSize(9);
1648
- gridPanel.setResizeWeight(0.85);
1694
+// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1695
+// gridPanel.setContinuousLayout(true);
1696
+// gridPanel.setOneTouchExpandable(true);
1697
+// gridPanel.setDividerLocation(1.0);
1698
+// gridPanel.setDividerSize(9);
1699
+// gridPanel.setResizeWeight(0.85);
16491700
16501701 // aConstraints.weighty = 0;
16511702 //System.out.println("THIS = " + this);
....@@ -1668,33 +1719,33 @@
16681719
16691720 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
16701721 //tmp.setName("Edit");
1722
+ objectPanel.add(skyboxPanel);
1723
+ objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg"));
1724
+ objectPanel.setToolTipTextAt(0, "Backgrounds");
1725
+
16711726 objectPanel.add(toolboxPanel);
1672
- objectPanel.setIconAt(0, GetIcon("icons/primitives.png"));
1673
- objectPanel.setToolTipTextAt(0, "Objects & textures");
1727
+ objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
1728
+ objectPanel.setToolTipTextAt(1, "Objects & textures");
16741729
16751730 objectPanel.add(materialPanel);
1676
- objectPanel.setIconAt(1, GetIcon("icons/material.png"));
1677
- objectPanel.setToolTipTextAt(1, "Material");
1731
+ objectPanel.setIconAt(2, GetIcon("icons/material.png"));
1732
+ objectPanel.setToolTipTextAt(2, "Material");
16781733
1679
- objectPanel.add(skyboxPanel);
1680
- objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1681
- objectPanel.setToolTipTextAt(2, "Backgrounds");
1682
-
16831734 // JPanel north = new JPanel(new BorderLayout());
16841735 // north.setName("Edit");
16851736 // north.add(ctrlPanel, BorderLayout.NORTH);
16861737 // objectPanel.add(north);
16871738 objectPanel.add(editPanel);
1688
- objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1739
+ objectPanel.setIconAt(3, GetIcon("icons/writewhite.png"));
16891740 objectPanel.setToolTipTextAt(3, "Edit controls");
16901741
1691
- objectPanel.add(XYZPanel);
1742
+ objectPanel.add(transformPanel);
16921743 objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1693
- objectPanel.setToolTipTextAt(4, "XYZ/RGB transform");
1744
+ objectPanel.setToolTipTextAt(4, "TRS transform");
16941745
16951746 patchMaterial = true;
16961747 cameraView.patchMaterial = this;
1697
- objectPanel.setSelectedIndex(1);
1748
+ objectPanel.setSelectedIndex(2);
16981749
16991750 /*
17001751 aConstraints.gridx = 0;
....@@ -1726,17 +1777,52 @@
17261777
17271778 AddOptions(optionsPanel); //, aConstraints);
17281779
1729
- tabbedPane.add(optionsPanel);
1730
-
17311780 tabbedPane.add(FSPane = new cFileSystemPane(this));
17321781
1782
+ tabbedPane.add(optionsPanel);
1783
+
17331784 scenePanel.add(tabbedPane);
17341785
1735
- //if (Globals.ADVANCED)
1736
-// tabbedPane.add(infoPanel);
1737
-// tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1738
-// tabbedPane.setToolTipTextAt(3, "Information");
1786
+ cGridBag creditsPanel = new cGridBag().setVertical(true);
1787
+ creditsPanel.setName("Credits");
17391788
1789
+ cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1790
+ creditsPanel.add(ogaLabel);
1791
+
1792
+ cButton opengameartButton;
1793
+ creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
1794
+ opengameartButton.setToolTipText("https://opengameart.org");
1795
+
1796
+ opengameartButton.addMouseListener(new MouseAdapter()
1797
+ {
1798
+ public void mouseClicked(MouseEvent e)
1799
+ {
1800
+ try
1801
+ {
1802
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
1803
+ } catch (Exception e1)
1804
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1805
+ {
1806
+ e1.printStackTrace();
1807
+ }
1808
+ }
1809
+ });
1810
+
1811
+ for (int i=10; --i>=0;)
1812
+ {
1813
+ creditsPanel.add(new cGridBag());
1814
+ }
1815
+
1816
+ tabbedPane.add(creditsPanel);
1817
+ tabbedPane.setToolTipTextAt(3, "Credits");
1818
+
1819
+ if (Globals.ADVANCED)
1820
+ {
1821
+ tabbedPane.add(infoPanel);
1822
+ tabbedPane.setIconAt(4, GetIcon("icons/info.png"));
1823
+ tabbedPane.setToolTipTextAt(4, "Information");
1824
+ }
1825
+
17401826 /*
17411827 cTree jTree = new cTree(null);
17421828 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1757,13 +1843,13 @@
17571843 jtp.add(tree);
17581844 */
17591845
1760
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1761
- bigPanel.setContinuousLayout(true);
1762
- bigPanel.setOneTouchExpandable(true);
1763
- bigPanel.setDividerLocation(0.8);
1764
- bigPanel.setDividerSize(15);
1765
- bigPanel.setResizeWeight(0.15);
1766
- bigPanel.setName("Scene");
1846
+// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1847
+// bigPanel.setContinuousLayout(true);
1848
+// bigPanel.setOneTouchExpandable(true);
1849
+// bigPanel.setDividerLocation(0.8);
1850
+// bigPanel.setDividerSize(15);
1851
+// bigPanel.setResizeWeight(0.15);
1852
+// bigPanel.setName("Scene");
17671853
17681854 //bigPanel.setLayout(new BorderLayout());
17691855 //bigPanel.setSize(new Dimension(10,10));
....@@ -1847,7 +1933,7 @@
18471933
18481934 cameraView.requestFocusInWindow();
18491935
1850
- gridPanel.setDividerLocation(1.0);
1936
+// gridPanel.setDividerLocation(1.0);
18511937
18521938 frame.validate();
18531939
....@@ -1882,7 +1968,7 @@
18821968 {
18831969 cGridBag presetpanel = new cGridBag().setVertical(true);
18841970
1885
- cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
1971
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF);
18861972 skin.setToolTipText("Skin");
18871973 skin.addMouseListener(new MouseAdapter()
18881974 {
....@@ -1920,7 +2006,7 @@
19202006 });
19212007 presetpanel.add(skin);
19222008
1923
- cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF);
2009
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF);
19242010 lambert.setToolTipText("Diffuse");
19252011 lambert.addMouseListener(new MouseAdapter()
19262012 {
....@@ -1938,7 +2024,7 @@
19382024 });
19392025 presetpanel.add(lambert);
19402026
1941
- cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF);
2027
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF);
19422028 diffuse2.setToolTipText("Diffuse2");
19432029 diffuse2.addMouseListener(new MouseAdapter()
19442030 {
....@@ -1956,7 +2042,7 @@
19562042 });
19572043 presetpanel.add(diffuse2);
19582044
1959
- cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF);
2045
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF);
19602046 diffusemoon.setToolTipText("Moon");
19612047 diffusemoon.addMouseListener(new MouseAdapter()
19622048 {
....@@ -1974,7 +2060,7 @@
19742060 });
19752061 presetpanel.add(diffusemoon);
19762062
1977
- cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF);
2063
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF);
19782064 diffusemoon2.setToolTipText("Moon2");
19792065 diffusemoon2.addMouseListener(new MouseAdapter()
19802066 {
....@@ -1992,7 +2078,7 @@
19922078 });
19932079 presetpanel.add(diffusemoon2);
19942080
1995
- cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF);
2081
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF);
19962082 diffusemoon3.setToolTipText("Moon3");
19972083 diffusemoon3.addMouseListener(new MouseAdapter()
19982084 {
....@@ -2010,7 +2096,7 @@
20102096 });
20112097 presetpanel.add(diffusemoon3);
20122098
2013
- cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF);
2099
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF);
20142100 diffusesheen.setToolTipText("Sheen");
20152101 diffusesheen.addMouseListener(new MouseAdapter()
20162102 {
....@@ -2027,7 +2113,7 @@
20272113 });
20282114 presetpanel.add(diffusesheen);
20292115
2030
- cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF);
2116
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF);
20312117 rough.setToolTipText("Rough metal");
20322118 rough.addMouseListener(new MouseAdapter()
20332119 {
....@@ -2045,7 +2131,7 @@
20452131 });
20462132 presetpanel.add(rough);
20472133
2048
- cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF);
2134
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF);
20492135 rough2.setToolTipText("Medium metal");
20502136 rough2.addMouseListener(new MouseAdapter()
20512137 {
....@@ -2063,7 +2149,7 @@
20632149 });
20642150 presetpanel.add(rough2);
20652151
2066
- cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF);
2152
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF);
20672153 shini0.setToolTipText("Shiny");
20682154 shini0.addMouseListener(new MouseAdapter()
20692155 {
....@@ -2081,7 +2167,7 @@
20812167 });
20822168 presetpanel.add(shini0);
20832169
2084
- cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF);
2170
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF);
20852171 shini1.setToolTipText("Shiny2");
20862172 shini1.addMouseListener(new MouseAdapter()
20872173 {
....@@ -2099,7 +2185,7 @@
20992185 });
21002186 presetpanel.add(shini1);
21012187
2102
- cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF);
2188
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF);
21032189 shini2.setToolTipText("Shiny3");
21042190 shini2.addMouseListener(new MouseAdapter()
21052191 {
....@@ -2117,7 +2203,7 @@
21172203 });
21182204 presetpanel.add(shini2);
21192205
2120
- cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF);
2206
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF);
21212207 aniso.setToolTipText("AnisoU");
21222208 aniso.addMouseListener(new MouseAdapter()
21232209 {
....@@ -2135,7 +2221,7 @@
21352221 });
21362222 presetpanel.add(aniso);
21372223
2138
- cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF);
2224
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF);
21392225 aniso2.setToolTipText("AnisoV");
21402226 aniso2.addMouseListener(new MouseAdapter()
21412227 {
....@@ -2153,7 +2239,7 @@
21532239 });
21542240 presetpanel.add(aniso2);
21552241
2156
- cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF);
2242
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF);
21572243 aniso3.setToolTipText("AnisoUV");
21582244 aniso3.addMouseListener(new MouseAdapter()
21592245 {
....@@ -2171,7 +2257,7 @@
21712257 });
21722258 presetpanel.add(aniso3);
21732259
2174
- cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF);
2260
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF);
21752261 velvet0.setToolTipText("Velvet");
21762262 velvet0.addMouseListener(new MouseAdapter()
21772263 {
....@@ -2193,7 +2279,7 @@
21932279 });
21942280 presetpanel.add(velvet0);
21952281
2196
- cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF);
2282
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF);
21972283 bump0.setToolTipText("Bump texture");
21982284 bump0.addMouseListener(new MouseAdapter()
21992285 {
....@@ -2212,7 +2298,7 @@
22122298 });
22132299 presetpanel.add(bump0);
22142300
2215
- cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF);
2301
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF);
22162302 borderShader.setToolTipText("Border fade");
22172303 borderShader.addMouseListener(new MouseAdapter()
22182304 {
....@@ -2227,7 +2313,7 @@
22272313 });
22282314 presetpanel.add(borderShader);
22292315
2230
- cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF);
2316
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF);
22312317 halo.setToolTipText("Halo");
22322318 halo.addMouseListener(new MouseAdapter()
22332319 {
....@@ -2244,7 +2330,7 @@
22442330 });
22452331 presetpanel.add(halo);
22462332
2247
- cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF);
2333
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF);
22482334 candle.setToolTipText("Candle");
22492335 candle.addMouseListener(new MouseAdapter()
22502336 {
....@@ -2266,7 +2352,7 @@
22662352 });
22672353 presetpanel.add(candle);
22682354
2269
- cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF);
2355
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF);
22702356 shadowShader.setToolTipText("Shadow");
22712357 shadowShader.addMouseListener(new MouseAdapter()
22722358 {
....@@ -2301,19 +2387,19 @@
23012387
23022388 cGridBag editBar = new cGridBag().setVertical(false);
23032389
2304
- editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
2390
+ editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints);
23052391 createMaterialButton.setToolTipText("Create material");
23062392
23072393 /*
23082394 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
23092395 */
23102396
2311
- editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
2397
+ editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints);
23122398 clearMaterialButton.setToolTipText("Clear material");
23132399
23142400 if (Globals.ADVANCED)
23152401 {
2316
- editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2402
+ editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints);
23172403 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
23182404 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
23192405 }
....@@ -4114,11 +4200,18 @@
41144200
41154201 void New()
41164202 {
4117
- while (copy.Size() > 1)
4203
+ while (copy.Size() > 0)
41184204 {
4119
- copy.remove(1);
4205
+ copy.remove(0);
41204206 }
41214207
4208
+ copy.selection.clear();
4209
+
4210
+ if (copy == Grafreed.grafreed.universe)
4211
+ {
4212
+ CreateCameras();
4213
+ cameraView.SetCamera(GetCamera(copy, 0));
4214
+ }
41224215 ResetModel();
41234216 objEditor.refreshContents();
41244217 }
....@@ -4432,6 +4525,8 @@
44324525 return count;
44334526 }
44344527
4528
+ public cGridBag versionSliderPane;
4529
+
44354530 void SetVersionStates()
44364531 {
44374532 //if (true)
....@@ -4439,21 +4534,36 @@
44394534
44404535 //cRadio tab = GetCurrentTab();
44414536
4442
- restoreButton.setEnabled(copy.versionindex != -1);
4443
- replaceButton.setEnabled(copy.versionindex != -1);
4444
-
4445
- previousVersionButton.setEnabled(copy.versionindex > 0);
4446
- nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4447
-
4448
- deleteVersionButton.setEnabled(copy.versionindex != -1);
4449
- //copy.versionlist[copy.versionindex + 1] != null);
4450
-
4451
- muteSlider = true;
4452
- versionSlider.setMinimum(0);
4453
- versionSlider.setMaximum(VersionCount() - 1);
4454
- versionSlider.setInteger(copy.versionindex);
4455
- versionSlider.setEnabled(copy.versionindex != -1);
4456
- muteSlider = false;
4537
+ if (copy.versionlist == null)
4538
+ {
4539
+ saveVersionButton.setEnabled(false);
4540
+ restoreButton.setEnabled(false);
4541
+ replaceButton.setEnabled(false);
4542
+ previousVersionButton.setEnabled(false);
4543
+ nextVersionButton.setEnabled(false);
4544
+ deleteVersionButton.setEnabled(false);
4545
+ versionSliderPane.setVisible(false);
4546
+ }
4547
+ else
4548
+ {
4549
+ restoreButton.setEnabled(copy.versionindex != -1);
4550
+ replaceButton.setEnabled(copy.versionindex != -1);
4551
+
4552
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4553
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4554
+
4555
+ deleteVersionButton.setEnabled(copy.versionindex != -1);
4556
+ //copy.versionlist[copy.versionindex + 1] != null);
4557
+
4558
+ muteSlider = true;
4559
+ versionSlider.setMinimum(0);
4560
+ versionSlider.setMaximum(VersionCount() - 1);
4561
+ versionSlider.setInteger(copy.versionindex);
4562
+ versionSlider.setEnabled(copy.versionindex != -1);
4563
+ muteSlider = false;
4564
+
4565
+ versionSliderPane.setVisible(true);
4566
+ }
44574567 }
44584568
44594569 public boolean PreviousVersion()
....@@ -4873,7 +4983,7 @@
48734983
48744984 public void stateChanged(ChangeEvent e)
48754985 {
4876
- // assert(false);
4986
+ // assert(false);
48774987 if (e.getSource() == versionSlider)
48784988 {
48794989 if (muteSlider)
....@@ -5986,6 +6096,7 @@
59866096 boolean materialFlushed;
59876097 Object3D latestObject;
59886098
6099
+ cGridBag transformPanel;
59896100 cGridBag XYZPanel;
59906101
59916102 JSplitPane gridPanel;