Normand Briere
2019-08-04 0c85af6e46f48b7425d59fc776b193c06a4a1f52
Material icons
5 files modified
45 files added
253 ■■■■ changed files
CameraPane.java 8 ●●●● patch | view | raw | blame | history
GroupEditor.java 28 ●●●●● patch | view | raw | blame | history
ObjEditor.java 174 ●●●● patch | view | raw | blame | history
Object3D.java 30 ●●●●● patch | view | raw | blame | history
cLabel.java 13 ●●●● patch | view | raw | blame | history
icons/broom.png patch | view | raw | blame | history
icons/clear.png patch | view | raw | blame | history
icons/shadericons/shadericon00000.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00000.png patch | view | raw | blame | history
icons/shadericons/shadericon00001.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00001.png patch | view | raw | blame | history
icons/shadericons/shadericon00002.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00002.png patch | view | raw | blame | history
icons/shadericons/shadericon00003.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00003.png patch | view | raw | blame | history
icons/shadericons/shadericon00004.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00004.png patch | view | raw | blame | history
icons/shadericons/shadericon00005.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00005.png patch | view | raw | blame | history
icons/shadericons/shadericon00006.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00006.png patch | view | raw | blame | history
icons/shadericons/shadericon00007.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00007.png patch | view | raw | blame | history
icons/shadericons/shadericon00008.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00008.png patch | view | raw | blame | history
icons/shadericons/shadericon00009.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00009.png patch | view | raw | blame | history
icons/shadericons/shadericon00010.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00010.png patch | view | raw | blame | history
icons/shadericons/shadericon00011.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00011.png patch | view | raw | blame | history
icons/shadericons/shadericon00012.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00012.png patch | view | raw | blame | history
icons/shadericons/shadericon00013.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00013.png patch | view | raw | blame | history
icons/shadericons/shadericon00014.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00014.png patch | view | raw | blame | history
icons/shadericons/shadericon00015.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00015.png patch | view | raw | blame | history
icons/shadericons/shadericon00016.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00016.png patch | view | raw | blame | history
icons/shadericons/shadericon00017.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00017.png patch | view | raw | blame | history
icons/shadericons/shadericon00018.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00018.png patch | view | raw | blame | history
icons/shadericons/shadericon00019.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00019.png patch | view | raw | blame | history
icons/shadericons/shadericon00020.jpg patch | view | raw | blame | history
icons/shadericons/shadericon00020.png patch | view | raw | blame | history
icons/sphererender.gfd patch | view | raw | blame | history
CameraPane.java
....@@ -14632,9 +14632,9 @@
1463214632 MODIFIERS |= COMMAND;
1463314633 /**/
1463414634 if((mod&SHIFT) == SHIFT)
14635
- manipCamera.RotatePosition(0, -speed);
14636
- else
1463714635 manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14636
+ else
14637
+ manipCamera.RotatePosition(0, -speed);
1463814638 /**/
1463914639 if ((mod & SHIFT) == SHIFT)
1464014640 {
....@@ -14653,9 +14653,9 @@
1465314653 MODIFIERS |= COMMAND;
1465414654 /**/
1465514655 if((mod&SHIFT) == SHIFT)
14656
- manipCamera.RotatePosition(0, speed);
14657
- else
1465814656 manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14657
+ else
14658
+ manipCamera.RotatePosition(0, speed);
1465914659 /**/
1466014660 if ((mod & SHIFT) == SHIFT)
1466114661 {
GroupEditor.java
....@@ -356,9 +356,9 @@
356356 this.copy = this.group = group;
357357 //selectees = this.group.selectees;
358358
359
- if (copy.versions == null)
359
+ if (copy.versionlist == null)
360360 {
361
- copy.versions = new Object3D[100];
361
+ copy.versionlist = new Object3D[100];
362362 copy.versionindex = -1;
363363 }
364364
....@@ -383,9 +383,9 @@
383383
384384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385385
386
- if (copy.versions == null)
386
+ if (copy.versionlist == null)
387387 {
388
- copy.versions = new Object3D[100];
388
+ copy.versionlist = new Object3D[100];
389389 copy.versionindex = -1;
390390
391391 Save(true);
....@@ -942,12 +942,12 @@
942942
943943 cGridBag updown = new cGridBag().setVertical(true);
944944 updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
- restoreButton.setToolTipText("Restore current version (undo latest change)");
945
+ restoreButton.setToolTipText("Undo (restore current version)");
946946 restoreButton.addActionListener(this);
947947 restoreButton.setEnabled(false);
948948
949949 updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
- replaceButton.setToolTipText("Replace current version (save latest change)");
950
+ replaceButton.setToolTipText("Save (replace current version)");
951951 replaceButton.addActionListener(this);
952952 replaceButton.setEnabled(false);
953953
....@@ -1110,14 +1110,14 @@
11101110 editButton.addActionListener(this);
11111111
11121112 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
- uneditButton.setToolTipText("Remove selection controls");
1113
+ uneditButton.setToolTipText("Unpin and remove selection controls");
11141114 uneditButton.addActionListener(this);
11151115
11161116 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
11171117 allParamsButton.setToolTipText("Show all controle");
11181118 allParamsButton.addActionListener(this);
11191119
1120
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1120
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11211121 clearPanelButton.setToolTipText("Clear edit panel");
11221122 clearPanelButton.addActionListener(this);
11231123
....@@ -2613,11 +2613,13 @@
26132613 {
26142614 // Restore current version
26152615 Restore();
2616
+ restoreButton.setEnabled(false);
26162617 } else
26172618 if (source == replaceButton)
26182619 {
26192620 // Overwrite current version
26202621 Replace();
2622
+ replaceButton.setEnabled(false);
26212623 } else
26222624 if (source == redoButton)
26232625 {
....@@ -3820,10 +3822,10 @@
38203822 {
38213823 Object3D child = (Object3D)e.nextElement();
38223824 if(child.editWindow != null)
3823
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38243825 child.pinned = false;
38253826 child.CloseUI();
38263827 listUI.remove(child);
3828
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38273829
38283830 //child.editWindow = null; // ???????????
38293831 }
....@@ -3842,6 +3844,7 @@
38423844 obj.CloseUI();
38433845 }
38443846 listUI.clear();
3847
+ SetPinStates(group.selection.size() > 0);
38453848 refreshContents(true);
38463849 } else
38473850 if (source == allParamsButton)
....@@ -3928,6 +3931,7 @@
39283931 radio.layout.doClick();
39293932
39303933 ClearUnpinned();
3934
+
39313935 //Grafreed.Assert(group != null);
39323936 //Grafreed.Assert(group.selection != null);
39333937 SetPinStates(group.selection == null || group.selection.size() > 0);
....@@ -5083,9 +5087,7 @@
50835087
50845088 freezemodel = false;
50855089 }
5086
-
5087
- boolean flashIt = true;
5088
-
5090
+
50895091 public void valueChanged(TreeSelectionEvent e)
50905092 //public boolean handleEvent(Event event)
50915093 {
....@@ -5160,6 +5162,8 @@
51605162 uneditButton.setEnabled(enabled);
51615163 unselectButton.setEnabled(enabled);
51625164 flashSelectionButton.setEnabled(enabled);
5165
+
5166
+ clearPanelButton.setEnabled(!listUI.isEmpty());
51635167 }
51645168
51655169 void refreshContents(boolean cp)
ObjEditor.java
....@@ -296,9 +296,9 @@
296296 client = inClient;
297297 copy = client;
298298
299
- if (copy.versions == null)
299
+ if (copy.versionlist == null)
300300 {
301
- copy.versions = new Object3D[100];
301
+ copy.versionlist = new Object3D[100];
302302 copy.versionindex = -1;
303303 }
304304
....@@ -315,9 +315,9 @@
315315 client = inClient;
316316 copy = client;
317317
318
- if (copy.versions == null)
318
+ if (copy.versionlist == null)
319319 {
320
- copy.versions = new Object3D[100];
320
+ copy.versionlist = new Object3D[100];
321321 copy.versionindex = -1;
322322 }
323323
....@@ -353,7 +353,7 @@
353353 copy = localCopy;
354354 copy.editWindow = this;
355355
356
- if (copy.versions == null)
356
+ if (copy.versionlist == null)
357357 {
358358 // copy.versions = new byte[100][];
359359 // copy.versionindex = -1;
....@@ -467,7 +467,7 @@
467467 toolboxPanel = new cGridBag().setVertical(true);
468468 //toolboxPanel.setName("Toolbox");
469469
470
- materialPanel = new cGridBag().setVertical(true);
470
+ materialPanel = new cGridBag().setVertical(false);
471471 //materialPanel.setName("Material");
472472
473473 /*JTextPane*/
....@@ -858,13 +858,13 @@
858858 copy.ExtractBigData(versiontable);
859859 // if (copy == client)
860860
861
- Object3D versions[] = copy.versions;
862
- copy.versions = null;
861
+ Object3D versions[] = copy.versionlist;
862
+ copy.versionlist = null;
863863
864864 //byte[] compress = Compress(copy);
865865 Object3D compress = (Object3D)Grafreed.clone(copy);
866866
867
- copy.versions = versions;
867
+ copy.versionlist = versions;
868868
869869 copy.RestoreBigData(versiontable);
870870
....@@ -994,6 +994,7 @@
994994 {
995995 SetupMaterial(materialPanel);
996996 }
997
+
997998 //SetupName();
998999 //SetupViews();
9991000 }
....@@ -1551,7 +1552,7 @@
15511552 //tmp.setName("Edit");
15521553 objectPanel.add(materialPanel);
15531554 objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1554
- objectPanel.setToolTipTextAt(0, "Material panel");
1555
+ objectPanel.setToolTipTextAt(0, "Material");
15551556
15561557 // JPanel north = new JPanel(new BorderLayout());
15571558 // north.setName("Edit");
....@@ -1559,20 +1560,20 @@
15591560 // objectPanel.add(north);
15601561 objectPanel.add(editPanel);
15611562 objectPanel.setIconAt(1, GetIcon("icons/write.png"));
1562
- objectPanel.setToolTipTextAt(1, "Edit panel");
1563
+ objectPanel.setToolTipTextAt(1, "Edit controls");
15631564
15641565 //if (Globals.ADVANCED)
15651566 objectPanel.add(infoPanel);
15661567 objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1567
- objectPanel.setToolTipTextAt(2, "Info panel");
1568
+ objectPanel.setToolTipTextAt(2, "Information");
15681569
15691570 objectPanel.add(XYZPanel);
15701571 objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
1571
- objectPanel.setToolTipTextAt(3, "XYZ/RGB panel");
1572
+ objectPanel.setToolTipTextAt(3, "XYZ/RGB transform");
15721573
15731574 objectPanel.add(toolboxPanel);
15741575 objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
1575
- objectPanel.setToolTipTextAt(4, "Objects/backgrounds panel");
1576
+ objectPanel.setToolTipTextAt(4, "Objects & backgrounds");
15761577
15771578 /*
15781579 aConstraints.gridx = 0;
....@@ -1734,12 +1735,56 @@
17341735 ctrlPanel.removeAll();
17351736 }
17361737
1737
- void SetupMaterial(cGridBag panel)
1738
+ void SetupMaterial(cGridBag materialpanel)
17381739 {
1739
- /*
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
+ /*
17401785 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
17411786 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1742
- */
1787
+ */
17431788
17441789 cGridBag editBar = new cGridBag().setVertical(false);
17451790
....@@ -1776,7 +1821,9 @@
17761821
17771822 cGridBag huepanel = new cGridBag();
17781823 cGridBag huelabel = new cGridBag();
1779
- huelabel.add(GetLabel("icons/hue.png", false));
1824
+ label = GetLabel("icons/hue.png", false);
1825
+ label.fit = true;
1826
+ huelabel.add(label);
17801827 huelabel.preferredWidth = 20;
17811828 huepanel.add(new cGridBag()); // Label
17821829 huepanel.add(huelabel); // Field/slider
....@@ -1797,7 +1844,7 @@
17971844 cGridBag modulation = new cGridBag();
17981845 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
17991846 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1800
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
1847
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
18011848 colorSection.add(modulation);
18021849
18031850 cGridBag opacity = new cGridBag();
....@@ -2990,7 +3037,7 @@
29903037
29913038 freezematerial = true;
29923039 colorField.setFloat(mat.color);
2993
- modulationField.setFloat(mat.modulation);
3040
+ saturationField.setFloat(mat.modulation);
29943041 metalnessField.setFloat(mat.metalness);
29953042 diffuseField.setFloat(mat.diffuse);
29963043 specularField.setFloat(mat.specular);
....@@ -3301,6 +3348,7 @@
33013348 } else if (event.getSource() == liveCB)
33023349 {
33033350 copy.live ^= true;
3351
+ objEditor.refreshContents(true); // To show item colors
33043352 return;
33053353 } else if (event.getSource() == selectableCB)
33063354 {
....@@ -3310,7 +3358,7 @@
33103358 {
33113359 copy.hide ^= true;
33123360 copy.Touch(); // display list issue
3313
- objEditor.refreshContents();
3361
+ objEditor.refreshContents(true); // To show item colors
33143362 return;
33153363 } else if (event.getSource() == link2masterCB)
33163364 {
....@@ -3668,6 +3716,7 @@
36683716 {
36693717 //Save(true);
36703718 Replace();
3719
+ SetUndoStates();
36713720 }
36723721
36733722 private boolean Equal(byte[] compress, byte[] name)
....@@ -3691,6 +3740,7 @@
36913740 public boolean Save(boolean user)
36923741 {
36933742 System.err.println("Save");
3743
+ Replace();
36943744
36953745 cRadio tab = GetCurrentTab();
36963746
....@@ -3709,7 +3759,7 @@
37093759 //tab.user[tab.versionindex] = user;
37103760 //boolean increment = true; // tab.graphs[tab.versionindex] == null;
37113761
3712
- copy.versions[++copy.versionindex] = compress;
3762
+ copy.versionlist[++copy.versionindex] = compress;
37133763
37143764 // if (increment)
37153765 // tab.versionindex++;
....@@ -3719,10 +3769,10 @@
37193769
37203770 //assert(hashtable.isEmpty());
37213771
3722
- for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3772
+ for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
37233773 {
37243774 //tab.user[i] = false;
3725
- copy.versions[i] = null;
3775
+ copy.versionlist[i] = null;
37263776 }
37273777
37283778 SetUndoStates();
....@@ -3748,6 +3798,38 @@
37483798
37493799 return !thesame;
37503800 }
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
+ }
37513833
37523834 void CopyChanged(Object3D obj)
37533835 {
....@@ -3772,6 +3854,7 @@
37723854
37733855 CameraPane.SWITCH = temp;
37743856
3857
+ RefreshSelection();
37753858 //assert(hashtable.isEmpty());
37763859
37773860 copy.Touch();
....@@ -3806,9 +3889,9 @@
38063889 {
38073890 int count = 0;
38083891
3809
- for (int i = copy.versions.length; --i >= 0;)
3892
+ for (int i = copy.versionlist.length; --i >= 0;)
38103893 {
3811
- if (copy.versions[i] != null)
3894
+ if (copy.versionlist[i] != null)
38123895 count++;
38133896 }
38143897
....@@ -3823,7 +3906,7 @@
38233906 replaceButton.setEnabled(copy.versionindex != -1);
38243907
38253908 undoButton.setEnabled(copy.versionindex > 0);
3826
- redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
3909
+ redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
38273910
38283911 muteSlider = true;
38293912 versionSlider.setMaximum(VersionCount() - 1);
....@@ -3861,7 +3944,7 @@
38613944
38623945 copy.versionindex -= 1;
38633946
3864
- CopyChanged((Object3D)copy.versions[copy.versionindex]);
3947
+ CopyChanged((Object3D)copy.versionlist[copy.versionindex]);
38653948
38663949 return true;
38673950 }
....@@ -3872,14 +3955,14 @@
38723955
38733956 cRadio tab = GetCurrentTab();
38743957
3875
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3958
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38763959 {
38773960 java.awt.Toolkit.getDefaultToolkit().beep();
38783961 return false;
38793962 }
38803963
38813964 //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3882
- CopyChanged(copy.versions[copy.versionindex]);
3965
+ CopyChanged(copy.versionlist[copy.versionindex]);
38833966
38843967 return true;
38853968 }
....@@ -3890,13 +3973,13 @@
38903973
38913974 cRadio tab = GetCurrentTab();
38923975
3893
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3976
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38943977 {
38953978 // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
38963979 return false;
38973980 }
38983981
3899
- copy.versions[copy.versionindex] = CompressCopy();
3982
+ copy.versionlist[copy.versionindex] = CompressCopy();
39003983
39013984 return true;
39023985 }
....@@ -3908,7 +3991,7 @@
39083991
39093992 cRadio tab = GetCurrentTab();
39103993
3911
- if (copy.versions[copy.versionindex + 1] == null)
3994
+ if (copy.versionlist[copy.versionindex + 1] == null)
39123995 {
39133996 java.awt.Toolkit.getDefaultToolkit().beep();
39143997 return;
....@@ -3916,7 +3999,7 @@
39163999
39174000 copy.versionindex += 1;
39184001
3919
- CopyChanged(copy.versions[copy.versionindex]);
4002
+ CopyChanged(copy.versionlist[copy.versionindex]);
39204003
39214004 //if (!tab.user[tab.versionindex])
39224005 // tab.graphs[tab.versionindex] = null;
....@@ -4130,7 +4213,7 @@
41304213 //copy.material = new cMaterial(copy.GetMaterial());
41314214
41324215 current.color = (float) colorField.getFloat();
4133
- current.modulation = (float) modulationField.getFloat();
4216
+ current.modulation = (float) saturationField.getFloat();
41344217 current.metalness = (float) metalnessField.getFloat();
41354218 current.diffuse = (float) diffuseField.getFloat();
41364219 current.specular = (float) specularField.getFloat();
....@@ -4163,7 +4246,7 @@
41634246 cMaterial mat = copy.material;
41644247
41654248 colorField.SetToolTipValue((mat.color));
4166
- modulationField.SetToolTipValue((mat.modulation));
4249
+ saturationField.SetToolTipValue((mat.modulation));
41674250 metalnessField.SetToolTipValue((mat.metalness));
41684251 diffuseField.SetToolTipValue((mat.diffuse));
41694252 specularField.SetToolTipValue((mat.specular));
....@@ -4227,9 +4310,9 @@
42274310
42284311 int version = versionSlider.getInteger();
42294312
4230
- if (copy.versions[version] != null)
4313
+ if (copy.versionlist[version] != null)
42314314 {
4232
- CopyChanged(copy.versions[copy.versionindex = version]);
4315
+ CopyChanged(copy.versionlist[copy.versionindex = version]);
42334316 }
42344317
42354318 return;
....@@ -4269,6 +4352,12 @@
42694352 {
42704353 //System.out.println("stateChanged = " + this);
42714354 materialtouched = true;
4355
+
4356
+ if (e.getSource() == colorField && saturationField.getFloat() == 0.001)
4357
+ {
4358
+ saturationField.setFloat(1);
4359
+ }
4360
+
42724361 applySelf();
42734362 //System.out.println("this = " + this);
42744363 //System.out.println("PARENT = " + parent);
....@@ -4568,6 +4657,7 @@
45684657 {
45694658 if (GetTree() != null)
45704659 {
4660
+ GetTree().revalidate();
45714661 GetTree().repaint();
45724662 }
45734663
....@@ -4959,12 +5049,12 @@
49595049 c.addChild(csg);
49605050 }
49615051
4962
- copy.versions = readobj.versions;
5052
+ copy.versionlist = readobj.versionlist;
49635053 copy.versionindex = readobj.versionindex;
49645054
4965
- if (copy.versions == null)
5055
+ if (copy.versionlist == null)
49665056 {
4967
- copy.versions = new Object3D[100];
5057
+ copy.versionlist = new Object3D[100];
49685058 copy.versionindex = -1;
49695059 }
49705060
....@@ -5372,7 +5462,7 @@
53725462 JLabel colorLabel;
53735463 cNumberSlider colorField;
53745464 JLabel modulationLabel;
5375
- cNumberSlider modulationField;
5465
+ cNumberSlider saturationField;
53765466 JLabel metalnessLabel;
53775467 cNumberSlider metalnessField;
53785468 JLabel diffuseLabel;
Object3D.java
....@@ -22,6 +22,7 @@
2222 //static final long serialVersionUID = -607422624994562685L;
2323 static final long serialVersionUID = 5022536242724664900L;
2424
25
+ // Use GetUUID for backward compatibility with null.
2526 private UUID uuid = UUID.randomUUID();
2627
2728 // TEMPORARY for mocap undo. No need to be transient.
....@@ -32,7 +33,7 @@
3233 String skyboxname;
3334 String skyboxext;
3435
35
- Object3D versions[];
36
+ Object3D versionlist[];
3637 int versionindex = -1;
3738
3839 ScriptNode scriptnode;
....@@ -222,7 +223,7 @@
222223 // o.bRep.support = null;
223224 // }
224225 o.selection = this.selection;
225
- o.versions = this.versions;
226
+ o.versionlist = this.versionlist;
226227 o.versionindex = this.versionindex;
227228
228229 if (this.support != null)
....@@ -245,6 +246,29 @@
245246 // this.support = null;
246247 // this.fileparent = null;
247248 }
249
+
250
+// Object3D GetObject(java.util.UUID uuid)
251
+// {
252
+// if (this.uuid.equals(uuid))
253
+// return this;
254
+//
255
+// if (blockloop)
256
+// return null;
257
+//
258
+// blockloop = true;
259
+//
260
+// for (int i=0; i<Size(); i++)
261
+// {
262
+// Object3D o = get(i).GetObject(uuid);
263
+//
264
+// if (o != null)
265
+// return o;
266
+// }
267
+//
268
+// blockloop = false;
269
+//
270
+// return null;
271
+// }
248272
249273 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
250274 {
....@@ -280,7 +304,7 @@
280304
281305 this.selection = o.selection;
282306
283
- this.versions = o.versions;
307
+ this.versionlist = o.versionlist;
284308 this.versionindex = o.versionindex;
285309 // July 2019 if (this.bRep != null)
286310 // this.bRep.support = o.transientrep;
cLabel.java
....@@ -2,6 +2,8 @@
22
33 public class cLabel extends javax.swing.JLabel
44 {
5
+ boolean fit;
6
+
57 BufferedImage image;
68
79 cLabel(String name)
....@@ -55,10 +57,17 @@
5557 }
5658 else
5759 {
58
- BufferedImage resizedimage = new BufferedImage(getWidth(),getHeight(),java.awt.image.BufferedImage.TYPE_INT_RGB);
60
+ BufferedImage resizedimage = new BufferedImage(getWidth(),getHeight(),java.awt.image.BufferedImage.TYPE_INT_ARGB);
5961 java.awt.Graphics2D g2 = resizedimage.createGraphics();
6062 g2.setRenderingHint(java.awt.RenderingHints.KEY_INTERPOLATION, java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR);
61
- g2.drawImage(image, 0, 0,getWidth(),getHeight(), null);
63
+
64
+ if (fit)
65
+ g2.drawImage(image, 0, 0, getWidth(), getHeight(), null);
66
+ else
67
+ {
68
+ g2.drawImage(image, getWidth()/2 - image.getWidth()/2, 0, image.getWidth(), image.getHeight(), null);
69
+ }
70
+
6271 g2.dispose();
6372
6473 g.drawImage(resizedimage, 0, 0,getWidth(),getHeight(), null);
icons/broom.png
Binary files differ
icons/clear.png
Binary files differ
icons/shadericons/shadericon00000.jpg
Binary files differ
icons/shadericons/shadericon00000.png
Binary files differ
icons/shadericons/shadericon00001.jpg
Binary files differ
icons/shadericons/shadericon00001.png
Binary files differ
icons/shadericons/shadericon00002.jpg
Binary files differ
icons/shadericons/shadericon00002.png
Binary files differ
icons/shadericons/shadericon00003.jpg
Binary files differ
icons/shadericons/shadericon00003.png
Binary files differ
icons/shadericons/shadericon00004.jpg
Binary files differ
icons/shadericons/shadericon00004.png
Binary files differ
icons/shadericons/shadericon00005.jpg
Binary files differ
icons/shadericons/shadericon00005.png
Binary files differ
icons/shadericons/shadericon00006.jpg
Binary files differ
icons/shadericons/shadericon00006.png
Binary files differ
icons/shadericons/shadericon00007.jpg
Binary files differ
icons/shadericons/shadericon00007.png
Binary files differ
icons/shadericons/shadericon00008.jpg
Binary files differ
icons/shadericons/shadericon00008.png
Binary files differ
icons/shadericons/shadericon00009.jpg
Binary files differ
icons/shadericons/shadericon00009.png
Binary files differ
icons/shadericons/shadericon00010.jpg
Binary files differ
icons/shadericons/shadericon00010.png
Binary files differ
icons/shadericons/shadericon00011.jpg
Binary files differ
icons/shadericons/shadericon00011.png
Binary files differ
icons/shadericons/shadericon00012.jpg
Binary files differ
icons/shadericons/shadericon00012.png
Binary files differ
icons/shadericons/shadericon00013.jpg
Binary files differ
icons/shadericons/shadericon00013.png
Binary files differ
icons/shadericons/shadericon00014.jpg
Binary files differ
icons/shadericons/shadericon00014.png
Binary files differ
icons/shadericons/shadericon00015.jpg
Binary files differ
icons/shadericons/shadericon00015.png
Binary files differ
icons/shadericons/shadericon00016.jpg
Binary files differ
icons/shadericons/shadericon00016.png
Binary files differ
icons/shadericons/shadericon00017.jpg
Binary files differ
icons/shadericons/shadericon00017.png
Binary files differ
icons/shadericons/shadericon00018.jpg
Binary files differ
icons/shadericons/shadericon00018.png
Binary files differ
icons/shadericons/shadericon00019.jpg
Binary files differ
icons/shadericons/shadericon00019.png
Binary files differ
icons/shadericons/shadericon00020.jpg
Binary files differ
icons/shadericons/shadericon00020.png
Binary files differ
icons/sphererender.gfd
Binary files differ