.. | .. |
---|
220 | 220 | // toggleSwitchItem.addItemListener(this); |
---|
221 | 221 | // toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
222 | 222 | |
---|
223 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 223 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
224 | 224 | toggleHandleItem.addItemListener(this); |
---|
225 | 225 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
226 | 226 | |
---|
.. | .. |
---|
582 | 582 | */ |
---|
583 | 583 | cGridBag copyOptionsPanel = new cGridBag(); |
---|
584 | 584 | |
---|
585 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 585 | + copyOptionsPanel.preferredHeight = 1; |
---|
586 | 586 | |
---|
587 | 587 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
588 | 588 | |
---|
.. | .. |
---|
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"); |
---|
.. | .. |
---|
724 | 726 | compositeButton.addActionListener(this); |
---|
725 | 727 | |
---|
726 | 728 | oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
727 | | - switchButton.setToolTipText("Create switch"); |
---|
| 729 | + switchButton.setToolTipText("Create item switcher"); |
---|
728 | 730 | switchButton.addActionListener(this); |
---|
729 | 731 | |
---|
730 | 732 | oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
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) |
---|
850 | 865 | { |
---|
851 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
852 | | - supportCB.setToolTipText("Enable rigging"); |
---|
853 | | - supportCB.addItemListener(this); |
---|
| 866 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 867 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 868 | +// supportCB.addItemListener(this); |
---|
| 869 | + |
---|
| 870 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 871 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 872 | + freezeCB.addItemListener(this); |
---|
854 | 873 | |
---|
855 | 874 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
856 | 875 | // localCB.addItemListener(this); |
---|
.. | .. |
---|
905 | 924 | oeilCB.addItemListener(this); |
---|
906 | 925 | |
---|
907 | 926 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
908 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 927 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
909 | 928 | shadowCB.addItemListener(this); |
---|
910 | 929 | |
---|
911 | 930 | panel.Return(); |
---|
.. | .. |
---|
914 | 933 | toggleTextureCB.addItemListener(this); |
---|
915 | 934 | |
---|
916 | 935 | panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
917 | | - toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 936 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
918 | 937 | toggleSwitchCB.addItemListener(this); |
---|
919 | 938 | |
---|
920 | 939 | panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
921 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 940 | + autosaveCB.setToolTipText("On structure change"); |
---|
922 | 941 | autosaveCB.addItemListener(this); |
---|
923 | 942 | |
---|
924 | 943 | panel.Return(); |
---|
.. | .. |
---|
985 | 1004 | cCheckBox slowCB; |
---|
986 | 1005 | cCheckBox boxCB; |
---|
987 | 1006 | cCheckBox zoomBoxCB; |
---|
| 1007 | + cCheckBox freezeCB; |
---|
988 | 1008 | //cToggleButton trackCB; |
---|
989 | 1009 | cCheckBox trackCB; |
---|
990 | 1010 | cCheckBox smoothfocusCB; |
---|
.. | .. |
---|
1102 | 1122 | else if(e.getSource() == shadowCB) |
---|
1103 | 1123 | { |
---|
1104 | 1124 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1125 | + } |
---|
| 1126 | + else if(e.getSource() == freezeCB) |
---|
| 1127 | + { |
---|
| 1128 | + Globals.FREEZEONMOVE ^= true; |
---|
1105 | 1129 | } |
---|
1106 | 1130 | else if(e.getSource() == autosaveCB) |
---|
1107 | 1131 | { |
---|
.. | .. |
---|
1614 | 1638 | |
---|
1615 | 1639 | makeSomething(shadow); |
---|
1616 | 1640 | } |
---|
| 1641 | + |
---|
| 1642 | + private void ClearUnpinned() |
---|
| 1643 | + { |
---|
| 1644 | + //for (Object3D obj : listUI) |
---|
| 1645 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1646 | + { |
---|
| 1647 | + Object3D obj = listUI.elementAt(i); |
---|
| 1648 | + if (!obj.pinned) |
---|
| 1649 | + { |
---|
| 1650 | + obj.CloseUI(); |
---|
| 1651 | + listUI.remove(i); |
---|
| 1652 | + } |
---|
| 1653 | + } |
---|
| 1654 | + } |
---|
1617 | 1655 | |
---|
1618 | 1656 | /** |
---|
1619 | 1657 | * applyExample |
---|
.. | .. |
---|
2093 | 2131 | Composite csg = new GroupLeaf(); |
---|
2094 | 2132 | csg.count = 5; |
---|
2095 | 2133 | group(csg); |
---|
2096 | | - Composite child = new cGroup(); |
---|
| 2134 | + Composite child = new cGroup("Branch"); |
---|
2097 | 2135 | csg.addChild(child); |
---|
2098 | 2136 | child.addChild(csg); |
---|
2099 | 2137 | } else |
---|
2100 | 2138 | if (source == doubleItem) |
---|
2101 | 2139 | { |
---|
2102 | | - Composite csg = new GroupLeaf(); |
---|
| 2140 | + Composite csg = new GroupLeaf("Fork"); |
---|
2103 | 2141 | csg.count = 5; |
---|
2104 | 2142 | group(csg); |
---|
2105 | | - Composite child = new cGroup(); |
---|
| 2143 | + Composite child = new cGroup("Branch A"); |
---|
2106 | 2144 | csg.addChild(child); |
---|
2107 | 2145 | child.addChild(csg); |
---|
2108 | | - child = new cGroup(); |
---|
| 2146 | + child = new cGroup("Branch B"); |
---|
2109 | 2147 | csg.addChild(child); |
---|
2110 | 2148 | child.addChild(csg); |
---|
2111 | 2149 | } else |
---|
2112 | 2150 | if (source == tripleItem) |
---|
2113 | 2151 | { |
---|
2114 | | - Composite csg = new GroupLeaf(); |
---|
| 2152 | + Composite csg = new GroupLeaf("Trident"); |
---|
2115 | 2153 | csg.count = 4; |
---|
2116 | 2154 | group(csg); |
---|
2117 | 2155 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2726 | 2764 | } else |
---|
2727 | 2765 | if (source == ungroupItem || source == ungroupButton) |
---|
2728 | 2766 | { |
---|
2729 | | - //ungroup(); |
---|
| 2767 | + boolean hasRoot = false; |
---|
| 2768 | + |
---|
2730 | 2769 | for (int i=0; i<group.selection.size(); i++) |
---|
2731 | 2770 | { |
---|
2732 | | - Ungroup(group.selection.get(i)); |
---|
| 2771 | + if (group.selection.get(i) == group) |
---|
| 2772 | + { |
---|
| 2773 | + hasRoot = true; |
---|
| 2774 | + break; |
---|
| 2775 | + } |
---|
2733 | 2776 | } |
---|
2734 | 2777 | |
---|
2735 | | - ClearSelection(false); |
---|
2736 | | - |
---|
2737 | | - refreshContents(); |
---|
| 2778 | + if (!hasRoot) |
---|
| 2779 | + { |
---|
| 2780 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2781 | + { |
---|
| 2782 | + Ungroup(group.selection.get(i)); |
---|
| 2783 | + } |
---|
| 2784 | + |
---|
| 2785 | + ClearSelection(false); |
---|
| 2786 | + |
---|
| 2787 | + refreshContents(); |
---|
| 2788 | + } |
---|
2738 | 2789 | } else |
---|
2739 | 2790 | if (source == genUVItem) |
---|
2740 | 2791 | { |
---|
.. | .. |
---|
3326 | 3377 | } else |
---|
3327 | 3378 | if (source == editItem || source == editButton) |
---|
3328 | 3379 | { |
---|
| 3380 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3381 | + { |
---|
| 3382 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3383 | + child.pinned = true; |
---|
| 3384 | + } |
---|
| 3385 | + |
---|
3329 | 3386 | EditSelection(false); |
---|
3330 | 3387 | } else |
---|
3331 | 3388 | if (source == uneditButton) |
---|
.. | .. |
---|
3335 | 3392 | Object3D child = (Object3D)e.nextElement(); |
---|
3336 | 3393 | if(child.editWindow != null) |
---|
3337 | 3394 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3395 | + child.pinned = false; |
---|
3338 | 3396 | child.CloseUI(); |
---|
3339 | 3397 | listUI.remove(child); |
---|
3340 | 3398 | |
---|
.. | .. |
---|
3351 | 3409 | //copy.ClearUI(); |
---|
3352 | 3410 | for (Object3D obj : listUI) |
---|
3353 | 3411 | { |
---|
| 3412 | + obj.pinned = false; |
---|
3354 | 3413 | obj.CloseUI(); |
---|
3355 | 3414 | } |
---|
3356 | 3415 | listUI.clear(); |
---|
.. | .. |
---|
3360 | 3419 | { |
---|
3361 | 3420 | assert(copy == group); |
---|
3362 | 3421 | |
---|
3363 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3422 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3364 | 3423 | |
---|
3365 | 3424 | for (Object3D obj : listUI) |
---|
3366 | 3425 | { |
---|
.. | .. |
---|
3435 | 3494 | currentLayout = sevenButton; |
---|
3436 | 3495 | */ |
---|
3437 | 3496 | radio.layout.doClick(); |
---|
| 3497 | + |
---|
| 3498 | + ClearUnpinned(); |
---|
| 3499 | + SetPinStates(group.selection.size() > 0); |
---|
| 3500 | + if (group.selection.size() == 1) |
---|
| 3501 | + EditSelection(false); |
---|
3438 | 3502 | keepparent = group.parent; |
---|
3439 | 3503 | // PARENT = NULL or not??? |
---|
3440 | 3504 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
4502 | 4566 | // } |
---|
4503 | 4567 | // } |
---|
4504 | 4568 | |
---|
4505 | | - static boolean allparams = true; |
---|
4506 | | - |
---|
4507 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4508 | | - |
---|
4509 | 4569 | void EditSelection(boolean newWindow) |
---|
4510 | 4570 | { |
---|
4511 | 4571 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4598 | 4658 | //new Exception().printStackTrace(); |
---|
4599 | 4659 | |
---|
4600 | 4660 | freezemodel = true; |
---|
4601 | | - |
---|
| 4661 | + ClearUnpinned(); |
---|
| 4662 | + |
---|
4602 | 4663 | /**/ |
---|
4603 | 4664 | //switch (event.id) |
---|
4604 | 4665 | { |
---|
.. | .. |
---|
4631 | 4692 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4632 | 4693 | // a camera |
---|
4633 | 4694 | { |
---|
4634 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4695 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4635 | 4696 | { |
---|
4636 | 4697 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4637 | 4698 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4640 | 4701 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4641 | 4702 | } |
---|
4642 | 4703 | |
---|
| 4704 | + if (tps != null && tps.length == 1) |
---|
| 4705 | + { |
---|
| 4706 | + EditSelection(false); |
---|
| 4707 | + } |
---|
| 4708 | + |
---|
| 4709 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4710 | + |
---|
4643 | 4711 | refreshContents(); |
---|
4644 | 4712 | //return true; |
---|
4645 | 4713 | } |
---|
.. | .. |
---|
4649 | 4717 | freezemodel = false; |
---|
4650 | 4718 | } |
---|
4651 | 4719 | |
---|
| 4720 | + void SetPinStates(boolean enabled) |
---|
| 4721 | + { |
---|
| 4722 | + editButton.setEnabled(enabled); |
---|
| 4723 | + uneditButton.setEnabled(enabled); |
---|
| 4724 | + unselectButton.setEnabled(enabled); |
---|
| 4725 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4726 | + } |
---|
| 4727 | + |
---|
4652 | 4728 | void refreshContents(boolean cp) |
---|
4653 | 4729 | { |
---|
4654 | 4730 | if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
.. | .. |
---|
5472 | 5548 | |
---|
5473 | 5549 | cButton restoreCameraButton; |
---|
5474 | 5550 | |
---|
5475 | | - cButton minButton; |
---|
5476 | | - cButton maxButton; |
---|
5477 | | - cButton fullButton; |
---|
5478 | | - cButton undoButton; |
---|
5479 | | - cButton redoButton; |
---|
5480 | 5551 | cButton saveButton; |
---|
5481 | 5552 | cButton oneStepButton; |
---|
5482 | 5553 | |
---|