.. | .. |
---|
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"); |
---|
.. | .. |
---|
853 | 871 | } else if(e.getSource() == liveCB) |
---|
854 | 872 | { |
---|
855 | 873 | cameraView.ToggleLive(); |
---|
| 874 | + refreshContents(false); |
---|
856 | 875 | } |
---|
857 | 876 | else if(e.getSource() == supportCB) |
---|
858 | 877 | { |
---|
.. | .. |
---|
1260 | 1279 | memoryItem.addActionListener(this); |
---|
1261 | 1280 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1262 | 1281 | analyzeItem.addActionListener(this); |
---|
1263 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1282 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1264 | 1283 | dumpItem.addActionListener(this); |
---|
1265 | 1284 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1266 | 1285 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1951 | 1970 | { |
---|
1952 | 1971 | DumpObject(); |
---|
1953 | 1972 | } else |
---|
| 1973 | + if (source == undoButton) |
---|
| 1974 | + { |
---|
| 1975 | + Undo(); |
---|
| 1976 | + } else |
---|
| 1977 | + if (source == redoButton) |
---|
| 1978 | + { |
---|
| 1979 | + Redo(); |
---|
| 1980 | + } else |
---|
| 1981 | + if (source == saveButton) |
---|
| 1982 | + { |
---|
| 1983 | + Save(); |
---|
| 1984 | + } else |
---|
1954 | 1985 | if (source == oneStepButton) |
---|
1955 | 1986 | { |
---|
1956 | 1987 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
2004 | 2035 | if (source == cutItem || source == clearButton) |
---|
2005 | 2036 | { |
---|
2006 | 2037 | loadClipboard(true); |
---|
| 2038 | + } else |
---|
| 2039 | + if (source == undoItem) |
---|
| 2040 | + { |
---|
| 2041 | + Undo(); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == redoItem) |
---|
| 2044 | + { |
---|
| 2045 | + Redo(); |
---|
2007 | 2046 | } else |
---|
2008 | 2047 | if (source == duplicateItem) |
---|
2009 | 2048 | { |
---|
.. | .. |
---|
2504 | 2543 | } else |
---|
2505 | 2544 | if (source == genNormalsMESHItem) |
---|
2506 | 2545 | { |
---|
2507 | | - GenNormals(true); // TODO |
---|
| 2546 | + GenNormalsMESH(); |
---|
2508 | 2547 | } else |
---|
2509 | 2548 | if (source == genNormalsORGANItem) |
---|
2510 | 2549 | { |
---|
.. | .. |
---|
3028 | 3067 | child.CloseUI(); |
---|
3029 | 3068 | listUI.remove(child); |
---|
3030 | 3069 | |
---|
3031 | | - child.editWindow = null; // ??????????? |
---|
| 3070 | + //child.editWindow = null; // ??????????? |
---|
3032 | 3071 | } |
---|
3033 | 3072 | objEditor.ctrlPanel.FlushUI(); |
---|
3034 | 3073 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3115 | 3154 | sideView.object = group; |
---|
3116 | 3155 | } |
---|
3117 | 3156 | |
---|
3118 | | -// fix "+" issue group.editWindow = this; |
---|
| 3157 | +// fix "+" issue |
---|
| 3158 | + group.editWindow = this; |
---|
3119 | 3159 | |
---|
3120 | 3160 | /* |
---|
3121 | 3161 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3390 | 3430 | |
---|
3391 | 3431 | int size = obj.MemorySize(); |
---|
3392 | 3432 | |
---|
3393 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3433 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3434 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3394 | 3435 | } |
---|
3395 | 3436 | } |
---|
3396 | 3437 | catch (Exception e) |
---|
.. | .. |
---|
3471 | 3512 | void GenNormals(boolean crease) |
---|
3472 | 3513 | { |
---|
3473 | 3514 | group.GenNormalsS(crease); |
---|
| 3515 | + |
---|
| 3516 | + refreshContents(); |
---|
| 3517 | + } |
---|
| 3518 | + |
---|
| 3519 | + void GenNormalsMESH() |
---|
| 3520 | + { |
---|
| 3521 | + group.GenNormalsMeshS(); |
---|
3474 | 3522 | |
---|
3475 | 3523 | refreshContents(); |
---|
3476 | 3524 | } |
---|
.. | .. |
---|
4273 | 4321 | //case 702: // Event.LIST_DESELECT |
---|
4274 | 4322 | group.deselectAll(); |
---|
4275 | 4323 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4276 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4277 | 4324 | if (tps != null) |
---|
4278 | 4325 | { |
---|
4279 | 4326 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4282 | 4329 | |
---|
4283 | 4330 | //if (child.parent != null) |
---|
4284 | 4331 | //child.parent.addSelectee(child); |
---|
| 4332 | + objEditor.SetMaterial(child); |
---|
4285 | 4333 | group.addSelectee(child); |
---|
4286 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4287 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4288 | | - System.err.println("info : " + child.GetPath()); |
---|
4289 | 4334 | } |
---|
4290 | 4335 | } |
---|
4291 | 4336 | // else |
---|
.. | .. |
---|
4295 | 4340 | // System.err.println("info : " + group.GetPath()); |
---|
4296 | 4341 | // } |
---|
4297 | 4342 | |
---|
4298 | | - objEditor.SetText(); // jan 2014 |
---|
4299 | | - |
---|
4300 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4343 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4301 | 4344 | CameraPane.flash = true; |
---|
4302 | 4345 | |
---|
4303 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4346 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4304 | 4347 | // a camera |
---|
4305 | 4348 | { |
---|
4306 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4307 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4349 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4350 | + { |
---|
| 4351 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4352 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4353 | + } |
---|
4308 | 4354 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4309 | 4355 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4310 | 4356 | } |
---|
.. | .. |
---|
4317 | 4363 | |
---|
4318 | 4364 | freezemodel = false; |
---|
4319 | 4365 | } |
---|
| 4366 | + |
---|
| 4367 | + void refreshContents(boolean cp) |
---|
| 4368 | + { |
---|
| 4369 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4370 | + { |
---|
| 4371 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4372 | + |
---|
| 4373 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4374 | + { |
---|
| 4375 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4376 | + |
---|
| 4377 | + objEditor.AddInfo(child, this, true); |
---|
| 4378 | + System.err.println("info : " + child.GetPath()); |
---|
| 4379 | + } |
---|
| 4380 | + |
---|
| 4381 | + objEditor.SetText(); // jan 2014 |
---|
| 4382 | + } |
---|
| 4383 | + |
---|
| 4384 | + super.refreshContents(cp); |
---|
| 4385 | + } |
---|
4320 | 4386 | |
---|
4321 | 4387 | void linkSomething(Object3D thing) |
---|
4322 | 4388 | { |
---|
.. | .. |
---|
4388 | 4454 | { |
---|
4389 | 4455 | if (group.selection.isEmpty()) |
---|
4390 | 4456 | return; |
---|
| 4457 | + |
---|
4391 | 4458 | Grafreed.clipboardIsTempGroup = false; |
---|
4392 | 4459 | Composite tGroup = null; |
---|
4393 | 4460 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4398 | 4465 | |
---|
4399 | 4466 | if (cut) |
---|
4400 | 4467 | { |
---|
| 4468 | + Save(); |
---|
4401 | 4469 | //int indices[] = jList.getSelectedIndices(); |
---|
4402 | 4470 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4403 | 4471 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4487 | 4555 | } |
---|
4488 | 4556 | |
---|
4489 | 4557 | } |
---|
| 4558 | + |
---|
4490 | 4559 | if (Grafreed.clipboardIsTempGroup) |
---|
4491 | 4560 | Grafreed.clipboard = tGroup; |
---|
| 4561 | + |
---|
4492 | 4562 | if (cut) |
---|
4493 | 4563 | { |
---|
4494 | 4564 | ResetModel(); |
---|
.. | .. |
---|
5113 | 5183 | cButton clearpanelButton; |
---|
5114 | 5184 | cButton unselectButton; |
---|
5115 | 5185 | |
---|
| 5186 | + cButton saveButton; |
---|
| 5187 | + cButton undoButton; |
---|
| 5188 | + cButton redoButton; |
---|
5116 | 5189 | cButton oneStepButton; |
---|
5117 | 5190 | |
---|
5118 | 5191 | cButton screenfitButton; |
---|
.. | .. |
---|
5145 | 5218 | private MenuItem lookFromItem; |
---|
5146 | 5219 | private MenuItem switchItem; |
---|
5147 | 5220 | private MenuItem cutItem; |
---|
| 5221 | + private MenuItem undoItem; |
---|
| 5222 | + private MenuItem redoItem; |
---|
5148 | 5223 | private MenuItem duplicateItem; |
---|
5149 | 5224 | private MenuItem cloneItem; |
---|
5150 | 5225 | private MenuItem cloneSupportItem; |
---|