Normand Briere
2019-08-08 8294241adc5fe698b70e13ebd6780af46ab83f7e
GroupEditor.java
....@@ -16,6 +16,7 @@
1616 //import buoy.widget.BFileChooser;
1717
1818 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
19
+ Grafreed.iResourceCallBack,
1920 ObjectUI,
2021 Runnable,
2122 ActionListener,
....@@ -28,8 +29,8 @@
2829 {
2930 cButton skyboxButton;
3031 final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
- //row.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF));
32
- row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
33
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
3334 skyboxButton.setToolTipText(s);
3435 skyboxButton.addActionListener(new ActionListener()
3536 {
....@@ -41,6 +42,22 @@
4142 });
4243 }
4344
45
+ public void AddTextureButton(String f, final String t, cGridBag row)
46
+ {
47
+ cButton textureButton;
48
+ final String path = "textures/" + f + "/"; // + t;
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
+ textureButton.setToolTipText(f + "s");
51
+ textureButton.addActionListener(new ActionListener()
52
+ {
53
+ @Override
54
+ public void actionPerformed(ActionEvent e)
55
+ {
56
+ ChangeTexture(path + t);
57
+ }
58
+ });
59
+ }
60
+
4461 public void AddSkyboxTab0(JTabbedPane skyboxpanel)
4562 {
4663 cGridBag tab0 = new cGridBag().setVertical(true);
....@@ -57,11 +74,12 @@
5774 cGridBag row6 = new cGridBag();
5875
5976 AddSkyboxButton("default", "rgb", row0);
60
- AddSkyboxButton("default", "cornell", row0);
61
- AddSkyboxButton("default", "uffizi", row0);
62
- AddSkyboxButton("default", "CloudyHills", row0);
63
-
64
- AddSkyboxButton("default", "skycube", row1);
77
+ //AddSkyboxButton("default", "cornell", row0);
78
+ AddSkyboxButton("penguins", "dust", row0);
79
+ AddSkyboxButton("penguins", "tropic", row0);
80
+ AddSkyboxButton("penguins", "yonder", row0);
81
+
82
+ AddSkyboxButton("default", "uffizi", row1);
6583 AddSkyboxButton("bridge", "Bridge", row1);
6684 AddSkyboxButton("bridge", "Bridge2", row1);
6785 AddSkyboxButton("urban", "GamlaStan2", row1);
....@@ -73,23 +91,23 @@
7391
7492 AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
7593 AddSkyboxButton("urban", "UnionSquare", row3);
94
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
7695 AddSkyboxButton("park", "BerzeliiPark", row3);
77
- AddSkyboxButton("park", "Buddha", row3);
7896
97
+ AddSkyboxButton("park", "Buddha", row4);
7998 AddSkyboxButton("park", "CNTower2", row4);
8099 AddSkyboxButton("park", "NiagaraFalls1", row4);
81100 AddSkyboxButton("park", "NiagaraFalls3", row4);
82
- AddSkyboxButton("park", "Park", row4);
83101
102
+ AddSkyboxButton("park", "Park", row5);
84103 AddSkyboxButton("park", "Pond", row5);
85104 AddSkyboxButton("park", "Skansen", row5);
86105 AddSkyboxButton("park", "Skansen2", row5);
87
- AddSkyboxButton("park", "Skansen3", row5);
88106
107
+ AddSkyboxButton("park", "Skansen3", row6);
89108 AddSkyboxButton("park", "Skansen4", row6);
90109 AddSkyboxButton("park", "Skansen5", row6);
91
- AddSkyboxButton("park", "Stairs", row6);
92
- AddSkyboxButton("park", "Tantolunden4", row6);
110
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
93111
94112 tab0.add(row0);
95113 tab0.add(row1);
....@@ -140,24 +158,29 @@
140158 AddSkyboxButton("forest", "Langholmen2", row3);
141159 AddSkyboxButton("forest", "Plants", row3);
142160 AddSkyboxButton("mountain", "Maskonaive", row3);
161
+
143162 AddSkyboxButton("mountain", "Maskonaive2", row4);
144
-
145163 AddSkyboxButton("mountain", "Maskonaive3", row4);
146
- AddSkyboxButton("mountain", "Ryfjallet", row4);
147
- AddSkyboxButton("mountain", "Teide", row4);
164
+ AddSkyboxButton("mountain", "Teide", row4);
165
+ AddSkyboxButton("park", "Tantolunden4", row4);
148166
167
+ AddSkyboxButton("park", "Stairs", row5);
168
+ AddSkyboxButton("default", "skycube", row6);
149169 AddSkyboxButton("rocky", "Langholmen", row5);
150
- AddSkyboxButton("rocky", "Riddarfjarden", row5);
151170 AddSkyboxButton("rocky", "Skinnarviksberget", row5);
171
+
152172 AddSkyboxButton("rocky", "Tantolunden6", row5);
173
+ AddSkyboxButton("default", "CloudyHills", row6);
174
+ AddSkyboxButton("daz", "Autumn", row6);
175
+ AddSkyboxButton("daz", "MountainTrail", row6);
153176 /*
154
-Kastellholmen
155
-Langholmen
156
-Riddarfjarden
157
-Skinnarviksberget
158
-Tanto
159
-Tantolunden2
160
-Tantolunden6
177
+Autumn
178
+Greenlands
179
+MountainTrail
180
+Oasis
181
+TheRock
182
+TopOfTheWorld
183
+Winter
161184 */
162185
163186 tab0.add(row0);
....@@ -197,39 +220,33 @@
197220
198221 AddSkyboxButton("urban", "CNTower", row1);
199222 AddSkyboxButton("bridge", "ArstaBridge", row1);
200
- AddSkyboxButton("indoors", "DallasW", row1);
201
- AddSkyboxButton("indoors", "MarriottMadisonWest", row1);
223
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
224
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
202225
226
+ AddSkyboxButton("penguins", "kenon_star", row2);
227
+ AddSkyboxButton("persson", "corona", row2);
228
+ AddSkyboxButton("persson", "spaceskybox", row2);
203229 AddSkyboxButton("indoors", "Vasa", row2);
204
- AddSkyboxButton("winter", "Backyard", row2);
205
- AddSkyboxButton("winter", "Creek", row2);
206
- AddSkyboxButton("winter", "FootballField3", row2);
207230
231
+ AddSkyboxButton("winter", "Backyard", row3);
232
+ AddSkyboxButton("winter", "Creek", row3);
233
+ AddSkyboxButton("winter", "FootballField3", row3);
208234 AddSkyboxButton("winter", "Forest", row3);
209
- AddSkyboxButton("winter", "HornstullsStrand2", row3);
210
- AddSkyboxButton("winter", "House", row3);
211
- AddSkyboxButton("winter", "IceLake", row3);
212235
236
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
237
+ AddSkyboxButton("winter", "House", row4);
238
+ AddSkyboxButton("winter", "IceLake", row4);
213239 AddSkyboxButton("winter", "IceRiver", row4);
214
- AddSkyboxButton("winter", "Park3", row4);
215
- AddSkyboxButton("winter", "PondWinter", row4);
216240
241
+ AddSkyboxButton("winter", "Park3", row5);
242
+ AddSkyboxButton("winter", "PondWinter", row5);
217243 AddSkyboxButton("winter", "Tantolunden5", row5);
218244 AddSkyboxButton("winter", "Vindelalven", row5);
219
- /*
220
-Backyard
221
-Creek
222
-FootballField3
223
-Forest
224
-HornstullsStrand2
225
-House
226
-IceLake
227
-IceRiver
228
-Park3
229
-PondWinter
230
-Tantolunden5
231
-Vindelalven *
232
- */
245
+
246
+ AddSkyboxButton("daz", "TheRock", row6);
247
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
248
+ AddSkyboxButton("daz", "Winter", row6);
249
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233250
234251 tab0.add(row0);
235252 tab0.add(row1);
....@@ -245,15 +262,97 @@
245262 //tab0.add(new cGridBag());
246263 }
247264 }
248
-
249
- public void ChangeSkybox(String name)
265
+
266
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250267 {
251
- cameraView.envyoff = false;
252
- cameraView.skyboxname = name;
253
- cameraView.skyboxext = "jpg";
268
+ cGridBag tab0 = new cGridBag().setVertical(true);
269
+
270
+ tab0.setName("Others");
271
+ skyboxpanel.add(tab0);
272
+
273
+ cGridBag row0 = new cGridBag();
274
+ cGridBag row1 = new cGridBag();
275
+ cGridBag row2 = new cGridBag();
276
+ cGridBag row3 = new cGridBag();
277
+ cGridBag row4 = new cGridBag();
278
+ cGridBag row5 = new cGridBag();
279
+ cGridBag row6 = new cGridBag();
280
+
281
+ AddSkyboxButton("mayhem", "afterrain", row0);
282
+ AddSkyboxButton("mayhem", "aqua4", row0);
283
+ AddSkyboxButton("mayhem", "aqua9", row0);
284
+ AddSkyboxButton("mayhem", "flame", row0);
285
+
286
+ AddSkyboxButton("mayhem", "h2s", row1);
287
+ AddSkyboxButton("mayhem", "prehistoric", row1);
288
+ AddSkyboxButton("mayhem", "scorched", row1);
289
+ AddSkyboxButton("penguins", "desertdawn", row1);
290
+
291
+ AddSkyboxButton("persson", "Citadella", row2);
292
+ AddSkyboxButton("persson", "Citadella2", row2);
293
+ AddSkyboxButton("persson", "clouds1", row2);
294
+ AddSkyboxButton("penguins", "wrath", row2);
295
+
296
+ AddSkyboxButton("persson", "FishermansBastion", row3);
297
+ AddSkyboxButton("persson", "HeroesSquare", row3);
298
+ AddSkyboxButton("indoors", "DallasW", row3);
299
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
300
+
301
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
302
+ AddSkyboxButton("persson", "PereaBeach1", row4);
303
+ AddSkyboxButton("persson", "PereaBeach2", row4);
304
+ AddSkyboxButton("persson", "redeclipse", row4);
305
+
306
+ AddSkyboxButton("daz", "Greenlands", row5);
307
+ AddSkyboxButton("daz", "Oasis", row5);
308
+ AddSkyboxButton("elyvisions", "arch3", row5);
309
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
310
+
311
+ AddSkyboxButton("elyvisions", "rainbow", row6);
312
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
313
+ AddSkyboxButton("elyvisions", "heaven", row6);
314
+ AddSkyboxButton("elyvisions", "hot", row6);
315
+
316
+ tab0.add(row0);
317
+ tab0.add(row1);
318
+ tab0.add(row2);
319
+ tab0.add(row3);
320
+ tab0.add(row4);
321
+ tab0.add(row5);
322
+ tab0.add(row6);
323
+
324
+ for (int i=5; --i>=0;)
325
+ {
326
+ //oe.toolboxPanel.Return();
327
+ //tab0.add(new cGridBag());
328
+ }
329
+ }
330
+
331
+ public void ChangeSkybox(String skybox)
332
+ {
333
+ //cameraView.envyoff = false;
334
+ group.skyboxname = skybox;
335
+ group.skyboxext = "jpg";
254336 cameraView.repaint();
255337 }
338
+
339
+ public void CreateSkyboxPanel(cGridBag skyboxPanel)
340
+ {
341
+ JTabbedPane skyboxpane = new JTabbedPane();
342
+
343
+ AddSkyboxTab0(skyboxpane);
344
+ AddSkyboxTab1(skyboxpane);
345
+ AddSkyboxTab2(skyboxpane);
346
+ AddSkyboxTab3(skyboxpane);
347
+
348
+ skyboxPanel.add(skyboxpane);
349
+ }
256350
351
+ public void ChangeTexture(String texture)
352
+ {
353
+ cameraView.repaint();
354
+ }
355
+
257356 //ObjEditor objEditor;
258357 public void closeUI2()
259358 {
....@@ -291,9 +390,9 @@
291390 this.copy = this.group = group;
292391 //selectees = this.group.selectees;
293392
294
- if (copy.versions == null)
393
+ if (copy.versionlist == null)
295394 {
296
- copy.versions = new byte[100][];
395
+ copy.versionlist = new Object3D[100];
297396 copy.versionindex = -1;
298397 }
299398
....@@ -318,9 +417,9 @@
318417
319418 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
320419
321
- if (copy.versions == null)
420
+ if (copy.versionlist == null)
322421 {
323
- copy.versions = new byte[100][];
422
+ copy.versionlist = new Object3D[100];
324423 copy.versionindex = -1;
325424
326425 Save(true);
....@@ -794,6 +893,67 @@
794893 buildToolsMenu(menu);
795894 }
796895
896
+ JTabbedPane resourcecontainer;
897
+ cGridBag currenttab;
898
+ boolean added; // patch for jar
899
+
900
+ int tabcount = 0;
901
+ int colcount = 0;
902
+ int rowcount = 0;
903
+
904
+ int columns = 5;
905
+ int rows = 7;
906
+
907
+ public void ResourceCallBack(String[] path)
908
+ {
909
+ for (int i = 0; i < path.length; i++)
910
+ System.out.print(path[i] + "/");
911
+ System.out.println();
912
+ if (rowcount == 0)
913
+ {
914
+ currenttab = new cGridBag();
915
+ added = false;
916
+ String tabname = String.valueOf((char)('A'+tabcount));
917
+ currenttab.setName(tabname);
918
+ rowcount = 1;
919
+ }
920
+
921
+ if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg"))
922
+ {
923
+ if (!added)
924
+ {
925
+ added = true;
926
+ resourcecontainer.add(currenttab);
927
+ String tabname = String.valueOf((char)('A'+tabcount));
928
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
929
+ }
930
+
931
+ AddTextureButton(path[0], path[1], currenttab);
932
+ if (++colcount >= columns)
933
+ {
934
+ colcount = 0;
935
+ currenttab.Return();
936
+
937
+ if (rowcount++ >= rows)
938
+ {
939
+ rowcount = 0;
940
+ }
941
+ }
942
+ }
943
+ else
944
+ {
945
+// if (!path[path.length-1].equals("icons"))
946
+// resourcecontainer.Return();
947
+ }
948
+ }
949
+
950
+ void CreateTexturePanel(cGridBag container)
951
+ {
952
+ resourcecontainer = new JTabbedPane();
953
+ container.add(resourcecontainer);
954
+
955
+ Grafreed.ParseResources("textures", this);
956
+ }
797957
798958 void SetupUI2(ObjEditor oe)
799959 {
....@@ -866,32 +1026,36 @@
8661026 restoreCameraButton.setToolTipText("Restore viewpoint");
8671027 restoreCameraButton.addActionListener(this);
8681028
869
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
870
- saveButton.setToolTipText("New version");
871
- saveButton.addActionListener(this);
1029
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1030
+ saveVersionButton.setToolTipText("Duplicate current version");
1031
+ saveVersionButton.addActionListener(this);
8721032
873
- copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
874
- undoButton.setToolTipText("Previous version");
875
- undoButton.addActionListener(this);
876
- undoButton.setEnabled(false);
1033
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1034
+ deleteVersionButton.setToolTipText("Delete current version");
1035
+ deleteVersionButton.addActionListener(this);
1036
+
1037
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1038
+ previousVersionButton.setToolTipText("Previous version");
1039
+ previousVersionButton.addActionListener(this);
1040
+ previousVersionButton.setEnabled(false);
8771041
8781042 cGridBag updown = new cGridBag().setVertical(true);
8791043 updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
880
- restoreButton.setToolTipText("Restore current");
1044
+ restoreButton.setToolTipText("Undo (restore current version)");
8811045 restoreButton.addActionListener(this);
882
- restoreButton.setEnabled(false);
1046
+ //restoreButton.setEnabled(false);
8831047
8841048 updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
885
- replaceButton.setToolTipText("Replace current");
1049
+ replaceButton.setToolTipText("Save (replace current version)");
8861050 replaceButton.addActionListener(this);
887
- replaceButton.setEnabled(false);
1051
+ //replaceButton.setEnabled(false);
8881052
8891053 copyOptionsPanel.add(updown);
8901054
891
- copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
892
- redoButton.setToolTipText("Next version");
893
- redoButton.addActionListener(this);
894
- redoButton.setEnabled(false);
1055
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ nextVersionButton.setToolTipText("Next version");
1057
+ nextVersionButton.addActionListener(this);
1058
+ nextVersionButton.setEnabled(false);
8951059
8961060 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
8971061 liveCB.setToolTipText("Enable animation");
....@@ -1025,18 +1189,15 @@
10251189
10261190 oe.toolboxPanel.add(row2);
10271191
1028
- // ENVYMAPS
1029
- cGridBag skyboxpane = new cGridBag();
1030
- skyboxpane.preferredHeight = 100;
1192
+ cGridBag textures = new cGridBag();
10311193
1032
- oe.toolboxPanel.add(skyboxpane);
1194
+ CreateTexturePanel(textures);
10331195
1034
- JTabbedPane skyboxpanel = new JTabbedPane();
1035
- skyboxpane.add(skyboxpanel);
1196
+ oe.toolboxPanel.add(textures);
10361197
1037
- AddSkyboxTab0(skyboxpanel);
1038
- AddSkyboxTab1(skyboxpanel);
1039
- AddSkyboxTab2(skyboxpanel);
1198
+ textures.preferredHeight = 100;
1199
+
1200
+ CreateSkyboxPanel(oe.skyboxPanel);
10401201
10411202 // EDIT panel
10421203 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1044,20 +1205,20 @@
10441205 editButton.addActionListener(this);
10451206
10461207 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
- uneditButton.setToolTipText("Remove selection controls");
1208
+ uneditButton.setToolTipText("Unpin and remove selection controls");
10481209 uneditButton.addActionListener(this);
10491210
10501211 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1051
- allParamsButton.setToolTipText("Show all controle");
1212
+ allParamsButton.setToolTipText("Show all controls");
10521213 allParamsButton.addActionListener(this);
10531214
1054
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
- clearPanelButton.setToolTipText("Clear edit panel");
1215
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1216
+ clearPanelButton.setToolTipText("Clear all controls");
10561217 clearPanelButton.addActionListener(this);
10571218
1058
- editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
- unselectButton.setToolTipText("Unselect");
1060
- unselectButton.addActionListener(this);
1219
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ //unselectButton.setToolTipText("Unselect");
1221
+ //unselectButton.addActionListener(this);
10611222
10621223 editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10631224 flashSelectionButton.setToolTipText("Highlight selection");
....@@ -1117,7 +1278,7 @@
11171278 dgr.addDragGestureListener(this);
11181279 }catch(Exception e) {}
11191280 */
1120
- radio.layout = sixButton; // sevenButton;
1281
+ radio.layout = threeButton; // sixButton;
11211282 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
11221283 }
11231284
....@@ -1168,9 +1329,12 @@
11681329 smoothCB.setToolTipText("Snapping delay");
11691330 smoothCB.addItemListener(this);
11701331
1171
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1172
- slowCB.setToolTipText("Smooth interpolation");
1173
- slowCB.addItemListener(this);
1332
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1333
+// slowCB.setToolTipText("Smooth interpolation");
1334
+// slowCB.addItemListener(this);
1335
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1336
+ minshaderCB.setToolTipText("Minimal fast shader");
1337
+ minshaderCB.addItemListener(this);
11741338
11751339 // constraints.gridy += 1;
11761340 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -1259,7 +1423,7 @@
12591423 }
12601424
12611425 radioButton.SetObject(obj);
1262
- radioButton.layout = sixButton; // sevenButton;
1426
+ radioButton.layout = threeButton; // sixButton;
12631427 radioButton.SetCamera(cameraView.renderCamera, false);
12641428 radioButton.addActionListener(this);
12651429 radioPanel.add(radioButton);
....@@ -1284,6 +1448,8 @@
12841448 cCheckBox localCB;
12851449 cCheckBox crowdCB;
12861450 cCheckBox smoothCB;
1451
+ cCheckBox minshaderCB;
1452
+
12871453 cToggleButton fastCB;
12881454 cCheckBox slowCB;
12891455 cCheckBox boxCB;
....@@ -1354,6 +1520,12 @@
13541520 {
13551521 cameraView.ToggleInertia();
13561522 cameraView.repaint();
1523
+ }
1524
+ else if(e.getSource() == minshaderCB)
1525
+ {
1526
+ Globals.MINSHADER ^= true;
1527
+ cameraView.programInitialized = false;
1528
+ cameraView.repaint();
13571529 }
13581530 else if(e.getSource() == localCB)
13591531 {
....@@ -2494,7 +2666,7 @@
24942666 if (source == invariantsItem)
24952667 {
24962668 System.out.println("Invariants:");
2497
- Grafreed.grafreeD.universe.invariants();
2669
+ Grafreed.grafreed.universe.invariants();
24982670 } else
24992671 if (source == memoryItem)
25002672 {
....@@ -2525,33 +2697,40 @@
25252697 {
25262698 ToggleFullScreen();
25272699 } else
2528
- if (source == undoButton)
2700
+ if (source == previousVersionButton)
25292701 {
25302702 // Go to previous version
25312703 //if (!Undo())
25322704 //java.awt.Toolkit.getDefaultToolkit().beep();
2533
- Undo();
2705
+ PreviousVersion();
25342706 } else
25352707 if (source == restoreButton)
25362708 {
25372709 // Restore current version
25382710 Restore();
2711
+ //restoreButton.setEnabled(false);
25392712 } else
25402713 if (source == replaceButton)
25412714 {
25422715 // Overwrite current version
25432716 Replace();
2717
+ //replaceButton.setEnabled(false);
25442718 } else
2545
- if (source == redoButton)
2719
+ if (source == nextVersionButton)
25462720 {
25472721 // Go to next version
2548
- Redo();
2722
+ NextVersion();
25492723 } else
2550
- if (source == saveButton)
2724
+ if (source == saveVersionButton)
25512725 {
25522726 // Save a new version
25532727 if (!Save(true))
25542728 java.awt.Toolkit.getDefaultToolkit().beep();
2729
+ } else
2730
+ if (source == deleteVersionButton)
2731
+ {
2732
+ // Delete a new version
2733
+ DeleteVersion();
25552734 } else
25562735 if (source == oneStepButton)
25572736 {
....@@ -2606,11 +2785,11 @@
26062785 } else
26072786 if (source == undoItem)
26082787 {
2609
- Undo();
2788
+ PreviousVersion();
26102789 } else
26112790 if (source == redoItem)
26122791 {
2613
- Redo();
2792
+ NextVersion();
26142793 } else
26152794 if (source == duplicateItem)
26162795 {
....@@ -3743,10 +3922,10 @@
37433922 {
37443923 Object3D child = (Object3D)e.nextElement();
37453924 if(child.editWindow != null)
3746
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
37473925 child.pinned = false;
37483926 child.CloseUI();
37493927 listUI.remove(child);
3928
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
37503929
37513930 //child.editWindow = null; // ???????????
37523931 }
....@@ -3765,6 +3944,7 @@
37653944 obj.CloseUI();
37663945 }
37673946 listUI.clear();
3947
+ SetPinStates(group.selection.size() > 0);
37683948 refreshContents(true);
37693949 } else
37703950 if (source == allParamsButton)
....@@ -3851,6 +4031,7 @@
38514031 radio.layout.doClick();
38524032
38534033 ClearUnpinned();
4034
+
38544035 //Grafreed.Assert(group != null);
38554036 //Grafreed.Assert(group.selection != null);
38564037 SetPinStates(group.selection == null || group.selection.size() > 0);
....@@ -3867,11 +4048,13 @@
38674048 } else if (event.getSource() == editCameraItem)
38684049 {
38694050 cameraView.ProtectCamera();
4051
+ cameraView.requestFocusInWindow();
38704052 cameraView.repaint();
38714053 return;
38724054 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
38734055 {
38744056 cameraView.RevertCamera();
4057
+ cameraView.requestFocusInWindow();
38754058 cameraView.repaint();
38764059 return;
38774060 // } else if (event.getSource() == textureButton)
....@@ -5004,9 +5187,7 @@
50045187
50055188 freezemodel = false;
50065189 }
5007
-
5008
- boolean flashIt = true;
5009
-
5190
+
50105191 public void valueChanged(TreeSelectionEvent e)
50115192 //public boolean handleEvent(Event event)
50125193 {
....@@ -5079,13 +5260,15 @@
50795260 {
50805261 editButton.setEnabled(enabled);
50815262 uneditButton.setEnabled(enabled);
5082
- unselectButton.setEnabled(enabled);
5263
+ //unselectButton.setEnabled(enabled);
50835264 flashSelectionButton.setEnabled(enabled);
5265
+
5266
+ clearPanelButton.setEnabled(!listUI.isEmpty());
50845267 }
50855268
50865269 void refreshContents(boolean cp)
50875270 {
5088
- if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5271
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
50895272 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
50905273 {
50915274 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5921,7 +6104,6 @@
59216104
59226105 cButton restoreCameraButton;
59236106
5924
- cButton saveButton;
59256107 cButton oneStepButton;
59266108
59276109 cButton groupButton;