Normand Briere
2019-06-11 4113164b3be1e50251ac40d6fd65660f0a6c2e63
GroupEditor.java
....@@ -154,11 +154,12 @@
154154 oe.menuBar.add(menu = new Menu("Edit"));
155155 //editItem = menu.add(new MenuItem("Edit"));
156156 //editItem.addActionListener(this);
157
- undoItem = menu.add(new MenuItem("Undo"));
158
- undoItem.addActionListener(this);
159
- redoItem = menu.add(new MenuItem("Redo"));
160
- redoItem.addActionListener(this);
161
- menu.add("-");
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
162163 duplicateItem = menu.add(new MenuItem("Duplicate"));
163164 duplicateItem.addActionListener(this);
164165 cloneItem = menu.add(new MenuItem("Clone"));
....@@ -202,7 +203,7 @@
202203 //zBufferItem.addActionListener(this);
203204 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204205 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206207 revertCameraItem.addActionListener(this);
207208
208209 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
....@@ -266,7 +267,7 @@
266267 // animationItem.addItemListener(this);
267268 // animationItem.setState(CameraPane.ANIMATION);
268269 cameraMenu.add("-");
269
- cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270271 editCameraItem.addActionListener(this);
271272
272273 if (Globals.ADVANCED)
....@@ -555,6 +556,18 @@
555556 oe.buttonGroup.add(dummyButton);
556557 */
557558 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
559
+
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
558571
559572 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
560573 liveCB.setToolTipText("Enable animation");
....@@ -1956,6 +1969,18 @@
19561969 {
19571970 DumpObject();
19581971 } else
1972
+ if (source == undoButton)
1973
+ {
1974
+ Undo();
1975
+ } else
1976
+ if (source == redoButton)
1977
+ {
1978
+ Redo();
1979
+ } else
1980
+ if (source == saveButton)
1981
+ {
1982
+ Save();
1983
+ } else
19591984 if (source == oneStepButton)
19601985 {
19611986 Globals.ONESTEP = true;
....@@ -3041,7 +3066,7 @@
30413066 child.CloseUI();
30423067 listUI.remove(child);
30433068
3044
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
30453070 }
30463071 objEditor.ctrlPanel.FlushUI();
30473072 //objEditor.jTree.clearSelection();
....@@ -3128,7 +3153,8 @@
31283153 sideView.object = group;
31293154 }
31303155
3131
-// fix "+" issue group.editWindow = this;
3156
+// fix "+" issue
3157
+ group.editWindow = this;
31323158
31333159 /*
31343160 currentLayout = radio.layout;
....@@ -3403,7 +3429,8 @@
34033429
34043430 int size = obj.MemorySize();
34053431
3406
- System.err.println((size/1024) + " KB is the size of " + obj);
3432
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
34073434 }
34083435 }
34093436 catch (Exception e)
....@@ -4310,15 +4337,13 @@
43104337
43114338 objEditor.SetText(); // jan 2014
43124339
4313
- Object3D object = (Object3D) tps[0].getLastPathComponent();
4314
-
4315
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(object instanceof Camera))
4340
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43164341 CameraPane.flash = true;
43174342
4318
- if (tps != null && tps.length > 0 && object instanceof Camera)
4343
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43194344 // a camera
43204345 {
4321
- if (object != Globals.theRenderer.LightCamera())
4346
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
43224347 {
43234348 CameraPane.camerachangeframe = 0; // don't refuse it
43244349 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4406,6 +4431,7 @@
44064431 {
44074432 if (group.selection.isEmpty())
44084433 return;
4434
+
44094435 Grafreed.clipboardIsTempGroup = false;
44104436 Composite tGroup = null;
44114437 if (group.selection.size() > 0) // 1)
....@@ -4416,6 +4442,7 @@
44164442
44174443 if (cut)
44184444 {
4445
+ Save();
44194446 //int indices[] = jList.getSelectedIndices();
44204447 //for (int i = indices.length - 1; i >= 0; i--)
44214448 //jList.remove(indices[i]);
....@@ -4505,8 +4532,10 @@
45054532 }
45064533
45074534 }
4535
+
45084536 if (Grafreed.clipboardIsTempGroup)
45094537 Grafreed.clipboard = tGroup;
4538
+
45104539 if (cut)
45114540 {
45124541 ResetModel();
....@@ -5131,6 +5160,9 @@
51315160 cButton clearpanelButton;
51325161 cButton unselectButton;
51335162
5163
+ cButton saveButton;
5164
+ cButton undoButton;
5165
+ cButton redoButton;
51345166 cButton oneStepButton;
51355167
51365168 cButton screenfitButton;