.. | .. |
---|
605 | 605 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | 606 | undoButton.setToolTipText("Undo changes"); |
---|
607 | 607 | undoButton.addActionListener(this); |
---|
| 608 | + undoButton.setEnabled(false); |
---|
608 | 609 | |
---|
609 | 610 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
610 | 611 | redoButton.setToolTipText("Redo changes"); |
---|
611 | 612 | redoButton.addActionListener(this); |
---|
| 613 | + redoButton.setEnabled(false); |
---|
612 | 614 | |
---|
613 | 615 | copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
614 | 616 | saveButton.setToolTipText("Save changes"); |
---|
.. | .. |
---|
743 | 745 | lightButton.setToolTipText("Create light"); |
---|
744 | 746 | lightButton.addActionListener(this); |
---|
745 | 747 | |
---|
| 748 | + for (int i=6; --i>=0;) |
---|
| 749 | + { |
---|
| 750 | + oe.toolboxPanel.Return(); |
---|
| 751 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 752 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 753 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 754 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 755 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 756 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 757 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 758 | + } |
---|
| 759 | + |
---|
746 | 760 | // EDIT panel |
---|
747 | 761 | editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
748 | 762 | editButton.setToolTipText("Edit selection"); |
---|
.. | .. |
---|
3326 | 3340 | } else |
---|
3327 | 3341 | if (source == editItem || source == editButton) |
---|
3328 | 3342 | { |
---|
| 3343 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3344 | + { |
---|
| 3345 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3346 | + child.pinned = true; |
---|
| 3347 | + } |
---|
| 3348 | + |
---|
3329 | 3349 | EditSelection(false); |
---|
3330 | 3350 | } else |
---|
3331 | 3351 | if (source == uneditButton) |
---|
.. | .. |
---|
3335 | 3355 | Object3D child = (Object3D)e.nextElement(); |
---|
3336 | 3356 | if(child.editWindow != null) |
---|
3337 | 3357 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3358 | + child.pinned = false; |
---|
3338 | 3359 | child.CloseUI(); |
---|
3339 | 3360 | listUI.remove(child); |
---|
3340 | 3361 | |
---|
.. | .. |
---|
3351 | 3372 | //copy.ClearUI(); |
---|
3352 | 3373 | for (Object3D obj : listUI) |
---|
3353 | 3374 | { |
---|
| 3375 | + obj.pinned = true; |
---|
3354 | 3376 | obj.CloseUI(); |
---|
3355 | 3377 | } |
---|
3356 | 3378 | listUI.clear(); |
---|
.. | .. |
---|
3360 | 3382 | { |
---|
3361 | 3383 | assert(copy == group); |
---|
3362 | 3384 | |
---|
3363 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3385 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3364 | 3386 | |
---|
3365 | 3387 | for (Object3D obj : listUI) |
---|
3366 | 3388 | { |
---|
.. | .. |
---|
4502 | 4524 | // } |
---|
4503 | 4525 | // } |
---|
4504 | 4526 | |
---|
4505 | | - static boolean allparams = true; |
---|
4506 | | - |
---|
4507 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4508 | | - |
---|
4509 | 4527 | void EditSelection(boolean newWindow) |
---|
4510 | 4528 | { |
---|
4511 | 4529 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4599 | 4617 | |
---|
4600 | 4618 | freezemodel = true; |
---|
4601 | 4619 | |
---|
| 4620 | + //for (Object3D obj : listUI) |
---|
| 4621 | + for (int i=listUI.size(); --i>=0;) |
---|
| 4622 | + { |
---|
| 4623 | + Object3D obj = listUI.elementAt(i); |
---|
| 4624 | + if (!obj.pinned) |
---|
| 4625 | + { |
---|
| 4626 | + obj.CloseUI(); |
---|
| 4627 | + listUI.remove(i); |
---|
| 4628 | + } |
---|
| 4629 | + } |
---|
| 4630 | + |
---|
4602 | 4631 | /**/ |
---|
4603 | 4632 | //switch (event.id) |
---|
4604 | 4633 | { |
---|
.. | .. |
---|
4631 | 4660 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4632 | 4661 | // a camera |
---|
4633 | 4662 | { |
---|
4634 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4663 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4635 | 4664 | { |
---|
4636 | 4665 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4637 | 4666 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4640 | 4669 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4641 | 4670 | } |
---|
4642 | 4671 | |
---|
| 4672 | + if (tps != null && tps.length == 1) |
---|
| 4673 | + { |
---|
| 4674 | + EditSelection(false); |
---|
| 4675 | + } |
---|
| 4676 | + |
---|
| 4677 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4678 | + |
---|
4643 | 4679 | refreshContents(); |
---|
4644 | 4680 | //return true; |
---|
4645 | 4681 | } |
---|
.. | .. |
---|
4649 | 4685 | freezemodel = false; |
---|
4650 | 4686 | } |
---|
4651 | 4687 | |
---|
| 4688 | + void SetPinStates(boolean enabled) |
---|
| 4689 | + { |
---|
| 4690 | + editButton.setEnabled(enabled); |
---|
| 4691 | + uneditButton.setEnabled(enabled); |
---|
| 4692 | + } |
---|
| 4693 | + |
---|
4652 | 4694 | void refreshContents(boolean cp) |
---|
4653 | 4695 | { |
---|
4654 | 4696 | if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
.. | .. |
---|
5475 | 5517 | cButton minButton; |
---|
5476 | 5518 | cButton maxButton; |
---|
5477 | 5519 | cButton fullButton; |
---|
5478 | | - cButton undoButton; |
---|
5479 | | - cButton redoButton; |
---|
5480 | 5520 | cButton saveButton; |
---|
5481 | 5521 | cButton oneStepButton; |
---|
5482 | 5522 | |
---|