Normand Briere
2019-06-29 a69bb4474a3264a9a7a7f8b8d8154ea771f167c8
GroupEditor.java
....@@ -220,7 +220,7 @@
220220 // toggleSwitchItem.addItemListener(this);
221221 // toggleSwitchItem.setState(CameraPane.SWITCH);
222222
223
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224224 toggleHandleItem.addItemListener(this);
225225 toggleHandleItem.setState(CameraPane.HANDLES);
226226
....@@ -582,7 +582,7 @@
582582 */
583583 cGridBag copyOptionsPanel = new cGridBag();
584584
585
- copyOptionsPanel.preferredHeight = 2;
585
+ copyOptionsPanel.preferredHeight = 1;
586586
587587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588588
....@@ -726,7 +726,7 @@
726726 compositeButton.addActionListener(this);
727727
728728 oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
- switchButton.setToolTipText("Create switch");
729
+ switchButton.setToolTipText("Create item switcher");
730730 switchButton.addActionListener(this);
731731
732732 oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -758,16 +758,16 @@
758758 }
759759
760760 // EDIT panel
761
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
- editButton.setToolTipText("Edit selection");
761
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ editButton.setToolTipText("Pin selection controls");
763763 editButton.addActionListener(this);
764764
765
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
- uneditButton.setToolTipText("Unedit selection");
765
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Remove selection controls");
767767 uneditButton.addActionListener(this);
768768
769769 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
- allParamsButton.setToolTipText("Edit all params");
770
+ allParamsButton.setToolTipText("Show all controle");
771771 allParamsButton.addActionListener(this);
772772
773773 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -784,6 +784,7 @@
784784
785785 editCommandsPanel.preferredHeight = 1;
786786
787
+ SetPinStates(false);
787788 // oe.treePanel.add(commandsPanel);
788789 // oe.treePanel.Return();
789790
....@@ -857,14 +858,18 @@
857858 boxCB.addItemListener(this);
858859
859860 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
860
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
861
+ zoomBoxCB.setToolTipText("Display only for wheel");
861862 zoomBoxCB.addItemListener(this);
862863
863864 if (true) // Globals.ADVANCED)
864865 {
865
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
- supportCB.setToolTipText("Enable rigging");
867
- 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);
868873
869874 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
870875 // localCB.addItemListener(this);
....@@ -919,7 +924,7 @@
919924 oeilCB.addItemListener(this);
920925
921926 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
- shadowCB.setToolTipText("Compute shadows when live");
927
+ shadowCB.setToolTipText("When live compute shadows");
923928 shadowCB.addItemListener(this);
924929
925930 panel.Return();
....@@ -928,11 +933,11 @@
928933 toggleTextureCB.addItemListener(this);
929934
930935 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
- toggleSwitchCB.setToolTipText("Use switch");
936
+ toggleSwitchCB.setToolTipText("Choose a single item");
932937 toggleSwitchCB.addItemListener(this);
933938
934939 panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
- autosaveCB.setToolTipText("Auto-save on structure change");
940
+ autosaveCB.setToolTipText("On structure change");
936941 autosaveCB.addItemListener(this);
937942
938943 panel.Return();
....@@ -999,6 +1004,7 @@
9991004 cCheckBox slowCB;
10001005 cCheckBox boxCB;
10011006 cCheckBox zoomBoxCB;
1007
+ cCheckBox freezeCB;
10021008 //cToggleButton trackCB;
10031009 cCheckBox trackCB;
10041010 cCheckBox smoothfocusCB;
....@@ -1116,6 +1122,10 @@
11161122 else if(e.getSource() == shadowCB)
11171123 {
11181124 Globals.COMPUTESHADOWWHENLIVE ^= true;
1125
+ }
1126
+ else if(e.getSource() == freezeCB)
1127
+ {
1128
+ Globals.FREEZEONMOVE ^= true;
11191129 }
11201130 else if(e.getSource() == autosaveCB)
11211131 {
....@@ -1628,6 +1638,20 @@
16281638
16291639 makeSomething(shadow);
16301640 }
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
+ }
16311655
16321656 /**
16331657 * applyExample
....@@ -2107,25 +2131,25 @@
21072131 Composite csg = new GroupLeaf();
21082132 csg.count = 5;
21092133 group(csg);
2110
- Composite child = new cGroup();
2134
+ Composite child = new cGroup("Branch");
21112135 csg.addChild(child);
21122136 child.addChild(csg);
21132137 } else
21142138 if (source == doubleItem)
21152139 {
2116
- Composite csg = new GroupLeaf();
2140
+ Composite csg = new GroupLeaf("Fork");
21172141 csg.count = 5;
21182142 group(csg);
2119
- Composite child = new cGroup();
2143
+ Composite child = new cGroup("Branch A");
21202144 csg.addChild(child);
21212145 child.addChild(csg);
2122
- child = new cGroup();
2146
+ child = new cGroup("Branch B");
21232147 csg.addChild(child);
21242148 child.addChild(csg);
21252149 } else
21262150 if (source == tripleItem)
21272151 {
2128
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Trident");
21292153 csg.count = 4;
21302154 group(csg);
21312155 Composite child = new cGroup();
....@@ -2740,15 +2764,28 @@
27402764 } else
27412765 if (source == ungroupItem || source == ungroupButton)
27422766 {
2743
- //ungroup();
2767
+ boolean hasRoot = false;
2768
+
27442769 for (int i=0; i<group.selection.size(); i++)
27452770 {
2746
- Ungroup(group.selection.get(i));
2771
+ if (group.selection.get(i) == group)
2772
+ {
2773
+ hasRoot = true;
2774
+ break;
2775
+ }
27472776 }
27482777
2749
- ClearSelection(false);
2750
-
2751
- 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
+ }
27522789 } else
27532790 if (source == genUVItem)
27542791 {
....@@ -3372,7 +3409,7 @@
33723409 //copy.ClearUI();
33733410 for (Object3D obj : listUI)
33743411 {
3375
- obj.pinned = true;
3412
+ obj.pinned = false;
33763413 obj.CloseUI();
33773414 }
33783415 listUI.clear();
....@@ -3457,6 +3494,11 @@
34573494 currentLayout = sevenButton;
34583495 */
34593496 radio.layout.doClick();
3497
+
3498
+ ClearUnpinned();
3499
+ SetPinStates(group.selection.size() > 0);
3500
+ if (group.selection.size() == 1)
3501
+ EditSelection(false);
34603502 keepparent = group.parent;
34613503 // PARENT = NULL or not???
34623504 //group.parent = null; // ROOT
....@@ -4616,17 +4658,7 @@
46164658 //new Exception().printStackTrace();
46174659
46184660 freezemodel = true;
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
- }
4661
+ ClearUnpinned();
46304662
46314663 /**/
46324664 //switch (event.id)
....@@ -4689,6 +4721,8 @@
46894721 {
46904722 editButton.setEnabled(enabled);
46914723 uneditButton.setEnabled(enabled);
4724
+ unselectButton.setEnabled(enabled);
4725
+ flashSelectionButton.setEnabled(enabled);
46924726 }
46934727
46944728 void refreshContents(boolean cp)
....@@ -5514,9 +5548,6 @@
55145548
55155549 cButton restoreCameraButton;
55165550
5517
- cButton minButton;
5518
- cButton maxButton;
5519
- cButton fullButton;
55205551 cButton saveButton;
55215552 cButton oneStepButton;
55225553