Normand Briere
2019-06-11 d0dc7ff35d71919d503ae35592478b173cf3cfd3
GroupEditor.java
....@@ -154,6 +154,12 @@
154154 oe.menuBar.add(menu = new Menu("Edit"));
155155 //editItem = menu.add(new MenuItem("Edit"));
156156 //editItem.addActionListener(this);
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("-");
157163 duplicateItem = menu.add(new MenuItem("Duplicate"));
158164 duplicateItem.addActionListener(this);
159165 cloneItem = menu.add(new MenuItem("Clone"));
....@@ -197,7 +203,7 @@
197203 //zBufferItem.addActionListener(this);
198204 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199205 //normalLensItem.addActionListener(this);
200
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
201207 revertCameraItem.addActionListener(this);
202208
203209 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
....@@ -261,7 +267,7 @@
261267 // animationItem.addItemListener(this);
262268 // animationItem.setState(CameraPane.ANIMATION);
263269 cameraMenu.add("-");
264
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
265271 editCameraItem.addActionListener(this);
266272
267273 if (Globals.ADVANCED)
....@@ -550,6 +556,18 @@
550556 oe.buttonGroup.add(dummyButton);
551557 */
552558 //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);
553571
554572 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
555573 liveCB.setToolTipText("Enable animation");
....@@ -1951,6 +1969,18 @@
19511969 {
19521970 DumpObject();
19531971 } 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
19541984 if (source == oneStepButton)
19551985 {
19561986 Globals.ONESTEP = true;
....@@ -2004,6 +2034,14 @@
20042034 if (source == cutItem || source == clearButton)
20052035 {
20062036 loadClipboard(true);
2037
+ } else
2038
+ if (source == undoItem)
2039
+ {
2040
+ Undo();
2041
+ } else
2042
+ if (source == redoItem)
2043
+ {
2044
+ Redo();
20072045 } else
20082046 if (source == duplicateItem)
20092047 {
....@@ -3028,7 +3066,7 @@
30283066 child.CloseUI();
30293067 listUI.remove(child);
30303068
3031
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
30323070 }
30333071 objEditor.ctrlPanel.FlushUI();
30343072 //objEditor.jTree.clearSelection();
....@@ -3115,7 +3153,8 @@
31153153 sideView.object = group;
31163154 }
31173155
3118
-// fix "+" issue group.editWindow = this;
3156
+// fix "+" issue
3157
+ group.editWindow = this;
31193158
31203159 /*
31213160 currentLayout = radio.layout;
....@@ -3390,7 +3429,8 @@
33903429
33913430 int size = obj.MemorySize();
33923431
3393
- 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)");
33943434 }
33953435 }
33963436 catch (Exception e)
....@@ -4297,14 +4337,17 @@
42974337
42984338 objEditor.SetText(); // jan 2014
42994339
4300
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4340
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43014341 CameraPane.flash = true;
43024342
4303
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4343
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43044344 // a camera
43054345 {
4306
- CameraPane.camerachangeframe = 0; // don't refuse it
4307
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4346
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4347
+ {
4348
+ CameraPane.camerachangeframe = 0; // don't refuse it
4349
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4350
+ }
43084351 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
43094352 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43104353 }
....@@ -4388,6 +4431,7 @@
43884431 {
43894432 if (group.selection.isEmpty())
43904433 return;
4434
+
43914435 Grafreed.clipboardIsTempGroup = false;
43924436 Composite tGroup = null;
43934437 if (group.selection.size() > 0) // 1)
....@@ -4398,6 +4442,7 @@
43984442
43994443 if (cut)
44004444 {
4445
+ Save();
44014446 //int indices[] = jList.getSelectedIndices();
44024447 //for (int i = indices.length - 1; i >= 0; i--)
44034448 //jList.remove(indices[i]);
....@@ -4487,8 +4532,10 @@
44874532 }
44884533
44894534 }
4535
+
44904536 if (Grafreed.clipboardIsTempGroup)
44914537 Grafreed.clipboard = tGroup;
4538
+
44924539 if (cut)
44934540 {
44944541 ResetModel();
....@@ -5113,6 +5160,9 @@
51135160 cButton clearpanelButton;
51145161 cButton unselectButton;
51155162
5163
+ cButton saveButton;
5164
+ cButton undoButton;
5165
+ cButton redoButton;
51165166 cButton oneStepButton;
51175167
51185168 cButton screenfitButton;
....@@ -5145,6 +5195,8 @@
51455195 private MenuItem lookFromItem;
51465196 private MenuItem switchItem;
51475197 private MenuItem cutItem;
5198
+ private MenuItem undoItem;
5199
+ private MenuItem redoItem;
51485200 private MenuItem duplicateItem;
51495201 private MenuItem cloneItem;
51505202 private MenuItem cloneSupportItem;