.. | .. |
---|
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 | |
---|
.. | .. |
---|
590 | 590 | //minButton.setToolTipText("Minimize window"); |
---|
591 | 591 | //minButton.addActionListener(this); |
---|
592 | 592 | |
---|
593 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | | - maxButton.setToolTipText("Maximize window"); |
---|
595 | | - maxButton.addActionListener(this); |
---|
| 593 | + if (Globals.ADVANCED) |
---|
| 594 | + { |
---|
| 595 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + maxButton.setToolTipText("Maximize window"); |
---|
| 597 | + maxButton.addActionListener(this); |
---|
| 598 | + } |
---|
596 | 599 | |
---|
597 | 600 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 601 | fullButton.setToolTipText("Full-screen window"); |
---|
.. | .. |
---|
605 | 608 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | 609 | undoButton.setToolTipText("Undo changes"); |
---|
607 | 610 | undoButton.addActionListener(this); |
---|
| 611 | + undoButton.setEnabled(false); |
---|
608 | 612 | |
---|
609 | 613 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
610 | 614 | redoButton.setToolTipText("Redo changes"); |
---|
611 | 615 | redoButton.addActionListener(this); |
---|
| 616 | + redoButton.setEnabled(false); |
---|
612 | 617 | |
---|
613 | 618 | copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
614 | 619 | saveButton.setToolTipText("Save changes"); |
---|
.. | .. |
---|
724 | 729 | compositeButton.addActionListener(this); |
---|
725 | 730 | |
---|
726 | 731 | oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
727 | | - switchButton.setToolTipText("Create switch"); |
---|
| 732 | + switchButton.setToolTipText("Create item switcher"); |
---|
728 | 733 | switchButton.addActionListener(this); |
---|
729 | 734 | |
---|
730 | 735 | oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
743 | 748 | lightButton.setToolTipText("Create light"); |
---|
744 | 749 | lightButton.addActionListener(this); |
---|
745 | 750 | |
---|
| 751 | + for (int i=6; --i>=0;) |
---|
| 752 | + { |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 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 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 759 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 760 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 761 | + } |
---|
| 762 | + |
---|
746 | 763 | // EDIT panel |
---|
747 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
748 | | - editButton.setToolTipText("Edit selection"); |
---|
| 764 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + editButton.setToolTipText("Pin selection controls"); |
---|
749 | 766 | editButton.addActionListener(this); |
---|
750 | 767 | |
---|
751 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
752 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 768 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 769 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
753 | 770 | uneditButton.addActionListener(this); |
---|
754 | 771 | |
---|
755 | 772 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
756 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 773 | + allParamsButton.setToolTipText("Show all controle"); |
---|
757 | 774 | allParamsButton.addActionListener(this); |
---|
758 | 775 | |
---|
759 | 776 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
770 | 787 | |
---|
771 | 788 | editCommandsPanel.preferredHeight = 1; |
---|
772 | 789 | |
---|
| 790 | + SetPinStates(false); |
---|
773 | 791 | // oe.treePanel.add(commandsPanel); |
---|
774 | 792 | // oe.treePanel.Return(); |
---|
775 | 793 | |
---|
.. | .. |
---|
843 | 861 | boxCB.addItemListener(this); |
---|
844 | 862 | |
---|
845 | 863 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
846 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 864 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
847 | 865 | zoomBoxCB.addItemListener(this); |
---|
848 | 866 | |
---|
849 | 867 | if (true) // Globals.ADVANCED) |
---|
850 | 868 | { |
---|
851 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
852 | | - supportCB.setToolTipText("Enable rigging"); |
---|
853 | | - supportCB.addItemListener(this); |
---|
| 869 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 870 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 871 | +// supportCB.addItemListener(this); |
---|
| 872 | + |
---|
| 873 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 874 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 875 | + freezeCB.addItemListener(this); |
---|
854 | 876 | |
---|
855 | 877 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
856 | 878 | // localCB.addItemListener(this); |
---|
.. | .. |
---|
905 | 927 | oeilCB.addItemListener(this); |
---|
906 | 928 | |
---|
907 | 929 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
908 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 930 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
909 | 931 | shadowCB.addItemListener(this); |
---|
910 | 932 | |
---|
911 | 933 | panel.Return(); |
---|
.. | .. |
---|
914 | 936 | toggleTextureCB.addItemListener(this); |
---|
915 | 937 | |
---|
916 | 938 | panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
917 | | - toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 939 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
918 | 940 | toggleSwitchCB.addItemListener(this); |
---|
919 | 941 | |
---|
920 | 942 | panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
921 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 943 | + autosaveCB.setToolTipText("On structure change"); |
---|
922 | 944 | autosaveCB.addItemListener(this); |
---|
923 | 945 | |
---|
924 | 946 | panel.Return(); |
---|
.. | .. |
---|
985 | 1007 | cCheckBox slowCB; |
---|
986 | 1008 | cCheckBox boxCB; |
---|
987 | 1009 | cCheckBox zoomBoxCB; |
---|
| 1010 | + cCheckBox freezeCB; |
---|
988 | 1011 | //cToggleButton trackCB; |
---|
989 | 1012 | cCheckBox trackCB; |
---|
990 | 1013 | cCheckBox smoothfocusCB; |
---|
.. | .. |
---|
1102 | 1125 | else if(e.getSource() == shadowCB) |
---|
1103 | 1126 | { |
---|
1104 | 1127 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1128 | + } |
---|
| 1129 | + else if(e.getSource() == freezeCB) |
---|
| 1130 | + { |
---|
| 1131 | + Globals.FREEZEONMOVE ^= true; |
---|
1105 | 1132 | } |
---|
1106 | 1133 | else if(e.getSource() == autosaveCB) |
---|
1107 | 1134 | { |
---|
.. | .. |
---|
1445 | 1472 | animationItem.addItemListener(this); |
---|
1446 | 1473 | animationItem.setState(Globals.ANIMATION); |
---|
1447 | 1474 | |
---|
| 1475 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1476 | + archiveItem.addActionListener(this); |
---|
| 1477 | + |
---|
1448 | 1478 | menu.add("-"); |
---|
1449 | 1479 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1450 | 1480 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1614 | 1644 | |
---|
1615 | 1645 | makeSomething(shadow); |
---|
1616 | 1646 | } |
---|
| 1647 | + |
---|
| 1648 | + private void ClearUnpinned() |
---|
| 1649 | + { |
---|
| 1650 | + //for (Object3D obj : listUI) |
---|
| 1651 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1652 | + { |
---|
| 1653 | + Object3D obj = listUI.elementAt(i); |
---|
| 1654 | + if (!obj.pinned) |
---|
| 1655 | + { |
---|
| 1656 | + obj.CloseUI(); |
---|
| 1657 | + listUI.remove(i); |
---|
| 1658 | + } |
---|
| 1659 | + } |
---|
| 1660 | + } |
---|
1617 | 1661 | |
---|
1618 | 1662 | /** |
---|
1619 | 1663 | * applyExample |
---|
.. | .. |
---|
2093 | 2137 | Composite csg = new GroupLeaf(); |
---|
2094 | 2138 | csg.count = 5; |
---|
2095 | 2139 | group(csg); |
---|
2096 | | - Composite child = new cGroup(); |
---|
| 2140 | + Composite child = new cGroup("Branch"); |
---|
2097 | 2141 | csg.addChild(child); |
---|
2098 | 2142 | child.addChild(csg); |
---|
2099 | 2143 | } else |
---|
2100 | 2144 | if (source == doubleItem) |
---|
2101 | 2145 | { |
---|
2102 | | - Composite csg = new GroupLeaf(); |
---|
| 2146 | + Composite csg = new GroupLeaf("Fork"); |
---|
2103 | 2147 | csg.count = 5; |
---|
2104 | 2148 | group(csg); |
---|
2105 | | - Composite child = new cGroup(); |
---|
| 2149 | + Composite child = new cGroup("Branch A"); |
---|
2106 | 2150 | csg.addChild(child); |
---|
2107 | 2151 | child.addChild(csg); |
---|
2108 | | - child = new cGroup(); |
---|
| 2152 | + child = new cGroup("Branch B"); |
---|
2109 | 2153 | csg.addChild(child); |
---|
2110 | 2154 | child.addChild(csg); |
---|
2111 | 2155 | } else |
---|
2112 | 2156 | if (source == tripleItem) |
---|
2113 | 2157 | { |
---|
2114 | | - Composite csg = new GroupLeaf(); |
---|
| 2158 | + Composite csg = new GroupLeaf("Trident"); |
---|
2115 | 2159 | csg.count = 4; |
---|
2116 | 2160 | group(csg); |
---|
2117 | 2161 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2726 | 2770 | } else |
---|
2727 | 2771 | if (source == ungroupItem || source == ungroupButton) |
---|
2728 | 2772 | { |
---|
2729 | | - //ungroup(); |
---|
| 2773 | + boolean hasRoot = false; |
---|
| 2774 | + |
---|
2730 | 2775 | for (int i=0; i<group.selection.size(); i++) |
---|
2731 | 2776 | { |
---|
2732 | | - Ungroup(group.selection.get(i)); |
---|
| 2777 | + if (group.selection.get(i) == group) |
---|
| 2778 | + { |
---|
| 2779 | + hasRoot = true; |
---|
| 2780 | + break; |
---|
| 2781 | + } |
---|
2733 | 2782 | } |
---|
2734 | 2783 | |
---|
2735 | | - ClearSelection(false); |
---|
2736 | | - |
---|
2737 | | - refreshContents(); |
---|
| 2784 | + if (!hasRoot) |
---|
| 2785 | + { |
---|
| 2786 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2787 | + { |
---|
| 2788 | + Ungroup(group.selection.get(i)); |
---|
| 2789 | + } |
---|
| 2790 | + |
---|
| 2791 | + ClearSelection(false); |
---|
| 2792 | + |
---|
| 2793 | + refreshContents(); |
---|
| 2794 | + } |
---|
2738 | 2795 | } else |
---|
2739 | 2796 | if (source == genUVItem) |
---|
2740 | 2797 | { |
---|
.. | .. |
---|
3326 | 3383 | } else |
---|
3327 | 3384 | if (source == editItem || source == editButton) |
---|
3328 | 3385 | { |
---|
| 3386 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3387 | + { |
---|
| 3388 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3389 | + child.pinned = true; |
---|
| 3390 | + } |
---|
| 3391 | + |
---|
3329 | 3392 | EditSelection(false); |
---|
3330 | 3393 | } else |
---|
3331 | 3394 | if (source == uneditButton) |
---|
.. | .. |
---|
3335 | 3398 | Object3D child = (Object3D)e.nextElement(); |
---|
3336 | 3399 | if(child.editWindow != null) |
---|
3337 | 3400 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3401 | + child.pinned = false; |
---|
3338 | 3402 | child.CloseUI(); |
---|
3339 | 3403 | listUI.remove(child); |
---|
3340 | 3404 | |
---|
.. | .. |
---|
3351 | 3415 | //copy.ClearUI(); |
---|
3352 | 3416 | for (Object3D obj : listUI) |
---|
3353 | 3417 | { |
---|
| 3418 | + obj.pinned = false; |
---|
3354 | 3419 | obj.CloseUI(); |
---|
3355 | 3420 | } |
---|
3356 | 3421 | listUI.clear(); |
---|
.. | .. |
---|
3360 | 3425 | { |
---|
3361 | 3426 | assert(copy == group); |
---|
3362 | 3427 | |
---|
3363 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3428 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3364 | 3429 | |
---|
3365 | 3430 | for (Object3D obj : listUI) |
---|
3366 | 3431 | { |
---|
.. | .. |
---|
3435 | 3500 | currentLayout = sevenButton; |
---|
3436 | 3501 | */ |
---|
3437 | 3502 | radio.layout.doClick(); |
---|
| 3503 | + |
---|
| 3504 | + ClearUnpinned(); |
---|
| 3505 | + SetPinStates(group.selection.size() > 0); |
---|
| 3506 | + if (group.selection.size() == 1) |
---|
| 3507 | + EditSelection(false); |
---|
3438 | 3508 | keepparent = group.parent; |
---|
3439 | 3509 | // PARENT = NULL or not??? |
---|
3440 | 3510 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
4502 | 4572 | // } |
---|
4503 | 4573 | // } |
---|
4504 | 4574 | |
---|
4505 | | - static boolean allparams = true; |
---|
4506 | | - |
---|
4507 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4508 | | - |
---|
4509 | 4575 | void EditSelection(boolean newWindow) |
---|
4510 | 4576 | { |
---|
4511 | 4577 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4598 | 4664 | //new Exception().printStackTrace(); |
---|
4599 | 4665 | |
---|
4600 | 4666 | freezemodel = true; |
---|
4601 | | - |
---|
| 4667 | + ClearUnpinned(); |
---|
| 4668 | + |
---|
4602 | 4669 | /**/ |
---|
4603 | 4670 | //switch (event.id) |
---|
4604 | 4671 | { |
---|
.. | .. |
---|
4631 | 4698 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4632 | 4699 | // a camera |
---|
4633 | 4700 | { |
---|
4634 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4701 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4635 | 4702 | { |
---|
4636 | 4703 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4637 | 4704 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4640 | 4707 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4641 | 4708 | } |
---|
4642 | 4709 | |
---|
| 4710 | + if (tps != null && tps.length == 1) |
---|
| 4711 | + { |
---|
| 4712 | + EditSelection(false); |
---|
| 4713 | + } |
---|
| 4714 | + |
---|
| 4715 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4716 | + |
---|
4643 | 4717 | refreshContents(); |
---|
4644 | 4718 | //return true; |
---|
4645 | 4719 | } |
---|
.. | .. |
---|
4649 | 4723 | freezemodel = false; |
---|
4650 | 4724 | } |
---|
4651 | 4725 | |
---|
| 4726 | + void SetPinStates(boolean enabled) |
---|
| 4727 | + { |
---|
| 4728 | + editButton.setEnabled(enabled); |
---|
| 4729 | + uneditButton.setEnabled(enabled); |
---|
| 4730 | + unselectButton.setEnabled(enabled); |
---|
| 4731 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4732 | + } |
---|
| 4733 | + |
---|
4652 | 4734 | void refreshContents(boolean cp) |
---|
4653 | 4735 | { |
---|
4654 | 4736 | if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4655 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4737 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4656 | 4738 | { |
---|
4657 | 4739 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4658 | 4740 | |
---|
.. | .. |
---|
5472 | 5554 | |
---|
5473 | 5555 | cButton restoreCameraButton; |
---|
5474 | 5556 | |
---|
5475 | | - cButton minButton; |
---|
5476 | | - cButton maxButton; |
---|
5477 | | - cButton fullButton; |
---|
5478 | | - cButton undoButton; |
---|
5479 | | - cButton redoButton; |
---|
5480 | 5557 | cButton saveButton; |
---|
5481 | 5558 | cButton oneStepButton; |
---|
5482 | 5559 | |
---|