Normand Briere
2019-06-11 1d909ffa0c2beb51d453b53b845c4f3a749ca5f0
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;
....@@ -4297,14 +4336,17 @@
42974336
42984337 objEditor.SetText(); // jan 2014
42994338
4300
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4339
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43014340 CameraPane.flash = true;
43024341
4303
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4342
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43044343 // a camera
43054344 {
4306
- CameraPane.camerachangeframe = 0; // don't refuse it
4307
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4345
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4346
+ {
4347
+ CameraPane.camerachangeframe = 0; // don't refuse it
4348
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4349
+ }
43084350 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
43094351 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43104352 }
....@@ -4388,6 +4430,7 @@
43884430 {
43894431 if (group.selection.isEmpty())
43904432 return;
4433
+
43914434 Grafreed.clipboardIsTempGroup = false;
43924435 Composite tGroup = null;
43934436 if (group.selection.size() > 0) // 1)
....@@ -4398,6 +4441,7 @@
43984441
43994442 if (cut)
44004443 {
4444
+ Save();
44014445 //int indices[] = jList.getSelectedIndices();
44024446 //for (int i = indices.length - 1; i >= 0; i--)
44034447 //jList.remove(indices[i]);
....@@ -4487,8 +4531,10 @@
44874531 }
44884532
44894533 }
4534
+
44904535 if (Grafreed.clipboardIsTempGroup)
44914536 Grafreed.clipboard = tGroup;
4537
+
44924538 if (cut)
44934539 {
44944540 ResetModel();
....@@ -5113,6 +5159,9 @@
51135159 cButton clearpanelButton;
51145160 cButton unselectButton;
51155161
5162
+ cButton saveButton;
5163
+ cButton undoButton;
5164
+ cButton redoButton;
51165165 cButton oneStepButton;
51175166
51185167 cButton screenfitButton;
....@@ -5145,6 +5194,8 @@
51455194 private MenuItem lookFromItem;
51465195 private MenuItem switchItem;
51475196 private MenuItem cutItem;
5197
+ private MenuItem undoItem;
5198
+ private MenuItem redoItem;
51485199 private MenuItem duplicateItem;
51495200 private MenuItem cloneItem;
51505201 private MenuItem cloneSupportItem;