Normand Briere
2019-08-04 0c85af6e46f48b7425d59fc776b193c06a4a1f52
ObjEditor.java
....@@ -41,11 +41,25 @@
4141 JFrame frame;
4242
4343 static ObjEditor theFrame;
44
+
45
+ public cGridBag GetSeparator()
46
+ {
47
+ cGridBag separator = new cGridBag();
48
+ separator.add(new JSeparator());
49
+ separator.preferredHeight = 5;
50
+ return separator;
51
+ }
4452
4553 cButton GetButton(String name, boolean border)
4654 {
4755 ImageIcon icon = GetIcon(name);
4856 return new cButton(icon, border);
57
+ }
58
+
59
+ cLabel GetLabel(String name, boolean border)
60
+ {
61
+ //ImageIcon icon = GetIcon(name);
62
+ return new cLabel(GetImage(name), border);
4963 }
5064
5165 cToggleButton GetToggleButton(String name, boolean border)
....@@ -60,26 +74,40 @@
6074 return new cCheckBox(icon, border);
6175 }
6276
63
- private ImageIcon GetIcon(String name)
77
+ ImageIcon GetIcon(String name)
6478 {
6579 try
6680 {
6781 BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
6882
69
- if (image.getWidth() != 24 && image.getHeight() != 24)
70
- {
71
- BufferedImage resized = new BufferedImage(24, 24, 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, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
76
- g.dispose();
77
-
78
- image = resized;
79
- }
83
+// if (image.getWidth() > 48 && image.getHeight() > 48)
84
+// {
85
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
86
+// Graphics2D g = resized.createGraphics();
87
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
88
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
89
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
90
+// g.dispose();
91
+//
92
+// image = resized;
93
+// }
8094
8195 javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
8296 return icon;
97
+ }
98
+ catch (Exception e)
99
+ {
100
+ return null;
101
+ }
102
+ }
103
+
104
+ BufferedImage GetImage(String name)
105
+ {
106
+ try
107
+ {
108
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
109
+
110
+ return image;
83111 }
84112 catch (Exception e)
85113 {
....@@ -268,9 +296,9 @@
268296 client = inClient;
269297 copy = client;
270298
271
- if (copy.versions == null)
299
+ if (copy.versionlist == null)
272300 {
273
- copy.versions = new byte[100][];
301
+ copy.versionlist = new Object3D[100];
274302 copy.versionindex = -1;
275303 }
276304
....@@ -287,9 +315,9 @@
287315 client = inClient;
288316 copy = client;
289317
290
- if (copy.versions == null)
318
+ if (copy.versionlist == null)
291319 {
292
- copy.versions = new byte[100][];
320
+ copy.versionlist = new Object3D[100];
293321 copy.versionindex = -1;
294322 }
295323
....@@ -325,7 +353,7 @@
325353 copy = localCopy;
326354 copy.editWindow = this;
327355
328
- if (copy.versions == null)
356
+ if (copy.versionlist == null)
329357 {
330358 // copy.versions = new byte[100][];
331359 // copy.versionindex = -1;
....@@ -436,10 +464,10 @@
436464 editPanel.add(editCommandsPanel);
437465 editPanel.add(ctrlPanel);
438466
439
- toolboxPanel = new cGridBag().setVertical(false);
467
+ toolboxPanel = new cGridBag().setVertical(true);
440468 //toolboxPanel.setName("Toolbox");
441469
442
- materialPanel = new cGridBag().setVertical(true);
470
+ materialPanel = new cGridBag().setVertical(false);
443471 //materialPanel.setName("Material");
444472
445473 /*JTextPane*/
....@@ -822,7 +850,7 @@
822850 frame.validate();
823851 }
824852
825
- private byte[] CompressCopy()
853
+ private Object3D CompressCopy()
826854 {
827855 boolean temp = CameraPane.SWITCH;
828856 CameraPane.SWITCH = false;
....@@ -830,12 +858,13 @@
830858 copy.ExtractBigData(versiontable);
831859 // if (copy == client)
832860
833
- byte[] versions[] = copy.versions;
834
- copy.versions = null;
861
+ Object3D versions[] = copy.versionlist;
862
+ copy.versionlist = null;
835863
836
- byte[] compress = Compress(copy);
864
+ //byte[] compress = Compress(copy);
865
+ Object3D compress = (Object3D)Grafreed.clone(copy);
837866
838
- copy.versions = versions;
867
+ copy.versionlist = versions;
839868
840869 copy.RestoreBigData(versiontable);
841870
....@@ -965,6 +994,7 @@
965994 {
966995 SetupMaterial(materialPanel);
967996 }
997
+
968998 //SetupName();
969999 //SetupViews();
9701000 }
....@@ -1194,6 +1224,8 @@
11941224 hideCB.setToolTipText("Hide object");
11951225 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
11961226 markCB.setToolTipText("As animation target transform");
1227
+
1228
+ ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
11971229
11981230 setupPanel2 = new cGridBag().setVertical(false);
11991231
....@@ -1520,22 +1552,28 @@
15201552 //tmp.setName("Edit");
15211553 objectPanel.add(materialPanel);
15221554 objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1555
+ objectPanel.setToolTipTextAt(0, "Material");
1556
+
15231557 // JPanel north = new JPanel(new BorderLayout());
15241558 // north.setName("Edit");
15251559 // north.add(ctrlPanel, BorderLayout.NORTH);
15261560 // objectPanel.add(north);
15271561 objectPanel.add(editPanel);
15281562 objectPanel.setIconAt(1, GetIcon("icons/write.png"));
1563
+ objectPanel.setToolTipTextAt(1, "Edit controls");
15291564
15301565 //if (Globals.ADVANCED)
15311566 objectPanel.add(infoPanel);
15321567 objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1568
+ objectPanel.setToolTipTextAt(2, "Information");
15331569
15341570 objectPanel.add(XYZPanel);
15351571 objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
1572
+ objectPanel.setToolTipTextAt(3, "XYZ/RGB transform");
15361573
15371574 objectPanel.add(toolboxPanel);
15381575 objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
1576
+ objectPanel.setToolTipTextAt(4, "Objects & backgrounds");
15391577
15401578 /*
15411579 aConstraints.gridx = 0;
....@@ -1675,7 +1713,6 @@
16751713 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
16761714 frame.addWindowListener(new WindowAdapter()
16771715 {
1678
-
16791716 public void windowClosing(WindowEvent e)
16801717 {
16811718 Close();
....@@ -1698,12 +1735,56 @@
16981735 ctrlPanel.removeAll();
16991736 }
17001737
1701
- void SetupMaterial(cGridBag panel)
1738
+ void SetupMaterial(cGridBag materialpanel)
17021739 {
1703
- /*
1740
+ cGridBag presetpanel = new cGridBag().setVertical(true);
1741
+ cLabel label = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
1742
+ label.addMouseListener(new MouseAdapter()
1743
+ {
1744
+ public void mouseClicked(MouseEvent e)
1745
+ {
1746
+ colorField.setFloat(0);
1747
+ saturationField.setFloat(1);
1748
+ materialtouched = true;
1749
+ applySelf();
1750
+ }
1751
+ });
1752
+ presetpanel.add(label);
1753
+
1754
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF));
1755
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF));
1756
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF));
1757
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF));
1758
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF));
1759
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF));
1760
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF));
1761
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF));
1762
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF));
1763
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF));
1764
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF));
1765
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF));
1766
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF));
1767
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF));
1768
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF));
1769
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF));
1770
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF));
1771
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF));
1772
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00019.png", !Grafreed.NIMBUSLAF));
1773
+ presetpanel.add(GetLabel("icons/shadericons/shadericon00020.png", !Grafreed.NIMBUSLAF));
1774
+
1775
+ cGridBag panel = new cGridBag().setVertical(true);
1776
+
1777
+ presetpanel.preferredWidth = 1;
1778
+
1779
+ materialpanel.add(panel);
1780
+ materialpanel.add(presetpanel);
1781
+
1782
+ panel.preferredWidth = 8;
1783
+
1784
+ /*
17041785 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
17051786 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1706
- */
1787
+ */
17071788
17081789 cGridBag editBar = new cGridBag().setVertical(false);
17091790
....@@ -1737,27 +1818,50 @@
17371818 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17381819
17391820 cGridBag colorSection = new cGridBag().setVertical(true);
1821
+
1822
+ cGridBag huepanel = new cGridBag();
1823
+ cGridBag huelabel = new cGridBag();
1824
+ label = GetLabel("icons/hue.png", false);
1825
+ label.fit = true;
1826
+ huelabel.add(label);
1827
+ huelabel.preferredWidth = 20;
1828
+ huepanel.add(new cGridBag()); // Label
1829
+ huepanel.add(huelabel); // Field/slider
1830
+
1831
+ huepanel.preferredHeight = 7;
1832
+
1833
+ colorSection.add(huepanel);
17401834
17411835 cGridBag color = new cGridBag();
1742
- color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1743
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1744
- color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1836
+
1837
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1838
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1839
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
1840
+
17451841 //colorField.preferredWidth = 200;
17461842 colorSection.add(color);
17471843
17481844 cGridBag modulation = new cGridBag();
17491845 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
17501846 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1751
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1847
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
17521848 colorSection.add(modulation);
17531849
1850
+ cGridBag opacity = new cGridBag();
1851
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1852
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1853
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
1854
+ colorSection.add(opacity);
1855
+
1856
+ colorSection.add(GetSeparator());
1857
+
17541858 cGridBag texture = new cGridBag();
17551859 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
17561860 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17571861 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
17581862 colorSection.add(texture);
17591863
1760
- panel.add(new JSeparator());
1864
+ panel.add(GetSeparator());
17611865
17621866 panel.add(colorSection);
17631867
....@@ -1813,7 +1917,7 @@
18131917 shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
18141918 diffuseSection.add(shadowbias);
18151919
1816
- panel.add(new JSeparator());
1920
+ panel.add(GetSeparator());
18171921
18181922 panel.add(diffuseSection);
18191923
....@@ -1876,7 +1980,7 @@
18761980 specularSection.add(anisoV);
18771981
18781982
1879
- panel.add(new JSeparator());
1983
+ panel.add(GetSeparator());
18801984
18811985 panel.add(specularSection);
18821986
....@@ -1901,12 +2005,6 @@
19012005 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
19022006 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
19032007 colorSection.add(backlit);
1904
-
1905
- cGridBag opacity = new cGridBag();
1906
- opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1907
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1908
- opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1909
- colorSection.add(opacity);
19102008
19112009 //panel.add(new JSeparator());
19122010
....@@ -1952,7 +2050,7 @@
19522050 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
19532051 textureSection.add(opacityPower);
19542052
1955
- panel.add(new JSeparator());
2053
+ panel.add(GetSeparator());
19562054
19572055 panel.add(textureSection);
19582056
....@@ -2939,7 +3037,7 @@
29393037
29403038 freezematerial = true;
29413039 colorField.setFloat(mat.color);
2942
- modulationField.setFloat(mat.modulation);
3040
+ saturationField.setFloat(mat.modulation);
29433041 metalnessField.setFloat(mat.metalness);
29443042 diffuseField.setFloat(mat.diffuse);
29453043 specularField.setFloat(mat.specular);
....@@ -3250,6 +3348,7 @@
32503348 } else if (event.getSource() == liveCB)
32513349 {
32523350 copy.live ^= true;
3351
+ objEditor.refreshContents(true); // To show item colors
32533352 return;
32543353 } else if (event.getSource() == selectableCB)
32553354 {
....@@ -3259,7 +3358,7 @@
32593358 {
32603359 copy.hide ^= true;
32613360 copy.Touch(); // display list issue
3262
- objEditor.refreshContents();
3361
+ objEditor.refreshContents(true); // To show item colors
32633362 return;
32643363 } else if (event.getSource() == link2masterCB)
32653364 {
....@@ -3515,6 +3614,7 @@
35153614
35163615 static public byte[] Compress(Object3D o)
35173616 {
3617
+ // Slower to actually compress.
35183618 try
35193619 {
35203620 ByteArrayOutputStream baos = new ByteArrayOutputStream();
....@@ -3616,6 +3716,7 @@
36163716 {
36173717 //Save(true);
36183718 Replace();
3719
+ SetUndoStates();
36193720 }
36203721
36213722 private boolean Equal(byte[] compress, byte[] name)
....@@ -3639,18 +3740,18 @@
36393740 public boolean Save(boolean user)
36403741 {
36413742 System.err.println("Save");
3743
+ Replace();
36423744
36433745 cRadio tab = GetCurrentTab();
36443746
3645
- byte[] compress = CompressCopy();
3747
+ Object3D compress = CompressCopy(); // Saved version. No need for "Replace".
36463748
36473749 boolean thesame = false;
36483750
3649
- // Quick heuristic using length. Works only when stream is compressed.
3650
- if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3651
- {
3652
- thesame = true;
3653
- }
3751
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3752
+// {
3753
+// thesame = true;
3754
+// }
36543755
36553756 //EditorFrame.m_MainFrame.requestFocusInWindow();
36563757 if (!thesame)
....@@ -3658,7 +3759,7 @@
36583759 //tab.user[tab.versionindex] = user;
36593760 //boolean increment = true; // tab.graphs[tab.versionindex] == null;
36603761
3661
- copy.versions[++copy.versionindex] = compress;
3762
+ copy.versionlist[++copy.versionindex] = compress;
36623763
36633764 // if (increment)
36643765 // tab.versionindex++;
....@@ -3668,10 +3769,10 @@
36683769
36693770 //assert(hashtable.isEmpty());
36703771
3671
- for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3772
+ for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
36723773 {
36733774 //tab.user[i] = false;
3674
- copy.versions[i] = null;
3775
+ copy.versionlist[i] = null;
36753776 }
36763777
36773778 SetUndoStates();
....@@ -3697,6 +3798,38 @@
36973798
36983799 return !thesame;
36993800 }
3801
+
3802
+ boolean flashIt = true;
3803
+
3804
+ void RefreshSelection()
3805
+ {
3806
+ Object3D selection = new Object3D();
3807
+
3808
+ for (int i = 0; i < copy.selection.size(); i++)
3809
+ {
3810
+ Object3D elem = copy.selection.elementAt(i);
3811
+
3812
+ Object3D obj = copy.GetObject(elem.GetUUID());
3813
+
3814
+ if (obj == null)
3815
+ {
3816
+ copy.selection.remove(i--);
3817
+ }
3818
+ else
3819
+ {
3820
+ selection.add(obj);
3821
+ copy.selection.setElementAt(obj, i);
3822
+ }
3823
+ }
3824
+
3825
+ flashIt = false;
3826
+ GetTree().clearSelection();
3827
+ for (int i = 0; i < selection.size(); i++)
3828
+ GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath());
3829
+ flashIt = true;
3830
+
3831
+ refreshContents(false);
3832
+ }
37003833
37013834 void CopyChanged(Object3D obj)
37023835 {
....@@ -3709,6 +3842,9 @@
37093842
37103843 copy.clear();
37113844
3845
+ copy.skyboxname = obj.skyboxname;
3846
+ copy.skyboxext = obj.skyboxext;
3847
+
37123848 for (int i=0; i<obj.Size(); i++)
37133849 {
37143850 copy.add(obj.get(i));
....@@ -3718,6 +3854,7 @@
37183854
37193855 CameraPane.SWITCH = temp;
37203856
3857
+ RefreshSelection();
37213858 //assert(hashtable.isEmpty());
37223859
37233860 copy.Touch();
....@@ -3752,9 +3889,9 @@
37523889 {
37533890 int count = 0;
37543891
3755
- for (int i = copy.versions.length; --i >= 0;)
3892
+ for (int i = copy.versionlist.length; --i >= 0;)
37563893 {
3757
- if (copy.versions[i] != null)
3894
+ if (copy.versionlist[i] != null)
37583895 count++;
37593896 }
37603897
....@@ -3769,7 +3906,7 @@
37693906 replaceButton.setEnabled(copy.versionindex != -1);
37703907
37713908 undoButton.setEnabled(copy.versionindex > 0);
3772
- redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
3909
+ redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
37733910
37743911 muteSlider = true;
37753912 versionSlider.setMaximum(VersionCount() - 1);
....@@ -3807,7 +3944,7 @@
38073944
38083945 copy.versionindex -= 1;
38093946
3810
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3947
+ CopyChanged((Object3D)copy.versionlist[copy.versionindex]);
38113948
38123949 return true;
38133950 }
....@@ -3818,13 +3955,14 @@
38183955
38193956 cRadio tab = GetCurrentTab();
38203957
3821
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3958
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38223959 {
38233960 java.awt.Toolkit.getDefaultToolkit().beep();
38243961 return false;
38253962 }
38263963
3827
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3964
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3965
+ CopyChanged(copy.versionlist[copy.versionindex]);
38283966
38293967 return true;
38303968 }
....@@ -3835,13 +3973,13 @@
38353973
38363974 cRadio tab = GetCurrentTab();
38373975
3838
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3976
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38393977 {
38403978 // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
38413979 return false;
38423980 }
38433981
3844
- copy.versions[copy.versionindex] = CompressCopy();
3982
+ copy.versionlist[copy.versionindex] = CompressCopy();
38453983
38463984 return true;
38473985 }
....@@ -3853,7 +3991,7 @@
38533991
38543992 cRadio tab = GetCurrentTab();
38553993
3856
- if (copy.versions[copy.versionindex + 1] == null)
3994
+ if (copy.versionlist[copy.versionindex + 1] == null)
38573995 {
38583996 java.awt.Toolkit.getDefaultToolkit().beep();
38593997 return;
....@@ -3861,7 +3999,7 @@
38613999
38624000 copy.versionindex += 1;
38634001
3864
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4002
+ CopyChanged(copy.versionlist[copy.versionindex]);
38654003
38664004 //if (!tab.user[tab.versionindex])
38674005 // tab.graphs[tab.versionindex] = null;
....@@ -4075,7 +4213,7 @@
40754213 //copy.material = new cMaterial(copy.GetMaterial());
40764214
40774215 current.color = (float) colorField.getFloat();
4078
- current.modulation = (float) modulationField.getFloat();
4216
+ current.modulation = (float) saturationField.getFloat();
40794217 current.metalness = (float) metalnessField.getFloat();
40804218 current.diffuse = (float) diffuseField.getFloat();
40814219 current.specular = (float) specularField.getFloat();
....@@ -4108,7 +4246,7 @@
41084246 cMaterial mat = copy.material;
41094247
41104248 colorField.SetToolTipValue((mat.color));
4111
- modulationField.SetToolTipValue((mat.modulation));
4249
+ saturationField.SetToolTipValue((mat.modulation));
41124250 metalnessField.SetToolTipValue((mat.metalness));
41134251 diffuseField.SetToolTipValue((mat.diffuse));
41144252 specularField.SetToolTipValue((mat.specular));
....@@ -4172,9 +4310,9 @@
41724310
41734311 int version = versionSlider.getInteger();
41744312
4175
- if (copy.versions[version] != null)
4313
+ if (copy.versionlist[version] != null)
41764314 {
4177
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version]));
4315
+ CopyChanged(copy.versionlist[copy.versionindex = version]);
41784316 }
41794317
41804318 return;
....@@ -4214,6 +4352,12 @@
42144352 {
42154353 //System.out.println("stateChanged = " + this);
42164354 materialtouched = true;
4355
+
4356
+ if (e.getSource() == colorField && saturationField.getFloat() == 0.001)
4357
+ {
4358
+ saturationField.setFloat(1);
4359
+ }
4360
+
42174361 applySelf();
42184362 //System.out.println("this = " + this);
42194363 //System.out.println("PARENT = " + parent);
....@@ -4513,6 +4657,7 @@
45134657 {
45144658 if (GetTree() != null)
45154659 {
4660
+ GetTree().revalidate();
45164661 GetTree().repaint();
45174662 }
45184663
....@@ -4769,7 +4914,9 @@
47694914 readobj.ResetDisplayList();
47704915 } catch (Exception e)
47714916 {
4772
- //e.printStackTrace();
4917
+ if (!e.toString().contains("GZIP"))
4918
+ e.printStackTrace();
4919
+
47734920 try
47744921 {
47754922 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
....@@ -4849,6 +4996,8 @@
48494996 {
48504997 //readobj.deepCopySelf(copy);
48514998 copy.clear(); // june 2014
4999
+ copy.skyboxname = readobj.skyboxname;
5000
+ copy.skyboxext = readobj.skyboxext;
48525001 for (int i = 0; i < readobj.size(); i++)
48535002 {
48545003 Object3D child = readobj.get(i); // reserve(i);
....@@ -4889,6 +5038,7 @@
48895038 }
48905039 } catch (ClassCastException e)
48915040 {
5041
+ e.printStackTrace();
48925042 assert (false);
48935043 Composite c = (Composite) copy;
48945044 c.children.clear();
....@@ -4899,12 +5049,12 @@
48995049 c.addChild(csg);
49005050 }
49015051
4902
- copy.versions = readobj.versions;
5052
+ copy.versionlist = readobj.versionlist;
49035053 copy.versionindex = readobj.versionindex;
49045054
4905
- if (copy.versions == null)
5055
+ if (copy.versionlist == null)
49065056 {
4907
- copy.versions = new byte[100][];
5057
+ copy.versionlist = new Object3D[100];
49085058 copy.versionindex = -1;
49095059 }
49105060
....@@ -5019,6 +5169,7 @@
50195169 //ps.print(buffer.toString());
50205170 } catch (IOException e)
50215171 {
5172
+ e.printStackTrace();
50225173 }
50235174 }
50245175
....@@ -5311,7 +5462,7 @@
53115462 JLabel colorLabel;
53125463 cNumberSlider colorField;
53135464 JLabel modulationLabel;
5314
- cNumberSlider modulationField;
5465
+ cNumberSlider saturationField;
53155466 JLabel metalnessLabel;
53165467 cNumberSlider metalnessField;
53175468 JLabel diffuseLabel;