Normand Briere
2019-09-02 21ac57b36a9e3b909853c7d64ac29b7ad72490a3
GroupEditor.java
....@@ -29,9 +29,9 @@
2929 {
3030 cButton skyboxButton;
3131 final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
- row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF));
3333 //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
34
- skyboxButton.setToolTipText(s);
34
+ skyboxButton.setToolTipText(s.equals("") ? "No background" : s);
3535 skyboxButton.addActionListener(new ActionListener()
3636 {
3737 @Override
....@@ -46,7 +46,7 @@
4646 {
4747 cButton textureButton;
4848 final String path = "textures/" + f + "/" + c + "/"; // + t;
49
- row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF));
5050 textureButton.setToolTipText(c + count);
5151 textureButton.addActionListener(new ActionListener()
5252 {
....@@ -73,7 +73,7 @@
7373 cGridBag row5 = new cGridBag();
7474 cGridBag row6 = new cGridBag();
7575
76
- AddSkyboxButton("default", "rgb", row0);
76
+ AddSkyboxButton("default", "", row0);
7777 //AddSkyboxButton("default", "cornell", row0);
7878 AddSkyboxButton("penguins", "dust", row0);
7979 AddSkyboxButton("penguins", "tropic", row0);
....@@ -330,15 +330,24 @@
330330
331331 public void ChangeSkybox(String skybox)
332332 {
333
- //cameraView.envyoff = false;
334
- group.skyboxname = skybox;
335
- group.skyboxext = "jpg";
336
- cameraView.repaint();
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
+ }
337346 }
338347
339348 public void CreateSkyboxPanel(cGridBag skyboxPanel)
340349 {
341
- JTabbedPane skyboxpane = new JTabbedPane();
350
+ JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT);
342351
343352 AddSkyboxTab0(skyboxpane);
344353 AddSkyboxTab1(skyboxpane);
....@@ -357,16 +366,6 @@
357366 }
358367
359368 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();
370369 }
371370
372371 //ObjEditor objEditor;
....@@ -406,13 +405,15 @@
406405 this.copy = this.group = group;
407406 //selectees = this.group.selectees;
408407
409
- if (copy.versionlist == null)
410
- {
411
- copy.versionlist = new Object3D[100];
412
- copy.versionindex = -1;
413
-
414
- Save(true);
415
- }
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
+// }
416417
417418 if(ui)
418419 SetupUI(objEditor);
....@@ -435,13 +436,13 @@
435436
436437 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
437438
438
- if (copy.versionlist == null)
439
- {
440
- copy.versionlist = new Object3D[100];
441
- copy.versionindex = -1;
442
-
443
- Save(true);
444
- }
439
+// if (copy.versionlist == null)
440
+// {
441
+// copy.versionlist = new Object3D[100];
442
+// copy.versionindex = -1;
443
+//
444
+// //Save(true);
445
+// }
445446 }
446447
447448 void CloneSelection(boolean supports)
....@@ -531,33 +532,35 @@
531532 // menu.add("-");
532533 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
533534 duplicateItem.addActionListener(this);
534
- cloneItem = menu.add(new MenuItem("Clone"));
535
+
536
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
535537 cloneItem.addActionListener(this);
536
- if (Globals.ADVANCED)
538
+ //if (Globals.ADVANCED)
537539 {
538540 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
539541 cloneSupportItem.addActionListener(this);
540542 }
543
+ oe.jTree.popup.addSeparator();
541544 menu.add("-");
542
- cutItem = menu.add(new MenuItem("Cut"));
545
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
543546 cutItem.addActionListener(this);
544
- copyItem = menu.add(new MenuItem("Copy"));
547
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
545548 copyItem.addActionListener(this);
546549 pasteItem = menu.add(new MenuItem("Paste"));
547550 pasteItem.addActionListener(this);
548551
549
- menu.add("-");
550
- pasteIntoItem = menu.add(new MenuItem("Paste into"));
552
+ oe.jTree.popup.addSeparator();
553
+ //menu.add("-");
554
+ pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into"));
551555 pasteIntoItem.addActionListener(this);
552
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
556
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
553557 pasteLinkItem.addActionListener(this);
554
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
558
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
555559 pasteCloneItem.addActionListener(this);
556
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
560
+// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
557561 // pasteExpandItem.addActionListener(this);
558
- menu.add("-");
559
- deleteItem = menu.add(new MenuItem("Delete"));
560
- deleteItem.addActionListener(this);
562
+ //menu.add("-");
563
+ oe.jTree.popup.addSeparator();
561564
562565 if (Globals.ADVANCED)
563566 {
....@@ -692,9 +695,8 @@
692695 setMasterItem.addActionListener(this);
693696 }
694697
695
- oe.menuBar.add(menu = new Menu("Group"));
696
-// grabItem = menu.add(new MenuItem("Grab"));
697
-// grabItem.addActionListener(this);
698
+ oe.menuBar.add(menu = new Menu("Order"));
699
+
698700 backItem = menu.add(new MenuItem("Back"));
699701 backItem.addActionListener(this);
700702 frontItem = menu.add(new MenuItem("Front"));
....@@ -702,13 +704,21 @@
702704 // compositeItem = menu.add(new MenuItem("Composite"));
703705 // compositeItem.addActionListener(this);
704706
707
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
708
+ grabItem.addActionListener(this);
709
+
705710 if (Globals.ADVANCED)
706711 {
707712 hideItem = menu.add(new MenuItem("Hidden Group"));
708713 hideItem.addActionListener(this);
709714 }
710
- ungroupItem = menu.add(new MenuItem("Ungroup"));
715
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
711716 ungroupItem.addActionListener(this);
717
+
718
+ oe.jTree.popup.addSeparator();
719
+
720
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
721
+ deleteItem.addActionListener(this);
712722
713723 // menu.add("-");
714724 //
....@@ -745,9 +755,9 @@
745755 shadowYItem.addActionListener(this);
746756 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
747757 shadowZItem.addActionListener(this);
758
+
748759 attributeItem = menu.add(new MenuItem("Attribute"));
749760 attributeItem.addActionListener(this);
750
-
751761 if (Globals.ADVANCED)
752762 {
753763 menu.add("-");
....@@ -759,11 +769,18 @@
759769 pointflowItem.addActionListener(this);
760770 }
761771 menu.add("-");
772
+ textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red"));
773
+ textureRatioRItem.addActionListener(this);
774
+ textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green"));
775
+ textureRatioGItem.addActionListener(this);
776
+ textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue"));
777
+ textureRatioBItem.addActionListener(this);
778
+ menu.add("-");
762779 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
763780 resetTransformItem.addActionListener(this);
764781 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
765782 resetCentroidItem.addActionListener(this);
766
- resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
783
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ"));
767784 resetCentroidXZItem.addActionListener(this);
768785 transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
769786 transformGeometryItem.addActionListener(this);
....@@ -815,6 +832,8 @@
815832 }
816833
817834 oe.menuBar.add(menu = new Menu("Attributes"));
835
+ clearVersionsItem = menu.add(new MenuItem("Clear Versions"));
836
+ clearVersionsItem.addActionListener(this);
818837 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
819838 clearMaterialsItem.addActionListener(this);
820839 resetAllItem = menu.add(new MenuItem("Reset All"));
....@@ -837,9 +856,9 @@
837856 hideleavesItem.addActionListener(this);
838857 showleavesItem = menu.add(new MenuItem("Show Leaves"));
839858 showleavesItem.addActionListener(this);
840
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
859
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
841860 markleavesItem.addActionListener(this);
842
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
861
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
843862 unmarkleavesItem.addActionListener(this);
844863 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
845864 rewindleavesItem.addActionListener(this);
....@@ -914,8 +933,10 @@
914933
915934 JTabbedPane resourcecontainer;
916935 cGridBag currenttab;
917
- boolean added; // patch for jar
936
+ //boolean added; // patch for jar
918937
938
+ int totalcount = 0;
939
+
919940 int tabcount = 0;
920941 int colcount = 0;
921942 int rowcount = 0;
....@@ -931,28 +952,30 @@
931952 // System.out.println();
932953
933954 if (//rowcount == 0 ||
934
- path.length == 1)
955
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
935956 {
936957 currenttab = new cGridBag();
937
- added = false;
938958 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
939959 currenttab.setName(tabname);
960
+ //added = false;
961
+ resourcecontainer.add(currenttab);
962
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
940963 rowcount = 1;
941964 colcount = 0;
942965 texturecount = 0;
943966 }
944967
945
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
968
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
946969 {
947
- if (!added)
970
+ //if (!added)
948971 {
949
- added = true;
950
- resourcecontainer.add(currenttab);
972
+ //added = true;
951973 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
952
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
974
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
953975 }
954976
955
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
977
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
978
+ totalcount++;
956979
957980 if (++colcount >= columns)
958981 {
....@@ -978,6 +1001,8 @@
9781001 container.add(resourcecontainer);
9791002
9801003 Grafreed.ParseResources("textures", this);
1004
+
1005
+ // 935. System.out.println("Total = " + totalcount);
9811006 }
9821007
9831008 void SetupUI2(ObjEditor oe)
....@@ -1017,9 +1042,9 @@
10171042 oe.radioPanel.add(dummyButton);
10181043 oe.buttonGroup.add(dummyButton);
10191044 */
1020
- cGridBag copyOptionsPanel = new cGridBag();
1045
+ cGridBag versionManagerPanel = new cGridBag();
10211046
1022
- copyOptionsPanel.preferredHeight = 2;
1047
+ versionManagerPanel.preferredHeight = 4;
10231048
10241049 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10251050
....@@ -1034,8 +1059,8 @@
10341059 // maxButton.addActionListener(this);
10351060 }
10361061
1037
-// cButton gcButton;
1038
-//
1062
+ cButton gcButton;
1063
+
10391064 // oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10401065 // gcButton.setToolTipText("Garbage collect");
10411066 // gcButton.addActionListener(new ActionListener()
....@@ -1046,25 +1071,29 @@
10461071 // }
10471072 // });
10481073
1049
- oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1074
+ oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1075
+ fullScreenButton.setToolTipText("Full-screen window");
1076
+ fullScreenButton.addActionListener(this);
1077
+
1078
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10501079 collapseButton.setToolTipText("Collapse toolbar");
10511080 collapseButton.addActionListener(this);
10521081
1053
- oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1054
- maximize3DButton.setToolTipText("Maximize 3D view");
1055
- maximize3DButton.addActionListener(this);
1082
+// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1083
+// maximize3DButton.setToolTipText("Maximize 3D view");
1084
+// maximize3DButton.addActionListener(this);
10561085
1057
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1086
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10581087 twoButton.setToolTipText("Show 3D view only");
10591088 twoButton.addActionListener(this);
10601089 this.fullscreenLayout = twoButton;
10611090
1062
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1091
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10631092 threeButton.setToolTipText("Show controls and 3D view");
10641093 threeButton.addActionListener(this);
10651094 if (Globals.ADVANCED)
10661095 {
1067
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1096
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10681097 sixButton.setToolTipText("Show 3D view and controls");
10691098 sixButton.addActionListener(this);
10701099 }
....@@ -1073,50 +1102,47 @@
10731102 // sevenButton.addActionListener(this);
10741103 //
10751104
1076
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1077
- fullButton.setToolTipText("Full-screen window");
1078
- fullButton.addActionListener(this);
1079
-
1080
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1105
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10811106 screenfitButton.setToolTipText("Screen fit");
10821107 screenfitButton.addActionListener(this);
10831108
1084
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10851110 restoreCameraButton.setToolTipText("Restore viewpoint");
10861111 restoreCameraButton.addActionListener(this);
10871112
1088
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10891114 saveVersionButton.setToolTipText("Duplicate current version");
10901115 saveVersionButton.addActionListener(this);
10911116
1092
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1117
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10931118 deleteVersionButton.setToolTipText("Delete current version");
10941119 deleteVersionButton.addActionListener(this);
1120
+ deleteVersionButton.setEnabled(false);
10951121
1096
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1122
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10971123 previousVersionButton.setToolTipText("Previous version");
10981124 previousVersionButton.addActionListener(this);
10991125 previousVersionButton.setEnabled(false);
11001126
11011127 cGridBag updown = new cGridBag().setVertical(true);
1102
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1128
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11031129 restoreButton.setToolTipText("Undo (restore current version)");
11041130 restoreButton.addActionListener(this);
1105
- //restoreButton.setEnabled(false);
1131
+ restoreButton.setEnabled(false);
11061132
1107
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1133
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11081134 replaceButton.setToolTipText("Save (replace current version)");
11091135 replaceButton.addActionListener(this);
1110
- //replaceButton.setEnabled(false);
1136
+ replaceButton.setEnabled(false);
11111137
1112
- copyOptionsPanel.add(updown);
1138
+ versionManagerPanel.add(updown);
11131139
1114
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1140
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11151141 nextVersionButton.setToolTipText("Next version");
11161142 nextVersionButton.addActionListener(this);
11171143 nextVersionButton.setEnabled(false);
11181144
1119
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1145
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11201146 oneStepButton.setToolTipText("Animate one step forward");
11211147 oneStepButton.addActionListener(this);
11221148
....@@ -1139,11 +1165,11 @@
11391165
11401166 if (Globals.ADVANCED)
11411167 {
1142
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1168
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11431169 snapobjectButton.addActionListener(this);
11441170 snapobjectButton.setToolTipText("Snap Object");
11451171
1146
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1172
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11471173 fourButton.addActionListener(this);
11481174 fourButton.setToolTipText("Show control panel only");
11491175 }
....@@ -1151,11 +1177,11 @@
11511177 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11521178
11531179
1154
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1180
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11551181 rootButton.setToolTipText("Open selection in new tab");
11561182 rootButton.addActionListener(this);
11571183
1158
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1184
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11591185 closeButton.setToolTipText("Close tab");
11601186 closeButton.addActionListener(this);
11611187 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1164,38 +1190,38 @@
11641190 cGridBag row1 = new cGridBag();
11651191
11661192 // INSERT
1167
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1193
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11681194 gridButton.setToolTipText("Create ground");
11691195 gridButton.addActionListener(this);
11701196
1171
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1197
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11721198 boxButton.setToolTipText("Create box");
11731199 boxButton.addActionListener(this);
11741200
1175
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1176
- sphereButton.setToolTipText("Create sphere");
1177
- sphereButton.addActionListener(this);
1178
-
1179
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1180
- coneButton.setToolTipText("Create cone");
1181
- coneButton.addActionListener(this);
1182
-
1183
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1184
- torusButton.setToolTipText("Create torus");
1185
- torusButton.addActionListener(this);
1186
-
1187
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1201
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11881202 superButton.setToolTipText("Create superellipsoid");
11891203 superButton.addActionListener(this);
11901204
1191
- if (Globals.ADVANCED)
1205
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1206
+ sphereButton.setToolTipText("Create sphere");
1207
+ sphereButton.addActionListener(this);
1208
+
1209
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1210
+ coneButton.setToolTipText("Create cone");
1211
+ coneButton.addActionListener(this);
1212
+
1213
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1214
+ torusButton.setToolTipText("Create torus");
1215
+ torusButton.addActionListener(this);
1216
+
1217
+ if (false) //Globals.ADVANCED)
11921218 {
1193
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1219
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11941220 kleinButton.setToolTipText("Create Klein bottle");
11951221 kleinButton.addActionListener(this);
11961222 }
11971223
1198
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1224
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11991225 particlesButton.setToolTipText("Create particle system");
12001226 particlesButton.addActionListener(this);
12011227
....@@ -1203,31 +1229,31 @@
12031229
12041230 cGridBag row2 = new cGridBag();
12051231
1206
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1232
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12071233 groupButton.setToolTipText("Create group");
12081234 groupButton.addActionListener(this);
12091235
1210
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1236
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12111237 compositeButton.setToolTipText("Create composite");
12121238 compositeButton.addActionListener(this);
12131239
1214
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1240
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12151241 switchButton.setToolTipText("Create item switcher");
12161242 switchButton.addActionListener(this);
12171243
1218
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1244
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12191245 loopButton.setToolTipText("Create loop");
12201246 loopButton.addActionListener(this);
12211247
1222
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1248
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12231249 textureButton.setToolTipText("Create texture");
12241250 textureButton.addActionListener(this);
12251251
1226
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1252
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12271253 overlayButton.setToolTipText("Create overlay");
12281254 overlayButton.addActionListener(this);
12291255
1230
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1256
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12311257 lightButton.setToolTipText("Create light");
12321258 lightButton.addActionListener(this);
12331259
....@@ -1237,6 +1263,11 @@
12371263
12381264 CreateTexturePanel(textures);
12391265
1266
+ int tabCount = resourcecontainer.getTabCount();
1267
+
1268
+ if (tabCount > 0)
1269
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1270
+
12401271 oe.toolboxPanel.add(textures);
12411272
12421273 textures.preferredHeight = 100;
....@@ -1244,11 +1275,11 @@
12441275 CreateSkyboxPanel(oe.skyboxPanel);
12451276
12461277 // EDIT panel
1247
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1278
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12481279 editButton.setToolTipText("Pin selection controls");
12491280 editButton.addActionListener(this);
12501281
1251
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1282
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12521283 uneditButton.setToolTipText("Unpin and remove selection controls");
12531284 uneditButton.addActionListener(this);
12541285
....@@ -1256,7 +1287,7 @@
12561287 allParamsButton.setToolTipText("Show all controls");
12571288 allParamsButton.addActionListener(this);
12581289
1259
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1290
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12601291 clearPanelButton.setToolTipText("Clear all controls");
12611292 clearPanelButton.addActionListener(this);
12621293
....@@ -1264,7 +1295,7 @@
12641295 //unselectButton.setToolTipText("Unselect");
12651296 //unselectButton.addActionListener(this);
12661297
1267
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1298
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12681299 flashSelectionButton.setToolTipText("Highlight selection");
12691300 flashSelectionButton.addActionListener(this);
12701301
....@@ -1287,6 +1318,8 @@
12871318
12881319 cGridBag jSPPanel = new cGridBag();
12891320
1321
+ jSPPanel.preferredHeight = 20;
1322
+
12901323 JScrollPane jSP;
12911324 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
12921325 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1295,11 +1328,11 @@
12951328 oe.treePanel.add(jSPPanel);
12961329 oe.treePanel.Return();
12971330
1298
- oe.treePanel.add(copyOptionsPanel);
1331
+ oe.treePanel.add(versionManagerPanel);
12991332 oe.treePanel.Return();
1300
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1301
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1302
- sliderPane.preferredHeight = 1;
1333
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1334
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1335
+ versionSliderPane.preferredHeight = 3;
13031336
13041337 // mainPanel.setDividerLocation(0.1); //1.0);
13051338 mainPanel.setResizeWeight(0.4);
....@@ -1457,13 +1490,13 @@
14571490
14581491 void EditObject(Object3D obj)
14591492 {
1460
- assert(obj instanceof Composite);
1493
+ //assert(obj instanceof Composite);
14611494
1462
- if (obj.versionlist == null)
1463
- {
1464
- obj.versionlist = new Object3D[100];
1465
- obj.versionindex = -1;
1466
- }
1495
+// if (obj.versionlist == null)
1496
+// {
1497
+// obj.versionlist = new Object3D[100];
1498
+// obj.versionindex = -1;
1499
+// }
14671500
14681501 cRadio radioButton = new cRadio(obj.name);
14691502
....@@ -1489,6 +1522,7 @@
14891522
14901523 oe.SetupViews();
14911524
1525
+ if (Globals.DEBUG)
14921526 System.out.println("SetupViews");
14931527 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
14941528 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -2092,24 +2126,24 @@
20922126 switch(axis)
20932127 {
20942128 case 0 :
2095
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2096
- vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z;
2097
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2098
- vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z;
2129
+ vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z;
2130
+ vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z;
2131
+ vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z;
2132
+ vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z;
20992133 norm = cVector.X;
21002134 break;
21012135 case 1 :
2102
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2103
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2104
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2105
- vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z;
2136
+ vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z;
2137
+ vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z;
2138
+ vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z;
2139
+ vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z;
21062140 norm = cVector.Y;
21072141 break;
21082142 case 2 :
2109
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2110
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2111
- vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z;
2112
- vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z;
2143
+ vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f;
2144
+ vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f;
2145
+ vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f;
2146
+ vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f;
21132147 norm = cVector.Z;
21142148 break;
21152149 }
....@@ -2150,7 +2184,11 @@
21502184 shadow.material = new cMaterial(obj.material);
21512185 shadow.material.diffuse = 0.0001f;
21522186 shadow.material.specular = 0.0001f;
2153
- //shadow.projectedVertices[1].x = 300;
2187
+ shadow.material.opacity = 0.75f;
2188
+
2189
+ AllocProjectedVertices(shadow);
2190
+
2191
+ shadow.projectedVertices[1].x = 300;
21542192
21552193 makeSomething(shadow);
21562194 }
....@@ -2671,27 +2709,35 @@
26712709 } else
26722710 if (source == loopItem || source == loopButton)
26732711 {
2712
+ if (!group.selection.isEmpty())
2713
+ {
26742714 Composite csg = new GroupLeaf();
2675
- csg.count = 5;
26762715 group(csg);
2716
+ csg.count = 5;
26772717 Composite child = new cGroup("Branch");
26782718 csg.addChild(child);
26792719 child.addChild(csg);
2720
+ }
26802721 } else
26812722 if (source == doubleItem)
26822723 {
2724
+ if (!group.selection.isEmpty())
2725
+ {
26832726 Composite csg = new GroupLeaf("Fork");
2684
- csg.count = 5;
26852727 group(csg);
2728
+ csg.count = 5;
26862729 Composite child = new cGroup("Branch A");
26872730 csg.addChild(child);
26882731 child.addChild(csg);
26892732 child = new cGroup("Branch B");
26902733 csg.addChild(child);
26912734 child.addChild(csg);
2735
+ }
26922736 } else
26932737 if (source == tripleItem)
26942738 {
2739
+ if (!group.selection.isEmpty())
2740
+ {
26952741 Composite csg = new GroupLeaf("Trident");
26962742 csg.count = 4;
26972743 group(csg);
....@@ -2704,6 +2750,7 @@
27042750 child = new cGroup();
27052751 csg.addChild(child);
27062752 child.addChild(csg);
2753
+ }
27072754 } else
27082755 if (source == computeAOItem)
27092756 {
....@@ -2750,7 +2797,7 @@
27502797 {
27512798 Maximize();
27522799 } else
2753
- if (source == fullButton)
2800
+ if (source == fullScreenButton)
27542801 {
27552802 ToggleFullScreen();
27562803 } else
....@@ -2759,13 +2806,13 @@
27592806 this.expandedLayout = radio.layout;
27602807 CollapseToolbar();
27612808 } else
2762
- if (source == maximize3DButton)
2763
- {
2764
- this.expandedLayout = radio.layout;
2765
- radio.layout = twoButton;
2766
- Show3DView();
2767
- CollapseToolbar();
2768
- } else
2809
+// if (source == maximize3DButton)
2810
+// {
2811
+// this.expandedLayout = radio.layout;
2812
+// radio.layout = twoButton;
2813
+// CollapseToolbar();
2814
+// Show3DView();
2815
+// } else
27692816 if (source == previousVersionButton)
27702817 {
27712818 // Go to previous version
....@@ -3339,22 +3386,34 @@
33393386 } else
33403387 if (source == ungroupItem || source == ungroupButton)
33413388 {
3342
- boolean hasRoot = false;
3389
+ boolean canUngroup = true;
33433390
33443391 for (int i=0; i<group.selection.size(); i++)
33453392 {
3346
- if (group.selection.get(i) == group)
3393
+ Object3D selectedItem = group.selection.get(i);
3394
+
3395
+ if (selectedItem.Size() == 0)
33473396 {
3348
- hasRoot = true;
3397
+ // Cannot ungroup leaves
3398
+ canUngroup = false;
3399
+ break;
3400
+ }
3401
+
3402
+ if (selectedItem == group)
3403
+ {
3404
+ // Cannot ungroup root
3405
+ canUngroup = false;
33493406 break;
33503407 }
33513408 }
33523409
3353
- if (!hasRoot)
3410
+ if (canUngroup)
33543411 {
33553412 for (int i=0; i<group.selection.size(); i++)
33563413 {
3357
- Ungroup(group.selection.get(i));
3414
+ Object3D selectedItem = group.selection.get(i);
3415
+
3416
+ Ungroup(selectedItem);
33583417 }
33593418
33603419 ClearSelection(false);
....@@ -3405,6 +3464,10 @@
34053464 if (source == clearMaterialsItem)
34063465 {
34073466 ClearMaterials();
3467
+ } else
3468
+ if (source == clearVersionsItem)
3469
+ {
3470
+ ClearVersions();
34083471 } else
34093472 if (source == liveleavesItem)
34103473 {
....@@ -3545,6 +3608,18 @@
35453608 if (source == transformChildrenItem)
35463609 {
35473610 TransformChildren();
3611
+ } else
3612
+ if (source == textureRatioRItem)
3613
+ {
3614
+ TextureRatio(0);
3615
+ } else
3616
+ if (source == textureRatioGItem)
3617
+ {
3618
+ TextureRatio(1);
3619
+ } else
3620
+ if (source == textureRatioBItem)
3621
+ {
3622
+ TextureRatio(2);
35483623 } else
35493624 if (source == resetTransformItem)
35503625 {
....@@ -3918,6 +3993,9 @@
39183993 if (source == closeButton)
39193994 {
39203995 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3996
+ if (copy.versionlist != null)
3997
+ Replace();
3998
+
39213999 cRadio ab;
39224000 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39234001 {
....@@ -4016,6 +4094,9 @@
40164094 } else
40174095 if(source instanceof cRadio)
40184096 {
4097
+ if (copy.versionlist != null)
4098
+ Replace();
4099
+
40194100 group.parent = keepparent;
40204101 group.attributes = 0;
40214102 //group.editWindow = null;
....@@ -4067,7 +4148,31 @@
40674148 */
40684149 radio.layout.doClick();
40694150
4070
- SetUndoStates();
4151
+ //assert(copy instanceof Composite);
4152
+
4153
+ if (copy.versionlist == null)
4154
+ {
4155
+ copy.versionindex = -1;
4156
+
4157
+ // Cannot work with loops
4158
+ // To fix this issue, we first mark all nodes above the root,
4159
+ // and check if any of these nodes are reachable below the root.
4160
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4161
+
4162
+ if (copy instanceof Composite && !copy.HasTags())
4163
+ {
4164
+ if (copy.versionlist == null)
4165
+ copy.versionlist = new Object3D[100];
4166
+
4167
+ //Save(true);
4168
+ }
4169
+ else
4170
+ copy.versionindex = -2;
4171
+
4172
+ Grafreed.grafreed.universe.TagObjects(copy, false);
4173
+ }
4174
+
4175
+ SetVersionStates();
40714176
40724177 ClearUnpinned();
40734178
....@@ -4182,6 +4287,18 @@
41824287 refreshContents();
41834288 }
41844289
4290
+ void TextureRatio(int axis)
4291
+ {
4292
+ Object3D obj;
4293
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4294
+ {
4295
+ obj = (Object3D)e.nextElement();
4296
+ obj.TextureRatio(axis);
4297
+ }
4298
+
4299
+ refreshContents();
4300
+ }
4301
+
41854302 void ResetTransform()
41864303 {
41874304 ResetTransform(-1);
....@@ -4197,42 +4314,8 @@
41974314 if (obj.toParent == null)
41984315 continue;
41994316
4200
- if (mask == -1)
4201
- {
4202
- if (obj instanceof Camera) // jan 2014
4203
- {
4204
- LA.matIdentity(obj.toParent);
4205
- LA.matIdentity(obj.fromParent);
4206
- }
4207
- else
4208
- {
4209
- obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent);
4210
- obj.fromParent = null; // LA.matIdentity(obj.fromParent);
4211
- }
4212
- TouchTransform(obj);
4213
- continue;
4214
- }
4215
- if ((mask&2) != 0) // Scale
4216
- {
4217
- obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
4218
- obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
4219
- obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0;
4220
- obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
4221
- obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
4222
- obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4223
- }
4224
- if ((mask&4) != 0) // Rotation
4225
- {
4226
- // ?
4227
- }
4228
- if ((mask&1) != 0) // Translation
4229
- {
4230
- if (obj.toParent != null)
4231
- {
4232
- obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0;
4233
- obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0;
4234
- }
4235
- }
4317
+ obj.ResetTransform(mask);
4318
+
42364319 if (obj.parent == null)
42374320 {
42384321 System.out.println("NULL PARENT!");
....@@ -4741,6 +4824,12 @@
47414824 {
47424825 Object3D obj = group.selection.get(i);
47434826
4827
+ if (obj.toParent == null)
4828
+ {
4829
+ obj.toParent = LA.newMatrix();
4830
+ obj.fromParent = LA.newMatrix();
4831
+ }
4832
+
47444833 LA.matTranslate(obj.toParent, i * scale, 0, 0);
47454834 LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
47464835 }
....@@ -5032,6 +5121,12 @@
50325121 refreshContents();
50335122 }
50345123
5124
+ void ClearVersions()
5125
+ {
5126
+ group.selection.ClearVersions();
5127
+ refreshContents();
5128
+ }
5129
+
50355130 void FlipV(boolean flip)
50365131 {
50375132 group.selection.FlipV(flip);
....@@ -5270,7 +5365,7 @@
52705365 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
52715366 // a camera
52725367 {
5273
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5368
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace
52745369 {
52755370 CameraPane.camerachangeframe = 0; // don't refuse it
52765371 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -5306,20 +5401,23 @@
53065401
53075402 boolean allComposites = true;
53085403
5404
+ if (group.selection != null)
53095405 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
53105406 {
5311
- if (!(e.nextElement() instanceof Composite))
5407
+ Object next = e.nextElement();
5408
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
53125409 {
53135410 allComposites = false;
53145411 break;
53155412 }
53165413 }
53175414
5318
- rootButton.setEnabled(allComposites);
5415
+ rootButton.setEnabled(true); // allComposites);
53195416 }
53205417
53215418 void refreshContents(boolean cp)
53225419 {
5420
+ if (Globals.SHOWINFO)
53235421 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53245422 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53255423 {
....@@ -6213,11 +6311,11 @@
62136311 private MenuItem lookAtItem;
62146312 private MenuItem lookFromItem;
62156313 private MenuItem switchViewItem;
6216
- private MenuItem cutItem;
6314
+ private JMenuItem cutItem;
62176315 private MenuItem undoItem;
62186316 private MenuItem redoItem;
62196317 private JMenuItem duplicateItem;
6220
- private MenuItem cloneItem;
6318
+ private JMenuItem cloneItem;
62216319 private MenuItem cloneSupportItem;
62226320 private MenuItem overwriteGeoItem;
62236321 private MenuItem overwriteMatItem;
....@@ -6238,13 +6336,13 @@
62386336 private MenuItem cloneGeometriesItem;
62396337 private MenuItem shareGeometriesItem;
62406338 private MenuItem mergeGeometriesItem;
6241
- private MenuItem copyItem;
6339
+ private JMenuItem copyItem;
62426340 private MenuItem pasteItem;
6243
- private MenuItem pasteIntoItem;
6244
- private MenuItem pasteLinkItem;
6245
- private MenuItem pasteCloneItem;
6246
- private MenuItem pasteExpandItem;
6247
- private MenuItem deleteItem;
6341
+ private JMenuItem pasteIntoItem;
6342
+ private JMenuItem pasteLinkItem;
6343
+ private JMenuItem pasteCloneItem;
6344
+ private JMenuItem pasteExpandItem;
6345
+ private JMenuItem deleteItem;
62486346 private MenuItem clearAllItem;
62496347 private MenuItem genUVItem;
62506348 private MenuItem genNormalsMESHItem;
....@@ -6270,6 +6368,7 @@
62706368 private MenuItem clipMeshItem;
62716369 private MenuItem smoothMeshItem;
62726370 private MenuItem clearMaterialsItem;
6371
+ private MenuItem clearVersionsItem;
62736372
62746373 private MenuItem liveleavesItem;
62756374 private MenuItem unliveleavesItem;
....@@ -6293,13 +6392,16 @@
62936392 private MenuItem maxTexturesItem;
62946393 private MenuItem panoTexturesItem;
62956394
6395
+ private MenuItem textureRatioRItem;
6396
+ private MenuItem textureRatioGItem;
6397
+ private MenuItem textureRatioBItem;
62966398 private MenuItem resetCentroidItem;
62976399 private MenuItem resetCentroidXZItem;
62986400 private MenuItem resetTransformItem;
62996401 private MenuItem transformGeometryItem;
63006402 private MenuItem transformChildrenItem;
63016403 private MenuItem hideItem;
6302
- private MenuItem grabItem;
6404
+ private JMenuItem grabItem;
63036405 private MenuItem backItem;
63046406 private MenuItem frontItem;
63056407 private MenuItem cameraItem;
....@@ -6312,7 +6414,7 @@
63126414 private MenuItem switchTransfoItem;
63136415 private MenuItem morphItem;
63146416 private MenuItem linkerItem;
6315
- private MenuItem ungroupItem;
6417
+ private JMenuItem ungroupItem;
63166418 private MenuItem editItem;
63176419 private MenuItem openWindowItem;
63186420 private MenuItem editLeafItem;