.. | .. |
---|
154 | 154 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 155 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 156 | //editItem.addActionListener(this); |
---|
157 | | - undoItem = menu.add(new MenuItem("Undo")); |
---|
158 | | - undoItem.addActionListener(this); |
---|
159 | | - redoItem = menu.add(new MenuItem("Redo")); |
---|
160 | | - redoItem.addActionListener(this); |
---|
161 | | - menu.add("-"); |
---|
| 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("-"); |
---|
162 | 163 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
163 | 164 | duplicateItem.addActionListener(this); |
---|
164 | 165 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
.. | .. |
---|
202 | 203 | //zBufferItem.addActionListener(this); |
---|
203 | 204 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 205 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); |
---|
| 206 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
206 | 207 | revertCameraItem.addActionListener(this); |
---|
207 | 208 | |
---|
208 | 209 | cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
.. | .. |
---|
266 | 267 | // animationItem.addItemListener(this); |
---|
267 | 268 | // animationItem.setState(CameraPane.ANIMATION); |
---|
268 | 269 | cameraMenu.add("-"); |
---|
269 | | - cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); |
---|
| 270 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
270 | 271 | editCameraItem.addActionListener(this); |
---|
271 | 272 | |
---|
272 | 273 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
555 | 556 | oe.buttonGroup.add(dummyButton); |
---|
556 | 557 | */ |
---|
557 | 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); |
---|
558 | 571 | |
---|
559 | 572 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
560 | 573 | liveCB.setToolTipText("Enable animation"); |
---|
.. | .. |
---|
858 | 871 | } else if(e.getSource() == liveCB) |
---|
859 | 872 | { |
---|
860 | 873 | cameraView.ToggleLive(); |
---|
| 874 | + refreshContents(false); |
---|
861 | 875 | } |
---|
862 | 876 | else if(e.getSource() == supportCB) |
---|
863 | 877 | { |
---|
.. | .. |
---|
1265 | 1279 | memoryItem.addActionListener(this); |
---|
1266 | 1280 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1267 | 1281 | analyzeItem.addActionListener(this); |
---|
1268 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1282 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1269 | 1283 | dumpItem.addActionListener(this); |
---|
1270 | 1284 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1271 | 1285 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1956 | 1970 | { |
---|
1957 | 1971 | DumpObject(); |
---|
1958 | 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 |
---|
1959 | 1985 | if (source == oneStepButton) |
---|
1960 | 1986 | { |
---|
1961 | 1987 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
2517 | 2543 | } else |
---|
2518 | 2544 | if (source == genNormalsMESHItem) |
---|
2519 | 2545 | { |
---|
2520 | | - GenNormals(true); // TODO |
---|
| 2546 | + GenNormalsMESH(); |
---|
2521 | 2547 | } else |
---|
2522 | 2548 | if (source == genNormalsORGANItem) |
---|
2523 | 2549 | { |
---|
.. | .. |
---|
3041 | 3067 | child.CloseUI(); |
---|
3042 | 3068 | listUI.remove(child); |
---|
3043 | 3069 | |
---|
3044 | | - child.editWindow = null; // ??????????? |
---|
| 3070 | + //child.editWindow = null; // ??????????? |
---|
3045 | 3071 | } |
---|
3046 | 3072 | objEditor.ctrlPanel.FlushUI(); |
---|
3047 | 3073 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3128 | 3154 | sideView.object = group; |
---|
3129 | 3155 | } |
---|
3130 | 3156 | |
---|
3131 | | -// fix "+" issue group.editWindow = this; |
---|
| 3157 | +// fix "+" issue |
---|
| 3158 | + group.editWindow = this; |
---|
3132 | 3159 | |
---|
3133 | 3160 | /* |
---|
3134 | 3161 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3403 | 3430 | |
---|
3404 | 3431 | int size = obj.MemorySize(); |
---|
3405 | 3432 | |
---|
3406 | | - 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)"); |
---|
3407 | 3435 | } |
---|
3408 | 3436 | } |
---|
3409 | 3437 | catch (Exception e) |
---|
.. | .. |
---|
3484 | 3512 | void GenNormals(boolean crease) |
---|
3485 | 3513 | { |
---|
3486 | 3514 | group.GenNormalsS(crease); |
---|
| 3515 | + |
---|
| 3516 | + refreshContents(); |
---|
| 3517 | + } |
---|
| 3518 | + |
---|
| 3519 | + void GenNormalsMESH() |
---|
| 3520 | + { |
---|
| 3521 | + group.GenNormalsMeshS(); |
---|
3487 | 3522 | |
---|
3488 | 3523 | refreshContents(); |
---|
3489 | 3524 | } |
---|
.. | .. |
---|
4286 | 4321 | //case 702: // Event.LIST_DESELECT |
---|
4287 | 4322 | group.deselectAll(); |
---|
4288 | 4323 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4289 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4290 | 4324 | if (tps != null) |
---|
4291 | 4325 | { |
---|
4292 | 4326 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4296 | 4330 | //if (child.parent != null) |
---|
4297 | 4331 | //child.parent.addSelectee(child); |
---|
4298 | 4332 | group.addSelectee(child); |
---|
4299 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4300 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4301 | | - System.err.println("info : " + child.GetPath()); |
---|
4302 | 4333 | } |
---|
4303 | 4334 | } |
---|
4304 | 4335 | // else |
---|
.. | .. |
---|
4308 | 4339 | // System.err.println("info : " + group.GetPath()); |
---|
4309 | 4340 | // } |
---|
4310 | 4341 | |
---|
4311 | | - objEditor.SetText(); // jan 2014 |
---|
4312 | | - |
---|
4313 | | - Object3D object = (Object3D) tps[0].getLastPathComponent(); |
---|
4314 | | - |
---|
4315 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(object instanceof Camera)) |
---|
| 4342 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4316 | 4343 | CameraPane.flash = true; |
---|
4317 | 4344 | |
---|
4318 | | - if (tps != null && tps.length > 0 && object instanceof Camera) |
---|
| 4345 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4319 | 4346 | // a camera |
---|
4320 | 4347 | { |
---|
4321 | | - if (object != Globals.theRenderer.LightCamera()) |
---|
| 4348 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
4322 | 4349 | { |
---|
4323 | 4350 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4324 | 4351 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4335 | 4362 | |
---|
4336 | 4363 | freezemodel = false; |
---|
4337 | 4364 | } |
---|
| 4365 | + |
---|
| 4366 | + void refreshContents(boolean cp) |
---|
| 4367 | + { |
---|
| 4368 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4369 | + { |
---|
| 4370 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4371 | + |
---|
| 4372 | + for (int i=0; i < group.selection.size(); i++) |
---|
| 4373 | + { |
---|
| 4374 | + Object3D child = (Object3D) group.selection.reserve(i); |
---|
| 4375 | + |
---|
| 4376 | + objEditor.SetMaterial(child); |
---|
| 4377 | + objEditor.AddInfo(child, this, true); |
---|
| 4378 | + System.err.println("info : " + child.GetPath()); |
---|
| 4379 | + |
---|
| 4380 | + group.selection.release(i); |
---|
| 4381 | + } |
---|
| 4382 | + |
---|
| 4383 | + objEditor.SetText(); // jan 2014 |
---|
| 4384 | + } |
---|
| 4385 | + |
---|
| 4386 | + super.refreshContents(cp); |
---|
| 4387 | + } |
---|
4338 | 4388 | |
---|
4339 | 4389 | void linkSomething(Object3D thing) |
---|
4340 | 4390 | { |
---|
.. | .. |
---|
4406 | 4456 | { |
---|
4407 | 4457 | if (group.selection.isEmpty()) |
---|
4408 | 4458 | return; |
---|
| 4459 | + |
---|
4409 | 4460 | Grafreed.clipboardIsTempGroup = false; |
---|
4410 | 4461 | Composite tGroup = null; |
---|
4411 | 4462 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4416 | 4467 | |
---|
4417 | 4468 | if (cut) |
---|
4418 | 4469 | { |
---|
| 4470 | + Save(); |
---|
4419 | 4471 | //int indices[] = jList.getSelectedIndices(); |
---|
4420 | 4472 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4421 | 4473 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4505 | 4557 | } |
---|
4506 | 4558 | |
---|
4507 | 4559 | } |
---|
| 4560 | + |
---|
4508 | 4561 | if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 4562 | Grafreed.clipboard = tGroup; |
---|
| 4563 | + |
---|
4510 | 4564 | if (cut) |
---|
4511 | 4565 | { |
---|
4512 | 4566 | ResetModel(); |
---|
.. | .. |
---|
5131 | 5185 | cButton clearpanelButton; |
---|
5132 | 5186 | cButton unselectButton; |
---|
5133 | 5187 | |
---|
| 5188 | + cButton saveButton; |
---|
| 5189 | + cButton undoButton; |
---|
| 5190 | + cButton redoButton; |
---|
5134 | 5191 | cButton oneStepButton; |
---|
5135 | 5192 | |
---|
5136 | 5193 | cButton screenfitButton; |
---|