Normand Briere
2019-09-20 cbe4e90105d07d7d3fecabffaa01342403aa2ae3
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,9 +29,9 @@
2829 {
2930 cButton skyboxButton;
3031 final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
- row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF));
3233 //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
- skyboxButton.setToolTipText(s);
34
+ skyboxButton.setToolTipText(s.equals("") ? "No background" : s);
3435 skyboxButton.addActionListener(new ActionListener()
3536 {
3637 @Override
....@@ -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, !Globals.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);
....@@ -56,11 +73,11 @@
5673 cGridBag row5 = new cGridBag();
5774 cGridBag row6 = new cGridBag();
5875
59
- AddSkyboxButton("default", "rgb", row0);
76
+ AddSkyboxButton("default", "", row0);
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,112 @@
248262 //tab0.add(new cGridBag());
249263 }
250264 }
251
-
252
- public void ChangeSkybox(String name)
265
+
266
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
253267 {
254
- cameraView.envyoff = false;
255
- cameraView.skyboxname = name;
256
- cameraView.skyboxext = "jpg";
257
- cameraView.repaint();
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
+ if (skybox.endsWith("/"))
334
+ {
335
+ group.skyboxname = null;
336
+ group.skyboxext = null;
337
+ cameraView.repaint();
338
+ }
339
+ else
340
+ {
341
+ //cameraView.envyoff = false;
342
+ group.skyboxname = skybox;
343
+ group.skyboxext = "jpg";
344
+ cameraView.repaint();
345
+ }
346
+ }
347
+
348
+ public void CreateSkyboxPanel(cGridBag skyboxPanel)
349
+ {
350
+ JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT);
351
+
352
+ AddSkyboxTab0(skyboxpane);
353
+ AddSkyboxTab1(skyboxpane);
354
+ AddSkyboxTab2(skyboxpane);
355
+ AddSkyboxTab3(skyboxpane);
356
+
357
+ skyboxPanel.add(skyboxpane);
258358 }
259359
360
+ public void ChangeTexture(String texture)
361
+ {
362
+ for (int i=0; i<group.selection.size(); i++)
363
+ {
364
+ Object3D obj = group.selection.get(i);
365
+ obj.SetPigmentTexture("@" + texture);
366
+ }
367
+
368
+ refreshContents();
369
+ }
370
+
260371 //ObjEditor objEditor;
261372 public void closeUI2()
262373 {
....@@ -294,11 +405,15 @@
294405 this.copy = this.group = group;
295406 //selectees = this.group.selectees;
296407
297
- if (copy.versions == null)
298
- {
299
- copy.versions = new byte[100][];
300
- copy.versionindex = -1;
301
- }
408
+ assert(false);
409
+
410
+// if (copy.versionlist == null)
411
+// {
412
+// copy.versionlist = new Object3D[100];
413
+// copy.versionindex = -1;
414
+//
415
+// //Save(true);
416
+// }
302417
303418 if(ui)
304419 SetupUI(objEditor);
....@@ -321,13 +436,13 @@
321436
322437 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
323438
324
- if (copy.versions == null)
325
- {
326
- copy.versions = new byte[100][];
327
- copy.versionindex = -1;
328
-
329
- Save(true);
330
- }
439
+// if (copy.versionlist == null)
440
+// {
441
+// copy.versionlist = new Object3D[100];
442
+// copy.versionindex = -1;
443
+//
444
+// //Save(true);
445
+// }
331446 }
332447
333448 void CloneSelection(boolean supports)
....@@ -368,11 +483,16 @@
368483
369484 Object3D parent = obj.parent;
370485 obj.parent = null;
486
+
371487 // Object3D support = obj.support;
372488 // obj.support = null;
373489 if (!supports)
374490 obj.SaveSupports();
491
+
375492 Object3D clone = (Object3D)Grafreed.clone(obj);
493
+
494
+ clone.ResetUUIDs();
495
+
376496 obj.parent = parent;
377497 // obj.support = support;
378498 // clone.support = support; // aout 2013
....@@ -417,33 +537,37 @@
417537 // menu.add("-");
418538 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
419539 duplicateItem.addActionListener(this);
420
- cloneItem = menu.add(new MenuItem("Clone"));
540
+
541
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
421542 cloneItem.addActionListener(this);
422
- if (Globals.ADVANCED)
543
+ //if (Globals.ADVANCED)
423544 {
424545 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
425546 cloneSupportItem.addActionListener(this);
426547 }
548
+ oe.jTree.popup.addSeparator();
427549 menu.add("-");
428
- cutItem = menu.add(new MenuItem("Cut"));
550
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
429551 cutItem.addActionListener(this);
430
- copyItem = menu.add(new MenuItem("Copy"));
552
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
431553 copyItem.addActionListener(this);
432554 pasteItem = menu.add(new MenuItem("Paste"));
433555 pasteItem.addActionListener(this);
434556
435
- menu.add("-");
436
- pasteIntoItem = menu.add(new MenuItem("Paste into"));
557
+ oe.jTree.popup.addSeparator();
558
+ //menu.add("-");
559
+ pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into"));
437560 pasteIntoItem.addActionListener(this);
438
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
561
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
439562 pasteLinkItem.addActionListener(this);
440
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
563
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
441564 pasteCloneItem.addActionListener(this);
442
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
443
-// pasteExpandItem.addActionListener(this);
444
- menu.add("-");
445
- deleteItem = menu.add(new MenuItem("Delete"));
446
- deleteItem.addActionListener(this);
565
+// CRASH
566
+ pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
567
+//
568
+ pasteExpandItem.addActionListener(this);
569
+ //menu.add("-");
570
+ oe.jTree.popup.addSeparator();
447571
448572 if (Globals.ADVANCED)
449573 {
....@@ -529,11 +653,9 @@
529653 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
530654 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
531655 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
532
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
533656 oe.cameraMenu.add("-");
534657 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
535658 openWindowItem.addActionListener(this);
536
- editLeafItem.addActionListener(this);
537659 lookAtItem.addActionListener(this);
538660 //lookFromItem.addActinoListener(this);
539661 //switchViewItem.addActionListener(this);
....@@ -580,9 +702,8 @@
580702 setMasterItem.addActionListener(this);
581703 }
582704
583
- oe.menuBar.add(menu = new Menu("Group"));
584
-// grabItem = menu.add(new MenuItem("Grab"));
585
-// grabItem.addActionListener(this);
705
+ oe.menuBar.add(menu = new Menu("Order"));
706
+
586707 backItem = menu.add(new MenuItem("Back"));
587708 backItem.addActionListener(this);
588709 frontItem = menu.add(new MenuItem("Front"));
....@@ -590,13 +711,21 @@
590711 // compositeItem = menu.add(new MenuItem("Composite"));
591712 // compositeItem.addActionListener(this);
592713
714
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
715
+ grabItem.addActionListener(this);
716
+
593717 if (Globals.ADVANCED)
594718 {
595719 hideItem = menu.add(new MenuItem("Hidden Group"));
596720 hideItem.addActionListener(this);
597721 }
598
- ungroupItem = menu.add(new MenuItem("Ungroup"));
722
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
599723 ungroupItem.addActionListener(this);
724
+
725
+ oe.jTree.popup.addSeparator();
726
+
727
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
728
+ deleteItem.addActionListener(this);
600729
601730 // menu.add("-");
602731 //
....@@ -633,9 +762,9 @@
633762 shadowYItem.addActionListener(this);
634763 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
635764 shadowZItem.addActionListener(this);
765
+
636766 attributeItem = menu.add(new MenuItem("Attribute"));
637767 attributeItem.addActionListener(this);
638
-
639768 if (Globals.ADVANCED)
640769 {
641770 menu.add("-");
....@@ -647,11 +776,18 @@
647776 pointflowItem.addActionListener(this);
648777 }
649778 menu.add("-");
779
+ textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red"));
780
+ textureRatioRItem.addActionListener(this);
781
+ textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green"));
782
+ textureRatioGItem.addActionListener(this);
783
+ textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue"));
784
+ textureRatioBItem.addActionListener(this);
785
+ menu.add("-");
650786 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
651787 resetTransformItem.addActionListener(this);
652788 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
653789 resetCentroidItem.addActionListener(this);
654
- resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
790
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ"));
655791 resetCentroidXZItem.addActionListener(this);
656792 transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
657793 transformGeometryItem.addActionListener(this);
....@@ -667,7 +803,7 @@
667803 genNormalsCADItem.addActionListener(this);
668804 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
669805 genNormalsMESHItem.addActionListener(this);
670
- if (Globals.ADVANCED)
806
+ //if (Globals.ADVANCED)
671807 {
672808 genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
673809 genNormalsMINEItem.addActionListener(this);
....@@ -703,6 +839,8 @@
703839 }
704840
705841 oe.menuBar.add(menu = new Menu("Attributes"));
842
+ clearVersionsItem = menu.add(new MenuItem("Clear Versions"));
843
+ clearVersionsItem.addActionListener(this);
706844 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
707845 clearMaterialsItem.addActionListener(this);
708846 resetAllItem = menu.add(new MenuItem("Reset All"));
....@@ -725,9 +863,9 @@
725863 hideleavesItem.addActionListener(this);
726864 showleavesItem = menu.add(new MenuItem("Show Leaves"));
727865 showleavesItem.addActionListener(this);
728
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
866
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
729867 markleavesItem.addActionListener(this);
730
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
868
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
731869 unmarkleavesItem.addActionListener(this);
732870 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
733871 rewindleavesItem.addActionListener(this);
....@@ -781,6 +919,9 @@
781919 shareGeometriesItem.addActionListener(this);
782920 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
783921 mergeGeometriesItem.addActionListener(this);
922
+ menu.add("-");
923
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
924
+ editLeafItem.addActionListener(this);
784925 if (Globals.ADVANCED)
785926 {
786927 // Pretty much the same as duplicate and clone.
....@@ -797,6 +938,84 @@
797938 buildToolsMenu(menu);
798939 }
799940
941
+ JTabbedPane resourcecontainer;
942
+ cGridBag currenttab;
943
+ //boolean added; // patch for jar
944
+
945
+ int totalcount = 0;
946
+
947
+ int tabcount = 0;
948
+ int colcount = 0;
949
+ int rowcount = 0;
950
+ int texturecount = 0;
951
+
952
+ int columns = 5;
953
+ int rows = 7;
954
+
955
+ public void ResourceCallBack(String[] path)
956
+ {
957
+// for (int i = 0; i < path.length; i++)
958
+// System.out.print(path[i] + "/");
959
+// System.out.println();
960
+
961
+ if (//rowcount == 0 ||
962
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
963
+ {
964
+ currenttab = new cGridBag();
965
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
966
+ currenttab.setName(tabname);
967
+ //added = false;
968
+ resourcecontainer.add(currenttab);
969
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname);
970
+ rowcount = 1;
971
+ colcount = 0;
972
+ texturecount = 0;
973
+ }
974
+
975
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
976
+ {
977
+ //if (!added)
978
+ {
979
+ //added = true;
980
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
981
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
982
+ }
983
+
984
+ columns = 5;
985
+
986
+ if (path[0].contains("D&R") || path[0].contains("Paint"))
987
+ columns = 4;
988
+
989
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
990
+ totalcount++;
991
+
992
+ if (++colcount >= columns)
993
+ {
994
+ colcount = 0;
995
+ currenttab.Return();
996
+
997
+ if (rowcount++ >= rows)
998
+ {
999
+ rowcount = 0;
1000
+ }
1001
+ }
1002
+ }
1003
+ else
1004
+ {
1005
+// if (!path[path.length-1].equals("icons"))
1006
+// resourcecontainer.Return();
1007
+ }
1008
+ }
1009
+
1010
+ void CreateTexturePanel(cGridBag container)
1011
+ {
1012
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
1013
+ container.add(resourcecontainer);
1014
+
1015
+ Grafreed.ParseResources("textures", this);
1016
+
1017
+ // 935. System.out.println("Total = " + totalcount);
1018
+ }
8001019
8011020 void SetupUI2(ObjEditor oe)
8021021 {
....@@ -815,11 +1034,6 @@
8151034 //new Exception().printStackTrace();
8161035
8171036 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;
8231037 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8241038
8251039 oe.buttonGroup = new ButtonGroup();
....@@ -840,9 +1054,9 @@
8401054 oe.radioPanel.add(dummyButton);
8411055 oe.buttonGroup.add(dummyButton);
8421056 */
843
- cGridBag copyOptionsPanel = new cGridBag();
1057
+ cGridBag versionManagerPanel = new cGridBag();
8441058
845
- copyOptionsPanel.preferredHeight = 2;
1059
+ versionManagerPanel.preferredHeight = 4;
8461060
8471061 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
8481062
....@@ -852,58 +1066,102 @@
8521066
8531067 if (Globals.ADVANCED)
8541068 {
855
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
856
- maxButton.setToolTipText("Maximize window");
857
- maxButton.addActionListener(this);
1069
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1070
+// maxButton.setToolTipText("Maximize window");
1071
+// maxButton.addActionListener(this);
8581072 }
8591073
860
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
861
- fullButton.setToolTipText("Full-screen window");
862
- fullButton.addActionListener(this);
1074
+ cButton gcButton;
8631075
864
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1077
+// gcButton.setToolTipText("Garbage collect");
1078
+// gcButton.addActionListener(new ActionListener()
1079
+// {
1080
+// public void actionPerformed(ActionEvent e)
1081
+// {
1082
+// System.gc();
1083
+// }
1084
+// });
1085
+
1086
+ oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1087
+ fullScreenButton.setToolTipText("Full-screen window");
1088
+ fullScreenButton.addActionListener(this);
1089
+
1090
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1091
+ collapseButton.setToolTipText("Collapse toolbar");
1092
+ collapseButton.addActionListener(this);
1093
+
1094
+// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1095
+// maximize3DButton.setToolTipText("Maximize 3D view");
1096
+// maximize3DButton.addActionListener(this);
1097
+
1098
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1099
+ twoButton.setToolTipText("Show 3D view only");
1100
+ twoButton.addActionListener(this);
1101
+ this.fullscreenLayout = twoButton;
1102
+
1103
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1104
+ threeButton.setToolTipText("Show controls and 3D view");
1105
+ threeButton.addActionListener(this);
1106
+ if (Globals.ADVANCED)
1107
+ {
1108
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1109
+ sixButton.setToolTipText("Show 3D view and controls");
1110
+ sixButton.addActionListener(this);
1111
+ }
1112
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+// sevenButton.setToolTipText("3-column layout");
1114
+// sevenButton.addActionListener(this);
1115
+ //
1116
+
1117
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
8651118 screenfitButton.setToolTipText("Screen fit");
8661119 screenfitButton.addActionListener(this);
8671120
868
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1121
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
8691122 restoreCameraButton.setToolTipText("Restore viewpoint");
8701123 restoreCameraButton.addActionListener(this);
8711124
872
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
873
- saveButton.setToolTipText("New version");
874
- saveButton.addActionListener(this);
1125
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1126
+ saveVersionButton.setToolTipText("Duplicate current version");
1127
+ saveVersionButton.addActionListener(this);
8751128
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);
1129
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1130
+ deleteVersionButton.setToolTipText("Delete current version");
1131
+ deleteVersionButton.addActionListener(this);
1132
+ deleteVersionButton.setEnabled(false);
1133
+
1134
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1135
+ previousVersionButton.setToolTipText("Previous version");
1136
+ previousVersionButton.addActionListener(this);
1137
+ previousVersionButton.setEnabled(false);
8801138
8811139 cGridBag updown = new cGridBag().setVertical(true);
882
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
883
- restoreButton.setToolTipText("Restore current");
1140
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1141
+ restoreButton.setToolTipText("Undo (restore current version)");
8841142 restoreButton.addActionListener(this);
8851143 restoreButton.setEnabled(false);
8861144
887
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
888
- replaceButton.setToolTipText("Replace current");
1145
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1146
+ replaceButton.setToolTipText("Save (replace current version)");
8891147 replaceButton.addActionListener(this);
8901148 replaceButton.setEnabled(false);
8911149
892
- copyOptionsPanel.add(updown);
1150
+ versionManagerPanel.add(updown);
8931151
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);
1152
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1153
+ nextVersionButton.setToolTipText("Next version");
1154
+ nextVersionButton.addActionListener(this);
1155
+ nextVersionButton.setEnabled(false);
1156
+
1157
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1158
+ oneStepButton.setToolTipText("Animate one step forward");
1159
+ oneStepButton.addActionListener(this);
8981160
8991161 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
9001162 liveCB.setToolTipText("Enable animation");
9011163 liveCB.addItemListener(this);
9021164
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
-
9071165 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
9081166 fastCB.setToolTipText("Fast mode");
9091167 fastCB.addItemListener(this);
....@@ -919,150 +1177,139 @@
9191177
9201178 if (Globals.ADVANCED)
9211179 {
922
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1180
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9231181 snapobjectButton.addActionListener(this);
9241182 snapobjectButton.setToolTipText("Snap Object");
9251183
926
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1184
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9271185 fourButton.addActionListener(this);
9281186 fourButton.setToolTipText("Show control panel only");
9291187 }
9301188
9311189 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
9321190
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
- //
9481191
949
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1192
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9501193 rootButton.setToolTipText("Open selection in new tab");
9511194 rootButton.addActionListener(this);
9521195
953
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1196
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9541197 closeButton.setToolTipText("Close tab");
9551198 closeButton.addActionListener(this);
9561199 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
9571200 //clearButton.addActionListener(this);
9581201
9591202 cGridBag row1 = new cGridBag();
1203
+ row1.preferredHeight = 8;
9601204
9611205 // INSERT
962
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
963
- gridButton.setToolTipText("Create grid");
1206
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1207
+ gridButton.setToolTipText("Create ground");
9641208 gridButton.addActionListener(this);
9651209
966
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1210
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9671211 boxButton.setToolTipText("Create box");
9681212 boxButton.addActionListener(this);
9691213
970
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
971
- sphereButton.setToolTipText("Create sphere");
972
- sphereButton.addActionListener(this);
973
-
974
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
975
- coneButton.setToolTipText("Create cone");
976
- coneButton.addActionListener(this);
977
-
978
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
979
- torusButton.setToolTipText("Create torus");
980
- torusButton.addActionListener(this);
981
-
982
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1214
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9831215 superButton.setToolTipText("Create superellipsoid");
9841216 superButton.addActionListener(this);
9851217
986
- if (Globals.ADVANCED)
1218
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1219
+ sphereButton.setToolTipText("Create sphere");
1220
+ sphereButton.addActionListener(this);
1221
+
1222
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1223
+ coneButton.setToolTipText("Create cone");
1224
+ coneButton.addActionListener(this);
1225
+
1226
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1227
+ torusButton.setToolTipText("Create torus");
1228
+ torusButton.addActionListener(this);
1229
+
1230
+ if (false) //Globals.ADVANCED)
9871231 {
988
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1232
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9891233 kleinButton.setToolTipText("Create Klein bottle");
9901234 kleinButton.addActionListener(this);
9911235 }
9921236
993
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1237
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9941238 particlesButton.setToolTipText("Create particle system");
9951239 particlesButton.addActionListener(this);
9961240
9971241 oe.toolboxPanel.add(row1);
9981242
9991243 cGridBag row2 = new cGridBag();
1244
+ row2.preferredHeight = 8;
10001245
1001
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1246
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10021247 groupButton.setToolTipText("Create group");
10031248 groupButton.addActionListener(this);
10041249
1005
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1250
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10061251 compositeButton.setToolTipText("Create composite");
10071252 compositeButton.addActionListener(this);
10081253
1009
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1254
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10101255 switchButton.setToolTipText("Create item switcher");
10111256 switchButton.addActionListener(this);
10121257
1013
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1258
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10141259 loopButton.setToolTipText("Create loop");
10151260 loopButton.addActionListener(this);
10161261
1017
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1262
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10181263 textureButton.setToolTipText("Create texture");
10191264 textureButton.addActionListener(this);
10201265
1021
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1266
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10221267 overlayButton.setToolTipText("Create overlay");
10231268 overlayButton.addActionListener(this);
10241269
1025
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1270
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10261271 lightButton.setToolTipText("Create light");
10271272 lightButton.addActionListener(this);
10281273
10291274 oe.toolboxPanel.add(row2);
10301275
1031
- // ENVYMAPS
1032
- cGridBag skyboxpane = new cGridBag();
1033
- skyboxpane.preferredHeight = 100;
1276
+ cGridBag textures = new cGridBag();
10341277
1035
- oe.toolboxPanel.add(skyboxpane);
1278
+ CreateTexturePanel(textures);
10361279
1037
- JTabbedPane skyboxpanel = new JTabbedPane();
1038
- skyboxpane.add(skyboxpanel);
1280
+ int tabCount = resourcecontainer.getTabCount();
10391281
1040
- AddSkyboxTab0(skyboxpanel);
1041
- AddSkyboxTab1(skyboxpanel);
1042
- AddSkyboxTab2(skyboxpanel);
1282
+ if (tabCount > 0)
1283
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1284
+
1285
+ oe.toolboxPanel.add(textures);
1286
+
1287
+ textures.preferredHeight = 100;
1288
+
1289
+ CreateSkyboxPanel(oe.skyboxPanel);
10431290
10441291 // EDIT panel
1045
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1292
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10461293 editButton.setToolTipText("Pin selection controls");
10471294 editButton.addActionListener(this);
10481295
1049
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
- uneditButton.setToolTipText("Remove selection controls");
1296
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1297
+ uneditButton.setToolTipText("Unpin and remove selection controls");
10511298 uneditButton.addActionListener(this);
10521299
10531300 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1054
- allParamsButton.setToolTipText("Show all controle");
1301
+ allParamsButton.setToolTipText("Show all controls");
10551302 allParamsButton.addActionListener(this);
10561303
1057
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1058
- clearPanelButton.setToolTipText("Clear edit panel");
1304
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1305
+ clearPanelButton.setToolTipText("Clear all controls");
10591306 clearPanelButton.addActionListener(this);
10601307
1061
- editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1062
- unselectButton.setToolTipText("Unselect");
1063
- unselectButton.addActionListener(this);
1308
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1309
+ //unselectButton.setToolTipText("Unselect");
1310
+ //unselectButton.addActionListener(this);
10641311
1065
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1312
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10661313 flashSelectionButton.setToolTipText("Highlight selection");
10671314 flashSelectionButton.addActionListener(this);
10681315
....@@ -1085,6 +1332,8 @@
10851332
10861333 cGridBag jSPPanel = new cGridBag();
10871334
1335
+ jSPPanel.preferredHeight = 20;
1336
+
10881337 JScrollPane jSP;
10891338 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
10901339 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1093,11 +1342,12 @@
10931342 oe.treePanel.add(jSPPanel);
10941343 oe.treePanel.Return();
10951344
1096
- oe.treePanel.add(copyOptionsPanel);
1345
+ oe.treePanel.add(versionManagerPanel);
10971346 oe.treePanel.Return();
1098
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1099
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1100
- sliderPane.preferredHeight = 1;
1347
+
1348
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1349
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1350
+ versionSliderPane.preferredHeight = 3;
11011351
11021352 // mainPanel.setDividerLocation(0.1); //1.0);
11031353 mainPanel.setResizeWeight(0.4);
....@@ -1120,7 +1370,7 @@
11201370 dgr.addDragGestureListener(this);
11211371 }catch(Exception e) {}
11221372 */
1123
- radio.layout = sixButton; // sevenButton;
1373
+ radio.layout = threeButton; // sixButton;
11241374 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
11251375 }
11261376
....@@ -1154,7 +1404,7 @@
11541404 // supportCB.setToolTipText("Enable rigging");
11551405 // supportCB.addItemListener(this);
11561406
1157
- panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1407
+ panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints);
11581408 freezeCB.setToolTipText("Fast moving camera");
11591409 freezeCB.addItemListener(this);
11601410
....@@ -1163,42 +1413,44 @@
11631413
11641414 panel.Return();
11651415
1416
+ if (Globals.ADVANCED)
1417
+ {
11661418 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
11671419 crowdCB.setToolTipText("Used for crowds");
11681420 crowdCB.addItemListener(this);
1421
+ }
11691422
11701423 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
11711424 smoothCB.setToolTipText("Snapping delay");
11721425 smoothCB.addItemListener(this);
11731426
1174
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1175
- slowCB.setToolTipText("Smooth interpolation");
1176
- slowCB.addItemListener(this);
1427
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1428
+// slowCB.setToolTipText("Smooth interpolation");
1429
+// slowCB.addItemListener(this);
1430
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1431
+ minshaderCB.setToolTipText("Minimal fast shader");
1432
+ minshaderCB.addItemListener(this);
11771433
1178
-// constraints.gridy += 1;
11791434 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
11801435 // speakerMocapCB.addItemListener(this);
11811436
1182
- panel.Return();
1183
-
11841437 if (false)
11851438 {
11861439 // handled in scripts
1187
- //constraints.gridy += 1;
11881440 panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
11891441 speakerCameraCB.addItemListener(this);
11901442
1191
- //constraints.gridy += 1;
11921443 panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
11931444 speakerFocusCB.addItemListener(this);
11941445
1195
- //constraints.gridy += 1;
1196
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1197
- smoothfocusCB.addItemListener(this);
11981446 panel.Return();
11991447 }
12001448
1201
-//constraints.gridx += 1;
1449
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1450
+ smoothfocusCB.addItemListener(this);
1451
+
1452
+ panel.Return();
1453
+
12021454 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
12031455 // debugCB.addItemListener(this);
12041456
....@@ -1252,6 +1504,14 @@
12521504
12531505 void EditObject(Object3D obj)
12541506 {
1507
+ //assert(obj instanceof Composite);
1508
+
1509
+// if (obj.versionlist == null)
1510
+// {
1511
+// obj.versionlist = new Object3D[100];
1512
+// obj.versionindex = -1;
1513
+// }
1514
+
12551515 cRadio radioButton = new cRadio(obj.name);
12561516
12571517 // June 2019. Patch to avoid bug with transparency.
....@@ -1262,7 +1522,7 @@
12621522 }
12631523
12641524 radioButton.SetObject(obj);
1265
- radioButton.layout = sixButton; // sevenButton;
1525
+ radioButton.layout = threeButton; // sixButton;
12661526 radioButton.SetCamera(cameraView.renderCamera, false);
12671527 radioButton.addActionListener(this);
12681528 radioPanel.add(radioButton);
....@@ -1276,6 +1536,7 @@
12761536
12771537 oe.SetupViews();
12781538
1539
+ if (Globals.DEBUG)
12791540 System.out.println("SetupViews");
12801541 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
12811542 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -1287,6 +1548,8 @@
12871548 cCheckBox localCB;
12881549 cCheckBox crowdCB;
12891550 cCheckBox smoothCB;
1551
+ cCheckBox minshaderCB;
1552
+
12901553 cToggleButton fastCB;
12911554 cCheckBox slowCB;
12921555 cCheckBox boxCB;
....@@ -1357,6 +1620,12 @@
13571620 {
13581621 cameraView.ToggleInertia();
13591622 cameraView.repaint();
1623
+ }
1624
+ else if(e.getSource() == minshaderCB)
1625
+ {
1626
+ Globals.MINSHADER ^= true;
1627
+ cameraView.programInitialized = false;
1628
+ cameraView.repaint();
13601629 }
13611630 else if(e.getSource() == localCB)
13621631 {
....@@ -1634,7 +1903,12 @@
16341903 TreePath path;
16351904
16361905 public TransferableTreePath(TreePath tp) {
1637
- path = tp;
1906
+ Object[] objs = new Object[tp.getPathCount()];
1907
+ for (int i=0; i<objs.length; i++)
1908
+ {
1909
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1910
+ }
1911
+ path = new TreePath(objs);
16381912 }
16391913
16401914 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -1815,7 +2089,7 @@
18152089 Object3D obj = (Object3D)group.selection.elementAt(0);
18162090 objEditor.ScreenFit(obj, false);
18172091
1818
- cameraView.pingthread.StepToTarget(true);
2092
+ cameraView.pingthread.StepToTarget(); //true);
18192093 refreshContents();
18202094 }
18212095
....@@ -1852,7 +2126,7 @@
18522126 obj.parent.TransformToWorld(maxima); //, maxima);
18532127 }
18542128
1855
- Object3D shadow = new Object3D("Shadow " + obj.name);
2129
+ Object3D shadow = new Object3D("Shadow" + obj.name);
18562130
18572131 shadow.toParent = LA.newMatrix();
18582132 shadow.fromParent = LA.newMatrix();
....@@ -1866,24 +2140,24 @@
18662140 switch(axis)
18672141 {
18682142 case 0 :
1869
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
1870
- vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z;
1871
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
1872
- vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z;
2143
+ vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z;
2144
+ vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z;
2145
+ vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z;
2146
+ vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z;
18732147 norm = cVector.X;
18742148 break;
18752149 case 1 :
1876
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
1877
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
1878
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
1879
- vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z;
2150
+ vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z;
2151
+ vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z;
2152
+ vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z;
2153
+ vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z;
18802154 norm = cVector.Y;
18812155 break;
18822156 case 2 :
1883
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
1884
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
1885
- vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z;
1886
- vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z;
2157
+ vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f;
2158
+ vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f;
2159
+ vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f;
2160
+ vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f;
18872161 norm = cVector.Z;
18882162 break;
18892163 }
....@@ -1924,7 +2198,11 @@
19242198 shadow.material = new cMaterial(obj.material);
19252199 shadow.material.diffuse = 0.0001f;
19262200 shadow.material.specular = 0.0001f;
1927
- //shadow.projectedVertices[1].x = 300;
2201
+ shadow.material.opacity = 0.75f;
2202
+
2203
+ AllocProjectedVertices(shadow);
2204
+
2205
+ shadow.projectedVertices[1].x = 300;
19282206
19292207 makeSomething(shadow);
19302208 }
....@@ -2445,27 +2723,35 @@
24452723 } else
24462724 if (source == loopItem || source == loopButton)
24472725 {
2726
+ if (!group.selection.isEmpty())
2727
+ {
24482728 Composite csg = new GroupLeaf();
2449
- csg.count = 5;
24502729 group(csg);
2730
+ csg.count = 5;
24512731 Composite child = new cGroup("Branch");
24522732 csg.addChild(child);
24532733 child.addChild(csg);
2734
+ }
24542735 } else
24552736 if (source == doubleItem)
24562737 {
2738
+ if (!group.selection.isEmpty())
2739
+ {
24572740 Composite csg = new GroupLeaf("Fork");
2458
- csg.count = 5;
24592741 group(csg);
2742
+ csg.count = 5;
24602743 Composite child = new cGroup("Branch A");
24612744 csg.addChild(child);
24622745 child.addChild(csg);
24632746 child = new cGroup("Branch B");
24642747 csg.addChild(child);
24652748 child.addChild(csg);
2749
+ }
24662750 } else
24672751 if (source == tripleItem)
24682752 {
2753
+ if (!group.selection.isEmpty())
2754
+ {
24692755 Composite csg = new GroupLeaf("Trident");
24702756 csg.count = 4;
24712757 group(csg);
....@@ -2478,6 +2764,7 @@
24782764 child = new cGroup();
24792765 csg.addChild(child);
24802766 child.addChild(csg);
2767
+ }
24812768 } else
24822769 if (source == computeAOItem)
24832770 {
....@@ -2497,7 +2784,7 @@
24972784 if (source == invariantsItem)
24982785 {
24992786 System.out.println("Invariants:");
2500
- Grafreed.grafreeD.universe.invariants();
2787
+ Grafreed.grafreed.universe.invariants();
25012788 } else
25022789 if (source == memoryItem)
25032790 {
....@@ -2524,37 +2811,56 @@
25242811 {
25252812 Maximize();
25262813 } else
2527
- if (source == fullButton)
2814
+ if (source == fullScreenButton)
25282815 {
25292816 ToggleFullScreen();
25302817 } else
2531
- if (source == undoButton)
2818
+ if (source == collapseButton)
2819
+ {
2820
+ this.expandedLayout = radio.layout;
2821
+ CollapseToolbar();
2822
+ } else
2823
+// if (source == maximize3DButton)
2824
+// {
2825
+// this.expandedLayout = radio.layout;
2826
+// radio.layout = twoButton;
2827
+// CollapseToolbar();
2828
+// Show3DView();
2829
+// } else
2830
+ if (source == previousVersionButton)
25322831 {
25332832 // Go to previous version
25342833 //if (!Undo())
25352834 //java.awt.Toolkit.getDefaultToolkit().beep();
2536
- Undo();
2835
+ PreviousVersion();
25372836 } else
25382837 if (source == restoreButton)
25392838 {
25402839 // Restore current version
25412840 Restore();
2841
+ //restoreButton.setEnabled(false);
25422842 } else
25432843 if (source == replaceButton)
25442844 {
25452845 // Overwrite current version
25462846 Replace();
2847
+ //replaceButton.setEnabled(false);
25472848 } else
2548
- if (source == redoButton)
2849
+ if (source == nextVersionButton)
25492850 {
25502851 // Go to next version
2551
- Redo();
2852
+ NextVersion();
25522853 } else
2553
- if (source == saveButton)
2854
+ if (source == saveVersionButton)
25542855 {
25552856 // Save a new version
2556
- if (!Save(true))
2857
+ if (!DuplicateVersion()) //true))
25572858 java.awt.Toolkit.getDefaultToolkit().beep();
2859
+ } else
2860
+ if (source == deleteVersionButton)
2861
+ {
2862
+ // Delete a new version
2863
+ DeleteVersion();
25582864 } else
25592865 if (source == oneStepButton)
25602866 {
....@@ -2609,11 +2915,11 @@
26092915 } else
26102916 if (source == undoItem)
26112917 {
2612
- Undo();
2918
+ PreviousVersion();
26132919 } else
26142920 if (source == redoItem)
26152921 {
2616
- Redo();
2922
+ NextVersion();
26172923 } else
26182924 if (source == duplicateItem)
26192925 {
....@@ -3094,22 +3400,34 @@
30943400 } else
30953401 if (source == ungroupItem || source == ungroupButton)
30963402 {
3097
- boolean hasRoot = false;
3403
+ boolean canUngroup = true;
30983404
30993405 for (int i=0; i<group.selection.size(); i++)
31003406 {
3101
- if (group.selection.get(i) == group)
3407
+ Object3D selectedItem = group.selection.get(i);
3408
+
3409
+ if (selectedItem.Size() == 0)
31023410 {
3103
- hasRoot = true;
3411
+ // Cannot ungroup leaves
3412
+ canUngroup = false;
3413
+ break;
3414
+ }
3415
+
3416
+ if (selectedItem == group)
3417
+ {
3418
+ // Cannot ungroup root
3419
+ canUngroup = false;
31043420 break;
31053421 }
31063422 }
31073423
3108
- if (!hasRoot)
3424
+ if (canUngroup)
31093425 {
31103426 for (int i=0; i<group.selection.size(); i++)
31113427 {
3112
- Ungroup(group.selection.get(i));
3428
+ Object3D selectedItem = group.selection.get(i);
3429
+
3430
+ Ungroup(selectedItem);
31133431 }
31143432
31153433 ClearSelection(false);
....@@ -3160,6 +3478,10 @@
31603478 if (source == clearMaterialsItem)
31613479 {
31623480 ClearMaterials();
3481
+ } else
3482
+ if (source == clearVersionsItem)
3483
+ {
3484
+ ClearVersions();
31633485 } else
31643486 if (source == liveleavesItem)
31653487 {
....@@ -3300,6 +3622,18 @@
33003622 if (source == transformChildrenItem)
33013623 {
33023624 TransformChildren();
3625
+ } else
3626
+ if (source == textureRatioRItem)
3627
+ {
3628
+ TextureRatio(0);
3629
+ } else
3630
+ if (source == textureRatioGItem)
3631
+ {
3632
+ TextureRatio(1);
3633
+ } else
3634
+ if (source == textureRatioBItem)
3635
+ {
3636
+ TextureRatio(2);
33033637 } else
33043638 if (source == resetTransformItem)
33053639 {
....@@ -3472,38 +3806,7 @@
34723806 if (CameraPane.FULLSCREEN)
34733807 fullscreenLayout = radio.layout;
34743808
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();
3809
+ Show3DView();
35073810
35083811 cameraView.requestFocusInWindow();
35093812
....@@ -3689,6 +3992,7 @@
36893992 } else
36903993 if (source == rootButton)
36913994 {
3995
+ Replace();
36923996 Object3D obj;
36933997 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
36943998 {
....@@ -3703,6 +4007,9 @@
37034007 if (source == closeButton)
37044008 {
37054009 //System.out.println("CLOSE: " + buttonGroup.getSelection());
4010
+ if (copy.versionlist != null)
4011
+ Replace();
4012
+
37064013 cRadio ab;
37074014 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
37084015 {
....@@ -3746,10 +4053,10 @@
37464053 {
37474054 Object3D child = (Object3D)e.nextElement();
37484055 if(child.editWindow != null)
3749
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
37504056 child.pinned = false;
37514057 child.CloseUI();
37524058 listUI.remove(child);
4059
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
37534060
37544061 //child.editWindow = null; // ???????????
37554062 }
....@@ -3768,6 +4075,7 @@
37684075 obj.CloseUI();
37694076 }
37704077 listUI.clear();
4078
+ SetPinStates(group.selection.size() > 0);
37714079 refreshContents(true);
37724080 } else
37734081 if (source == allParamsButton)
....@@ -3800,6 +4108,9 @@
38004108 } else
38014109 if(source instanceof cRadio)
38024110 {
4111
+ if (copy.versionlist != null)
4112
+ Replace();
4113
+
38034114 group.parent = keepparent;
38044115 group.attributes = 0;
38054116 //group.editWindow = null;
....@@ -3824,8 +4135,6 @@
38244135
38254136 copy = group;
38264137
3827
- SetUndoStates();
3828
-
38294138 //Globals.theRenderer.object = group;
38304139 if(!useclient)
38314140 {
....@@ -3853,7 +4162,34 @@
38534162 */
38544163 radio.layout.doClick();
38554164
4165
+ //assert(copy instanceof Composite);
4166
+
4167
+ if (copy.versionlist == null)
4168
+ {
4169
+ copy.versionindex = -1;
4170
+
4171
+ // Cannot work with loops
4172
+ // To fix this issue, we first mark all nodes above the root,
4173
+ // and check if any of these nodes are reachable below the root.
4174
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4175
+
4176
+ if (copy instanceof Composite && !copy.HasTags())
4177
+ {
4178
+ if (copy.versionlist == null)
4179
+ copy.versionlist = new Object3D[100];
4180
+
4181
+ //Save(true);
4182
+ }
4183
+ else
4184
+ copy.versionindex = -2;
4185
+
4186
+ Grafreed.grafreed.universe.TagObjects(copy, false);
4187
+ }
4188
+
4189
+ SetVersionStates();
4190
+
38564191 ClearUnpinned();
4192
+
38574193 //Grafreed.Assert(group != null);
38584194 //Grafreed.Assert(group.selection != null);
38594195 SetPinStates(group.selection == null || group.selection.size() > 0);
....@@ -3870,11 +4206,13 @@
38704206 } else if (event.getSource() == editCameraItem)
38714207 {
38724208 cameraView.ProtectCamera();
4209
+ cameraView.requestFocusInWindow();
38734210 cameraView.repaint();
38744211 return;
38754212 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
38764213 {
38774214 cameraView.RevertCamera();
4215
+ cameraView.requestFocusInWindow();
38784216 cameraView.repaint();
38794217 return;
38804218 // } else if (event.getSource() == textureButton)
....@@ -3963,9 +4301,46 @@
39634301 refreshContents();
39644302 }
39654303
4304
+ void TextureRatio(int axis)
4305
+ {
4306
+ Object3D obj;
4307
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4308
+ {
4309
+ obj = (Object3D)e.nextElement();
4310
+ obj.TextureRatio(axis);
4311
+ }
4312
+
4313
+ refreshContents();
4314
+ }
4315
+
39664316 void ResetTransform()
39674317 {
39684318 ResetTransform(-1);
4319
+ }
4320
+
4321
+ void ScaleSelection(int scale)
4322
+ {
4323
+ Object3D obj;
4324
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4325
+ {
4326
+ obj = (Object3D)e.nextElement();
4327
+
4328
+ if (obj.toParent == null)
4329
+ continue;
4330
+
4331
+ obj.Scale(scale);
4332
+
4333
+ if (obj.parent == null)
4334
+ {
4335
+ System.out.println("NULL PARENT!");
4336
+ // new Exception().printStackTrace();
4337
+ }
4338
+ else
4339
+ TouchTransform(obj);
4340
+ //obj.parent.Touch();
4341
+ }
4342
+
4343
+ refreshContents();
39694344 }
39704345
39714346 void ResetTransform(int mask)
....@@ -3978,42 +4353,8 @@
39784353 if (obj.toParent == null)
39794354 continue;
39804355
3981
- if (mask == -1)
3982
- {
3983
- if (obj instanceof Camera) // jan 2014
3984
- {
3985
- LA.matIdentity(obj.toParent);
3986
- LA.matIdentity(obj.fromParent);
3987
- }
3988
- else
3989
- {
3990
- obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent);
3991
- obj.fromParent = null; // LA.matIdentity(obj.fromParent);
3992
- }
3993
- TouchTransform(obj);
3994
- continue;
3995
- }
3996
- if ((mask&2) != 0) // Scale
3997
- {
3998
- obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
3999
- obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
4000
- obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0;
4001
- obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
4002
- obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
4003
- obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4004
- }
4005
- if ((mask&4) != 0) // Rotation
4006
- {
4007
- // ?
4008
- }
4009
- if ((mask&1) != 0) // Translation
4010
- {
4011
- if (obj.toParent != null)
4012
- {
4013
- obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0;
4014
- obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0;
4015
- }
4016
- }
4356
+ obj.ResetTransform(mask);
4357
+
40174358 if (obj.parent == null)
40184359 {
40194360 System.out.println("NULL PARENT!");
....@@ -4522,10 +4863,17 @@
45224863 {
45234864 Object3D obj = group.selection.get(i);
45244865
4866
+ if (obj.toParent == null)
4867
+ {
4868
+ obj.toParent = LA.newMatrix();
4869
+ obj.fromParent = LA.newMatrix();
4870
+ }
4871
+
45254872 LA.matTranslate(obj.toParent, i * scale, 0, 0);
45264873 LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
45274874 }
45284875
4876
+ Globals.lighttouched = true;
45294877 refreshContents();
45304878 }
45314879
....@@ -4813,6 +5161,12 @@
48135161 refreshContents();
48145162 }
48155163
5164
+ void ClearVersions()
5165
+ {
5166
+ group.selection.ClearVersions();
5167
+ refreshContents();
5168
+ }
5169
+
48165170 void FlipV(boolean flip)
48175171 {
48185172 group.selection.FlipV(flip);
....@@ -5007,9 +5361,7 @@
50075361
50085362 freezemodel = false;
50095363 }
5010
-
5011
- boolean flashIt = true;
5012
-
5364
+
50135365 public void valueChanged(TreeSelectionEvent e)
50145366 //public boolean handleEvent(Event event)
50155367 {
....@@ -5053,10 +5405,10 @@
50535405 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
50545406 // a camera
50555407 {
5056
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5408
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace
50575409 {
50585410 CameraPane.camerachangeframe = 0; // don't refuse it
5059
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5411
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true);
50605412 }
50615413 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
50625414 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
....@@ -5082,13 +5434,31 @@
50825434 {
50835435 editButton.setEnabled(enabled);
50845436 uneditButton.setEnabled(enabled);
5085
- unselectButton.setEnabled(enabled);
5437
+ //unselectButton.setEnabled(enabled);
50865438 flashSelectionButton.setEnabled(enabled);
5439
+
5440
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5441
+
5442
+ boolean allComposites = true;
5443
+
5444
+ if (group.selection != null)
5445
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5446
+ {
5447
+ Object next = e.nextElement();
5448
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
5449
+ {
5450
+ allComposites = false;
5451
+ break;
5452
+ }
5453
+ }
5454
+
5455
+ rootButton.setEnabled(true); // allComposites);
50875456 }
50885457
50895458 void refreshContents(boolean cp)
50905459 {
5091
- if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5460
+ if (Globals.SHOWINFO)
5461
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
50925462 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
50935463 {
50945464 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5098,7 +5468,7 @@
50985468 Object3D child = (Object3D) group.selection.get(i);
50995469
51005470 objEditor.AddInfo(child, this, true);
5101
- System.err.println("info : " + child.GetPath());
5471
+// System.err.println("info : " + child.GetPath());
51025472 }
51035473
51045474 objEditor.SetText(); // jan 2014
....@@ -5924,7 +6294,6 @@
59246294
59256295 cButton restoreCameraButton;
59266296
5927
- cButton saveButton;
59286297 cButton oneStepButton;
59296298
59306299 cButton groupButton;
....@@ -5982,11 +6351,11 @@
59826351 private MenuItem lookAtItem;
59836352 private MenuItem lookFromItem;
59846353 private MenuItem switchViewItem;
5985
- private MenuItem cutItem;
6354
+ private JMenuItem cutItem;
59866355 private MenuItem undoItem;
59876356 private MenuItem redoItem;
59886357 private JMenuItem duplicateItem;
5989
- private MenuItem cloneItem;
6358
+ private JMenuItem cloneItem;
59906359 private MenuItem cloneSupportItem;
59916360 private MenuItem overwriteGeoItem;
59926361 private MenuItem overwriteMatItem;
....@@ -6007,13 +6376,13 @@
60076376 private MenuItem cloneGeometriesItem;
60086377 private MenuItem shareGeometriesItem;
60096378 private MenuItem mergeGeometriesItem;
6010
- private MenuItem copyItem;
6379
+ private JMenuItem copyItem;
60116380 private MenuItem pasteItem;
6012
- private MenuItem pasteIntoItem;
6013
- private MenuItem pasteLinkItem;
6014
- private MenuItem pasteCloneItem;
6015
- private MenuItem pasteExpandItem;
6016
- private MenuItem deleteItem;
6381
+ private JMenuItem pasteIntoItem;
6382
+ private JMenuItem pasteLinkItem;
6383
+ private JMenuItem pasteCloneItem;
6384
+ private JMenuItem pasteExpandItem;
6385
+ private JMenuItem deleteItem;
60176386 private MenuItem clearAllItem;
60186387 private MenuItem genUVItem;
60196388 private MenuItem genNormalsMESHItem;
....@@ -6039,6 +6408,7 @@
60396408 private MenuItem clipMeshItem;
60406409 private MenuItem smoothMeshItem;
60416410 private MenuItem clearMaterialsItem;
6411
+ private MenuItem clearVersionsItem;
60426412
60436413 private MenuItem liveleavesItem;
60446414 private MenuItem unliveleavesItem;
....@@ -6062,13 +6432,16 @@
60626432 private MenuItem maxTexturesItem;
60636433 private MenuItem panoTexturesItem;
60646434
6435
+ private MenuItem textureRatioRItem;
6436
+ private MenuItem textureRatioGItem;
6437
+ private MenuItem textureRatioBItem;
60656438 private MenuItem resetCentroidItem;
60666439 private MenuItem resetCentroidXZItem;
60676440 private MenuItem resetTransformItem;
60686441 private MenuItem transformGeometryItem;
60696442 private MenuItem transformChildrenItem;
60706443 private MenuItem hideItem;
6071
- private MenuItem grabItem;
6444
+ private JMenuItem grabItem;
60726445 private MenuItem backItem;
60736446 private MenuItem frontItem;
60746447 private MenuItem cameraItem;
....@@ -6081,7 +6454,7 @@
60816454 private MenuItem switchTransfoItem;
60826455 private MenuItem morphItem;
60836456 private MenuItem linkerItem;
6084
- private MenuItem ungroupItem;
6457
+ private JMenuItem ungroupItem;
60856458 private MenuItem editItem;
60866459 private MenuItem openWindowItem;
60876460 private MenuItem editLeafItem;