Normand Briere
2019-08-12 8f1afe25ea8fc8801aab66331c32a50859a758c2
ObjEditor.java
....@@ -34,6 +34,7 @@
3434 iSendInfo
3535 //KeyListener
3636 {
37
+ public cToggleButton pinButton;
3738 boolean timeline;
3839 boolean wasFullScreen;
3940
....@@ -41,11 +42,25 @@
4142 JFrame frame;
4243
4344 static ObjEditor theFrame;
45
+
46
+ public cGridBag GetSeparator()
47
+ {
48
+ cGridBag separator = new cGridBag();
49
+ separator.add(new JSeparator());
50
+ separator.preferredHeight = 5;
51
+ return separator;
52
+ }
4453
4554 cButton GetButton(String name, boolean border)
4655 {
4756 ImageIcon icon = GetIcon(name);
4857 return new cButton(icon, border);
58
+ }
59
+
60
+ cLabel GetLabel(String name, boolean border)
61
+ {
62
+ //ImageIcon icon = GetIcon(name);
63
+ return new cLabel(GetImage(name), border);
4964 }
5065
5166 cToggleButton GetToggleButton(String name, boolean border)
....@@ -66,20 +81,34 @@
6681 {
6782 BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
6883
69
- if (image.getWidth() > 48 && image.getHeight() > 48)
70
- {
71
- BufferedImage resized = new BufferedImage(48, 48, image.getType());
72
- Graphics2D g = resized.createGraphics();
73
- g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
74
- //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
75
- g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
76
- g.dispose();
77
-
78
- image = resized;
79
- }
84
+// if (image.getWidth() > 48 && image.getHeight() > 48)
85
+// {
86
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
87
+// Graphics2D g = resized.createGraphics();
88
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
89
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
90
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
91
+// g.dispose();
92
+//
93
+// image = resized;
94
+// }
8095
8196 javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
8297 return icon;
98
+ }
99
+ catch (Exception e)
100
+ {
101
+ return null;
102
+ }
103
+ }
104
+
105
+ BufferedImage GetImage(String name)
106
+ {
107
+ try
108
+ {
109
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
110
+
111
+ return image;
83112 }
84113 catch (Exception e)
85114 {
....@@ -268,11 +297,13 @@
268297 client = inClient;
269298 copy = client;
270299
271
- if (copy.versions == null)
272
- {
273
- copy.versions = new byte[100][];
274
- copy.versionindex = -1;
275
- }
300
+// if (copy.versionlist == null)
301
+// {
302
+// copy.versionlist = new Object3D[100];
303
+// copy.versionindex = -1;
304
+//
305
+// callee.Save(true);
306
+// }
276307
277308 // "this" is not called: SetupUI2(objEditor);
278309 }
....@@ -287,10 +318,12 @@
287318 client = inClient;
288319 copy = client;
289320
290
- if (copy.versions == null)
321
+ if (copy.versionlist == null)
291322 {
292
- copy.versions = new byte[100][];
323
+ copy.versionlist = new Object3D[100];
293324 copy.versionindex = -1;
325
+
326
+// Save(true);
294327 }
295328
296329 SetupUI2(callee.GetEditor());
....@@ -325,11 +358,13 @@
325358 copy = localCopy;
326359 copy.editWindow = this;
327360
328
- if (copy.versions == null)
329
- {
330
-// copy.versions = new byte[100][];
361
+// if (copy.versionlist == null)
362
+// {
363
+// copy.versionlist = new Object3D[100];
331364 // copy.versionindex = -1;
332
- }
365
+//
366
+// Save(true);
367
+// }
333368
334369 SetupMenu();
335370
....@@ -416,7 +451,7 @@
416451 // EditSelection(false);
417452 // }
418453
419
- refreshContents(false); // To refresh Info tab
454
+// refreshContents(false); // To refresh Info tab
420455 }
421456 };
422457 objectPanel.addChangeListener(changeListener);
....@@ -439,7 +474,9 @@
439474 toolboxPanel = new cGridBag().setVertical(true);
440475 //toolboxPanel.setName("Toolbox");
441476
442
- materialPanel = new cGridBag().setVertical(true);
477
+ skyboxPanel = new cGridBag().setVertical(true);
478
+
479
+ materialPanel = new cGridBag().setVertical(false);
443480 //materialPanel.setName("Material");
444481
445482 /*JTextPane*/
....@@ -723,6 +760,7 @@
723760 boolean maximized;
724761
725762 cButton fullscreenLayout;
763
+ cButton expandedLayout;
726764
727765 void Minimize()
728766 {
....@@ -762,10 +800,12 @@
762800 cButton minButton;
763801 cButton maxButton;
764802 cButton fullButton;
803
+ cButton collapseButton;
804
+ cButton maximize3DButton;
765805
766806 void ToggleFullScreen()
767807 {
768
-GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
808
+ GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
769809
770810 cameraView.ToggleFullScreen();
771811
....@@ -786,13 +826,13 @@
786826 // X frame.getContentPane().remove(/*"Center",*/bigThree);
787827 // X framePanel.add(bigThree);
788828 // X frame.getContentPane().add(/*"Center",*/framePanel);
789
- framePanel.setDividerLocation(46);
829
+// framePanel.setDividerLocation(46); // icons are 24x24
790830
791831 //frame.setVisible(true);
792
- radio.layout = keepButton;
832
+// radio.layout = keepButton;
793833 //theFrame = null;
794834 keepButton = null;
795
- radio.layout.doClick();
835
+// radio.layout.doClick();
796836
797837 } else
798838 {
....@@ -813,31 +853,42 @@
813853 // X frame.getContentPane().remove(/*"Center",*/framePanel);
814854 // X framePanel.remove(bigThree);
815855 // X frame.getContentPane().add(/*"Center",*/bigThree);
816
- framePanel.setDividerLocation(0);
856
+// framePanel.setDividerLocation(0);
817857
818
- radio.layout = fullscreenLayout;
819
- radio.layout.doClick();
858
+// radio.layout = fullscreenLayout;
859
+// radio.layout.doClick();
820860 //frame.setVisible(true);
821861 }
822862 frame.validate();
863
+
864
+ cameraView.requestFocusInWindow();
823865 }
824866
825
- private byte[] CompressCopy()
867
+ void CollapseToolbar()
868
+ {
869
+ framePanel.setDividerLocation(0);
870
+ //frame.validate();
871
+
872
+ cameraView.requestFocusInWindow();
873
+ }
874
+
875
+ private Object3D Duplicate(Object3D object)
826876 {
827877 boolean temp = CameraPane.SWITCH;
828878 CameraPane.SWITCH = false;
829879
830
- copy.ExtractBigData(versiontable);
880
+ object.ExtractBigData(versiontable);
831881 // if (copy == client)
832882
833
- byte[] versions[] = copy.versions;
834
- copy.versions = null;
883
+ Object3D versions[] = object.versionlist;
884
+ object.versionlist = null;
835885
836
- byte[] compress = Compress(copy);
886
+ //byte[] compress = Compress(copy);
887
+ Object3D compress = (Object3D)Grafreed.clone(object);
837888
838
- copy.versions = versions;
889
+ object.versionlist = versions;
839890
840
- copy.RestoreBigData(versiontable);
891
+ object.RestoreBigData(versiontable);
841892
842893 CameraPane.SWITCH = temp;
843894
....@@ -965,6 +1016,7 @@
9651016 {
9661017 SetupMaterial(materialPanel);
9671018 }
1019
+
9681020 //SetupName();
9691021 //SetupViews();
9701022 }
....@@ -1173,6 +1225,18 @@
11731225
11741226 namePanel = new cGridBag();
11751227
1228
+ //if (copy.pinned)
1229
+ {
1230
+ pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1231
+ pinButton.setSelected(copy.pinned);
1232
+ cGridBag t = new cGridBag();
1233
+ t.preferredWidth = 2;
1234
+ t.add(pinButton);
1235
+ namePanel.add(t);
1236
+
1237
+ pinButton.addItemListener(this);
1238
+ }
1239
+
11761240 nameField = AddText(namePanel, copy.GetName());
11771241 namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11781242 oe.ctrlPanel.add(namePanel);
....@@ -1522,23 +1586,28 @@
15221586 //tmp.setName("Edit");
15231587 objectPanel.add(materialPanel);
15241588 objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1589
+ objectPanel.setToolTipTextAt(0, "Material");
1590
+
1591
+ objectPanel.add(toolboxPanel);
1592
+ objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
1593
+ objectPanel.setToolTipTextAt(1, "Objects & textures");
1594
+
1595
+ objectPanel.add(skyboxPanel);
1596
+ objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1597
+ objectPanel.setToolTipTextAt(2, "Backgrounds");
1598
+
15251599 // JPanel north = new JPanel(new BorderLayout());
15261600 // north.setName("Edit");
15271601 // north.add(ctrlPanel, BorderLayout.NORTH);
15281602 // objectPanel.add(north);
15291603 objectPanel.add(editPanel);
1530
- objectPanel.setIconAt(1, GetIcon("icons/write.png"));
1531
-
1532
- //if (Globals.ADVANCED)
1533
- objectPanel.add(infoPanel);
1534
- objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1604
+ objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1605
+ objectPanel.setToolTipTextAt(3, "Edit controls");
15351606
15361607 objectPanel.add(XYZPanel);
1537
- objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
1608
+ objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1609
+ objectPanel.setToolTipTextAt(4, "XYZ/RGB transform");
15381610
1539
- objectPanel.add(toolboxPanel);
1540
- objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
1541
-
15421611 /*
15431612 aConstraints.gridx = 0;
15441613 aConstraints.gridwidth = 1;
....@@ -1575,6 +1644,11 @@
15751644
15761645 scenePanel.add(tabbedPane);
15771646
1647
+ //if (Globals.ADVANCED)
1648
+ tabbedPane.add(infoPanel);
1649
+ tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1650
+ tabbedPane.setToolTipTextAt(3, "Information");
1651
+
15781652 /*
15791653 cTree jTree = new cTree(null);
15801654 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1634,8 +1708,8 @@
16341708 /**/
16351709
16361710 bigThree = new cGridBag();
1637
- bigThree.addComponent(centralPanel);
16381711 bigThree.addComponent(scenePanel);
1712
+ bigThree.addComponent(centralPanel);
16391713 //bigThree.addComponent(XYZPanel);
16401714
16411715 // // SIDE EFFECT!!!
....@@ -1645,6 +1719,23 @@
16451719 // aConstraints.gridheight = 1;
16461720
16471721 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1722
+
1723
+ framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,
1724
+ new java.beans.PropertyChangeListener()
1725
+ {
1726
+ public void propertyChange(java.beans.PropertyChangeEvent pce)
1727
+ {
1728
+ if ((Integer)pce.getOldValue() == 1)
1729
+ {
1730
+ if (radio.layout != expandedLayout)
1731
+ {
1732
+ radio.layout = expandedLayout;
1733
+ radio.layout.doClick();
1734
+ }
1735
+ }
1736
+ }
1737
+ });
1738
+
16481739 framePanel.setContinuousLayout(false);
16491740 framePanel.setOneTouchExpandable(false);
16501741 //.setDividerLocation(0.8);
....@@ -1677,7 +1768,6 @@
16771768 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
16781769 frame.addWindowListener(new WindowAdapter()
16791770 {
1680
-
16811771 public void windowClosing(WindowEvent e)
16821772 {
16831773 Close();
....@@ -1700,12 +1790,403 @@
17001790 ctrlPanel.removeAll();
17011791 }
17021792
1703
- void SetupMaterial(cGridBag panel)
1793
+ void SetupMaterial(cGridBag materialpanel)
17041794 {
1705
- /*
1795
+ cGridBag presetpanel = new cGridBag().setVertical(true);
1796
+
1797
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
1798
+ skin.setToolTipText("Skin");
1799
+ skin.addMouseListener(new MouseAdapter()
1800
+ {
1801
+ public void mouseClicked(MouseEvent e)
1802
+ {
1803
+ Object3D object = Grafreed.materials.versionlist[0].get(0);
1804
+ cMaterial material = object.material;
1805
+
1806
+ // Skin
1807
+ colorField.setFloat(material.color);
1808
+ saturationField.setFloat(material.modulation);
1809
+ subsurfaceField.setFloat(material.subsurface);
1810
+ selfshadowField.setFloat(material.diffuseness);
1811
+ diffusenessField.setFloat(material.factor);
1812
+ shininessField.setFloat(material.shininess);
1813
+ shadowbiasField.setFloat(material.shadowbias);
1814
+ diffuseField.setFloat(material.diffuse);
1815
+ specularField.setFloat(material.specular);
1816
+
1817
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
1818
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
1819
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
1820
+
1821
+ materialtouched = true;
1822
+ applySelf();
1823
+ }
1824
+ });
1825
+ presetpanel.add(skin);
1826
+
1827
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF);
1828
+ lambert.setToolTipText("Diffuse");
1829
+ lambert.addMouseListener(new MouseAdapter()
1830
+ {
1831
+ public void mouseClicked(MouseEvent e)
1832
+ {
1833
+ Object3D object = Grafreed.materials.versionlist[2].get(0);
1834
+ cMaterial material = object.material;
1835
+
1836
+ diffusenessField.setFloat(material.factor);
1837
+ selfshadowField.setFloat(material.diffuseness);
1838
+
1839
+ materialtouched = true;
1840
+ applySelf();
1841
+ }
1842
+ });
1843
+ presetpanel.add(lambert);
1844
+
1845
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF);
1846
+ diffuse2.setToolTipText("Diffuse2");
1847
+ diffuse2.addMouseListener(new MouseAdapter()
1848
+ {
1849
+ public void mouseClicked(MouseEvent e)
1850
+ {
1851
+ Object3D object = Grafreed.materials.versionlist[3].get(0);
1852
+ cMaterial material = object.material;
1853
+
1854
+ diffusenessField.setFloat(material.factor);
1855
+ selfshadowField.setFloat(material.diffuseness);
1856
+
1857
+ materialtouched = true;
1858
+ applySelf();
1859
+ }
1860
+ });
1861
+ presetpanel.add(diffuse2);
1862
+
1863
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF);
1864
+ diffusemoon.setToolTipText("Moon");
1865
+ diffusemoon.addMouseListener(new MouseAdapter()
1866
+ {
1867
+ public void mouseClicked(MouseEvent e)
1868
+ {
1869
+ Object3D object = Grafreed.materials.versionlist[4].get(0);
1870
+ cMaterial material = object.material;
1871
+
1872
+ diffusenessField.setFloat(material.factor);
1873
+ selfshadowField.setFloat(material.diffuseness);
1874
+
1875
+ materialtouched = true;
1876
+ applySelf();
1877
+ }
1878
+ });
1879
+ presetpanel.add(diffusemoon);
1880
+
1881
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF);
1882
+ diffusemoon2.setToolTipText("Moon2");
1883
+ diffusemoon2.addMouseListener(new MouseAdapter()
1884
+ {
1885
+ public void mouseClicked(MouseEvent e)
1886
+ {
1887
+ Object3D object = Grafreed.materials.versionlist[5].get(0);
1888
+ cMaterial material = object.material;
1889
+
1890
+ diffusenessField.setFloat(material.factor);
1891
+ selfshadowField.setFloat(material.diffuseness);
1892
+
1893
+ materialtouched = true;
1894
+ applySelf();
1895
+ }
1896
+ });
1897
+ presetpanel.add(diffusemoon2);
1898
+
1899
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF);
1900
+ diffusemoon3.setToolTipText("Moon3");
1901
+ diffusemoon3.addMouseListener(new MouseAdapter()
1902
+ {
1903
+ public void mouseClicked(MouseEvent e)
1904
+ {
1905
+ Object3D object = Grafreed.materials.versionlist[6].get(0);
1906
+ cMaterial material = object.material;
1907
+
1908
+ diffusenessField.setFloat(material.factor);
1909
+ selfshadowField.setFloat(material.diffuseness);
1910
+
1911
+ materialtouched = true;
1912
+ applySelf();
1913
+ }
1914
+ });
1915
+ presetpanel.add(diffusemoon3);
1916
+
1917
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF);
1918
+ diffusesheen.setToolTipText("Sheen");
1919
+ diffusesheen.addMouseListener(new MouseAdapter()
1920
+ {
1921
+ public void mouseClicked(MouseEvent e)
1922
+ {
1923
+ Object3D object = Grafreed.materials.versionlist[7].get(0);
1924
+ cMaterial material = object.material;
1925
+
1926
+ sheenField.setFloat(material.sheen);
1927
+
1928
+ materialtouched = true;
1929
+ applySelf();
1930
+ }
1931
+ });
1932
+ presetpanel.add(diffusesheen);
1933
+
1934
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF);
1935
+ rough.setToolTipText("Rough metal");
1936
+ rough.addMouseListener(new MouseAdapter()
1937
+ {
1938
+ public void mouseClicked(MouseEvent e)
1939
+ {
1940
+ Object3D object = Grafreed.materials.versionlist[1].get(0);
1941
+ cMaterial material = object.material;
1942
+
1943
+ shininessField.setFloat(material.shininess);
1944
+ velvetField.setFloat(material.velvet);
1945
+
1946
+ materialtouched = true;
1947
+ applySelf();
1948
+ }
1949
+ });
1950
+ presetpanel.add(rough);
1951
+
1952
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF);
1953
+ rough2.setToolTipText("Medium metal");
1954
+ rough2.addMouseListener(new MouseAdapter()
1955
+ {
1956
+ public void mouseClicked(MouseEvent e)
1957
+ {
1958
+ Object3D object = Grafreed.materials.versionlist[13].get(0);
1959
+ cMaterial material = object.material;
1960
+
1961
+ shininessField.setFloat(material.shininess);
1962
+ lightareaField.setFloat(material.lightarea);
1963
+
1964
+ materialtouched = true;
1965
+ applySelf();
1966
+ }
1967
+ });
1968
+ presetpanel.add(rough2);
1969
+
1970
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF);
1971
+ shini0.setToolTipText("Shiny");
1972
+ shini0.addMouseListener(new MouseAdapter()
1973
+ {
1974
+ public void mouseClicked(MouseEvent e)
1975
+ {
1976
+ Object3D object = Grafreed.materials.versionlist[14].get(0);
1977
+ cMaterial material = object.material;
1978
+
1979
+ shininessField.setFloat(material.shininess);
1980
+ lightareaField.setFloat(material.lightarea);
1981
+
1982
+ materialtouched = true;
1983
+ applySelf();
1984
+ }
1985
+ });
1986
+ presetpanel.add(shini0);
1987
+
1988
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF);
1989
+ shini1.setToolTipText("Shiny2");
1990
+ shini1.addMouseListener(new MouseAdapter()
1991
+ {
1992
+ public void mouseClicked(MouseEvent e)
1993
+ {
1994
+ Object3D object = Grafreed.materials.versionlist[11].get(0);
1995
+ cMaterial material = object.material;
1996
+
1997
+ shininessField.setFloat(material.shininess);
1998
+ lightareaField.setFloat(material.lightarea);
1999
+
2000
+ materialtouched = true;
2001
+ applySelf();
2002
+ }
2003
+ });
2004
+ presetpanel.add(shini1);
2005
+
2006
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF);
2007
+ shini2.setToolTipText("Shiny3");
2008
+ shini2.addMouseListener(new MouseAdapter()
2009
+ {
2010
+ public void mouseClicked(MouseEvent e)
2011
+ {
2012
+ Object3D object = Grafreed.materials.versionlist[12].get(0);
2013
+ cMaterial material = object.material;
2014
+
2015
+ shininessField.setFloat(material.shininess);
2016
+ lightareaField.setFloat(material.lightarea);
2017
+
2018
+ materialtouched = true;
2019
+ applySelf();
2020
+ }
2021
+ });
2022
+ presetpanel.add(shini2);
2023
+
2024
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF);
2025
+ aniso.setToolTipText("AnisoU");
2026
+ aniso.addMouseListener(new MouseAdapter()
2027
+ {
2028
+ public void mouseClicked(MouseEvent e)
2029
+ {
2030
+ Object3D object = Grafreed.materials.versionlist[8].get(0);
2031
+ cMaterial material = object.material;
2032
+
2033
+ anisoField.setFloat(material.aniso);
2034
+ anisoVField.setFloat(material.anisoV);
2035
+
2036
+ materialtouched = true;
2037
+ applySelf();
2038
+ }
2039
+ });
2040
+ presetpanel.add(aniso);
2041
+
2042
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF);
2043
+ aniso2.setToolTipText("AnisoV");
2044
+ aniso2.addMouseListener(new MouseAdapter()
2045
+ {
2046
+ public void mouseClicked(MouseEvent e)
2047
+ {
2048
+ Object3D object = Grafreed.materials.versionlist[9].get(0);
2049
+ cMaterial material = object.material;
2050
+
2051
+ anisoField.setFloat(material.aniso);
2052
+ anisoVField.setFloat(material.anisoV);
2053
+
2054
+ materialtouched = true;
2055
+ applySelf();
2056
+ }
2057
+ });
2058
+ presetpanel.add(aniso2);
2059
+
2060
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF);
2061
+ aniso3.setToolTipText("AnisoUV");
2062
+ aniso3.addMouseListener(new MouseAdapter()
2063
+ {
2064
+ public void mouseClicked(MouseEvent e)
2065
+ {
2066
+ Object3D object = Grafreed.materials.versionlist[10].get(0);
2067
+ cMaterial material = object.material;
2068
+
2069
+ anisoField.setFloat(material.aniso);
2070
+ anisoVField.setFloat(material.anisoV);
2071
+
2072
+ materialtouched = true;
2073
+ applySelf();
2074
+ }
2075
+ });
2076
+ presetpanel.add(aniso3);
2077
+
2078
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF);
2079
+ velvet0.setToolTipText("Velvet");
2080
+ velvet0.addMouseListener(new MouseAdapter()
2081
+ {
2082
+ public void mouseClicked(MouseEvent e)
2083
+ {
2084
+ Object3D object = Grafreed.materials.versionlist[15].get(0);
2085
+ cMaterial material = object.material;
2086
+
2087
+ diffusenessField.setFloat(material.factor);
2088
+ selfshadowField.setFloat(material.diffuseness);
2089
+ sheenField.setFloat(material.sheen);
2090
+ shininessField.setFloat(material.shininess);
2091
+ velvetField.setFloat(material.velvet);
2092
+ shiftField.setFloat(material.shift);
2093
+
2094
+ materialtouched = true;
2095
+ applySelf();
2096
+ }
2097
+ });
2098
+ presetpanel.add(velvet0);
2099
+
2100
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF);
2101
+ bump0.setToolTipText("Bump texture");
2102
+ bump0.addMouseListener(new MouseAdapter()
2103
+ {
2104
+ public void mouseClicked(MouseEvent e)
2105
+ {
2106
+ Object3D object = Grafreed.materials.versionlist[16].get(0);
2107
+ cMaterial material = object.material;
2108
+
2109
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2110
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2111
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2112
+
2113
+ materialtouched = true;
2114
+ applySelf();
2115
+ }
2116
+ });
2117
+ presetpanel.add(bump0);
2118
+
2119
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF);
2120
+ halo.setToolTipText("Halo");
2121
+ halo.addMouseListener(new MouseAdapter()
2122
+ {
2123
+ public void mouseClicked(MouseEvent e)
2124
+ {
2125
+ Object3D object = Grafreed.materials.versionlist[17].get(0);
2126
+ cMaterial material = object.material;
2127
+
2128
+ opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0);
2129
+
2130
+ materialtouched = true;
2131
+ applySelf();
2132
+ }
2133
+ });
2134
+ presetpanel.add(halo);
2135
+
2136
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF);
2137
+ candle.setToolTipText("Candle");
2138
+ candle.addMouseListener(new MouseAdapter()
2139
+ {
2140
+ public void mouseClicked(MouseEvent e)
2141
+ {
2142
+ Object3D object = Grafreed.materials.versionlist[18].get(0);
2143
+ cMaterial material = object.material;
2144
+
2145
+ subsurfaceField.setFloat(material.subsurface);
2146
+ shadowbiasField.setFloat(material.shadowbias);
2147
+ ambientField.setFloat(material.ambient);
2148
+ specularField.setFloat(material.specular);
2149
+ lightareaField.setFloat(material.lightarea);
2150
+ shininessField.setFloat(material.shininess);
2151
+
2152
+ materialtouched = true;
2153
+ applySelf();
2154
+ }
2155
+ });
2156
+ presetpanel.add(candle);
2157
+
2158
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF);
2159
+ shadowShader.setToolTipText("Shadow");
2160
+ shadowShader.addMouseListener(new MouseAdapter()
2161
+ {
2162
+ public void mouseClicked(MouseEvent e)
2163
+ {
2164
+ diffuseField.setFloat(0.001);
2165
+ ambientField.setFloat(0.001);
2166
+ cameraField.setFloat(0.001);
2167
+ specularField.setFloat(0.001);
2168
+ fakedepthField.setFloat(0.001);
2169
+ opacityField.setFloat(0.6);
2170
+
2171
+ materialtouched = true;
2172
+ applySelf();
2173
+ }
2174
+ });
2175
+ presetpanel.add(shadowShader);
2176
+
2177
+ cGridBag panel = new cGridBag().setVertical(true);
2178
+
2179
+ presetpanel.preferredWidth = 1;
2180
+
2181
+ materialpanel.add(presetpanel);
2182
+ materialpanel.add(panel);
2183
+
2184
+ panel.preferredWidth = 8;
2185
+
2186
+ /*
17062187 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
17072188 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- */
2189
+ */
17092190
17102191 cGridBag editBar = new cGridBag().setVertical(false);
17112192
....@@ -1739,27 +2220,50 @@
17392220 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17402221
17412222 cGridBag colorSection = new cGridBag().setVertical(true);
2223
+
2224
+ cGridBag huepanel = new cGridBag();
2225
+ cGridBag huelabel = new cGridBag();
2226
+ skin = GetLabel("icons/hue.png", false);
2227
+ skin.fit = true;
2228
+ huelabel.add(skin);
2229
+ huelabel.preferredWidth = 20;
2230
+ huepanel.add(new cGridBag()); // Label
2231
+ huepanel.add(huelabel); // Field/slider
2232
+
2233
+ huepanel.preferredHeight = 7;
2234
+
2235
+ colorSection.add(huepanel);
17422236
17432237 cGridBag color = new cGridBag();
1744
- color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1745
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1746
- color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2238
+
2239
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
2240
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2241
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2242
+
17472243 //colorField.preferredWidth = 200;
17482244 colorSection.add(color);
17492245
17502246 cGridBag modulation = new cGridBag();
17512247 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
17522248 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1753
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2249
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
17542250 colorSection.add(modulation);
17552251
2252
+ cGridBag opacity = new cGridBag();
2253
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
2254
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2255
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2256
+ colorSection.add(opacity);
2257
+
2258
+ colorSection.add(GetSeparator());
2259
+
17562260 cGridBag texture = new cGridBag();
17572261 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
17582262 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17592263 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
17602264 colorSection.add(texture);
17612265
1762
- panel.add(new JSeparator());
2266
+ panel.add(GetSeparator());
17632267
17642268 panel.add(colorSection);
17652269
....@@ -1815,7 +2319,7 @@
18152319 shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
18162320 diffuseSection.add(shadowbias);
18172321
1818
- panel.add(new JSeparator());
2322
+ panel.add(GetSeparator());
18192323
18202324 panel.add(diffuseSection);
18212325
....@@ -1878,7 +2382,7 @@
18782382 specularSection.add(anisoV);
18792383
18802384
1881
- panel.add(new JSeparator());
2385
+ panel.add(GetSeparator());
18822386
18832387 panel.add(specularSection);
18842388
....@@ -1903,12 +2407,6 @@
19032407 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
19042408 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
19052409 colorSection.add(backlit);
1906
-
1907
- cGridBag opacity = new cGridBag();
1908
- opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1909
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1910
- opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1911
- colorSection.add(opacity);
19122410
19132411 //panel.add(new JSeparator());
19142412
....@@ -1954,7 +2452,7 @@
19542452 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
19552453 textureSection.add(opacityPower);
19562454
1957
- panel.add(new JSeparator());
2455
+ panel.add(GetSeparator());
19582456
19592457 panel.add(textureSection);
19602458
....@@ -2941,7 +3439,7 @@
29413439
29423440 freezematerial = true;
29433441 colorField.setFloat(mat.color);
2944
- modulationField.setFloat(mat.modulation);
3442
+ saturationField.setFloat(mat.modulation);
29453443 metalnessField.setFloat(mat.metalness);
29463444 diffuseField.setFloat(mat.diffuse);
29473445 specularField.setFloat(mat.specular);
....@@ -3148,6 +3646,17 @@
31483646 public void itemStateChanged(ItemEvent event)
31493647 {
31503648 // System.out.println("Propagate = " + propagate);
3649
+ if (event.getSource() == pinButton)
3650
+ {
3651
+ copy.pinned ^= true;
3652
+ if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy))
3653
+ {
3654
+ ((GroupEditor)copy.editWindow).listUI.remove(copy);
3655
+ copy.CloseUI();
3656
+ //copy.editWindow.refreshContents();
3657
+ }
3658
+ }
3659
+ else
31513660 if (event.getSource() == propagateToggle)
31523661 {
31533662 propagate ^= true;
....@@ -3252,6 +3761,7 @@
32523761 } else if (event.getSource() == liveCB)
32533762 {
32543763 copy.live ^= true;
3764
+ objEditor.refreshContents(true); // To show item colors
32553765 return;
32563766 } else if (event.getSource() == selectableCB)
32573767 {
....@@ -3261,7 +3771,7 @@
32613771 {
32623772 copy.hide ^= true;
32633773 copy.Touch(); // display list issue
3264
- objEditor.refreshContents();
3774
+ objEditor.refreshContents(true); // To show item colors
32653775 return;
32663776 } else if (event.getSource() == link2masterCB)
32673777 {
....@@ -3517,6 +4027,7 @@
35174027
35184028 static public byte[] Compress(Object3D o)
35194029 {
4030
+ // Slower to actually compress.
35204031 try
35214032 {
35224033 ByteArrayOutputStream baos = new ByteArrayOutputStream();
....@@ -3618,6 +4129,7 @@
36184129 {
36194130 //Save(true);
36204131 Replace();
4132
+ SetUndoStates();
36214133 }
36224134
36234135 private boolean Equal(byte[] compress, byte[] name)
....@@ -3638,29 +4150,46 @@
36384150
36394151 java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
36404152
4153
+ void DeleteVersion()
4154
+ {
4155
+ for (int i = copy.versionindex; i < copy.versionlist.length-1; i++)
4156
+ {
4157
+ copy.versionlist[i] = copy.versionlist[i+1];
4158
+ }
4159
+
4160
+ CopyChanged();
4161
+
4162
+ SetUndoStates();
4163
+ }
4164
+
36414165 public boolean Save(boolean user)
36424166 {
36434167 System.err.println("Save");
4168
+ Replace();
36444169
3645
- cRadio tab = GetCurrentTab();
4170
+ //cRadio tab = GetCurrentTab();
36464171
3647
- byte[] compress = CompressCopy();
4172
+ Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
36484173
36494174 boolean thesame = false;
36504175
3651
- // Quick heuristic using length. Works only when stream is compressed.
3652
- if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3653
- {
3654
- thesame = true;
3655
- }
4176
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
4177
+// {
4178
+// thesame = true;
4179
+// }
36564180
36574181 //EditorFrame.m_MainFrame.requestFocusInWindow();
36584182 if (!thesame)
36594183 {
4184
+ for (int i = copy.versionlist.length; --i > copy.versionindex+1;)
4185
+ {
4186
+ copy.versionlist[i] = copy.versionlist[i-1];
4187
+ }
4188
+
36604189 //tab.user[tab.versionindex] = user;
36614190 //boolean increment = true; // tab.graphs[tab.versionindex] == null;
36624191
3663
- copy.versions[++copy.versionindex] = compress;
4192
+ copy.versionlist[++copy.versionindex] = compress;
36644193
36654194 // if (increment)
36664195 // tab.versionindex++;
....@@ -3670,11 +4199,11 @@
36704199
36714200 //assert(hashtable.isEmpty());
36724201
3673
- for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3674
- {
3675
- //tab.user[i] = false;
3676
- copy.versions[i] = null;
3677
- }
4202
+// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
4203
+// {
4204
+// //tab.user[i] = false;
4205
+// copy.versionlist[i] = null;
4206
+// }
36784207
36794208 SetUndoStates();
36804209
....@@ -3699,9 +4228,43 @@
36994228
37004229 return !thesame;
37014230 }
3702
-
3703
- void CopyChanged(Object3D obj)
4231
+
4232
+ boolean flashIt = true;
4233
+
4234
+ void RefreshSelection()
37044235 {
4236
+ Object3D selection = new Object3D();
4237
+
4238
+ for (int i = 0; i < copy.selection.size(); i++)
4239
+ {
4240
+ Object3D elem = copy.selection.elementAt(i);
4241
+
4242
+ Object3D obj = copy.GetObject(elem.GetUUID());
4243
+
4244
+ if (obj == null)
4245
+ {
4246
+ copy.selection.remove(i--);
4247
+ }
4248
+ else
4249
+ {
4250
+ selection.add(obj);
4251
+ copy.selection.setElementAt(obj, i);
4252
+ }
4253
+ }
4254
+
4255
+ flashIt = false;
4256
+ GetTree().clearSelection();
4257
+ for (int i = 0; i < selection.size(); i++)
4258
+ GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath());
4259
+ flashIt = true;
4260
+
4261
+ //refreshContents(false);
4262
+ }
4263
+
4264
+ void CopyChanged()
4265
+ {
4266
+ Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
4267
+
37054268 SetUndoStates();
37064269
37074270 boolean temp = CameraPane.SWITCH;
....@@ -3711,6 +4274,9 @@
37114274
37124275 copy.clear();
37134276
4277
+ copy.skyboxname = obj.skyboxname;
4278
+ copy.skyboxext = obj.skyboxext;
4279
+
37144280 for (int i=0; i<obj.Size(); i++)
37154281 {
37164282 copy.add(obj.get(i));
....@@ -3720,6 +4286,7 @@
37204286
37214287 CameraPane.SWITCH = temp;
37224288
4289
+ RefreshSelection();
37234290 //assert(hashtable.isEmpty());
37244291
37254292 copy.Touch();
....@@ -3740,13 +4307,15 @@
37404307 }
37414308 }
37424309
3743
- refreshContents();
4310
+ refreshContents(true);
37444311 }
37454312
3746
- cButton undoButton;
4313
+ cButton previousVersionButton;
37474314 cButton restoreButton;
37484315 cButton replaceButton;
3749
- cButton redoButton;
4316
+ cButton nextVersionButton;
4317
+ cButton saveVersionButton;
4318
+ cButton deleteVersionButton;
37504319
37514320 boolean muteSlider;
37524321
....@@ -3754,9 +4323,9 @@
37544323 {
37554324 int count = 0;
37564325
3757
- for (int i = copy.versions.length; --i >= 0;)
4326
+ for (int i = copy.versionlist.length; --i >= 0;)
37584327 {
3759
- if (copy.versions[i] != null)
4328
+ if (copy.versionlist[i] != null)
37604329 count++;
37614330 }
37624331
....@@ -3765,28 +4334,36 @@
37654334
37664335 void SetUndoStates()
37674336 {
3768
- cRadio tab = GetCurrentTab();
4337
+ //if (true)
4338
+ // return;
4339
+
4340
+ //cRadio tab = GetCurrentTab();
37694341
37704342 restoreButton.setEnabled(copy.versionindex != -1);
37714343 replaceButton.setEnabled(copy.versionindex != -1);
37724344
3773
- undoButton.setEnabled(copy.versionindex > 0);
3774
- redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
4345
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4346
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4347
+
4348
+ deleteVersionButton.setEnabled(//copy.versionindex > 0 &&
4349
+ copy.versionlist[copy.versionindex + 1] != null);
37754350
37764351 muteSlider = true;
4352
+ versionSlider.setMinimum(0);
37774353 versionSlider.setMaximum(VersionCount() - 1);
37784354 versionSlider.setInteger(copy.versionindex);
4355
+ versionSlider.setEnabled(copy.versionindex != -1);
37794356 muteSlider = false;
37804357 }
37814358
3782
- public boolean Undo()
4359
+ public boolean PreviousVersion()
37834360 {
37844361 // Option?
37854362 Replace();
37864363
37874364 System.err.println("Undo");
37884365
3789
- cRadio tab = GetCurrentTab();
4366
+ //cRadio tab = GetCurrentTab();
37904367
37914368 if (copy.versionindex == 0)
37924369 {
....@@ -3809,7 +4386,7 @@
38094386
38104387 copy.versionindex -= 1;
38114388
3812
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4389
+ CopyChanged();
38134390
38144391 return true;
38154392 }
....@@ -3818,15 +4395,16 @@
38184395 {
38194396 System.err.println("Restore");
38204397
3821
- cRadio tab = GetCurrentTab();
4398
+ //cRadio tab = GetCurrentTab();
38224399
3823
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
4400
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38244401 {
38254402 java.awt.Toolkit.getDefaultToolkit().beep();
38264403 return false;
38274404 }
38284405
3829
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4406
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4407
+ CopyChanged();
38304408
38314409 return true;
38324410 }
....@@ -3835,27 +4413,27 @@
38354413 {
38364414 System.err.println("Replace");
38374415
3838
- cRadio tab = GetCurrentTab();
4416
+ //cRadio tab = GetCurrentTab();
38394417
3840
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
4418
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38414419 {
38424420 // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
38434421 return false;
38444422 }
38454423
3846
- copy.versions[copy.versionindex] = CompressCopy();
4424
+ copy.versionlist[copy.versionindex] = Duplicate(copy);
38474425
38484426 return true;
38494427 }
38504428
3851
- public void Redo()
4429
+ public void NextVersion()
38524430 {
38534431 // Option?
38544432 Replace();
38554433
3856
- cRadio tab = GetCurrentTab();
4434
+ //cRadio tab = GetCurrentTab();
38574435
3858
- if (copy.versions[copy.versionindex + 1] == null)
4436
+ if (copy.versionlist[copy.versionindex + 1] == null)
38594437 {
38604438 java.awt.Toolkit.getDefaultToolkit().beep();
38614439 return;
....@@ -3863,7 +4441,7 @@
38634441
38644442 copy.versionindex += 1;
38654443
3866
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4444
+ CopyChanged();
38674445
38684446 //if (!tab.user[tab.versionindex])
38694447 // tab.graphs[tab.versionindex] = null;
....@@ -4077,7 +4655,7 @@
40774655 //copy.material = new cMaterial(copy.GetMaterial());
40784656
40794657 current.color = (float) colorField.getFloat();
4080
- current.modulation = (float) modulationField.getFloat();
4658
+ current.modulation = (float) saturationField.getFloat();
40814659 current.metalness = (float) metalnessField.getFloat();
40824660 current.diffuse = (float) diffuseField.getFloat();
40834661 current.specular = (float) specularField.getFloat();
....@@ -4110,7 +4688,7 @@
41104688 cMaterial mat = copy.material;
41114689
41124690 colorField.SetToolTipValue((mat.color));
4113
- modulationField.SetToolTipValue((mat.modulation));
4691
+ saturationField.SetToolTipValue((mat.modulation));
41144692 metalnessField.SetToolTipValue((mat.metalness));
41154693 diffuseField.SetToolTipValue((mat.diffuse));
41164694 specularField.SetToolTipValue((mat.specular));
....@@ -4174,9 +4752,10 @@
41744752
41754753 int version = versionSlider.getInteger();
41764754
4177
- if (copy.versions[version] != null)
4755
+ if (version != -1 && copy.versionlist[version] != null)
41784756 {
4179
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version]));
4757
+ copy.versionindex = version;
4758
+ CopyChanged();
41804759 }
41814760
41824761 return;
....@@ -4216,6 +4795,12 @@
42164795 {
42174796 //System.out.println("stateChanged = " + this);
42184797 materialtouched = true;
4798
+
4799
+ if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001)
4800
+ {
4801
+ saturationField.setFloat(1);
4802
+ }
4803
+
42194804 applySelf();
42204805 //System.out.println("this = " + this);
42214806 //System.out.println("PARENT = " + parent);
....@@ -4515,6 +5100,7 @@
45155100 {
45165101 if (GetTree() != null)
45175102 {
5103
+ GetTree().revalidate();
45185104 GetTree().repaint();
45195105 }
45205106
....@@ -4523,6 +5109,9 @@
45235109 ctrlPanel.validate(); // ? new
45245110 ctrlPanel.repaint();
45255111 }
5112
+
5113
+ if (previousVersionButton != null && copy.versionlist != null)
5114
+ SetUndoStates();
45265115 }
45275116
45285117 static TweenManager tweenManager = new TweenManager();
....@@ -4853,6 +5442,8 @@
48535442 {
48545443 //readobj.deepCopySelf(copy);
48555444 copy.clear(); // june 2014
5445
+ copy.skyboxname = readobj.skyboxname;
5446
+ copy.skyboxext = readobj.skyboxext;
48565447 for (int i = 0; i < readobj.size(); i++)
48575448 {
48585449 Object3D child = readobj.get(i); // reserve(i);
....@@ -4904,13 +5495,16 @@
49045495 c.addChild(csg);
49055496 }
49065497
4907
- copy.versions = readobj.versions;
5498
+ copy.versionlist = readobj.versionlist;
49085499 copy.versionindex = readobj.versionindex;
49095500
4910
- if (copy.versions == null)
5501
+ if (copy.versionlist == null)
49115502 {
4912
- copy.versions = new byte[100][];
5503
+ // Backward compatibility
5504
+ copy.versionlist = new Object3D[100];
49135505 copy.versionindex = -1;
5506
+
5507
+ Save(true);
49145508 }
49155509
49165510 //? SetUndoStates();
....@@ -4925,7 +5519,7 @@
49255519 {
49265520 if (Grafreed.standAlone)
49275521 {
4928
- FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
5522
+ FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD);
49295523 browser.show();
49305524 String filename = browser.getFile();
49315525 if (filename != null && filename.length() > 0)
....@@ -5244,6 +5838,7 @@
52445838 ButtonGroup buttonGroup;
52455839
52465840 cGridBag toolboxPanel;
5841
+ cGridBag skyboxPanel;
52475842 cGridBag materialPanel;
52485843 cGridBag ctrlPanel;
52495844
....@@ -5317,7 +5912,7 @@
53175912 JLabel colorLabel;
53185913 cNumberSlider colorField;
53195914 JLabel modulationLabel;
5320
- cNumberSlider modulationField;
5915
+ cNumberSlider saturationField;
53215916 JLabel metalnessLabel;
53225917 cNumberSlider metalnessField;
53235918 JLabel diffuseLabel;
....@@ -5348,6 +5943,7 @@
53485943 cNumberSlider anisoField;
53495944 JLabel anisoVLabel;
53505945 cNumberSlider anisoVField;
5946
+
53515947 JLabel cameraLabel;
53525948 cNumberSlider cameraField;
53535949 JLabel selfshadowLabel;
....@@ -5362,6 +5958,7 @@
53625958 cNumberSlider fakedepthField;
53635959 JLabel shadowbiasLabel;
53645960 cNumberSlider shadowbiasField;
5961
+
53655962 JLabel bumpLabel;
53665963 cNumberSlider bumpField;
53675964 JLabel noiseLabel;