.. | .. |
---|
154 | 154 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 155 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 156 | //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("-"); |
---|
157 | 163 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
158 | 164 | duplicateItem.addActionListener(this); |
---|
159 | 165 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
.. | .. |
---|
197 | 203 | //zBufferItem.addActionListener(this); |
---|
198 | 204 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
199 | 205 | //normalLensItem.addActionListener(this); |
---|
200 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
| 206 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
201 | 207 | revertCameraItem.addActionListener(this); |
---|
202 | 208 | |
---|
203 | 209 | cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
.. | .. |
---|
261 | 267 | // animationItem.addItemListener(this); |
---|
262 | 268 | // animationItem.setState(CameraPane.ANIMATION); |
---|
263 | 269 | cameraMenu.add("-"); |
---|
264 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
| 270 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
265 | 271 | editCameraItem.addActionListener(this); |
---|
266 | 272 | |
---|
267 | 273 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
550 | 556 | oe.buttonGroup.add(dummyButton); |
---|
551 | 557 | */ |
---|
552 | 558 | //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); |
---|
553 | 571 | |
---|
554 | 572 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
555 | 573 | liveCB.setToolTipText("Enable animation"); |
---|
.. | .. |
---|
1951 | 1969 | { |
---|
1952 | 1970 | DumpObject(); |
---|
1953 | 1971 | } 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 |
---|
1954 | 1984 | if (source == oneStepButton) |
---|
1955 | 1985 | { |
---|
1956 | 1986 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
2004 | 2034 | if (source == cutItem || source == clearButton) |
---|
2005 | 2035 | { |
---|
2006 | 2036 | loadClipboard(true); |
---|
| 2037 | + } else |
---|
| 2038 | + if (source == undoItem) |
---|
| 2039 | + { |
---|
| 2040 | + Undo(); |
---|
| 2041 | + } else |
---|
| 2042 | + if (source == redoItem) |
---|
| 2043 | + { |
---|
| 2044 | + Redo(); |
---|
2007 | 2045 | } else |
---|
2008 | 2046 | if (source == duplicateItem) |
---|
2009 | 2047 | { |
---|
.. | .. |
---|
3028 | 3066 | child.CloseUI(); |
---|
3029 | 3067 | listUI.remove(child); |
---|
3030 | 3068 | |
---|
3031 | | - child.editWindow = null; // ??????????? |
---|
| 3069 | + //child.editWindow = null; // ??????????? |
---|
3032 | 3070 | } |
---|
3033 | 3071 | objEditor.ctrlPanel.FlushUI(); |
---|
3034 | 3072 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3115 | 3153 | sideView.object = group; |
---|
3116 | 3154 | } |
---|
3117 | 3155 | |
---|
3118 | | -// fix "+" issue group.editWindow = this; |
---|
| 3156 | +// fix "+" issue |
---|
| 3157 | + group.editWindow = this; |
---|
3119 | 3158 | |
---|
3120 | 3159 | /* |
---|
3121 | 3160 | currentLayout = radio.layout; |
---|
.. | .. |
---|
4297 | 4336 | |
---|
4298 | 4337 | objEditor.SetText(); // jan 2014 |
---|
4299 | 4338 | |
---|
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)) |
---|
4301 | 4340 | CameraPane.flash = true; |
---|
4302 | 4341 | |
---|
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) |
---|
4304 | 4343 | // a camera |
---|
4305 | 4344 | { |
---|
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 | + } |
---|
4308 | 4350 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4309 | 4351 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4310 | 4352 | } |
---|
.. | .. |
---|
4388 | 4430 | { |
---|
4389 | 4431 | if (group.selection.isEmpty()) |
---|
4390 | 4432 | return; |
---|
| 4433 | + |
---|
4391 | 4434 | Grafreed.clipboardIsTempGroup = false; |
---|
4392 | 4435 | Composite tGroup = null; |
---|
4393 | 4436 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4398 | 4441 | |
---|
4399 | 4442 | if (cut) |
---|
4400 | 4443 | { |
---|
| 4444 | + Save(); |
---|
4401 | 4445 | //int indices[] = jList.getSelectedIndices(); |
---|
4402 | 4446 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4403 | 4447 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4487 | 4531 | } |
---|
4488 | 4532 | |
---|
4489 | 4533 | } |
---|
| 4534 | + |
---|
4490 | 4535 | if (Grafreed.clipboardIsTempGroup) |
---|
4491 | 4536 | Grafreed.clipboard = tGroup; |
---|
| 4537 | + |
---|
4492 | 4538 | if (cut) |
---|
4493 | 4539 | { |
---|
4494 | 4540 | ResetModel(); |
---|
.. | .. |
---|
5113 | 5159 | cButton clearpanelButton; |
---|
5114 | 5160 | cButton unselectButton; |
---|
5115 | 5161 | |
---|
| 5162 | + cButton saveButton; |
---|
| 5163 | + cButton undoButton; |
---|
| 5164 | + cButton redoButton; |
---|
5116 | 5165 | cButton oneStepButton; |
---|
5117 | 5166 | |
---|
5118 | 5167 | cButton screenfitButton; |
---|
.. | .. |
---|
5145 | 5194 | private MenuItem lookFromItem; |
---|
5146 | 5195 | private MenuItem switchItem; |
---|
5147 | 5196 | private MenuItem cutItem; |
---|
| 5197 | + private MenuItem undoItem; |
---|
| 5198 | + private MenuItem redoItem; |
---|
5148 | 5199 | private MenuItem duplicateItem; |
---|
5149 | 5200 | private MenuItem cloneItem; |
---|
5150 | 5201 | private MenuItem cloneSupportItem; |
---|