.. | .. |
---|
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 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
748 | | - editButton.setToolTipText("Edit selection"); |
---|
| 761 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 762 | + editButton.setToolTipText("Pin selection controls"); |
---|
749 | 763 | editButton.addActionListener(this); |
---|
750 | 764 | |
---|
751 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
752 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 765 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 766 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
753 | 767 | uneditButton.addActionListener(this); |
---|
754 | 768 | |
---|
755 | 769 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
756 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 770 | + allParamsButton.setToolTipText("Show all controle"); |
---|
757 | 771 | allParamsButton.addActionListener(this); |
---|
758 | 772 | |
---|
759 | 773 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
770 | 784 | |
---|
771 | 785 | editCommandsPanel.preferredHeight = 1; |
---|
772 | 786 | |
---|
| 787 | + SetPinStates(false); |
---|
773 | 788 | // oe.treePanel.add(commandsPanel); |
---|
774 | 789 | // oe.treePanel.Return(); |
---|
775 | 790 | |
---|
.. | .. |
---|
843 | 858 | boxCB.addItemListener(this); |
---|
844 | 859 | |
---|
845 | 860 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
846 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 861 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
847 | 862 | zoomBoxCB.addItemListener(this); |
---|
848 | 863 | |
---|
849 | 864 | if (true) // Globals.ADVANCED) |
---|
.. | .. |
---|
905 | 920 | oeilCB.addItemListener(this); |
---|
906 | 921 | |
---|
907 | 922 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
908 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 923 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
909 | 924 | shadowCB.addItemListener(this); |
---|
910 | 925 | |
---|
911 | 926 | panel.Return(); |
---|
.. | .. |
---|
918 | 933 | toggleSwitchCB.addItemListener(this); |
---|
919 | 934 | |
---|
920 | 935 | panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
921 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 936 | + autosaveCB.setToolTipText("On structure change"); |
---|
922 | 937 | autosaveCB.addItemListener(this); |
---|
923 | 938 | |
---|
924 | 939 | panel.Return(); |
---|
.. | .. |
---|
1614 | 1629 | |
---|
1615 | 1630 | makeSomething(shadow); |
---|
1616 | 1631 | } |
---|
| 1632 | + |
---|
| 1633 | + private void ClearUnpinned() |
---|
| 1634 | + { |
---|
| 1635 | + //for (Object3D obj : listUI) |
---|
| 1636 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1637 | + { |
---|
| 1638 | + Object3D obj = listUI.elementAt(i); |
---|
| 1639 | + if (!obj.pinned) |
---|
| 1640 | + { |
---|
| 1641 | + obj.CloseUI(); |
---|
| 1642 | + listUI.remove(i); |
---|
| 1643 | + } |
---|
| 1644 | + } |
---|
| 1645 | + } |
---|
1617 | 1646 | |
---|
1618 | 1647 | /** |
---|
1619 | 1648 | * applyExample |
---|
.. | .. |
---|
3326 | 3355 | } else |
---|
3327 | 3356 | if (source == editItem || source == editButton) |
---|
3328 | 3357 | { |
---|
| 3358 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3359 | + { |
---|
| 3360 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3361 | + child.pinned = true; |
---|
| 3362 | + } |
---|
| 3363 | + |
---|
3329 | 3364 | EditSelection(false); |
---|
3330 | 3365 | } else |
---|
3331 | 3366 | if (source == uneditButton) |
---|
.. | .. |
---|
3335 | 3370 | Object3D child = (Object3D)e.nextElement(); |
---|
3336 | 3371 | if(child.editWindow != null) |
---|
3337 | 3372 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3373 | + child.pinned = false; |
---|
3338 | 3374 | child.CloseUI(); |
---|
3339 | 3375 | listUI.remove(child); |
---|
3340 | 3376 | |
---|
.. | .. |
---|
3351 | 3387 | //copy.ClearUI(); |
---|
3352 | 3388 | for (Object3D obj : listUI) |
---|
3353 | 3389 | { |
---|
| 3390 | + obj.pinned = false; |
---|
3354 | 3391 | obj.CloseUI(); |
---|
3355 | 3392 | } |
---|
3356 | 3393 | listUI.clear(); |
---|
.. | .. |
---|
3360 | 3397 | { |
---|
3361 | 3398 | assert(copy == group); |
---|
3362 | 3399 | |
---|
3363 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3400 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3364 | 3401 | |
---|
3365 | 3402 | for (Object3D obj : listUI) |
---|
3366 | 3403 | { |
---|
.. | .. |
---|
3435 | 3472 | currentLayout = sevenButton; |
---|
3436 | 3473 | */ |
---|
3437 | 3474 | radio.layout.doClick(); |
---|
| 3475 | + |
---|
| 3476 | + ClearUnpinned(); |
---|
| 3477 | + SetPinStates(group.selection.size() > 0); |
---|
| 3478 | + if (group.selection.size() == 1) |
---|
| 3479 | + EditSelection(false); |
---|
3438 | 3480 | keepparent = group.parent; |
---|
3439 | 3481 | // PARENT = NULL or not??? |
---|
3440 | 3482 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
4502 | 4544 | // } |
---|
4503 | 4545 | // } |
---|
4504 | 4546 | |
---|
4505 | | - static boolean allparams = true; |
---|
4506 | | - |
---|
4507 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4508 | | - |
---|
4509 | 4547 | void EditSelection(boolean newWindow) |
---|
4510 | 4548 | { |
---|
4511 | 4549 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4598 | 4636 | //new Exception().printStackTrace(); |
---|
4599 | 4637 | |
---|
4600 | 4638 | freezemodel = true; |
---|
4601 | | - |
---|
| 4639 | + ClearUnpinned(); |
---|
| 4640 | + |
---|
4602 | 4641 | /**/ |
---|
4603 | 4642 | //switch (event.id) |
---|
4604 | 4643 | { |
---|
.. | .. |
---|
4631 | 4670 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4632 | 4671 | // a camera |
---|
4633 | 4672 | { |
---|
4634 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4673 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4635 | 4674 | { |
---|
4636 | 4675 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4637 | 4676 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4640 | 4679 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4641 | 4680 | } |
---|
4642 | 4681 | |
---|
| 4682 | + if (tps != null && tps.length == 1) |
---|
| 4683 | + { |
---|
| 4684 | + EditSelection(false); |
---|
| 4685 | + } |
---|
| 4686 | + |
---|
| 4687 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4688 | + |
---|
4643 | 4689 | refreshContents(); |
---|
4644 | 4690 | //return true; |
---|
4645 | 4691 | } |
---|
.. | .. |
---|
4649 | 4695 | freezemodel = false; |
---|
4650 | 4696 | } |
---|
4651 | 4697 | |
---|
| 4698 | + void SetPinStates(boolean enabled) |
---|
| 4699 | + { |
---|
| 4700 | + editButton.setEnabled(enabled); |
---|
| 4701 | + uneditButton.setEnabled(enabled); |
---|
| 4702 | + unselectButton.setEnabled(enabled); |
---|
| 4703 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4704 | + } |
---|
| 4705 | + |
---|
4652 | 4706 | void refreshContents(boolean cp) |
---|
4653 | 4707 | { |
---|
4654 | 4708 | if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
.. | .. |
---|
5475 | 5529 | cButton minButton; |
---|
5476 | 5530 | cButton maxButton; |
---|
5477 | 5531 | cButton fullButton; |
---|
5478 | | - cButton undoButton; |
---|
5479 | | - cButton redoButton; |
---|
5480 | 5532 | cButton saveButton; |
---|
5481 | 5533 | cButton oneStepButton; |
---|
5482 | 5534 | |
---|