Normand Briere
2019-07-01 9079880942d022ee32fd3a543843e132e52deb1a
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 {
....@@ -1459,6 +1472,9 @@
14591472 animationItem.addItemListener(this);
14601473 animationItem.setState(Globals.ANIMATION);
14611474
1475
+ menu.add(archiveItem = new CheckboxMenuItem("Archive3D..."));
1476
+ archiveItem.addItemListener(this);
1477
+
14621478 menu.add("-");
14631479 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14641480 parseverticesItem.addActionListener(this);
....@@ -1628,6 +1644,20 @@
16281644
16291645 makeSomething(shadow);
16301646 }
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
+ }
16311661
16321662 /**
16331663 * applyExample
....@@ -2107,25 +2137,25 @@
21072137 Composite csg = new GroupLeaf();
21082138 csg.count = 5;
21092139 group(csg);
2110
- Composite child = new cGroup();
2140
+ Composite child = new cGroup("Branch");
21112141 csg.addChild(child);
21122142 child.addChild(csg);
21132143 } else
21142144 if (source == doubleItem)
21152145 {
2116
- Composite csg = new GroupLeaf();
2146
+ Composite csg = new GroupLeaf("Fork");
21172147 csg.count = 5;
21182148 group(csg);
2119
- Composite child = new cGroup();
2149
+ Composite child = new cGroup("Branch A");
21202150 csg.addChild(child);
21212151 child.addChild(csg);
2122
- child = new cGroup();
2152
+ child = new cGroup("Branch B");
21232153 csg.addChild(child);
21242154 child.addChild(csg);
21252155 } else
21262156 if (source == tripleItem)
21272157 {
2128
- Composite csg = new GroupLeaf();
2158
+ Composite csg = new GroupLeaf("Trident");
21292159 csg.count = 4;
21302160 group(csg);
21312161 Composite child = new cGroup();
....@@ -2740,15 +2770,28 @@
27402770 } else
27412771 if (source == ungroupItem || source == ungroupButton)
27422772 {
2743
- //ungroup();
2773
+ boolean hasRoot = false;
2774
+
27442775 for (int i=0; i<group.selection.size(); i++)
27452776 {
2746
- Ungroup(group.selection.get(i));
2777
+ if (group.selection.get(i) == group)
2778
+ {
2779
+ hasRoot = true;
2780
+ break;
2781
+ }
27472782 }
27482783
2749
- ClearSelection(false);
2750
-
2751
- 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
+ }
27522795 } else
27532796 if (source == genUVItem)
27542797 {
....@@ -3372,7 +3415,7 @@
33723415 //copy.ClearUI();
33733416 for (Object3D obj : listUI)
33743417 {
3375
- obj.pinned = true;
3418
+ obj.pinned = false;
33763419 obj.CloseUI();
33773420 }
33783421 listUI.clear();
....@@ -3457,6 +3500,11 @@
34573500 currentLayout = sevenButton;
34583501 */
34593502 radio.layout.doClick();
3503
+
3504
+ ClearUnpinned();
3505
+ SetPinStates(group.selection.size() > 0);
3506
+ if (group.selection.size() == 1)
3507
+ EditSelection(false);
34603508 keepparent = group.parent;
34613509 // PARENT = NULL or not???
34623510 //group.parent = null; // ROOT
....@@ -4616,17 +4664,7 @@
46164664 //new Exception().printStackTrace();
46174665
46184666 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
- }
4667
+ ClearUnpinned();
46304668
46314669 /**/
46324670 //switch (event.id)
....@@ -4689,6 +4727,8 @@
46894727 {
46904728 editButton.setEnabled(enabled);
46914729 uneditButton.setEnabled(enabled);
4730
+ unselectButton.setEnabled(enabled);
4731
+ flashSelectionButton.setEnabled(enabled);
46924732 }
46934733
46944734 void refreshContents(boolean cp)
....@@ -5514,9 +5554,6 @@
55145554
55155555 cButton restoreCameraButton;
55165556
5517
- cButton minButton;
5518
- cButton maxButton;
5519
- cButton fullButton;
55205557 cButton saveButton;
55215558 cButton oneStepButton;
55225559