.. | .. |
---|
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) |
---|
.. | .. |
---|
464 | 470 | markleavesItem.addActionListener(this); |
---|
465 | 471 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
466 | 472 | unmarkleavesItem.addActionListener(this); |
---|
| 473 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 474 | + rewindleavesItem.addActionListener(this); |
---|
| 475 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 476 | + unrewindleavesItem.addActionListener(this); |
---|
| 477 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 478 | + randomleavesItem.addActionListener(this); |
---|
| 479 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 480 | + unrandomleavesItem.addActionListener(this); |
---|
467 | 481 | menu.add("-"); |
---|
468 | 482 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
469 | 483 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
550 | 564 | oe.buttonGroup.add(dummyButton); |
---|
551 | 565 | */ |
---|
552 | 566 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
| 567 | + |
---|
| 568 | + oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 569 | + undoButton.setToolTipText("Undo changes"); |
---|
| 570 | + undoButton.addActionListener(this); |
---|
| 571 | + |
---|
| 572 | + oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 573 | + redoButton.setToolTipText("Redo changes"); |
---|
| 574 | + redoButton.addActionListener(this); |
---|
| 575 | + |
---|
| 576 | + oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 577 | + saveButton.setToolTipText("Save changes"); |
---|
| 578 | + saveButton.addActionListener(this); |
---|
553 | 579 | |
---|
554 | 580 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
555 | 581 | liveCB.setToolTipText("Enable animation"); |
---|
.. | .. |
---|
853 | 879 | } else if(e.getSource() == liveCB) |
---|
854 | 880 | { |
---|
855 | 881 | cameraView.ToggleLive(); |
---|
| 882 | + refreshContents(false); |
---|
856 | 883 | } |
---|
857 | 884 | else if(e.getSource() == supportCB) |
---|
858 | 885 | { |
---|
.. | .. |
---|
1260 | 1287 | memoryItem.addActionListener(this); |
---|
1261 | 1288 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1262 | 1289 | analyzeItem.addActionListener(this); |
---|
1263 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1290 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1264 | 1291 | dumpItem.addActionListener(this); |
---|
1265 | 1292 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1266 | 1293 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1951 | 1978 | { |
---|
1952 | 1979 | DumpObject(); |
---|
1953 | 1980 | } else |
---|
| 1981 | + if (source == undoButton) |
---|
| 1982 | + { |
---|
| 1983 | + Undo(); |
---|
| 1984 | + } else |
---|
| 1985 | + if (source == redoButton) |
---|
| 1986 | + { |
---|
| 1987 | + Redo(); |
---|
| 1988 | + } else |
---|
| 1989 | + if (source == saveButton) |
---|
| 1990 | + { |
---|
| 1991 | + Save(); |
---|
| 1992 | + } else |
---|
1954 | 1993 | if (source == oneStepButton) |
---|
1955 | 1994 | { |
---|
1956 | 1995 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
2004 | 2043 | if (source == cutItem || source == clearButton) |
---|
2005 | 2044 | { |
---|
2006 | 2045 | loadClipboard(true); |
---|
| 2046 | + } else |
---|
| 2047 | + if (source == undoItem) |
---|
| 2048 | + { |
---|
| 2049 | + Undo(); |
---|
| 2050 | + } else |
---|
| 2051 | + if (source == redoItem) |
---|
| 2052 | + { |
---|
| 2053 | + Redo(); |
---|
2007 | 2054 | } else |
---|
2008 | 2055 | if (source == duplicateItem) |
---|
2009 | 2056 | { |
---|
.. | .. |
---|
2504 | 2551 | } else |
---|
2505 | 2552 | if (source == genNormalsMESHItem) |
---|
2506 | 2553 | { |
---|
2507 | | - GenNormals(true); // TODO |
---|
| 2554 | + GenNormalsMESH(); |
---|
2508 | 2555 | } else |
---|
2509 | 2556 | if (source == genNormalsORGANItem) |
---|
2510 | 2557 | { |
---|
.. | .. |
---|
2569 | 2616 | if (source == unmarkleavesItem) |
---|
2570 | 2617 | { |
---|
2571 | 2618 | MarkLeaves(false); |
---|
| 2619 | + } else |
---|
| 2620 | + if (source == rewindleavesItem) |
---|
| 2621 | + { |
---|
| 2622 | + RewindLeaves(true); |
---|
| 2623 | + } else |
---|
| 2624 | + if (source == unrewindleavesItem) |
---|
| 2625 | + { |
---|
| 2626 | + RewindLeaves(false); |
---|
| 2627 | + } else |
---|
| 2628 | + if (source == randomleavesItem) |
---|
| 2629 | + { |
---|
| 2630 | + RandomLeaves(true); |
---|
| 2631 | + } else |
---|
| 2632 | + if (source == unrandomleavesItem) |
---|
| 2633 | + { |
---|
| 2634 | + RandomLeaves(false); |
---|
2572 | 2635 | } else |
---|
2573 | 2636 | if (source == flipVItem) |
---|
2574 | 2637 | { |
---|
.. | .. |
---|
3028 | 3091 | child.CloseUI(); |
---|
3029 | 3092 | listUI.remove(child); |
---|
3030 | 3093 | |
---|
3031 | | - child.editWindow = null; // ??????????? |
---|
| 3094 | + //child.editWindow = null; // ??????????? |
---|
3032 | 3095 | } |
---|
3033 | 3096 | objEditor.ctrlPanel.FlushUI(); |
---|
3034 | 3097 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3115 | 3178 | sideView.object = group; |
---|
3116 | 3179 | } |
---|
3117 | 3180 | |
---|
3118 | | -// fix "+" issue group.editWindow = this; |
---|
| 3181 | +// fix "+" issue |
---|
| 3182 | + group.editWindow = this; |
---|
3119 | 3183 | |
---|
3120 | 3184 | /* |
---|
3121 | 3185 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3390 | 3454 | |
---|
3391 | 3455 | int size = obj.MemorySize(); |
---|
3392 | 3456 | |
---|
3393 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3457 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3458 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3394 | 3459 | } |
---|
3395 | 3460 | } |
---|
3396 | 3461 | catch (Exception e) |
---|
.. | .. |
---|
3471 | 3536 | void GenNormals(boolean crease) |
---|
3472 | 3537 | { |
---|
3473 | 3538 | group.GenNormalsS(crease); |
---|
| 3539 | + |
---|
| 3540 | + refreshContents(); |
---|
| 3541 | + } |
---|
| 3542 | + |
---|
| 3543 | + void GenNormalsMESH() |
---|
| 3544 | + { |
---|
| 3545 | + group.GenNormalsMeshS(); |
---|
3474 | 3546 | |
---|
3475 | 3547 | refreshContents(); |
---|
3476 | 3548 | } |
---|
.. | .. |
---|
4098 | 4170 | refreshContents(); |
---|
4099 | 4171 | } |
---|
4100 | 4172 | |
---|
| 4173 | + void RewindLeaves(boolean hide) |
---|
| 4174 | + { |
---|
| 4175 | + group.selection.RewindLeaves(hide); |
---|
| 4176 | + refreshContents(); |
---|
| 4177 | + } |
---|
| 4178 | + |
---|
| 4179 | + void RandomLeaves(boolean hide) |
---|
| 4180 | + { |
---|
| 4181 | + group.selection.RandomLeaves(hide); |
---|
| 4182 | + refreshContents(); |
---|
| 4183 | + } |
---|
| 4184 | + |
---|
4101 | 4185 | void SetTexRes(int tr) |
---|
4102 | 4186 | { |
---|
4103 | 4187 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4273 | 4357 | //case 702: // Event.LIST_DESELECT |
---|
4274 | 4358 | group.deselectAll(); |
---|
4275 | 4359 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4276 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4277 | 4360 | if (tps != null) |
---|
4278 | 4361 | { |
---|
4279 | 4362 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4282 | 4365 | |
---|
4283 | 4366 | //if (child.parent != null) |
---|
4284 | 4367 | //child.parent.addSelectee(child); |
---|
| 4368 | + objEditor.SetMaterial(child); |
---|
4285 | 4369 | group.addSelectee(child); |
---|
4286 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4287 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4288 | | - System.err.println("info : " + child.GetPath()); |
---|
4289 | 4370 | } |
---|
4290 | 4371 | } |
---|
4291 | 4372 | // else |
---|
.. | .. |
---|
4295 | 4376 | // System.err.println("info : " + group.GetPath()); |
---|
4296 | 4377 | // } |
---|
4297 | 4378 | |
---|
4298 | | - objEditor.SetText(); // jan 2014 |
---|
4299 | | - |
---|
4300 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4379 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4301 | 4380 | CameraPane.flash = true; |
---|
4302 | 4381 | |
---|
4303 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4382 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4304 | 4383 | // a camera |
---|
4305 | 4384 | { |
---|
4306 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4307 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4385 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4386 | + { |
---|
| 4387 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4388 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4389 | + } |
---|
4308 | 4390 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4309 | 4391 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4310 | 4392 | } |
---|
.. | .. |
---|
4317 | 4399 | |
---|
4318 | 4400 | freezemodel = false; |
---|
4319 | 4401 | } |
---|
| 4402 | + |
---|
| 4403 | + void refreshContents(boolean cp) |
---|
| 4404 | + { |
---|
| 4405 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4406 | + { |
---|
| 4407 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4408 | + |
---|
| 4409 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4410 | + { |
---|
| 4411 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4412 | + |
---|
| 4413 | + objEditor.AddInfo(child, this, true); |
---|
| 4414 | + System.err.println("info : " + child.GetPath()); |
---|
| 4415 | + } |
---|
| 4416 | + |
---|
| 4417 | + objEditor.SetText(); // jan 2014 |
---|
| 4418 | + } |
---|
| 4419 | + |
---|
| 4420 | + super.refreshContents(cp); |
---|
| 4421 | + } |
---|
4320 | 4422 | |
---|
4321 | 4423 | void linkSomething(Object3D thing) |
---|
4322 | 4424 | { |
---|
.. | .. |
---|
4388 | 4490 | { |
---|
4389 | 4491 | if (group.selection.isEmpty()) |
---|
4390 | 4492 | return; |
---|
| 4493 | + |
---|
4391 | 4494 | Grafreed.clipboardIsTempGroup = false; |
---|
4392 | 4495 | Composite tGroup = null; |
---|
4393 | 4496 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4398 | 4501 | |
---|
4399 | 4502 | if (cut) |
---|
4400 | 4503 | { |
---|
| 4504 | + Save(); |
---|
4401 | 4505 | //int indices[] = jList.getSelectedIndices(); |
---|
4402 | 4506 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4403 | 4507 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4487 | 4591 | } |
---|
4488 | 4592 | |
---|
4489 | 4593 | } |
---|
| 4594 | + |
---|
4490 | 4595 | if (Grafreed.clipboardIsTempGroup) |
---|
4491 | 4596 | Grafreed.clipboard = tGroup; |
---|
| 4597 | + |
---|
4492 | 4598 | if (cut) |
---|
4493 | 4599 | { |
---|
4494 | 4600 | ResetModel(); |
---|
.. | .. |
---|
5113 | 5219 | cButton clearpanelButton; |
---|
5114 | 5220 | cButton unselectButton; |
---|
5115 | 5221 | |
---|
| 5222 | + cButton saveButton; |
---|
| 5223 | + cButton undoButton; |
---|
| 5224 | + cButton redoButton; |
---|
5116 | 5225 | cButton oneStepButton; |
---|
5117 | 5226 | |
---|
5118 | 5227 | cButton screenfitButton; |
---|
.. | .. |
---|
5145 | 5254 | private MenuItem lookFromItem; |
---|
5146 | 5255 | private MenuItem switchItem; |
---|
5147 | 5256 | private MenuItem cutItem; |
---|
| 5257 | + private MenuItem undoItem; |
---|
| 5258 | + private MenuItem redoItem; |
---|
5148 | 5259 | private MenuItem duplicateItem; |
---|
5149 | 5260 | private MenuItem cloneItem; |
---|
5150 | 5261 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5208 | 5319 | private MenuItem showleavesItem; |
---|
5209 | 5320 | private MenuItem markleavesItem; |
---|
5210 | 5321 | private MenuItem unmarkleavesItem; |
---|
| 5322 | + private MenuItem rewindleavesItem; |
---|
| 5323 | + private MenuItem unrewindleavesItem; |
---|
| 5324 | + private MenuItem randomleavesItem; |
---|
| 5325 | + private MenuItem unrandomleavesItem; |
---|
5211 | 5326 | |
---|
5212 | 5327 | private MenuItem flipVItem; |
---|
5213 | 5328 | private MenuItem unflipVItem; |
---|