Normand Briere
2019-08-22 0c7b833be7d86598a6813cd1c6db0ca9e1b17966
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
....@@ -42,12 +42,12 @@
4242 });
4343 }
4444
45
- public void AddTextureButton(String f, final String t, cGridBag row)
45
+ public void AddTextureButton(String f, String c, final String t, int count, cGridBag row)
4646 {
4747 cButton textureButton;
48
- final String path = "textures/" + f + "/"; // + t;
49
- row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
- textureButton.setToolTipText(f + "s");
48
+ final String path = "textures/" + f + "/" + c + "/"; // + t;
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF));
50
+ textureButton.setToolTipText(c + count);
5151 textureButton.addActionListener(new ActionListener()
5252 {
5353 @Override
....@@ -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);
....@@ -350,7 +359,23 @@
350359
351360 public void ChangeTexture(String texture)
352361 {
353
- cameraView.repaint();
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
+
371
+ public void Show3DView()
372
+ {
373
+ // bug
374
+ //gridPanel.setDividerLocation(1.0);
375
+ //bigPanel.setDividerLocation(0.0);
376
+ bigThree.ClearUI();
377
+ bigThree.add(centralPanel);
378
+ bigThree.FlushUI();
354379 }
355380
356381 //ObjEditor objEditor;
....@@ -390,11 +415,15 @@
390415 this.copy = this.group = group;
391416 //selectees = this.group.selectees;
392417
393
- if (copy.versionlist == null)
394
- {
395
- copy.versionlist = new Object3D[100];
396
- copy.versionindex = -1;
397
- }
418
+ assert(false);
419
+
420
+// if (copy.versionlist == null)
421
+// {
422
+// copy.versionlist = new Object3D[100];
423
+// copy.versionindex = -1;
424
+//
425
+// //Save(true);
426
+// }
398427
399428 if(ui)
400429 SetupUI(objEditor);
....@@ -417,13 +446,13 @@
417446
418447 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
419448
420
- if (copy.versionlist == null)
421
- {
422
- copy.versionlist = new Object3D[100];
423
- copy.versionindex = -1;
424
-
425
- Save(true);
426
- }
449
+// if (copy.versionlist == null)
450
+// {
451
+// copy.versionlist = new Object3D[100];
452
+// copy.versionindex = -1;
453
+//
454
+// //Save(true);
455
+// }
427456 }
428457
429458 void CloneSelection(boolean supports)
....@@ -513,33 +542,35 @@
513542 // menu.add("-");
514543 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
515544 duplicateItem.addActionListener(this);
516
- cloneItem = menu.add(new MenuItem("Clone"));
545
+
546
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
517547 cloneItem.addActionListener(this);
518
- if (Globals.ADVANCED)
548
+ //if (Globals.ADVANCED)
519549 {
520550 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
521551 cloneSupportItem.addActionListener(this);
522552 }
553
+ oe.jTree.popup.addSeparator();
523554 menu.add("-");
524
- cutItem = menu.add(new MenuItem("Cut"));
555
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
525556 cutItem.addActionListener(this);
526
- copyItem = menu.add(new MenuItem("Copy"));
557
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
527558 copyItem.addActionListener(this);
528559 pasteItem = menu.add(new MenuItem("Paste"));
529560 pasteItem.addActionListener(this);
530561
531
- menu.add("-");
532
- pasteIntoItem = menu.add(new MenuItem("Paste into"));
562
+ oe.jTree.popup.addSeparator();
563
+ //menu.add("-");
564
+ pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into"));
533565 pasteIntoItem.addActionListener(this);
534
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
566
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
535567 pasteLinkItem.addActionListener(this);
536
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
568
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
537569 pasteCloneItem.addActionListener(this);
538
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
570
+// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
539571 // pasteExpandItem.addActionListener(this);
540
- menu.add("-");
541
- deleteItem = menu.add(new MenuItem("Delete"));
542
- deleteItem.addActionListener(this);
572
+ //menu.add("-");
573
+ oe.jTree.popup.addSeparator();
543574
544575 if (Globals.ADVANCED)
545576 {
....@@ -625,11 +656,9 @@
625656 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
626657 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
627658 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
628
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
629659 oe.cameraMenu.add("-");
630660 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
631661 openWindowItem.addActionListener(this);
632
- editLeafItem.addActionListener(this);
633662 lookAtItem.addActionListener(this);
634663 //lookFromItem.addActinoListener(this);
635664 //switchViewItem.addActionListener(this);
....@@ -676,9 +705,8 @@
676705 setMasterItem.addActionListener(this);
677706 }
678707
679
- oe.menuBar.add(menu = new Menu("Group"));
680
-// grabItem = menu.add(new MenuItem("Grab"));
681
-// grabItem.addActionListener(this);
708
+ oe.menuBar.add(menu = new Menu("Order"));
709
+
682710 backItem = menu.add(new MenuItem("Back"));
683711 backItem.addActionListener(this);
684712 frontItem = menu.add(new MenuItem("Front"));
....@@ -686,13 +714,21 @@
686714 // compositeItem = menu.add(new MenuItem("Composite"));
687715 // compositeItem.addActionListener(this);
688716
717
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
718
+ grabItem.addActionListener(this);
719
+
689720 if (Globals.ADVANCED)
690721 {
691722 hideItem = menu.add(new MenuItem("Hidden Group"));
692723 hideItem.addActionListener(this);
693724 }
694
- ungroupItem = menu.add(new MenuItem("Ungroup"));
725
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
695726 ungroupItem.addActionListener(this);
727
+
728
+ oe.jTree.popup.addSeparator();
729
+
730
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
731
+ deleteItem.addActionListener(this);
696732
697733 // menu.add("-");
698734 //
....@@ -799,6 +835,8 @@
799835 }
800836
801837 oe.menuBar.add(menu = new Menu("Attributes"));
838
+ clearVersionsItem = menu.add(new MenuItem("Clear Versions"));
839
+ clearVersionsItem.addActionListener(this);
802840 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
803841 clearMaterialsItem.addActionListener(this);
804842 resetAllItem = menu.add(new MenuItem("Reset All"));
....@@ -821,9 +859,9 @@
821859 hideleavesItem.addActionListener(this);
822860 showleavesItem = menu.add(new MenuItem("Show Leaves"));
823861 showleavesItem.addActionListener(this);
824
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
862
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
825863 markleavesItem.addActionListener(this);
826
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
864
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
827865 unmarkleavesItem.addActionListener(this);
828866 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
829867 rewindleavesItem.addActionListener(this);
....@@ -877,6 +915,9 @@
877915 shareGeometriesItem.addActionListener(this);
878916 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
879917 mergeGeometriesItem.addActionListener(this);
918
+ menu.add("-");
919
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
920
+ editLeafItem.addActionListener(this);
880921 if (Globals.ADVANCED)
881922 {
882923 // Pretty much the same as duplicate and clone.
....@@ -895,40 +936,50 @@
895936
896937 JTabbedPane resourcecontainer;
897938 cGridBag currenttab;
898
- boolean added; // patch for jar
939
+ //boolean added; // patch for jar
899940
941
+ int totalcount = 0;
942
+
900943 int tabcount = 0;
901944 int colcount = 0;
902945 int rowcount = 0;
946
+ int texturecount = 0;
903947
904948 int columns = 5;
905949 int rows = 7;
906950
907951 public void ResourceCallBack(String[] path)
908952 {
909
- for (int i = 0; i < path.length; i++)
910
- System.out.print(path[i] + "/");
911
- System.out.println();
912
- if (rowcount == 0)
953
+// for (int i = 0; i < path.length; i++)
954
+// System.out.print(path[i] + "/");
955
+// System.out.println();
956
+
957
+ if (//rowcount == 0 ||
958
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
913959 {
914960 currenttab = new cGridBag();
915
- added = false;
916
- String tabname = String.valueOf((char)('A'+tabcount));
961
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
917962 currenttab.setName(tabname);
963
+ //added = false;
964
+ resourcecontainer.add(currenttab);
965
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
918966 rowcount = 1;
967
+ colcount = 0;
968
+ texturecount = 0;
919969 }
920970
921
- if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg"))
971
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
922972 {
923
- if (!added)
973
+ //if (!added)
924974 {
925
- added = true;
926
- resourcecontainer.add(currenttab);
927
- String tabname = String.valueOf((char)('A'+tabcount));
928
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
975
+ //added = true;
976
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
977
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
929978 }
930979
931
- AddTextureButton(path[0], path[1], currenttab);
980
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
981
+ totalcount++;
982
+
932983 if (++colcount >= columns)
933984 {
934985 colcount = 0;
....@@ -949,10 +1000,12 @@
9491000
9501001 void CreateTexturePanel(cGridBag container)
9511002 {
952
- resourcecontainer = new JTabbedPane();
1003
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
9531004 container.add(resourcecontainer);
9541005
9551006 Grafreed.ParseResources("textures", this);
1007
+
1008
+ // 935. System.out.println("Total = " + totalcount);
9561009 }
9571010
9581011 void SetupUI2(ObjEditor oe)
....@@ -972,11 +1025,6 @@
9721025 //new Exception().printStackTrace();
9731026
9741027 oe.radioPanel = new JPanel(new GridBagLayout());
975
- oe.aConstraints.weightx = 1;
976
- oe.aConstraints.weighty = 0;
977
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
978
- oe.aConstraints.gridwidth = 100;
979
- oe.aConstraints.gridheight = 1;
9801028 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
9811029
9821030 oe.buttonGroup = new ButtonGroup();
....@@ -997,9 +1045,9 @@
9971045 oe.radioPanel.add(dummyButton);
9981046 oe.buttonGroup.add(dummyButton);
9991047 */
1000
- cGridBag copyOptionsPanel = new cGridBag();
1048
+ cGridBag versionManagerPanel = new cGridBag();
10011049
1002
- copyOptionsPanel.preferredHeight = 2;
1050
+ versionManagerPanel.preferredHeight = 4;
10031051
10041052 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10051053
....@@ -1009,62 +1057,102 @@
10091057
10101058 if (Globals.ADVANCED)
10111059 {
1012
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
- maxButton.setToolTipText("Maximize window");
1014
- maxButton.addActionListener(this);
1060
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+// maxButton.setToolTipText("Maximize window");
1062
+// maxButton.addActionListener(this);
10151063 }
10161064
1017
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1065
+ cButton gcButton;
1066
+
1067
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+// gcButton.setToolTipText("Garbage collect");
1069
+// gcButton.addActionListener(new ActionListener()
1070
+// {
1071
+// public void actionPerformed(ActionEvent e)
1072
+// {
1073
+// System.gc();
1074
+// }
1075
+// });
1076
+
1077
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1078
+ collapseButton.setToolTipText("Collapse toolbar");
1079
+ collapseButton.addActionListener(this);
1080
+
1081
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1082
+ maximize3DButton.setToolTipText("Maximize 3D view");
1083
+ maximize3DButton.addActionListener(this);
1084
+
1085
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1086
+ twoButton.setToolTipText("Show 3D view only");
1087
+ twoButton.addActionListener(this);
1088
+ this.fullscreenLayout = twoButton;
1089
+
1090
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1091
+ threeButton.setToolTipText("Show controls and 3D view");
1092
+ threeButton.addActionListener(this);
1093
+ if (Globals.ADVANCED)
1094
+ {
1095
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1096
+ sixButton.setToolTipText("Show 3D view and controls");
1097
+ sixButton.addActionListener(this);
1098
+ }
1099
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1100
+// sevenButton.setToolTipText("3-column layout");
1101
+// sevenButton.addActionListener(this);
1102
+ //
1103
+
1104
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10181105 fullButton.setToolTipText("Full-screen window");
10191106 fullButton.addActionListener(this);
10201107
1021
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1108
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10221109 screenfitButton.setToolTipText("Screen fit");
10231110 screenfitButton.addActionListener(this);
10241111
1025
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10261113 restoreCameraButton.setToolTipText("Restore viewpoint");
10271114 restoreCameraButton.addActionListener(this);
10281115
1029
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1116
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10301117 saveVersionButton.setToolTipText("Duplicate current version");
10311118 saveVersionButton.addActionListener(this);
10321119
1033
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1120
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10341121 deleteVersionButton.setToolTipText("Delete current version");
10351122 deleteVersionButton.addActionListener(this);
1123
+ deleteVersionButton.setEnabled(false);
10361124
1037
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10381126 previousVersionButton.setToolTipText("Previous version");
10391127 previousVersionButton.addActionListener(this);
10401128 previousVersionButton.setEnabled(false);
10411129
10421130 cGridBag updown = new cGridBag().setVertical(true);
1043
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1131
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10441132 restoreButton.setToolTipText("Undo (restore current version)");
10451133 restoreButton.addActionListener(this);
1046
- //restoreButton.setEnabled(false);
1134
+ restoreButton.setEnabled(false);
10471135
1048
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10491137 replaceButton.setToolTipText("Save (replace current version)");
10501138 replaceButton.addActionListener(this);
1051
- //replaceButton.setEnabled(false);
1139
+ replaceButton.setEnabled(false);
10521140
1053
- copyOptionsPanel.add(updown);
1141
+ versionManagerPanel.add(updown);
10541142
1055
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1143
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10561144 nextVersionButton.setToolTipText("Next version");
10571145 nextVersionButton.addActionListener(this);
10581146 nextVersionButton.setEnabled(false);
1147
+
1148
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1149
+ oneStepButton.setToolTipText("Animate one step forward");
1150
+ oneStepButton.addActionListener(this);
10591151
10601152 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
10611153 liveCB.setToolTipText("Enable animation");
10621154 liveCB.addItemListener(this);
10631155
1064
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1065
- oneStepButton.setToolTipText("Animate one step forward");
1066
- oneStepButton.addActionListener(this);
1067
-
10681156 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
10691157 fastCB.setToolTipText("Fast mode");
10701158 fastCB.addItemListener(this);
....@@ -1080,38 +1168,23 @@
10801168
10811169 if (Globals.ADVANCED)
10821170 {
1083
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1171
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10841172 snapobjectButton.addActionListener(this);
10851173 snapobjectButton.setToolTipText("Snap Object");
10861174
1087
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1175
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10881176 fourButton.addActionListener(this);
10891177 fourButton.setToolTipText("Show control panel only");
10901178 }
10911179
10921180 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
10931181
1094
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1095
- twoButton.setToolTipText("Show 3D view only");
1096
- twoButton.addActionListener(this);
1097
- this.fullscreenLayout = twoButton;
1098
-
1099
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1100
- threeButton.setToolTipText("Show controls and 3D view");
1101
- threeButton.addActionListener(this);
1102
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1103
- sixButton.setToolTipText("Show 3D view and controls");
1104
- sixButton.addActionListener(this);
1105
-// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1106
-// sevenButton.setToolTipText("3-column layout");
1107
-// sevenButton.addActionListener(this);
1108
- //
11091182
1110
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1183
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11111184 rootButton.setToolTipText("Open selection in new tab");
11121185 rootButton.addActionListener(this);
11131186
1114
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1187
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11151188 closeButton.setToolTipText("Close tab");
11161189 closeButton.addActionListener(this);
11171190 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1120,38 +1193,38 @@
11201193 cGridBag row1 = new cGridBag();
11211194
11221195 // INSERT
1123
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
- gridButton.setToolTipText("Create grid");
1196
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1197
+ gridButton.setToolTipText("Create ground");
11251198 gridButton.addActionListener(this);
11261199
1127
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1200
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11281201 boxButton.setToolTipText("Create box");
11291202 boxButton.addActionListener(this);
11301203
1131
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1132
- sphereButton.setToolTipText("Create sphere");
1133
- sphereButton.addActionListener(this);
1134
-
1135
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
- coneButton.setToolTipText("Create cone");
1137
- coneButton.addActionListener(this);
1138
-
1139
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1140
- torusButton.setToolTipText("Create torus");
1141
- torusButton.addActionListener(this);
1142
-
1143
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1204
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11441205 superButton.setToolTipText("Create superellipsoid");
11451206 superButton.addActionListener(this);
11461207
1208
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1209
+ sphereButton.setToolTipText("Create sphere");
1210
+ sphereButton.addActionListener(this);
1211
+
1212
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1213
+ coneButton.setToolTipText("Create cone");
1214
+ coneButton.addActionListener(this);
1215
+
1216
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1217
+ torusButton.setToolTipText("Create torus");
1218
+ torusButton.addActionListener(this);
1219
+
11471220 if (Globals.ADVANCED)
11481221 {
1149
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1222
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11501223 kleinButton.setToolTipText("Create Klein bottle");
11511224 kleinButton.addActionListener(this);
11521225 }
11531226
1154
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1227
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11551228 particlesButton.setToolTipText("Create particle system");
11561229 particlesButton.addActionListener(this);
11571230
....@@ -1159,31 +1232,31 @@
11591232
11601233 cGridBag row2 = new cGridBag();
11611234
1162
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1235
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11631236 groupButton.setToolTipText("Create group");
11641237 groupButton.addActionListener(this);
11651238
1166
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1239
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11671240 compositeButton.setToolTipText("Create composite");
11681241 compositeButton.addActionListener(this);
11691242
1170
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1243
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11711244 switchButton.setToolTipText("Create item switcher");
11721245 switchButton.addActionListener(this);
11731246
1174
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1247
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11751248 loopButton.setToolTipText("Create loop");
11761249 loopButton.addActionListener(this);
11771250
1178
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1251
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11791252 textureButton.setToolTipText("Create texture");
11801253 textureButton.addActionListener(this);
11811254
1182
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1255
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11831256 overlayButton.setToolTipText("Create overlay");
11841257 overlayButton.addActionListener(this);
11851258
1186
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1259
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11871260 lightButton.setToolTipText("Create light");
11881261 lightButton.addActionListener(this);
11891262
....@@ -1193,6 +1266,11 @@
11931266
11941267 CreateTexturePanel(textures);
11951268
1269
+ int tabCount = resourcecontainer.getTabCount();
1270
+
1271
+ if (tabCount > 0)
1272
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1273
+
11961274 oe.toolboxPanel.add(textures);
11971275
11981276 textures.preferredHeight = 100;
....@@ -1200,11 +1278,11 @@
12001278 CreateSkyboxPanel(oe.skyboxPanel);
12011279
12021280 // EDIT panel
1203
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1281
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12041282 editButton.setToolTipText("Pin selection controls");
12051283 editButton.addActionListener(this);
12061284
1207
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1285
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12081286 uneditButton.setToolTipText("Unpin and remove selection controls");
12091287 uneditButton.addActionListener(this);
12101288
....@@ -1212,7 +1290,7 @@
12121290 allParamsButton.setToolTipText("Show all controls");
12131291 allParamsButton.addActionListener(this);
12141292
1215
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1293
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12161294 clearPanelButton.setToolTipText("Clear all controls");
12171295 clearPanelButton.addActionListener(this);
12181296
....@@ -1220,7 +1298,7 @@
12201298 //unselectButton.setToolTipText("Unselect");
12211299 //unselectButton.addActionListener(this);
12221300
1223
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1301
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12241302 flashSelectionButton.setToolTipText("Highlight selection");
12251303 flashSelectionButton.addActionListener(this);
12261304
....@@ -1243,6 +1321,8 @@
12431321
12441322 cGridBag jSPPanel = new cGridBag();
12451323
1324
+ jSPPanel.preferredHeight = 20;
1325
+
12461326 JScrollPane jSP;
12471327 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
12481328 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1251,11 +1331,11 @@
12511331 oe.treePanel.add(jSPPanel);
12521332 oe.treePanel.Return();
12531333
1254
- oe.treePanel.add(copyOptionsPanel);
1334
+ oe.treePanel.add(versionManagerPanel);
12551335 oe.treePanel.Return();
1256
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1257
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1258
- sliderPane.preferredHeight = 1;
1336
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1337
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1338
+ versionSliderPane.preferredHeight = 3;
12591339
12601340 // mainPanel.setDividerLocation(0.1); //1.0);
12611341 mainPanel.setResizeWeight(0.4);
....@@ -1413,6 +1493,14 @@
14131493
14141494 void EditObject(Object3D obj)
14151495 {
1496
+ assert(obj instanceof Composite);
1497
+
1498
+// if (obj.versionlist == null)
1499
+// {
1500
+// obj.versionlist = new Object3D[100];
1501
+// obj.versionindex = -1;
1502
+// }
1503
+
14161504 cRadio radioButton = new cRadio(obj.name);
14171505
14181506 // June 2019. Patch to avoid bug with transparency.
....@@ -1437,6 +1525,7 @@
14371525
14381526 oe.SetupViews();
14391527
1528
+ if (Globals.DEBUG)
14401529 System.out.println("SetupViews");
14411530 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
14421531 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -1803,7 +1892,12 @@
18031892 TreePath path;
18041893
18051894 public TransferableTreePath(TreePath tp) {
1806
- path = tp;
1895
+ Object[] objs = new Object[tp.getPathCount()];
1896
+ for (int i=0; i<objs.length; i++)
1897
+ {
1898
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1899
+ }
1900
+ path = new TreePath(objs);
18071901 }
18081902
18091903 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2093,7 +2187,11 @@
20932187 shadow.material = new cMaterial(obj.material);
20942188 shadow.material.diffuse = 0.0001f;
20952189 shadow.material.specular = 0.0001f;
2096
- //shadow.projectedVertices[1].x = 300;
2190
+ shadow.material.opacity = 0.75f;
2191
+
2192
+ AllocProjectedVertices(shadow);
2193
+
2194
+ shadow.projectedVertices[1].x = 300;
20972195
20982196 makeSomething(shadow);
20992197 }
....@@ -2614,27 +2712,35 @@
26142712 } else
26152713 if (source == loopItem || source == loopButton)
26162714 {
2715
+ if (!group.selection.isEmpty())
2716
+ {
26172717 Composite csg = new GroupLeaf();
26182718 csg.count = 5;
2619
- group(csg);
26202719 Composite child = new cGroup("Branch");
26212720 csg.addChild(child);
26222721 child.addChild(csg);
2722
+ group(csg);
2723
+ }
26232724 } else
26242725 if (source == doubleItem)
26252726 {
2727
+ if (!group.selection.isEmpty())
2728
+ {
26262729 Composite csg = new GroupLeaf("Fork");
26272730 csg.count = 5;
2628
- group(csg);
26292731 Composite child = new cGroup("Branch A");
26302732 csg.addChild(child);
26312733 child.addChild(csg);
26322734 child = new cGroup("Branch B");
26332735 csg.addChild(child);
26342736 child.addChild(csg);
2737
+ group(csg);
2738
+ }
26352739 } else
26362740 if (source == tripleItem)
26372741 {
2742
+ if (!group.selection.isEmpty())
2743
+ {
26382744 Composite csg = new GroupLeaf("Trident");
26392745 csg.count = 4;
26402746 group(csg);
....@@ -2647,6 +2753,7 @@
26472753 child = new cGroup();
26482754 csg.addChild(child);
26492755 child.addChild(csg);
2756
+ }
26502757 } else
26512758 if (source == computeAOItem)
26522759 {
....@@ -2696,6 +2803,18 @@
26962803 if (source == fullButton)
26972804 {
26982805 ToggleFullScreen();
2806
+ } else
2807
+ if (source == collapseButton)
2808
+ {
2809
+ this.expandedLayout = radio.layout;
2810
+ CollapseToolbar();
2811
+ } else
2812
+ if (source == maximize3DButton)
2813
+ {
2814
+ this.expandedLayout = radio.layout;
2815
+ radio.layout = twoButton;
2816
+ Show3DView();
2817
+ CollapseToolbar();
26992818 } else
27002819 if (source == previousVersionButton)
27012820 {
....@@ -3270,22 +3389,34 @@
32703389 } else
32713390 if (source == ungroupItem || source == ungroupButton)
32723391 {
3273
- boolean hasRoot = false;
3392
+ boolean canUngroup = true;
32743393
32753394 for (int i=0; i<group.selection.size(); i++)
32763395 {
3277
- if (group.selection.get(i) == group)
3396
+ Object3D selectedItem = group.selection.get(i);
3397
+
3398
+ if (selectedItem.Size() == 0)
32783399 {
3279
- hasRoot = true;
3400
+ // Cannot ungroup leaves
3401
+ canUngroup = false;
3402
+ break;
3403
+ }
3404
+
3405
+ if (selectedItem == group)
3406
+ {
3407
+ // Cannot ungroup root
3408
+ canUngroup = false;
32803409 break;
32813410 }
32823411 }
32833412
3284
- if (!hasRoot)
3413
+ if (canUngroup)
32853414 {
32863415 for (int i=0; i<group.selection.size(); i++)
32873416 {
3288
- Ungroup(group.selection.get(i));
3417
+ Object3D selectedItem = group.selection.get(i);
3418
+
3419
+ Ungroup(selectedItem);
32893420 }
32903421
32913422 ClearSelection(false);
....@@ -3336,6 +3467,10 @@
33363467 if (source == clearMaterialsItem)
33373468 {
33383469 ClearMaterials();
3470
+ } else
3471
+ if (source == clearVersionsItem)
3472
+ {
3473
+ ClearVersions();
33393474 } else
33403475 if (source == liveleavesItem)
33413476 {
....@@ -3648,38 +3783,7 @@
36483783 if (CameraPane.FULLSCREEN)
36493784 fullscreenLayout = radio.layout;
36503785
3651
- // bug
3652
- //gridPanel.setDividerLocation(1.0);
3653
- //bigPanel.setDividerLocation(0.0);
3654
-// bigThree.remove(scenePanel);
3655
-// bigThree.remove(centralPanel);
3656
-// bigThree.remove(XYZPanel);
3657
-// aWindowConstraints.gridx = 0;
3658
-// aWindowConstraints.gridy = 0;
3659
-// aWindowConstraints.gridwidth = 1;
3660
-// // aConstraints.gridheight = 3;
3661
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3662
-// aWindowConstraints.weightx = 0;
3663
-// aWindowConstraints.weighty = 1;
3664
-// //bigThree.add(jtp, aWindowConstraints);
3665
-// aWindowConstraints.weightx = 1;
3666
-// aWindowConstraints.gridwidth = 3;
3667
-// // aConstraints.gridheight = 3;
3668
-// aWindowConstraints.gridx = 1;
3669
-// aWindowConstraints.fill = GridBagConstraints.BOTH;
3670
-// bigThree.add(centralPanel, aWindowConstraints);
3671
-// aWindowConstraints.weightx = 0;
3672
-// aWindowConstraints.gridx = 4;
3673
-// aWindowConstraints.gridwidth = 1;
3674
-// // aConstraints.gridheight = 3;
3675
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3676
-// //bigThree.add(XYZPanel, aWindowConstraints);
3677
-// scenePanel.setVisible(false);
3678
-// centralPanel.setVisible(true);
3679
-// XYZPanel.setVisible(false);
3680
- bigThree.ClearUI();
3681
- bigThree.add(centralPanel);
3682
- bigThree.FlushUI();
3786
+ Show3DView();
36833787
36843788 cameraView.requestFocusInWindow();
36853789
....@@ -3865,6 +3969,7 @@
38653969 } else
38663970 if (source == rootButton)
38673971 {
3972
+ Replace();
38683973 Object3D obj;
38693974 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
38703975 {
....@@ -3879,6 +3984,8 @@
38793984 if (source == closeButton)
38803985 {
38813986 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3987
+ Replace();
3988
+
38823989 cRadio ab;
38833990 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
38843991 {
....@@ -3977,6 +4084,8 @@
39774084 } else
39784085 if(source instanceof cRadio)
39794086 {
4087
+ Replace();
4088
+
39804089 group.parent = keepparent;
39814090 group.attributes = 0;
39824091 //group.editWindow = null;
....@@ -4001,8 +4110,6 @@
40014110
40024111 copy = group;
40034112
4004
- SetUndoStates();
4005
-
40064113 //Globals.theRenderer.object = group;
40074114 if(!useclient)
40084115 {
....@@ -4030,6 +4137,31 @@
40304137 */
40314138 radio.layout.doClick();
40324139
4140
+ assert(copy instanceof Composite);
4141
+
4142
+ if (copy.versionlist == null)
4143
+ {
4144
+ copy.versionindex = -1;
4145
+
4146
+ // Cannot work with loops
4147
+ // To fix this issue, we first mark all nodes above the root,
4148
+ // and check if any of these nodes are reachable below the root.
4149
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4150
+
4151
+ if (copy.versionlist == null && !copy.HasTags())
4152
+ {
4153
+ copy.versionlist = new Object3D[100];
4154
+
4155
+ //Save(true);
4156
+ }
4157
+ else
4158
+ copy.versionindex = -2;
4159
+
4160
+ Grafreed.grafreed.universe.TagObjects(copy, false);
4161
+ }
4162
+
4163
+ SetVersionStates();
4164
+
40334165 ClearUnpinned();
40344166
40354167 //Grafreed.Assert(group != null);
....@@ -4173,7 +4305,7 @@
41734305 TouchTransform(obj);
41744306 continue;
41754307 }
4176
- if ((mask&2) != 0) // Scale
4308
+ if ((mask&2) != 0) // Scale/rotation
41774309 {
41784310 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
41794311 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4181,10 +4313,6 @@
41814313 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
41824314 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
41834315 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4184
- }
4185
- if ((mask&4) != 0) // Rotation
4186
- {
4187
- // ?
41884316 }
41894317 if ((mask&1) != 0) // Translation
41904318 {
....@@ -4993,6 +5121,12 @@
49935121 refreshContents();
49945122 }
49955123
5124
+ void ClearVersions()
5125
+ {
5126
+ group.selection.ClearVersions();
5127
+ refreshContents();
5128
+ }
5129
+
49965130 void FlipV(boolean flip)
49975131 {
49985132 group.selection.FlipV(flip);
....@@ -5264,10 +5398,26 @@
52645398 flashSelectionButton.setEnabled(enabled);
52655399
52665400 clearPanelButton.setEnabled(!listUI.isEmpty());
5401
+
5402
+ boolean allComposites = true;
5403
+
5404
+ if (group.selection != null)
5405
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5406
+ {
5407
+ Object next = e.nextElement();
5408
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
5409
+ {
5410
+ allComposites = false;
5411
+ break;
5412
+ }
5413
+ }
5414
+
5415
+ rootButton.setEnabled(allComposites);
52675416 }
52685417
52695418 void refreshContents(boolean cp)
52705419 {
5420
+ if (Globals.ADVANCED)
52715421 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
52725422 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
52735423 {
....@@ -5278,7 +5428,7 @@
52785428 Object3D child = (Object3D) group.selection.get(i);
52795429
52805430 objEditor.AddInfo(child, this, true);
5281
- System.err.println("info : " + child.GetPath());
5431
+// System.err.println("info : " + child.GetPath());
52825432 }
52835433
52845434 objEditor.SetText(); // jan 2014
....@@ -6161,11 +6311,11 @@
61616311 private MenuItem lookAtItem;
61626312 private MenuItem lookFromItem;
61636313 private MenuItem switchViewItem;
6164
- private MenuItem cutItem;
6314
+ private JMenuItem cutItem;
61656315 private MenuItem undoItem;
61666316 private MenuItem redoItem;
61676317 private JMenuItem duplicateItem;
6168
- private MenuItem cloneItem;
6318
+ private JMenuItem cloneItem;
61696319 private MenuItem cloneSupportItem;
61706320 private MenuItem overwriteGeoItem;
61716321 private MenuItem overwriteMatItem;
....@@ -6186,13 +6336,13 @@
61866336 private MenuItem cloneGeometriesItem;
61876337 private MenuItem shareGeometriesItem;
61886338 private MenuItem mergeGeometriesItem;
6189
- private MenuItem copyItem;
6339
+ private JMenuItem copyItem;
61906340 private MenuItem pasteItem;
6191
- private MenuItem pasteIntoItem;
6192
- private MenuItem pasteLinkItem;
6193
- private MenuItem pasteCloneItem;
6194
- private MenuItem pasteExpandItem;
6195
- private MenuItem deleteItem;
6341
+ private JMenuItem pasteIntoItem;
6342
+ private JMenuItem pasteLinkItem;
6343
+ private JMenuItem pasteCloneItem;
6344
+ private JMenuItem pasteExpandItem;
6345
+ private JMenuItem deleteItem;
61966346 private MenuItem clearAllItem;
61976347 private MenuItem genUVItem;
61986348 private MenuItem genNormalsMESHItem;
....@@ -6218,6 +6368,7 @@
62186368 private MenuItem clipMeshItem;
62196369 private MenuItem smoothMeshItem;
62206370 private MenuItem clearMaterialsItem;
6371
+ private MenuItem clearVersionsItem;
62216372
62226373 private MenuItem liveleavesItem;
62236374 private MenuItem unliveleavesItem;
....@@ -6247,7 +6398,7 @@
62476398 private MenuItem transformGeometryItem;
62486399 private MenuItem transformChildrenItem;
62496400 private MenuItem hideItem;
6250
- private MenuItem grabItem;
6401
+ private JMenuItem grabItem;
62516402 private MenuItem backItem;
62526403 private MenuItem frontItem;
62536404 private MenuItem cameraItem;
....@@ -6260,7 +6411,7 @@
62606411 private MenuItem switchTransfoItem;
62616412 private MenuItem morphItem;
62626413 private MenuItem linkerItem;
6263
- private MenuItem ungroupItem;
6414
+ private JMenuItem ungroupItem;
62646415 private MenuItem editItem;
62656416 private MenuItem openWindowItem;
62666417 private MenuItem editLeafItem;