Normand Briere
2019-08-20 537f4ac57ae2b34f0a04fa63874c8ca6534c9a6d
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)
....@@ -116,8 +134,14 @@
116134
117135 try
118136 {
119
- BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
120
-
137
+ BufferedImage image;
138
+
139
+ if (name.endsWith("jpg"))
140
+ // Much faster!
141
+ image = new sun.awt.image.codec.JPEGImageDecoderImpl(ObjEditor.class.getClassLoader().getResourceAsStream(name)).decodeAsBufferedImage();
142
+ else
143
+ image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
144
+
121145 // if (image.getWidth() > 48 && image.getHeight() > 48)
122146 // {
123147 // BufferedImage resized = new BufferedImage(48, 48, image.getType());
....@@ -442,8 +466,11 @@
442466 importOBJItem.addActionListener(this);
443467 import3DSItem = menu.add(new MenuItem("3DS file..."));
444468 import3DSItem.addActionListener(this);
469
+ if (Globals.ADVANCED)
470
+ {
445471 importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
446472 importVRMLX3DItem.addActionListener(this);
473
+ }
447474 menu.add("-");
448475 importGFDItem = menu.add(new MenuItem("Grafreed file..."));
449476 importGFDItem.addActionListener(this);
....@@ -965,8 +992,13 @@
965992 object.versionlist = null;
966993 object.versiontable = null;
967994
995
+ Object3D parent = object.parent;
996
+ object.parent = null;
997
+
968998 //byte[] compress = Compress(copy);
969999 Object3D compress = (Object3D)Grafreed.clone(object);
1000
+
1001
+ object.parent = parent;
9701002
9711003 object.versionlist = versions;
9721004 object.versiontable = versiontable; // if Grafreed.grafreed.universe
....@@ -1310,7 +1342,7 @@
13101342
13111343 //if (copy.pinned)
13121344 {
1313
- pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1345
+ pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF);
13141346 pinButton.setSelected(copy.pinned);
13151347 cGridBag t = new cGridBag();
13161348 t.preferredWidth = 2;
....@@ -1542,23 +1574,9 @@
15421574
15431575 if (cam == null || !(copy.get(0) instanceof cGroup))
15441576 {
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);
1577
+ if (Globals.DEBUG)
1578
+ System.out.println("CREATE CAMERAS");
1579
+ cams = CreateCameras();
15621580 } else
15631581 {
15641582 cams = (cGroup) copy.get(0);
....@@ -1624,6 +1642,45 @@
16241642 //frontView.object = copy;
16251643 //sideView.object = copy;
16261644
1645
+ transformPanel = new cGridBag().setVertical(true);
1646
+
1647
+ cGridBag resetTransformPanel = new cGridBag();
1648
+
1649
+ resetTransformPanel.preferredHeight = 2;
1650
+
1651
+ cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF);
1652
+ resetTransform.setToolTipText("Reset Translation, Rotation and Scale");
1653
+ resetTransform.addMouseListener(new MouseAdapter()
1654
+ {
1655
+ public void mouseClicked(MouseEvent e)
1656
+ {
1657
+ ResetTransform();
1658
+ }
1659
+ });
1660
+ resetTransformPanel.add(resetTransform);
1661
+
1662
+ resetTransform = GetButton("T only", !Globals.NIMBUSLAF);
1663
+ resetTransform.setToolTipText("Reset Translation only");
1664
+ resetTransform.addMouseListener(new MouseAdapter()
1665
+ {
1666
+ public void mouseClicked(MouseEvent e)
1667
+ {
1668
+ ResetTransform(1);
1669
+ }
1670
+ });
1671
+ resetTransformPanel.add(resetTransform);
1672
+
1673
+ resetTransform = GetButton("RS only", !Globals.NIMBUSLAF);
1674
+ resetTransform.setToolTipText("Reset Rotation and Scale only");
1675
+ resetTransform.addMouseListener(new MouseAdapter()
1676
+ {
1677
+ public void mouseClicked(MouseEvent e)
1678
+ {
1679
+ ResetTransform(2);
1680
+ }
1681
+ });
1682
+ resetTransformPanel.add(resetTransform);
1683
+
16271684 XYZPanel = new cGridBag().setVertical(true);
16281685 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
16291686
....@@ -1633,6 +1690,9 @@
16331690 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
16341691 //XYZPanel.setName("XYZ");
16351692
1693
+ transformPanel.add(resetTransformPanel);
1694
+ transformPanel.add(XYZPanel);
1695
+
16361696 /*
16371697 gridPanel = new JPanel(); //new BorderLayout());
16381698 gridPanel.setLayout(new GridLayout(1, 2));
....@@ -1640,12 +1700,12 @@
16401700 gridPanel.add(cameraView);
16411701 gridPanel.add(XYZPanel);
16421702 */
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);
1703
+// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1704
+// gridPanel.setContinuousLayout(true);
1705
+// gridPanel.setOneTouchExpandable(true);
1706
+// gridPanel.setDividerLocation(1.0);
1707
+// gridPanel.setDividerSize(9);
1708
+// gridPanel.setResizeWeight(0.85);
16491709
16501710 // aConstraints.weighty = 0;
16511711 //System.out.println("THIS = " + this);
....@@ -1668,33 +1728,33 @@
16681728
16691729 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
16701730 //tmp.setName("Edit");
1731
+ objectPanel.add(skyboxPanel);
1732
+ objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg"));
1733
+ objectPanel.setToolTipTextAt(0, "Backgrounds");
1734
+
16711735 objectPanel.add(toolboxPanel);
1672
- objectPanel.setIconAt(0, GetIcon("icons/primitives.png"));
1673
- objectPanel.setToolTipTextAt(0, "Objects & textures");
1736
+ objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
1737
+ objectPanel.setToolTipTextAt(1, "Objects & textures");
16741738
16751739 objectPanel.add(materialPanel);
1676
- objectPanel.setIconAt(1, GetIcon("icons/material.png"));
1677
- objectPanel.setToolTipTextAt(1, "Material");
1740
+ objectPanel.setIconAt(2, GetIcon("icons/material.png"));
1741
+ objectPanel.setToolTipTextAt(2, "Material");
16781742
1679
- objectPanel.add(skyboxPanel);
1680
- objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1681
- objectPanel.setToolTipTextAt(2, "Backgrounds");
1682
-
16831743 // JPanel north = new JPanel(new BorderLayout());
16841744 // north.setName("Edit");
16851745 // north.add(ctrlPanel, BorderLayout.NORTH);
16861746 // objectPanel.add(north);
16871747 objectPanel.add(editPanel);
1688
- objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1748
+ objectPanel.setIconAt(3, GetIcon("icons/writewhite.png"));
16891749 objectPanel.setToolTipTextAt(3, "Edit controls");
16901750
1691
- objectPanel.add(XYZPanel);
1751
+ objectPanel.add(transformPanel);
16921752 objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1693
- objectPanel.setToolTipTextAt(4, "XYZ/RGB transform");
1753
+ objectPanel.setToolTipTextAt(4, "TRS transform");
16941754
16951755 patchMaterial = true;
16961756 cameraView.patchMaterial = this;
1697
- objectPanel.setSelectedIndex(1);
1757
+ objectPanel.setSelectedIndex(2);
16981758
16991759 /*
17001760 aConstraints.gridx = 0;
....@@ -1726,17 +1786,109 @@
17261786
17271787 AddOptions(optionsPanel); //, aConstraints);
17281788
1729
- tabbedPane.add(optionsPanel);
1730
-
17311789 tabbedPane.add(FSPane = new cFileSystemPane(this));
17321790
1791
+ tabbedPane.add(optionsPanel);
1792
+
17331793 scenePanel.add(tabbedPane);
17341794
1735
- //if (Globals.ADVANCED)
1736
-// tabbedPane.add(infoPanel);
1737
-// tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1738
-// tabbedPane.setToolTipTextAt(3, "Information");
1795
+ cGridBag creditsPanel = new cGridBag().setVertical(true);
1796
+ creditsPanel.setName("Credits");
17391797
1798
+ cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1799
+ creditsPanel.add(ogaLabel);
1800
+
1801
+ cButton creditButton;
1802
+ creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
1803
+ creditButton.setToolTipText("https://opengameart.org");
1804
+
1805
+ creditButton.addMouseListener(new MouseAdapter()
1806
+ {
1807
+ public void mouseClicked(MouseEvent e)
1808
+ {
1809
+ try
1810
+ {
1811
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
1812
+ } catch (Exception e1)
1813
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1814
+ {
1815
+ e1.printStackTrace();
1816
+ }
1817
+ }
1818
+ });
1819
+
1820
+ ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF);
1821
+ creditsPanel.add(ogaLabel);
1822
+
1823
+ creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF));
1824
+ creditButton.setToolTipText("https://3delicious.net");
1825
+
1826
+ creditButton.addMouseListener(new MouseAdapter()
1827
+ {
1828
+ public void mouseClicked(MouseEvent e)
1829
+ {
1830
+ try
1831
+ {
1832
+ Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net"));
1833
+ } catch (Exception e1)
1834
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1835
+ {
1836
+ e1.printStackTrace();
1837
+ }
1838
+ }
1839
+ });
1840
+
1841
+ creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF));
1842
+ creditButton.setToolTipText("https://archive3d.net");
1843
+
1844
+ creditButton.addMouseListener(new MouseAdapter()
1845
+ {
1846
+ public void mouseClicked(MouseEvent e)
1847
+ {
1848
+ try
1849
+ {
1850
+ Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net"));
1851
+ } catch (Exception e1)
1852
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1853
+ {
1854
+ e1.printStackTrace();
1855
+ }
1856
+ }
1857
+ });
1858
+
1859
+ creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF));
1860
+ creditButton.setToolTipText("https://turbosquid.com");
1861
+
1862
+ creditButton.addMouseListener(new MouseAdapter()
1863
+ {
1864
+ public void mouseClicked(MouseEvent e)
1865
+ {
1866
+ try
1867
+ {
1868
+ Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free"));
1869
+ } catch (Exception e1)
1870
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1871
+ {
1872
+ e1.printStackTrace();
1873
+ }
1874
+ }
1875
+ });
1876
+
1877
+ for (int i=6; --i>=0;)
1878
+ {
1879
+ creditsPanel.add(new cGridBag());
1880
+ }
1881
+
1882
+ tabbedPane.add(creditsPanel);
1883
+ tabbedPane.setToolTipTextAt(3, "Credits");
1884
+
1885
+ if (Globals.ADVANCED)
1886
+ {
1887
+ tabbedPane.add(infoPanel);
1888
+ tabbedPane.setIconAt(4, GetIcon("icons/info.png"));
1889
+ tabbedPane.setToolTipTextAt(4, "Information");
1890
+ }
1891
+
17401892 /*
17411893 cTree jTree = new cTree(null);
17421894 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1757,13 +1909,13 @@
17571909 jtp.add(tree);
17581910 */
17591911
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");
1912
+// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1913
+// bigPanel.setContinuousLayout(true);
1914
+// bigPanel.setOneTouchExpandable(true);
1915
+// bigPanel.setDividerLocation(0.8);
1916
+// bigPanel.setDividerSize(15);
1917
+// bigPanel.setResizeWeight(0.15);
1918
+// bigPanel.setName("Scene");
17671919
17681920 //bigPanel.setLayout(new BorderLayout());
17691921 //bigPanel.setSize(new Dimension(10,10));
....@@ -1847,7 +1999,7 @@
18471999
18482000 cameraView.requestFocusInWindow();
18492001
1850
- gridPanel.setDividerLocation(1.0);
2002
+// gridPanel.setDividerLocation(1.0);
18512003
18522004 frame.validate();
18532005
....@@ -1882,7 +2034,7 @@
18822034 {
18832035 cGridBag presetpanel = new cGridBag().setVertical(true);
18842036
1885
- cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
2037
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF);
18862038 skin.setToolTipText("Skin");
18872039 skin.addMouseListener(new MouseAdapter()
18882040 {
....@@ -1920,7 +2072,7 @@
19202072 });
19212073 presetpanel.add(skin);
19222074
1923
- cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF);
2075
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF);
19242076 lambert.setToolTipText("Diffuse");
19252077 lambert.addMouseListener(new MouseAdapter()
19262078 {
....@@ -1938,7 +2090,7 @@
19382090 });
19392091 presetpanel.add(lambert);
19402092
1941
- cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF);
2093
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF);
19422094 diffuse2.setToolTipText("Diffuse2");
19432095 diffuse2.addMouseListener(new MouseAdapter()
19442096 {
....@@ -1956,7 +2108,7 @@
19562108 });
19572109 presetpanel.add(diffuse2);
19582110
1959
- cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF);
2111
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF);
19602112 diffusemoon.setToolTipText("Moon");
19612113 diffusemoon.addMouseListener(new MouseAdapter()
19622114 {
....@@ -1974,7 +2126,7 @@
19742126 });
19752127 presetpanel.add(diffusemoon);
19762128
1977
- cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF);
2129
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF);
19782130 diffusemoon2.setToolTipText("Moon2");
19792131 diffusemoon2.addMouseListener(new MouseAdapter()
19802132 {
....@@ -1992,7 +2144,7 @@
19922144 });
19932145 presetpanel.add(diffusemoon2);
19942146
1995
- cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF);
2147
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF);
19962148 diffusemoon3.setToolTipText("Moon3");
19972149 diffusemoon3.addMouseListener(new MouseAdapter()
19982150 {
....@@ -2010,7 +2162,7 @@
20102162 });
20112163 presetpanel.add(diffusemoon3);
20122164
2013
- cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF);
2165
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF);
20142166 diffusesheen.setToolTipText("Sheen");
20152167 diffusesheen.addMouseListener(new MouseAdapter()
20162168 {
....@@ -2027,7 +2179,7 @@
20272179 });
20282180 presetpanel.add(diffusesheen);
20292181
2030
- cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF);
2182
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF);
20312183 rough.setToolTipText("Rough metal");
20322184 rough.addMouseListener(new MouseAdapter()
20332185 {
....@@ -2045,7 +2197,7 @@
20452197 });
20462198 presetpanel.add(rough);
20472199
2048
- cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF);
2200
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF);
20492201 rough2.setToolTipText("Medium metal");
20502202 rough2.addMouseListener(new MouseAdapter()
20512203 {
....@@ -2063,7 +2215,7 @@
20632215 });
20642216 presetpanel.add(rough2);
20652217
2066
- cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF);
2218
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF);
20672219 shini0.setToolTipText("Shiny");
20682220 shini0.addMouseListener(new MouseAdapter()
20692221 {
....@@ -2081,7 +2233,7 @@
20812233 });
20822234 presetpanel.add(shini0);
20832235
2084
- cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF);
2236
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF);
20852237 shini1.setToolTipText("Shiny2");
20862238 shini1.addMouseListener(new MouseAdapter()
20872239 {
....@@ -2099,7 +2251,7 @@
20992251 });
21002252 presetpanel.add(shini1);
21012253
2102
- cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF);
2254
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF);
21032255 shini2.setToolTipText("Shiny3");
21042256 shini2.addMouseListener(new MouseAdapter()
21052257 {
....@@ -2117,7 +2269,7 @@
21172269 });
21182270 presetpanel.add(shini2);
21192271
2120
- cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF);
2272
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF);
21212273 aniso.setToolTipText("AnisoU");
21222274 aniso.addMouseListener(new MouseAdapter()
21232275 {
....@@ -2135,7 +2287,7 @@
21352287 });
21362288 presetpanel.add(aniso);
21372289
2138
- cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF);
2290
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF);
21392291 aniso2.setToolTipText("AnisoV");
21402292 aniso2.addMouseListener(new MouseAdapter()
21412293 {
....@@ -2153,7 +2305,7 @@
21532305 });
21542306 presetpanel.add(aniso2);
21552307
2156
- cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF);
2308
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF);
21572309 aniso3.setToolTipText("AnisoUV");
21582310 aniso3.addMouseListener(new MouseAdapter()
21592311 {
....@@ -2171,7 +2323,7 @@
21712323 });
21722324 presetpanel.add(aniso3);
21732325
2174
- cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF);
2326
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF);
21752327 velvet0.setToolTipText("Velvet");
21762328 velvet0.addMouseListener(new MouseAdapter()
21772329 {
....@@ -2193,7 +2345,7 @@
21932345 });
21942346 presetpanel.add(velvet0);
21952347
2196
- cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF);
2348
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF);
21972349 bump0.setToolTipText("Bump texture");
21982350 bump0.addMouseListener(new MouseAdapter()
21992351 {
....@@ -2212,7 +2364,7 @@
22122364 });
22132365 presetpanel.add(bump0);
22142366
2215
- cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF);
2367
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF);
22162368 borderShader.setToolTipText("Border fade");
22172369 borderShader.addMouseListener(new MouseAdapter()
22182370 {
....@@ -2227,7 +2379,7 @@
22272379 });
22282380 presetpanel.add(borderShader);
22292381
2230
- cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF);
2382
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF);
22312383 halo.setToolTipText("Halo");
22322384 halo.addMouseListener(new MouseAdapter()
22332385 {
....@@ -2244,7 +2396,7 @@
22442396 });
22452397 presetpanel.add(halo);
22462398
2247
- cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF);
2399
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF);
22482400 candle.setToolTipText("Candle");
22492401 candle.addMouseListener(new MouseAdapter()
22502402 {
....@@ -2266,7 +2418,7 @@
22662418 });
22672419 presetpanel.add(candle);
22682420
2269
- cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF);
2421
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF);
22702422 shadowShader.setToolTipText("Shadow");
22712423 shadowShader.addMouseListener(new MouseAdapter()
22722424 {
....@@ -2301,19 +2453,19 @@
23012453
23022454 cGridBag editBar = new cGridBag().setVertical(false);
23032455
2304
- editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
2456
+ editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints);
23052457 createMaterialButton.setToolTipText("Create material");
23062458
23072459 /*
23082460 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
23092461 */
23102462
2311
- editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
2463
+ editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints);
23122464 clearMaterialButton.setToolTipText("Clear material");
23132465
23142466 if (Globals.ADVANCED)
23152467 {
2316
- editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2468
+ editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints);
23172469 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
23182470 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
23192471 }
....@@ -4114,11 +4266,18 @@
41144266
41154267 void New()
41164268 {
4117
- while (copy.Size() > 1)
4269
+ while (copy.Size() > 0)
41184270 {
4119
- copy.remove(1);
4271
+ copy.remove(0);
41204272 }
41214273
4274
+ copy.selection.clear();
4275
+
4276
+ if (copy == Grafreed.grafreed.universe)
4277
+ {
4278
+ CreateCameras();
4279
+ cameraView.SetCamera(GetCamera(copy, 0));
4280
+ }
41224281 ResetModel();
41234282 objEditor.refreshContents();
41244283 }
....@@ -4432,6 +4591,8 @@
44324591 return count;
44334592 }
44344593
4594
+ public cGridBag versionSliderPane;
4595
+
44354596 void SetVersionStates()
44364597 {
44374598 //if (true)
....@@ -4439,21 +4600,36 @@
44394600
44404601 //cRadio tab = GetCurrentTab();
44414602
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;
4603
+ if (copy.versionlist == null)
4604
+ {
4605
+ saveVersionButton.setEnabled(false);
4606
+ restoreButton.setEnabled(false);
4607
+ replaceButton.setEnabled(false);
4608
+ previousVersionButton.setEnabled(false);
4609
+ nextVersionButton.setEnabled(false);
4610
+ deleteVersionButton.setEnabled(false);
4611
+ versionSliderPane.setVisible(false);
4612
+ }
4613
+ else
4614
+ {
4615
+ restoreButton.setEnabled(copy.versionindex != -1);
4616
+ replaceButton.setEnabled(copy.versionindex != -1);
4617
+
4618
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4619
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4620
+
4621
+ deleteVersionButton.setEnabled(copy.versionindex != -1);
4622
+ //copy.versionlist[copy.versionindex + 1] != null);
4623
+
4624
+ muteSlider = true;
4625
+ versionSlider.setMinimum(0);
4626
+ versionSlider.setMaximum(VersionCount() - 1);
4627
+ versionSlider.setInteger(copy.versionindex);
4628
+ versionSlider.setEnabled(copy.versionindex != -1);
4629
+ muteSlider = false;
4630
+
4631
+ versionSliderPane.setVisible(true);
4632
+ }
44574633 }
44584634
44594635 public boolean PreviousVersion()
....@@ -4873,7 +5049,7 @@
48735049
48745050 public void stateChanged(ChangeEvent e)
48755051 {
4876
- // assert(false);
5052
+ // assert(false);
48775053 if (e.getSource() == versionSlider)
48785054 {
48795055 if (muteSlider)
....@@ -5986,6 +6162,7 @@
59866162 boolean materialFlushed;
59876163 Object3D latestObject;
59886164
6165
+ cGridBag transformPanel;
59896166 cGridBag XYZPanel;
59906167
59916168 JSplitPane gridPanel;