Normand Briere
2019-08-22 6a823ffbfcda4c843f46e02e83c869d5bc323e25
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,6 +366,16 @@
357366 }
358367
359368 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();
360379 }
361380
362381 //ObjEditor objEditor;
....@@ -396,10 +415,14 @@
396415 this.copy = this.group = group;
397416 //selectees = this.group.selectees;
398417
418
+ assert(false);
419
+
399420 if (copy.versionlist == null)
400421 {
401422 copy.versionlist = new Object3D[100];
402423 copy.versionindex = -1;
424
+
425
+ //Save(true);
403426 }
404427
405428 if(ui)
....@@ -428,7 +451,7 @@
428451 copy.versionlist = new Object3D[100];
429452 copy.versionindex = -1;
430453
431
- Save(true);
454
+ //Save(true);
432455 }
433456 }
434457
....@@ -519,33 +542,35 @@
519542 // menu.add("-");
520543 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
521544 duplicateItem.addActionListener(this);
522
- cloneItem = menu.add(new MenuItem("Clone"));
545
+
546
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
523547 cloneItem.addActionListener(this);
524
- if (Globals.ADVANCED)
548
+ //if (Globals.ADVANCED)
525549 {
526550 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
527551 cloneSupportItem.addActionListener(this);
528552 }
553
+ oe.jTree.popup.addSeparator();
529554 menu.add("-");
530
- cutItem = menu.add(new MenuItem("Cut"));
555
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
531556 cutItem.addActionListener(this);
532
- copyItem = menu.add(new MenuItem("Copy"));
557
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
533558 copyItem.addActionListener(this);
534559 pasteItem = menu.add(new MenuItem("Paste"));
535560 pasteItem.addActionListener(this);
536561
537
- menu.add("-");
538
- 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"));
539565 pasteIntoItem.addActionListener(this);
540
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
566
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
541567 pasteLinkItem.addActionListener(this);
542
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
568
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
543569 pasteCloneItem.addActionListener(this);
544
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
570
+// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
545571 // pasteExpandItem.addActionListener(this);
546
- menu.add("-");
547
- deleteItem = menu.add(new MenuItem("Delete"));
548
- deleteItem.addActionListener(this);
572
+ //menu.add("-");
573
+ oe.jTree.popup.addSeparator();
549574
550575 if (Globals.ADVANCED)
551576 {
....@@ -631,11 +656,9 @@
631656 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
632657 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
633658 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
634
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
635659 oe.cameraMenu.add("-");
636660 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
637661 openWindowItem.addActionListener(this);
638
- editLeafItem.addActionListener(this);
639662 lookAtItem.addActionListener(this);
640663 //lookFromItem.addActinoListener(this);
641664 //switchViewItem.addActionListener(this);
....@@ -682,9 +705,8 @@
682705 setMasterItem.addActionListener(this);
683706 }
684707
685
- oe.menuBar.add(menu = new Menu("Group"));
686
-// grabItem = menu.add(new MenuItem("Grab"));
687
-// grabItem.addActionListener(this);
708
+ oe.menuBar.add(menu = new Menu("Order"));
709
+
688710 backItem = menu.add(new MenuItem("Back"));
689711 backItem.addActionListener(this);
690712 frontItem = menu.add(new MenuItem("Front"));
....@@ -692,13 +714,21 @@
692714 // compositeItem = menu.add(new MenuItem("Composite"));
693715 // compositeItem.addActionListener(this);
694716
717
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
718
+ grabItem.addActionListener(this);
719
+
695720 if (Globals.ADVANCED)
696721 {
697722 hideItem = menu.add(new MenuItem("Hidden Group"));
698723 hideItem.addActionListener(this);
699724 }
700
- ungroupItem = menu.add(new MenuItem("Ungroup"));
725
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
701726 ungroupItem.addActionListener(this);
727
+
728
+ oe.jTree.popup.addSeparator();
729
+
730
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
731
+ deleteItem.addActionListener(this);
702732
703733 // menu.add("-");
704734 //
....@@ -827,9 +857,9 @@
827857 hideleavesItem.addActionListener(this);
828858 showleavesItem = menu.add(new MenuItem("Show Leaves"));
829859 showleavesItem.addActionListener(this);
830
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
860
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
831861 markleavesItem.addActionListener(this);
832
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
862
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
833863 unmarkleavesItem.addActionListener(this);
834864 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
835865 rewindleavesItem.addActionListener(this);
....@@ -883,6 +913,9 @@
883913 shareGeometriesItem.addActionListener(this);
884914 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
885915 mergeGeometriesItem.addActionListener(this);
916
+ menu.add("-");
917
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
918
+ editLeafItem.addActionListener(this);
886919 if (Globals.ADVANCED)
887920 {
888921 // Pretty much the same as duplicate and clone.
....@@ -901,8 +934,10 @@
901934
902935 JTabbedPane resourcecontainer;
903936 cGridBag currenttab;
904
- boolean added; // patch for jar
937
+ //boolean added; // patch for jar
905938
939
+ int totalcount = 0;
940
+
906941 int tabcount = 0;
907942 int colcount = 0;
908943 int rowcount = 0;
....@@ -918,28 +953,30 @@
918953 // System.out.println();
919954
920955 if (//rowcount == 0 ||
921
- path.length == 1)
956
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
922957 {
923958 currenttab = new cGridBag();
924
- added = false;
925959 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
926960 currenttab.setName(tabname);
961
+ //added = false;
962
+ resourcecontainer.add(currenttab);
963
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
927964 rowcount = 1;
928965 colcount = 0;
929966 texturecount = 0;
930967 }
931968
932
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
969
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
933970 {
934
- if (!added)
971
+ //if (!added)
935972 {
936
- added = true;
937
- resourcecontainer.add(currenttab);
973
+ //added = true;
938974 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
939
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
975
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
940976 }
941977
942
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
978
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
979
+ totalcount++;
943980
944981 if (++colcount >= columns)
945982 {
....@@ -965,6 +1002,8 @@
9651002 container.add(resourcecontainer);
9661003
9671004 Grafreed.ParseResources("textures", this);
1005
+
1006
+ // 935. System.out.println("Total = " + totalcount);
9681007 }
9691008
9701009 void SetupUI2(ObjEditor oe)
....@@ -984,11 +1023,6 @@
9841023 //new Exception().printStackTrace();
9851024
9861025 oe.radioPanel = new JPanel(new GridBagLayout());
987
- oe.aConstraints.weightx = 1;
988
- oe.aConstraints.weighty = 0;
989
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
990
- oe.aConstraints.gridwidth = 100;
991
- oe.aConstraints.gridheight = 1;
9921026 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
9931027
9941028 oe.buttonGroup = new ButtonGroup();
....@@ -1009,9 +1043,9 @@
10091043 oe.radioPanel.add(dummyButton);
10101044 oe.buttonGroup.add(dummyButton);
10111045 */
1012
- cGridBag copyOptionsPanel = new cGridBag();
1046
+ cGridBag versionManagerPanel = new cGridBag();
10131047
1014
- copyOptionsPanel.preferredHeight = 2;
1048
+ versionManagerPanel.preferredHeight = 4;
10151049
10161050 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10171051
....@@ -1021,62 +1055,102 @@
10211055
10221056 if (Globals.ADVANCED)
10231057 {
1024
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
- maxButton.setToolTipText("Maximize window");
1026
- maxButton.addActionListener(this);
1058
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
+// maxButton.setToolTipText("Maximize window");
1060
+// maxButton.addActionListener(this);
10271061 }
10281062
1029
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1063
+ cButton gcButton;
1064
+
1065
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1066
+// gcButton.setToolTipText("Garbage collect");
1067
+// gcButton.addActionListener(new ActionListener()
1068
+// {
1069
+// public void actionPerformed(ActionEvent e)
1070
+// {
1071
+// System.gc();
1072
+// }
1073
+// });
1074
+
1075
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1076
+ collapseButton.setToolTipText("Collapse toolbar");
1077
+ collapseButton.addActionListener(this);
1078
+
1079
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1080
+ maximize3DButton.setToolTipText("Maximize 3D view");
1081
+ maximize3DButton.addActionListener(this);
1082
+
1083
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1084
+ twoButton.setToolTipText("Show 3D view only");
1085
+ twoButton.addActionListener(this);
1086
+ this.fullscreenLayout = twoButton;
1087
+
1088
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1089
+ threeButton.setToolTipText("Show controls and 3D view");
1090
+ threeButton.addActionListener(this);
1091
+ if (Globals.ADVANCED)
1092
+ {
1093
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1094
+ sixButton.setToolTipText("Show 3D view and controls");
1095
+ sixButton.addActionListener(this);
1096
+ }
1097
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1098
+// sevenButton.setToolTipText("3-column layout");
1099
+// sevenButton.addActionListener(this);
1100
+ //
1101
+
1102
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10301103 fullButton.setToolTipText("Full-screen window");
10311104 fullButton.addActionListener(this);
10321105
1033
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1106
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10341107 screenfitButton.setToolTipText("Screen fit");
10351108 screenfitButton.addActionListener(this);
10361109
1037
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1110
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10381111 restoreCameraButton.setToolTipText("Restore viewpoint");
10391112 restoreCameraButton.addActionListener(this);
10401113
1041
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1114
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10421115 saveVersionButton.setToolTipText("Duplicate current version");
10431116 saveVersionButton.addActionListener(this);
10441117
1045
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10461119 deleteVersionButton.setToolTipText("Delete current version");
10471120 deleteVersionButton.addActionListener(this);
1121
+ deleteVersionButton.setEnabled(false);
10481122
1049
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1123
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10501124 previousVersionButton.setToolTipText("Previous version");
10511125 previousVersionButton.addActionListener(this);
10521126 previousVersionButton.setEnabled(false);
10531127
10541128 cGridBag updown = new cGridBag().setVertical(true);
1055
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10561130 restoreButton.setToolTipText("Undo (restore current version)");
10571131 restoreButton.addActionListener(this);
1058
- //restoreButton.setEnabled(false);
1132
+ restoreButton.setEnabled(false);
10591133
1060
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1134
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10611135 replaceButton.setToolTipText("Save (replace current version)");
10621136 replaceButton.addActionListener(this);
1063
- //replaceButton.setEnabled(false);
1137
+ replaceButton.setEnabled(false);
10641138
1065
- copyOptionsPanel.add(updown);
1139
+ versionManagerPanel.add(updown);
10661140
1067
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1141
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10681142 nextVersionButton.setToolTipText("Next version");
10691143 nextVersionButton.addActionListener(this);
10701144 nextVersionButton.setEnabled(false);
1145
+
1146
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1147
+ oneStepButton.setToolTipText("Animate one step forward");
1148
+ oneStepButton.addActionListener(this);
10711149
10721150 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
10731151 liveCB.setToolTipText("Enable animation");
10741152 liveCB.addItemListener(this);
10751153
1076
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1077
- oneStepButton.setToolTipText("Animate one step forward");
1078
- oneStepButton.addActionListener(this);
1079
-
10801154 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
10811155 fastCB.setToolTipText("Fast mode");
10821156 fastCB.addItemListener(this);
....@@ -1092,38 +1166,23 @@
10921166
10931167 if (Globals.ADVANCED)
10941168 {
1095
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1169
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10961170 snapobjectButton.addActionListener(this);
10971171 snapobjectButton.setToolTipText("Snap Object");
10981172
1099
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1173
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11001174 fourButton.addActionListener(this);
11011175 fourButton.setToolTipText("Show control panel only");
11021176 }
11031177
11041178 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11051179
1106
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1107
- twoButton.setToolTipText("Show 3D view only");
1108
- twoButton.addActionListener(this);
1109
- this.fullscreenLayout = twoButton;
1110
-
1111
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
- threeButton.setToolTipText("Show controls and 3D view");
1113
- threeButton.addActionListener(this);
1114
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1115
- sixButton.setToolTipText("Show 3D view and controls");
1116
- sixButton.addActionListener(this);
1117
-// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
-// sevenButton.setToolTipText("3-column layout");
1119
-// sevenButton.addActionListener(this);
1120
- //
11211180
1122
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1181
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11231182 rootButton.setToolTipText("Open selection in new tab");
11241183 rootButton.addActionListener(this);
11251184
1126
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1185
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11271186 closeButton.setToolTipText("Close tab");
11281187 closeButton.addActionListener(this);
11291188 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1132,38 +1191,38 @@
11321191 cGridBag row1 = new cGridBag();
11331192
11341193 // INSERT
1135
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
- gridButton.setToolTipText("Create grid");
1194
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1195
+ gridButton.setToolTipText("Create ground");
11371196 gridButton.addActionListener(this);
11381197
1139
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1198
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11401199 boxButton.setToolTipText("Create box");
11411200 boxButton.addActionListener(this);
11421201
1143
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1144
- sphereButton.setToolTipText("Create sphere");
1145
- sphereButton.addActionListener(this);
1146
-
1147
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1148
- coneButton.setToolTipText("Create cone");
1149
- coneButton.addActionListener(this);
1150
-
1151
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1152
- torusButton.setToolTipText("Create torus");
1153
- torusButton.addActionListener(this);
1154
-
1155
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1202
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11561203 superButton.setToolTipText("Create superellipsoid");
11571204 superButton.addActionListener(this);
11581205
1206
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1207
+ sphereButton.setToolTipText("Create sphere");
1208
+ sphereButton.addActionListener(this);
1209
+
1210
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1211
+ coneButton.setToolTipText("Create cone");
1212
+ coneButton.addActionListener(this);
1213
+
1214
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1215
+ torusButton.setToolTipText("Create torus");
1216
+ torusButton.addActionListener(this);
1217
+
11591218 if (Globals.ADVANCED)
11601219 {
1161
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11621221 kleinButton.setToolTipText("Create Klein bottle");
11631222 kleinButton.addActionListener(this);
11641223 }
11651224
1166
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1225
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11671226 particlesButton.setToolTipText("Create particle system");
11681227 particlesButton.addActionListener(this);
11691228
....@@ -1171,31 +1230,31 @@
11711230
11721231 cGridBag row2 = new cGridBag();
11731232
1174
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1233
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11751234 groupButton.setToolTipText("Create group");
11761235 groupButton.addActionListener(this);
11771236
1178
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1237
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11791238 compositeButton.setToolTipText("Create composite");
11801239 compositeButton.addActionListener(this);
11811240
1182
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1241
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11831242 switchButton.setToolTipText("Create item switcher");
11841243 switchButton.addActionListener(this);
11851244
1186
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1245
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11871246 loopButton.setToolTipText("Create loop");
11881247 loopButton.addActionListener(this);
11891248
1190
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1249
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11911250 textureButton.setToolTipText("Create texture");
11921251 textureButton.addActionListener(this);
11931252
1194
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1253
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11951254 overlayButton.setToolTipText("Create overlay");
11961255 overlayButton.addActionListener(this);
11971256
1198
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1257
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11991258 lightButton.setToolTipText("Create light");
12001259 lightButton.addActionListener(this);
12011260
....@@ -1205,6 +1264,11 @@
12051264
12061265 CreateTexturePanel(textures);
12071266
1267
+ int tabCount = resourcecontainer.getTabCount();
1268
+
1269
+ if (tabCount > 0)
1270
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1271
+
12081272 oe.toolboxPanel.add(textures);
12091273
12101274 textures.preferredHeight = 100;
....@@ -1212,11 +1276,11 @@
12121276 CreateSkyboxPanel(oe.skyboxPanel);
12131277
12141278 // EDIT panel
1215
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1279
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12161280 editButton.setToolTipText("Pin selection controls");
12171281 editButton.addActionListener(this);
12181282
1219
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1283
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12201284 uneditButton.setToolTipText("Unpin and remove selection controls");
12211285 uneditButton.addActionListener(this);
12221286
....@@ -1224,7 +1288,7 @@
12241288 allParamsButton.setToolTipText("Show all controls");
12251289 allParamsButton.addActionListener(this);
12261290
1227
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1291
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12281292 clearPanelButton.setToolTipText("Clear all controls");
12291293 clearPanelButton.addActionListener(this);
12301294
....@@ -1232,7 +1296,7 @@
12321296 //unselectButton.setToolTipText("Unselect");
12331297 //unselectButton.addActionListener(this);
12341298
1235
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1299
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12361300 flashSelectionButton.setToolTipText("Highlight selection");
12371301 flashSelectionButton.addActionListener(this);
12381302
....@@ -1255,6 +1319,8 @@
12551319
12561320 cGridBag jSPPanel = new cGridBag();
12571321
1322
+ jSPPanel.preferredHeight = 20;
1323
+
12581324 JScrollPane jSP;
12591325 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
12601326 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1263,11 +1329,11 @@
12631329 oe.treePanel.add(jSPPanel);
12641330 oe.treePanel.Return();
12651331
1266
- oe.treePanel.add(copyOptionsPanel);
1332
+ oe.treePanel.add(versionManagerPanel);
12671333 oe.treePanel.Return();
1268
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1269
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1270
- sliderPane.preferredHeight = 1;
1334
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1335
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1336
+ versionSliderPane.preferredHeight = 3;
12711337
12721338 // mainPanel.setDividerLocation(0.1); //1.0);
12731339 mainPanel.setResizeWeight(0.4);
....@@ -1425,6 +1491,14 @@
14251491
14261492 void EditObject(Object3D obj)
14271493 {
1494
+ assert(obj instanceof Composite);
1495
+
1496
+// if (obj.versionlist == null)
1497
+// {
1498
+// obj.versionlist = new Object3D[100];
1499
+// obj.versionindex = -1;
1500
+// }
1501
+
14281502 cRadio radioButton = new cRadio(obj.name);
14291503
14301504 // June 2019. Patch to avoid bug with transparency.
....@@ -1449,6 +1523,7 @@
14491523
14501524 oe.SetupViews();
14511525
1526
+ if (Globals.DEBUG)
14521527 System.out.println("SetupViews");
14531528 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
14541529 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -1815,7 +1890,12 @@
18151890 TreePath path;
18161891
18171892 public TransferableTreePath(TreePath tp) {
1818
- path = tp;
1893
+ Object[] objs = new Object[tp.getPathCount()];
1894
+ for (int i=0; i<objs.length; i++)
1895
+ {
1896
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1897
+ }
1898
+ path = new TreePath(objs);
18191899 }
18201900
18211901 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2105,7 +2185,11 @@
21052185 shadow.material = new cMaterial(obj.material);
21062186 shadow.material.diffuse = 0.0001f;
21072187 shadow.material.specular = 0.0001f;
2108
- //shadow.projectedVertices[1].x = 300;
2188
+ shadow.material.opacity = 0.75f;
2189
+
2190
+ AllocProjectedVertices(shadow);
2191
+
2192
+ shadow.projectedVertices[1].x = 300;
21092193
21102194 makeSomething(shadow);
21112195 }
....@@ -2626,27 +2710,35 @@
26262710 } else
26272711 if (source == loopItem || source == loopButton)
26282712 {
2713
+ if (!group.selection.isEmpty())
2714
+ {
26292715 Composite csg = new GroupLeaf();
26302716 csg.count = 5;
2631
- group(csg);
26322717 Composite child = new cGroup("Branch");
26332718 csg.addChild(child);
26342719 child.addChild(csg);
2720
+ group(csg);
2721
+ }
26352722 } else
26362723 if (source == doubleItem)
26372724 {
2725
+ if (!group.selection.isEmpty())
2726
+ {
26382727 Composite csg = new GroupLeaf("Fork");
26392728 csg.count = 5;
2640
- group(csg);
26412729 Composite child = new cGroup("Branch A");
26422730 csg.addChild(child);
26432731 child.addChild(csg);
26442732 child = new cGroup("Branch B");
26452733 csg.addChild(child);
26462734 child.addChild(csg);
2735
+ group(csg);
2736
+ }
26472737 } else
26482738 if (source == tripleItem)
26492739 {
2740
+ if (!group.selection.isEmpty())
2741
+ {
26502742 Composite csg = new GroupLeaf("Trident");
26512743 csg.count = 4;
26522744 group(csg);
....@@ -2659,6 +2751,7 @@
26592751 child = new cGroup();
26602752 csg.addChild(child);
26612753 child.addChild(csg);
2754
+ }
26622755 } else
26632756 if (source == computeAOItem)
26642757 {
....@@ -2708,6 +2801,18 @@
27082801 if (source == fullButton)
27092802 {
27102803 ToggleFullScreen();
2804
+ } else
2805
+ if (source == collapseButton)
2806
+ {
2807
+ this.expandedLayout = radio.layout;
2808
+ CollapseToolbar();
2809
+ } else
2810
+ if (source == maximize3DButton)
2811
+ {
2812
+ this.expandedLayout = radio.layout;
2813
+ radio.layout = twoButton;
2814
+ Show3DView();
2815
+ CollapseToolbar();
27112816 } else
27122817 if (source == previousVersionButton)
27132818 {
....@@ -3282,22 +3387,34 @@
32823387 } else
32833388 if (source == ungroupItem || source == ungroupButton)
32843389 {
3285
- boolean hasRoot = false;
3390
+ boolean canUngroup = true;
32863391
32873392 for (int i=0; i<group.selection.size(); i++)
32883393 {
3289
- if (group.selection.get(i) == group)
3394
+ Object3D selectedItem = group.selection.get(i);
3395
+
3396
+ if (selectedItem.Size() == 0)
32903397 {
3291
- hasRoot = true;
3398
+ // Cannot ungroup leaves
3399
+ canUngroup = false;
3400
+ break;
3401
+ }
3402
+
3403
+ if (selectedItem == group)
3404
+ {
3405
+ // Cannot ungroup root
3406
+ canUngroup = false;
32923407 break;
32933408 }
32943409 }
32953410
3296
- if (!hasRoot)
3411
+ if (canUngroup)
32973412 {
32983413 for (int i=0; i<group.selection.size(); i++)
32993414 {
3300
- Ungroup(group.selection.get(i));
3415
+ Object3D selectedItem = group.selection.get(i);
3416
+
3417
+ Ungroup(selectedItem);
33013418 }
33023419
33033420 ClearSelection(false);
....@@ -3660,38 +3777,7 @@
36603777 if (CameraPane.FULLSCREEN)
36613778 fullscreenLayout = radio.layout;
36623779
3663
- // bug
3664
- //gridPanel.setDividerLocation(1.0);
3665
- //bigPanel.setDividerLocation(0.0);
3666
-// bigThree.remove(scenePanel);
3667
-// bigThree.remove(centralPanel);
3668
-// bigThree.remove(XYZPanel);
3669
-// aWindowConstraints.gridx = 0;
3670
-// aWindowConstraints.gridy = 0;
3671
-// aWindowConstraints.gridwidth = 1;
3672
-// // aConstraints.gridheight = 3;
3673
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3674
-// aWindowConstraints.weightx = 0;
3675
-// aWindowConstraints.weighty = 1;
3676
-// //bigThree.add(jtp, aWindowConstraints);
3677
-// aWindowConstraints.weightx = 1;
3678
-// aWindowConstraints.gridwidth = 3;
3679
-// // aConstraints.gridheight = 3;
3680
-// aWindowConstraints.gridx = 1;
3681
-// aWindowConstraints.fill = GridBagConstraints.BOTH;
3682
-// bigThree.add(centralPanel, aWindowConstraints);
3683
-// aWindowConstraints.weightx = 0;
3684
-// aWindowConstraints.gridx = 4;
3685
-// aWindowConstraints.gridwidth = 1;
3686
-// // aConstraints.gridheight = 3;
3687
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3688
-// //bigThree.add(XYZPanel, aWindowConstraints);
3689
-// scenePanel.setVisible(false);
3690
-// centralPanel.setVisible(true);
3691
-// XYZPanel.setVisible(false);
3692
- bigThree.ClearUI();
3693
- bigThree.add(centralPanel);
3694
- bigThree.FlushUI();
3780
+ Show3DView();
36953781
36963782 cameraView.requestFocusInWindow();
36973783
....@@ -3877,6 +3963,7 @@
38773963 } else
38783964 if (source == rootButton)
38793965 {
3966
+ Replace();
38803967 Object3D obj;
38813968 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
38823969 {
....@@ -3891,6 +3978,8 @@
38913978 if (source == closeButton)
38923979 {
38933980 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3981
+ Replace();
3982
+
38943983 cRadio ab;
38953984 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
38963985 {
....@@ -3989,6 +4078,8 @@
39894078 } else
39904079 if(source instanceof cRadio)
39914080 {
4081
+ Replace();
4082
+
39924083 group.parent = keepparent;
39934084 group.attributes = 0;
39944085 //group.editWindow = null;
....@@ -4013,8 +4104,6 @@
40134104
40144105 copy = group;
40154106
4016
- SetUndoStates();
4017
-
40184107 //Globals.theRenderer.object = group;
40194108 if(!useclient)
40204109 {
....@@ -4042,6 +4131,29 @@
40424131 */
40434132 radio.layout.doClick();
40444133
4134
+ assert(copy instanceof Composite);
4135
+
4136
+ if (copy.versionlist == null)
4137
+ {
4138
+ copy.versionindex = -1;
4139
+
4140
+ // Cannot work with loops
4141
+ // To fix this issue, we first mark all nodes above the root,
4142
+ // and check if any of these nodes are reachable below the root.
4143
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4144
+
4145
+ if (!copy.HasTags())
4146
+ {
4147
+ copy.versionlist = new Object3D[100];
4148
+
4149
+ Save(true);
4150
+ }
4151
+
4152
+ Grafreed.grafreed.universe.TagObjects(copy, false);
4153
+ }
4154
+
4155
+ SetVersionStates();
4156
+
40454157 ClearUnpinned();
40464158
40474159 //Grafreed.Assert(group != null);
....@@ -4185,7 +4297,7 @@
41854297 TouchTransform(obj);
41864298 continue;
41874299 }
4188
- if ((mask&2) != 0) // Scale
4300
+ if ((mask&2) != 0) // Scale/rotation
41894301 {
41904302 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
41914303 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4193,10 +4305,6 @@
41934305 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
41944306 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
41954307 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4196
- }
4197
- if ((mask&4) != 0) // Rotation
4198
- {
4199
- // ?
42004308 }
42014309 if ((mask&1) != 0) // Translation
42024310 {
....@@ -5276,10 +5384,26 @@
52765384 flashSelectionButton.setEnabled(enabled);
52775385
52785386 clearPanelButton.setEnabled(!listUI.isEmpty());
5387
+
5388
+ boolean allComposites = true;
5389
+
5390
+ if (group.selection != null)
5391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5392
+ {
5393
+ Object next = e.nextElement();
5394
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
5395
+ {
5396
+ allComposites = false;
5397
+ break;
5398
+ }
5399
+ }
5400
+
5401
+ rootButton.setEnabled(allComposites);
52795402 }
52805403
52815404 void refreshContents(boolean cp)
52825405 {
5406
+ if (Globals.ADVANCED)
52835407 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
52845408 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
52855409 {
....@@ -5290,7 +5414,7 @@
52905414 Object3D child = (Object3D) group.selection.get(i);
52915415
52925416 objEditor.AddInfo(child, this, true);
5293
- System.err.println("info : " + child.GetPath());
5417
+// System.err.println("info : " + child.GetPath());
52945418 }
52955419
52965420 objEditor.SetText(); // jan 2014
....@@ -6173,11 +6297,11 @@
61736297 private MenuItem lookAtItem;
61746298 private MenuItem lookFromItem;
61756299 private MenuItem switchViewItem;
6176
- private MenuItem cutItem;
6300
+ private JMenuItem cutItem;
61776301 private MenuItem undoItem;
61786302 private MenuItem redoItem;
61796303 private JMenuItem duplicateItem;
6180
- private MenuItem cloneItem;
6304
+ private JMenuItem cloneItem;
61816305 private MenuItem cloneSupportItem;
61826306 private MenuItem overwriteGeoItem;
61836307 private MenuItem overwriteMatItem;
....@@ -6198,13 +6322,13 @@
61986322 private MenuItem cloneGeometriesItem;
61996323 private MenuItem shareGeometriesItem;
62006324 private MenuItem mergeGeometriesItem;
6201
- private MenuItem copyItem;
6325
+ private JMenuItem copyItem;
62026326 private MenuItem pasteItem;
6203
- private MenuItem pasteIntoItem;
6204
- private MenuItem pasteLinkItem;
6205
- private MenuItem pasteCloneItem;
6206
- private MenuItem pasteExpandItem;
6207
- private MenuItem deleteItem;
6327
+ private JMenuItem pasteIntoItem;
6328
+ private JMenuItem pasteLinkItem;
6329
+ private JMenuItem pasteCloneItem;
6330
+ private JMenuItem pasteExpandItem;
6331
+ private JMenuItem deleteItem;
62086332 private MenuItem clearAllItem;
62096333 private MenuItem genUVItem;
62106334 private MenuItem genNormalsMESHItem;
....@@ -6259,7 +6383,7 @@
62596383 private MenuItem transformGeometryItem;
62606384 private MenuItem transformChildrenItem;
62616385 private MenuItem hideItem;
6262
- private MenuItem grabItem;
6386
+ private JMenuItem grabItem;
62636387 private MenuItem backItem;
62646388 private MenuItem frontItem;
62656389 private MenuItem cameraItem;
....@@ -6272,7 +6396,7 @@
62726396 private MenuItem switchTransfoItem;
62736397 private MenuItem morphItem;
62746398 private MenuItem linkerItem;
6275
- private MenuItem ungroupItem;
6399
+ private JMenuItem ungroupItem;
62766400 private MenuItem editItem;
62776401 private MenuItem openWindowItem;
62786402 private MenuItem editLeafItem;