Normand Briere
2019-06-30 cfd7a643cb5a445016ddb15595158ecc59b184fd
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
....@@ -590,9 +590,12 @@
590590 //minButton.setToolTipText("Minimize window");
591591 //minButton.addActionListener(this);
592592
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
+ }
596599
597600 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598601 fullButton.setToolTipText("Full-screen window");
....@@ -726,7 +729,7 @@
726729 compositeButton.addActionListener(this);
727730
728731 oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
- switchButton.setToolTipText("Create switch");
732
+ switchButton.setToolTipText("Create item switcher");
730733 switchButton.addActionListener(this);
731734
732735 oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -758,16 +761,16 @@
758761 }
759762
760763 // EDIT panel
761
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
- editButton.setToolTipText("Edit selection");
764
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
765
+ editButton.setToolTipText("Pin selection controls");
763766 editButton.addActionListener(this);
764767
765
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
- uneditButton.setToolTipText("Unedit selection");
768
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
769
+ uneditButton.setToolTipText("Remove selection controls");
767770 uneditButton.addActionListener(this);
768771
769772 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
- allParamsButton.setToolTipText("Edit all params");
773
+ allParamsButton.setToolTipText("Show all controle");
771774 allParamsButton.addActionListener(this);
772775
773776 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -784,6 +787,7 @@
784787
785788 editCommandsPanel.preferredHeight = 1;
786789
790
+ SetPinStates(false);
787791 // oe.treePanel.add(commandsPanel);
788792 // oe.treePanel.Return();
789793
....@@ -857,14 +861,18 @@
857861 boxCB.addItemListener(this);
858862
859863 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
860
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
864
+ zoomBoxCB.setToolTipText("Display only for wheel");
861865 zoomBoxCB.addItemListener(this);
862866
863867 if (true) // Globals.ADVANCED)
864868 {
865
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
- supportCB.setToolTipText("Enable rigging");
867
- 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);
868876
869877 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
870878 // localCB.addItemListener(this);
....@@ -919,7 +927,7 @@
919927 oeilCB.addItemListener(this);
920928
921929 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
- shadowCB.setToolTipText("Compute shadows when live");
930
+ shadowCB.setToolTipText("When live compute shadows");
923931 shadowCB.addItemListener(this);
924932
925933 panel.Return();
....@@ -928,11 +936,11 @@
928936 toggleTextureCB.addItemListener(this);
929937
930938 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
- toggleSwitchCB.setToolTipText("Use switch");
939
+ toggleSwitchCB.setToolTipText("Choose a single item");
932940 toggleSwitchCB.addItemListener(this);
933941
934942 panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
- autosaveCB.setToolTipText("Auto-save on structure change");
943
+ autosaveCB.setToolTipText("On structure change");
936944 autosaveCB.addItemListener(this);
937945
938946 panel.Return();
....@@ -999,6 +1007,7 @@
9991007 cCheckBox slowCB;
10001008 cCheckBox boxCB;
10011009 cCheckBox zoomBoxCB;
1010
+ cCheckBox freezeCB;
10021011 //cToggleButton trackCB;
10031012 cCheckBox trackCB;
10041013 cCheckBox smoothfocusCB;
....@@ -1116,6 +1125,10 @@
11161125 else if(e.getSource() == shadowCB)
11171126 {
11181127 Globals.COMPUTESHADOWWHENLIVE ^= true;
1128
+ }
1129
+ else if(e.getSource() == freezeCB)
1130
+ {
1131
+ Globals.FREEZEONMOVE ^= true;
11191132 }
11201133 else if(e.getSource() == autosaveCB)
11211134 {
....@@ -1628,6 +1641,20 @@
16281641
16291642 makeSomething(shadow);
16301643 }
1644
+
1645
+ private void ClearUnpinned()
1646
+ {
1647
+ //for (Object3D obj : listUI)
1648
+ for (int i=listUI.size(); --i>=0;)
1649
+ {
1650
+ Object3D obj = listUI.elementAt(i);
1651
+ if (!obj.pinned)
1652
+ {
1653
+ obj.CloseUI();
1654
+ listUI.remove(i);
1655
+ }
1656
+ }
1657
+ }
16311658
16321659 /**
16331660 * applyExample
....@@ -2107,25 +2134,25 @@
21072134 Composite csg = new GroupLeaf();
21082135 csg.count = 5;
21092136 group(csg);
2110
- Composite child = new cGroup();
2137
+ Composite child = new cGroup("Branch");
21112138 csg.addChild(child);
21122139 child.addChild(csg);
21132140 } else
21142141 if (source == doubleItem)
21152142 {
2116
- Composite csg = new GroupLeaf();
2143
+ Composite csg = new GroupLeaf("Fork");
21172144 csg.count = 5;
21182145 group(csg);
2119
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch A");
21202147 csg.addChild(child);
21212148 child.addChild(csg);
2122
- child = new cGroup();
2149
+ child = new cGroup("Branch B");
21232150 csg.addChild(child);
21242151 child.addChild(csg);
21252152 } else
21262153 if (source == tripleItem)
21272154 {
2128
- Composite csg = new GroupLeaf();
2155
+ Composite csg = new GroupLeaf("Trident");
21292156 csg.count = 4;
21302157 group(csg);
21312158 Composite child = new cGroup();
....@@ -2740,15 +2767,28 @@
27402767 } else
27412768 if (source == ungroupItem || source == ungroupButton)
27422769 {
2743
- //ungroup();
2770
+ boolean hasRoot = false;
2771
+
27442772 for (int i=0; i<group.selection.size(); i++)
27452773 {
2746
- Ungroup(group.selection.get(i));
2774
+ if (group.selection.get(i) == group)
2775
+ {
2776
+ hasRoot = true;
2777
+ break;
2778
+ }
27472779 }
27482780
2749
- ClearSelection(false);
2750
-
2751
- refreshContents();
2781
+ if (!hasRoot)
2782
+ {
2783
+ for (int i=0; i<group.selection.size(); i++)
2784
+ {
2785
+ Ungroup(group.selection.get(i));
2786
+ }
2787
+
2788
+ ClearSelection(false);
2789
+
2790
+ refreshContents();
2791
+ }
27522792 } else
27532793 if (source == genUVItem)
27542794 {
....@@ -3372,7 +3412,7 @@
33723412 //copy.ClearUI();
33733413 for (Object3D obj : listUI)
33743414 {
3375
- obj.pinned = true;
3415
+ obj.pinned = false;
33763416 obj.CloseUI();
33773417 }
33783418 listUI.clear();
....@@ -3457,6 +3497,11 @@
34573497 currentLayout = sevenButton;
34583498 */
34593499 radio.layout.doClick();
3500
+
3501
+ ClearUnpinned();
3502
+ SetPinStates(group.selection.size() > 0);
3503
+ if (group.selection.size() == 1)
3504
+ EditSelection(false);
34603505 keepparent = group.parent;
34613506 // PARENT = NULL or not???
34623507 //group.parent = null; // ROOT
....@@ -4616,17 +4661,7 @@
46164661 //new Exception().printStackTrace();
46174662
46184663 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
- }
4664
+ ClearUnpinned();
46304665
46314666 /**/
46324667 //switch (event.id)
....@@ -4689,6 +4724,8 @@
46894724 {
46904725 editButton.setEnabled(enabled);
46914726 uneditButton.setEnabled(enabled);
4727
+ unselectButton.setEnabled(enabled);
4728
+ flashSelectionButton.setEnabled(enabled);
46924729 }
46934730
46944731 void refreshContents(boolean cp)
....@@ -5514,9 +5551,6 @@
55145551
55155552 cButton restoreCameraButton;
55165553
5517
- cButton minButton;
5518
- cButton maxButton;
5519
- cButton fullButton;
55205554 cButton saveButton;
55215555 cButton oneStepButton;
55225556