Normand Briere
2019-08-12 b1d79b74514041a059b454a9f6fc3970773c0cb8
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,
....@@ -41,6 +42,22 @@
4142 });
4243 }
4344
45
+ public void AddTextureButton(String f, String c, final String t, int count, cGridBag row)
46
+ {
47
+ cButton textureButton;
48
+ final String path = "textures/" + f + "/" + c + "/"; // + t;
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
+ textureButton.setToolTipText(c + count);
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);
....@@ -60,7 +77,7 @@
6077 //AddSkyboxButton("default", "cornell", row0);
6178 AddSkyboxButton("penguins", "dust", row0);
6279 AddSkyboxButton("penguins", "tropic", row0);
63
- AddSkyboxButton("default", "skycube", row0);
80
+ AddSkyboxButton("penguins", "yonder", row0);
6481
6582 AddSkyboxButton("default", "uffizi", row1);
6683 AddSkyboxButton("bridge", "Bridge", row1);
....@@ -90,7 +107,7 @@
90107 AddSkyboxButton("park", "Skansen3", row6);
91108 AddSkyboxButton("park", "Skansen4", row6);
92109 AddSkyboxButton("park", "Skansen5", row6);
93
- AddSkyboxButton("park", "Stairs", row6);
110
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94111
95112 tab0.add(row0);
96113 tab0.add(row1);
....@@ -144,21 +161,18 @@
144161
145162 AddSkyboxButton("mountain", "Maskonaive2", row4);
146163 AddSkyboxButton("mountain", "Maskonaive3", row4);
147
- AddSkyboxButton("mountain", "Ryfjallet", row4);
148164 AddSkyboxButton("mountain", "Teide", row4);
149165 AddSkyboxButton("park", "Tantolunden4", row4);
150166
151
- AddSkyboxButton("penguins", "wrath", row5);
152
- AddSkyboxButton("penguins", "yonder", row5);
167
+ AddSkyboxButton("park", "Stairs", row5);
168
+ AddSkyboxButton("default", "skycube", row6);
153169 AddSkyboxButton("rocky", "Langholmen", row5);
154170 AddSkyboxButton("rocky", "Skinnarviksberget", row5);
155
- AddSkyboxButton("rocky", "Tantolunden6", row5);
156171
172
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
157173 AddSkyboxButton("default", "CloudyHills", row6);
158174 AddSkyboxButton("daz", "Autumn", row6);
159
- AddSkyboxButton("daz", "Greenlands", row6);
160175 AddSkyboxButton("daz", "MountainTrail", row6);
161
- AddSkyboxButton("daz", "Oasis", row6);
162176 /*
163177 Autumn
164178 Greenlands
....@@ -210,8 +224,8 @@
210224 AddSkyboxButton("penguins", "sleepyhollow", row1);
211225
212226 AddSkyboxButton("penguins", "kenon_star", row2);
213
- AddSkyboxButton("indoors", "DallasW", row2);
214
- AddSkyboxButton("indoors", "MarriottMadisonWest", row2);
227
+ AddSkyboxButton("persson", "corona", row2);
228
+ AddSkyboxButton("persson", "spaceskybox", row2);
215229 AddSkyboxButton("indoors", "Vasa", row2);
216230
217231 AddSkyboxButton("winter", "Backyard", row3);
....@@ -232,7 +246,7 @@
232246 AddSkyboxButton("daz", "TheRock", row6);
233247 AddSkyboxButton("daz", "TopOfTheWorld", row6);
234248 AddSkyboxButton("daz", "Winter", row6);
235
- AddSkyboxButton("penguins", "desertdawn", row6);
249
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
236250
237251 tab0.add(row0);
238252 tab0.add(row1);
....@@ -248,15 +262,113 @@
248262 //tab0.add(new cGridBag());
249263 }
250264 }
251
-
252
- public void ChangeSkybox(String name)
265
+
266
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
267
+ {
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)
253332 {
254333 //cameraView.envyoff = false;
255
- group.skyboxname = name;
334
+ group.skyboxname = skybox;
256335 group.skyboxext = "jpg";
257336 cameraView.repaint();
258337 }
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
+ }
259350
351
+ public void ChangeTexture(String texture)
352
+ {
353
+ for (int i=0; i<group.selection.size(); i++)
354
+ {
355
+ Object3D obj = group.selection.get(i);
356
+ obj.SetPigmentTexture("@" + texture);
357
+ }
358
+
359
+ refreshContents();
360
+ }
361
+
362
+ public void Show3DView()
363
+ {
364
+ // bug
365
+ //gridPanel.setDividerLocation(1.0);
366
+ //bigPanel.setDividerLocation(0.0);
367
+ bigThree.ClearUI();
368
+ bigThree.add(centralPanel);
369
+ bigThree.FlushUI();
370
+ }
371
+
260372 //ObjEditor objEditor;
261373 public void closeUI2()
262374 {
....@@ -294,9 +406,9 @@
294406 this.copy = this.group = group;
295407 //selectees = this.group.selectees;
296408
297
- if (copy.versions == null)
409
+ if (copy.versionlist == null)
298410 {
299
- copy.versions = new byte[100][];
411
+ copy.versionlist = new Object3D[100];
300412 copy.versionindex = -1;
301413 }
302414
....@@ -321,9 +433,9 @@
321433
322434 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
323435
324
- if (copy.versions == null)
436
+ if (copy.versionlist == null)
325437 {
326
- copy.versions = new byte[100][];
438
+ copy.versionlist = new Object3D[100];
327439 copy.versionindex = -1;
328440
329441 Save(true);
....@@ -797,6 +909,73 @@
797909 buildToolsMenu(menu);
798910 }
799911
912
+ JTabbedPane resourcecontainer;
913
+ cGridBag currenttab;
914
+ boolean added; // patch for jar
915
+
916
+ int tabcount = 0;
917
+ int colcount = 0;
918
+ int rowcount = 0;
919
+ int texturecount = 0;
920
+
921
+ int columns = 5;
922
+ int rows = 7;
923
+
924
+ public void ResourceCallBack(String[] path)
925
+ {
926
+// for (int i = 0; i < path.length; i++)
927
+// System.out.print(path[i] + "/");
928
+// System.out.println();
929
+
930
+ if (//rowcount == 0 ||
931
+ path.length == 1)
932
+ {
933
+ currenttab = new cGridBag();
934
+ added = false;
935
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
936
+ currenttab.setName(tabname);
937
+ rowcount = 1;
938
+ colcount = 0;
939
+ texturecount = 0;
940
+ }
941
+
942
+ if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
943
+ {
944
+ if (!added)
945
+ {
946
+ added = true;
947
+ resourcecontainer.add(currenttab);
948
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
949
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
950
+ }
951
+
952
+ AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
953
+
954
+ if (++colcount >= columns)
955
+ {
956
+ colcount = 0;
957
+ currenttab.Return();
958
+
959
+ if (rowcount++ >= rows)
960
+ {
961
+ rowcount = 0;
962
+ }
963
+ }
964
+ }
965
+ else
966
+ {
967
+// if (!path[path.length-1].equals("icons"))
968
+// resourcecontainer.Return();
969
+ }
970
+ }
971
+
972
+ void CreateTexturePanel(cGridBag container)
973
+ {
974
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
975
+ container.add(resourcecontainer);
976
+
977
+ Grafreed.ParseResources("textures", this);
978
+ }
800979
801980 void SetupUI2(ObjEditor oe)
802981 {
....@@ -815,11 +994,6 @@
815994 //new Exception().printStackTrace();
816995
817996 oe.radioPanel = new JPanel(new GridBagLayout());
818
- oe.aConstraints.weightx = 1;
819
- oe.aConstraints.weighty = 0;
820
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
821
- oe.aConstraints.gridwidth = 100;
822
- oe.aConstraints.gridheight = 1;
823997 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
824998
825999 oe.buttonGroup = new ButtonGroup();
....@@ -857,6 +1031,45 @@
8571031 maxButton.addActionListener(this);
8581032 }
8591033
1034
+ cButton gcButton;
1035
+
1036
+ oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
+ gcButton.setToolTipText("Garbage collect");
1038
+ gcButton.addActionListener(new ActionListener()
1039
+ {
1040
+ public void actionPerformed(ActionEvent e)
1041
+ {
1042
+ System.gc();
1043
+ }
1044
+ });
1045
+
1046
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
+ collapseButton.setToolTipText("Collapse toolbar");
1048
+ collapseButton.addActionListener(this);
1049
+
1050
+ oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1051
+ maximize3DButton.setToolTipText("Maximize 3D view");
1052
+ maximize3DButton.addActionListener(this);
1053
+
1054
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ twoButton.setToolTipText("Show 3D view only");
1056
+ twoButton.addActionListener(this);
1057
+ this.fullscreenLayout = twoButton;
1058
+
1059
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1060
+ threeButton.setToolTipText("Show controls and 3D view");
1061
+ threeButton.addActionListener(this);
1062
+ if (Globals.ADVANCED)
1063
+ {
1064
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1065
+ sixButton.setToolTipText("Show 3D view and controls");
1066
+ sixButton.addActionListener(this);
1067
+ }
1068
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1069
+// sevenButton.setToolTipText("3-column layout");
1070
+// sevenButton.addActionListener(this);
1071
+ //
1072
+
8601073 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
8611074 fullButton.setToolTipText("Full-screen window");
8621075 fullButton.addActionListener(this);
....@@ -869,41 +1082,45 @@
8691082 restoreCameraButton.setToolTipText("Restore viewpoint");
8701083 restoreCameraButton.addActionListener(this);
8711084
872
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
873
- saveButton.setToolTipText("New version");
874
- saveButton.addActionListener(this);
1085
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1086
+ saveVersionButton.setToolTipText("Duplicate current version");
1087
+ saveVersionButton.addActionListener(this);
8751088
876
- copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
877
- undoButton.setToolTipText("Previous version");
878
- undoButton.addActionListener(this);
879
- undoButton.setEnabled(false);
1089
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1090
+ deleteVersionButton.setToolTipText("Delete current version");
1091
+ deleteVersionButton.addActionListener(this);
1092
+
1093
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1094
+ previousVersionButton.setToolTipText("Previous version");
1095
+ previousVersionButton.addActionListener(this);
1096
+ previousVersionButton.setEnabled(false);
8801097
8811098 cGridBag updown = new cGridBag().setVertical(true);
8821099 updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
883
- restoreButton.setToolTipText("Restore current");
1100
+ restoreButton.setToolTipText("Undo (restore current version)");
8841101 restoreButton.addActionListener(this);
885
- restoreButton.setEnabled(false);
1102
+ //restoreButton.setEnabled(false);
8861103
8871104 updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
888
- replaceButton.setToolTipText("Replace current");
1105
+ replaceButton.setToolTipText("Save (replace current version)");
8891106 replaceButton.addActionListener(this);
890
- replaceButton.setEnabled(false);
1107
+ //replaceButton.setEnabled(false);
8911108
8921109 copyOptionsPanel.add(updown);
8931110
894
- copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
895
- redoButton.setToolTipText("Next version");
896
- redoButton.addActionListener(this);
897
- redoButton.setEnabled(false);
1111
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
+ nextVersionButton.setToolTipText("Next version");
1113
+ nextVersionButton.addActionListener(this);
1114
+ nextVersionButton.setEnabled(false);
1115
+
1116
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1117
+ oneStepButton.setToolTipText("Animate one step forward");
1118
+ oneStepButton.addActionListener(this);
8981119
8991120 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
9001121 liveCB.setToolTipText("Enable animation");
9011122 liveCB.addItemListener(this);
9021123
903
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
904
- oneStepButton.setToolTipText("Animate one step forward");
905
- oneStepButton.addActionListener(this);
906
-
9071124 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
9081125 fastCB.setToolTipText("Fast mode");
9091126 fastCB.addItemListener(this);
....@@ -930,21 +1147,6 @@
9301147
9311148 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
9321149
933
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
934
- twoButton.setToolTipText("Show 3D view only");
935
- twoButton.addActionListener(this);
936
- this.fullscreenLayout = twoButton;
937
-
938
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
- threeButton.setToolTipText("Show controls and 3D view");
940
- threeButton.addActionListener(this);
941
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
- sixButton.setToolTipText("Show 3D view and controls");
943
- sixButton.addActionListener(this);
944
-// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
-// sevenButton.setToolTipText("3-column layout");
946
-// sevenButton.addActionListener(this);
947
- //
9481150
9491151 oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
9501152 rootButton.setToolTipText("Open selection in new tab");
....@@ -1028,18 +1230,15 @@
10281230
10291231 oe.toolboxPanel.add(row2);
10301232
1031
- // ENVYMAPS
1032
- cGridBag skyboxpane = new cGridBag();
1033
- skyboxpane.preferredHeight = 100;
1233
+ cGridBag textures = new cGridBag();
10341234
1035
- oe.toolboxPanel.add(skyboxpane);
1235
+ CreateTexturePanel(textures);
10361236
1037
- JTabbedPane skyboxpanel = new JTabbedPane();
1038
- skyboxpane.add(skyboxpanel);
1237
+ oe.toolboxPanel.add(textures);
10391238
1040
- AddSkyboxTab0(skyboxpanel);
1041
- AddSkyboxTab1(skyboxpanel);
1042
- AddSkyboxTab2(skyboxpanel);
1239
+ textures.preferredHeight = 100;
1240
+
1241
+ CreateSkyboxPanel(oe.skyboxPanel);
10431242
10441243 // EDIT panel
10451244 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1047,20 +1246,20 @@
10471246 editButton.addActionListener(this);
10481247
10491248 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
- uneditButton.setToolTipText("Remove selection controls");
1249
+ uneditButton.setToolTipText("Unpin and remove selection controls");
10511250 uneditButton.addActionListener(this);
10521251
10531252 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1054
- allParamsButton.setToolTipText("Show all controle");
1253
+ allParamsButton.setToolTipText("Show all controls");
10551254 allParamsButton.addActionListener(this);
10561255
1057
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1058
- clearPanelButton.setToolTipText("Clear edit panel");
1256
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1257
+ clearPanelButton.setToolTipText("Clear all controls");
10591258 clearPanelButton.addActionListener(this);
10601259
1061
- editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1062
- unselectButton.setToolTipText("Unselect");
1063
- unselectButton.addActionListener(this);
1260
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1261
+ //unselectButton.setToolTipText("Unselect");
1262
+ //unselectButton.addActionListener(this);
10641263
10651264 editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10661265 flashSelectionButton.setToolTipText("Highlight selection");
....@@ -1120,7 +1319,7 @@
11201319 dgr.addDragGestureListener(this);
11211320 }catch(Exception e) {}
11221321 */
1123
- radio.layout = sixButton; // sevenButton;
1322
+ radio.layout = threeButton; // sixButton;
11241323 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
11251324 }
11261325
....@@ -1171,9 +1370,12 @@
11711370 smoothCB.setToolTipText("Snapping delay");
11721371 smoothCB.addItemListener(this);
11731372
1174
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1175
- slowCB.setToolTipText("Smooth interpolation");
1176
- slowCB.addItemListener(this);
1373
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1374
+// slowCB.setToolTipText("Smooth interpolation");
1375
+// slowCB.addItemListener(this);
1376
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1377
+ minshaderCB.setToolTipText("Minimal fast shader");
1378
+ minshaderCB.addItemListener(this);
11771379
11781380 // constraints.gridy += 1;
11791381 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -1262,7 +1464,7 @@
12621464 }
12631465
12641466 radioButton.SetObject(obj);
1265
- radioButton.layout = sixButton; // sevenButton;
1467
+ radioButton.layout = threeButton; // sixButton;
12661468 radioButton.SetCamera(cameraView.renderCamera, false);
12671469 radioButton.addActionListener(this);
12681470 radioPanel.add(radioButton);
....@@ -1287,6 +1489,8 @@
12871489 cCheckBox localCB;
12881490 cCheckBox crowdCB;
12891491 cCheckBox smoothCB;
1492
+ cCheckBox minshaderCB;
1493
+
12901494 cToggleButton fastCB;
12911495 cCheckBox slowCB;
12921496 cCheckBox boxCB;
....@@ -1357,6 +1561,12 @@
13571561 {
13581562 cameraView.ToggleInertia();
13591563 cameraView.repaint();
1564
+ }
1565
+ else if(e.getSource() == minshaderCB)
1566
+ {
1567
+ Globals.MINSHADER ^= true;
1568
+ cameraView.programInitialized = false;
1569
+ cameraView.repaint();
13601570 }
13611571 else if(e.getSource() == localCB)
13621572 {
....@@ -1634,7 +1844,12 @@
16341844 TreePath path;
16351845
16361846 public TransferableTreePath(TreePath tp) {
1637
- path = tp;
1847
+ Object[] objs = new Object[tp.getPathCount()];
1848
+ for (int i=0; i<objs.length; i++)
1849
+ {
1850
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1851
+ }
1852
+ path = new TreePath(objs);
16381853 }
16391854
16401855 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2497,7 +2712,7 @@
24972712 if (source == invariantsItem)
24982713 {
24992714 System.out.println("Invariants:");
2500
- Grafreed.grafreeD.universe.invariants();
2715
+ Grafreed.grafreed.universe.invariants();
25012716 } else
25022717 if (source == memoryItem)
25032718 {
....@@ -2528,33 +2743,52 @@
25282743 {
25292744 ToggleFullScreen();
25302745 } else
2531
- if (source == undoButton)
2746
+ if (source == collapseButton)
2747
+ {
2748
+ this.expandedLayout = radio.layout;
2749
+ CollapseToolbar();
2750
+ } else
2751
+ if (source == maximize3DButton)
2752
+ {
2753
+ this.expandedLayout = radio.layout;
2754
+ radio.layout = twoButton;
2755
+ Show3DView();
2756
+ CollapseToolbar();
2757
+ } else
2758
+ if (source == previousVersionButton)
25322759 {
25332760 // Go to previous version
25342761 //if (!Undo())
25352762 //java.awt.Toolkit.getDefaultToolkit().beep();
2536
- Undo();
2763
+ PreviousVersion();
25372764 } else
25382765 if (source == restoreButton)
25392766 {
25402767 // Restore current version
25412768 Restore();
2769
+ //restoreButton.setEnabled(false);
25422770 } else
25432771 if (source == replaceButton)
25442772 {
25452773 // Overwrite current version
25462774 Replace();
2775
+ //replaceButton.setEnabled(false);
25472776 } else
2548
- if (source == redoButton)
2777
+ if (source == nextVersionButton)
25492778 {
25502779 // Go to next version
2551
- Redo();
2780
+ NextVersion();
25522781 } else
2553
- if (source == saveButton)
2782
+ if (source == saveVersionButton)
25542783 {
25552784 // Save a new version
25562785 if (!Save(true))
25572786 java.awt.Toolkit.getDefaultToolkit().beep();
2787
+ } else
2788
+ if (source == deleteVersionButton)
2789
+ {
2790
+ // Delete a new version
2791
+ DeleteVersion();
25582792 } else
25592793 if (source == oneStepButton)
25602794 {
....@@ -2609,11 +2843,11 @@
26092843 } else
26102844 if (source == undoItem)
26112845 {
2612
- Undo();
2846
+ PreviousVersion();
26132847 } else
26142848 if (source == redoItem)
26152849 {
2616
- Redo();
2850
+ NextVersion();
26172851 } else
26182852 if (source == duplicateItem)
26192853 {
....@@ -3472,38 +3706,7 @@
34723706 if (CameraPane.FULLSCREEN)
34733707 fullscreenLayout = radio.layout;
34743708
3475
- // bug
3476
- //gridPanel.setDividerLocation(1.0);
3477
- //bigPanel.setDividerLocation(0.0);
3478
-// bigThree.remove(scenePanel);
3479
-// bigThree.remove(centralPanel);
3480
-// bigThree.remove(XYZPanel);
3481
-// aWindowConstraints.gridx = 0;
3482
-// aWindowConstraints.gridy = 0;
3483
-// aWindowConstraints.gridwidth = 1;
3484
-// // aConstraints.gridheight = 3;
3485
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3486
-// aWindowConstraints.weightx = 0;
3487
-// aWindowConstraints.weighty = 1;
3488
-// //bigThree.add(jtp, aWindowConstraints);
3489
-// aWindowConstraints.weightx = 1;
3490
-// aWindowConstraints.gridwidth = 3;
3491
-// // aConstraints.gridheight = 3;
3492
-// aWindowConstraints.gridx = 1;
3493
-// aWindowConstraints.fill = GridBagConstraints.BOTH;
3494
-// bigThree.add(centralPanel, aWindowConstraints);
3495
-// aWindowConstraints.weightx = 0;
3496
-// aWindowConstraints.gridx = 4;
3497
-// aWindowConstraints.gridwidth = 1;
3498
-// // aConstraints.gridheight = 3;
3499
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3500
-// //bigThree.add(XYZPanel, aWindowConstraints);
3501
-// scenePanel.setVisible(false);
3502
-// centralPanel.setVisible(true);
3503
-// XYZPanel.setVisible(false);
3504
- bigThree.ClearUI();
3505
- bigThree.add(centralPanel);
3506
- bigThree.FlushUI();
3709
+ Show3DView();
35073710
35083711 cameraView.requestFocusInWindow();
35093712
....@@ -3746,10 +3949,10 @@
37463949 {
37473950 Object3D child = (Object3D)e.nextElement();
37483951 if(child.editWindow != null)
3749
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
37503952 child.pinned = false;
37513953 child.CloseUI();
37523954 listUI.remove(child);
3955
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
37533956
37543957 //child.editWindow = null; // ???????????
37553958 }
....@@ -3768,6 +3971,7 @@
37683971 obj.CloseUI();
37693972 }
37703973 listUI.clear();
3974
+ SetPinStates(group.selection.size() > 0);
37713975 refreshContents(true);
37723976 } else
37733977 if (source == allParamsButton)
....@@ -3854,6 +4058,7 @@
38544058 radio.layout.doClick();
38554059
38564060 ClearUnpinned();
4061
+
38574062 //Grafreed.Assert(group != null);
38584063 //Grafreed.Assert(group.selection != null);
38594064 SetPinStates(group.selection == null || group.selection.size() > 0);
....@@ -3870,11 +4075,13 @@
38704075 } else if (event.getSource() == editCameraItem)
38714076 {
38724077 cameraView.ProtectCamera();
4078
+ cameraView.requestFocusInWindow();
38734079 cameraView.repaint();
38744080 return;
38754081 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
38764082 {
38774083 cameraView.RevertCamera();
4084
+ cameraView.requestFocusInWindow();
38784085 cameraView.repaint();
38794086 return;
38804087 // } else if (event.getSource() == textureButton)
....@@ -5007,9 +5214,7 @@
50075214
50085215 freezemodel = false;
50095216 }
5010
-
5011
- boolean flashIt = true;
5012
-
5217
+
50135218 public void valueChanged(TreeSelectionEvent e)
50145219 //public boolean handleEvent(Event event)
50155220 {
....@@ -5082,13 +5287,15 @@
50825287 {
50835288 editButton.setEnabled(enabled);
50845289 uneditButton.setEnabled(enabled);
5085
- unselectButton.setEnabled(enabled);
5290
+ //unselectButton.setEnabled(enabled);
50865291 flashSelectionButton.setEnabled(enabled);
5292
+
5293
+ clearPanelButton.setEnabled(!listUI.isEmpty());
50875294 }
50885295
50895296 void refreshContents(boolean cp)
50905297 {
5091
- if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5298
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
50925299 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
50935300 {
50945301 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5098,7 +5305,7 @@
50985305 Object3D child = (Object3D) group.selection.get(i);
50995306
51005307 objEditor.AddInfo(child, this, true);
5101
- System.err.println("info : " + child.GetPath());
5308
+// System.err.println("info : " + child.GetPath());
51025309 }
51035310
51045311 objEditor.SetText(); // jan 2014
....@@ -5924,7 +6131,6 @@
59246131
59256132 cButton restoreCameraButton;
59266133
5927
- cButton saveButton;
59286134 cButton oneStepButton;
59296135
59306136 cButton groupButton;