Normand Briere
2019-07-07 46dbce888e7c3eff8969f1ddbe22e144410b67f4
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
....@@ -380,6 +380,7 @@
380380 shadowYItem.addActionListener(this);
381381 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382382 shadowZItem.addActionListener(this);
383
+
383384 if (Globals.ADVANCED)
384385 {
385386 menu.add("-");
....@@ -582,7 +583,7 @@
582583 */
583584 cGridBag copyOptionsPanel = new cGridBag();
584585
585
- copyOptionsPanel.preferredHeight = 2;
586
+ copyOptionsPanel.preferredHeight = 1;
586587
587588 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588589
....@@ -590,14 +591,21 @@
590591 //minButton.setToolTipText("Minimize window");
591592 //minButton.addActionListener(this);
592593
593
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
- maxButton.setToolTipText("Maximize window");
595
- maxButton.addActionListener(this);
594
+ if (Globals.ADVANCED)
595
+ {
596
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ maxButton.setToolTipText("Maximize window");
598
+ maxButton.addActionListener(this);
599
+ }
596600
597601 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598602 fullButton.setToolTipText("Full-screen window");
599603 fullButton.addActionListener(this);
600604
605
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ screenfitButton.setToolTipText("Screen fit");
607
+ screenfitButton.addActionListener(this);
608
+
601609 oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602610 restoreCameraButton.setToolTipText("Restore viewpoint");
603611 restoreCameraButton.addActionListener(this);
....@@ -630,10 +638,6 @@
630638
631639 //oe.toolboxPanel.Return();
632640
633
- copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- screenfitButton.setToolTipText("Screen fit");
635
- screenfitButton.addActionListener(this);
636
-
637641 // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638642 // trackCB.setToolTipText("Enable tracking");
639643 // trackCB.addItemListener(this);
....@@ -726,7 +730,7 @@
726730 compositeButton.addActionListener(this);
727731
728732 oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
- switchButton.setToolTipText("Create switch");
733
+ switchButton.setToolTipText("Create item switcher");
730734 switchButton.addActionListener(this);
731735
732736 oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -758,16 +762,16 @@
758762 }
759763
760764 // EDIT panel
761
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
- editButton.setToolTipText("Edit selection");
765
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ editButton.setToolTipText("Pin selection controls");
763767 editButton.addActionListener(this);
764768
765
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
- uneditButton.setToolTipText("Unedit selection");
769
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
770
+ uneditButton.setToolTipText("Remove selection controls");
767771 uneditButton.addActionListener(this);
768772
769773 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
- allParamsButton.setToolTipText("Edit all params");
774
+ allParamsButton.setToolTipText("Show all controle");
771775 allParamsButton.addActionListener(this);
772776
773777 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -784,6 +788,7 @@
784788
785789 editCommandsPanel.preferredHeight = 1;
786790
791
+ SetPinStates(false);
787792 // oe.treePanel.add(commandsPanel);
788793 // oe.treePanel.Return();
789794
....@@ -857,14 +862,18 @@
857862 boxCB.addItemListener(this);
858863
859864 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
860
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
865
+ zoomBoxCB.setToolTipText("Display only for wheel");
861866 zoomBoxCB.addItemListener(this);
862867
863868 if (true) // Globals.ADVANCED)
864869 {
865
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
- supportCB.setToolTipText("Enable rigging");
867
- supportCB.addItemListener(this);
870
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
871
+// supportCB.setToolTipText("Enable rigging");
872
+// supportCB.addItemListener(this);
873
+
874
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
875
+ freezeCB.setToolTipText("Fast moving camera");
876
+ freezeCB.addItemListener(this);
868877
869878 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
870879 // localCB.addItemListener(this);
....@@ -919,7 +928,7 @@
919928 oeilCB.addItemListener(this);
920929
921930 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
- shadowCB.setToolTipText("Compute shadows when live");
931
+ shadowCB.setToolTipText("When live compute shadows");
923932 shadowCB.addItemListener(this);
924933
925934 panel.Return();
....@@ -928,11 +937,11 @@
928937 toggleTextureCB.addItemListener(this);
929938
930939 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
- toggleSwitchCB.setToolTipText("Use switch");
940
+ toggleSwitchCB.setToolTipText("Choose a single item");
932941 toggleSwitchCB.addItemListener(this);
933942
934943 panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
- autosaveCB.setToolTipText("Auto-save on structure change");
944
+ autosaveCB.setToolTipText("On structure change");
936945 autosaveCB.addItemListener(this);
937946
938947 panel.Return();
....@@ -999,6 +1008,7 @@
9991008 cCheckBox slowCB;
10001009 cCheckBox boxCB;
10011010 cCheckBox zoomBoxCB;
1011
+ cCheckBox freezeCB;
10021012 //cToggleButton trackCB;
10031013 cCheckBox trackCB;
10041014 cCheckBox smoothfocusCB;
....@@ -1117,6 +1127,10 @@
11171127 {
11181128 Globals.COMPUTESHADOWWHENLIVE ^= true;
11191129 }
1130
+ else if(e.getSource() == freezeCB)
1131
+ {
1132
+ Globals.FREEZEONMOVE ^= true;
1133
+ }
11201134 else if(e.getSource() == autosaveCB)
11211135 {
11221136 Globals.SAVEONMAKE ^= true;
....@@ -1201,8 +1215,6 @@
12011215 }
12021216 }
12031217
1204
- String string = (String) object;
1205
-
12061218 System.out.println("Transfer = " + object + "; drop : " + target);
12071219 // if( object instanceof java.io.File[])
12081220 // {
....@@ -1210,6 +1222,8 @@
12101222 // objEditor.DropFile((java.io.File[]) object, true);
12111223 // return;
12121224 // }
1225
+
1226
+ String string = (String) object;
12131227
12141228 // File path for Mac and Windows
12151229 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1459,6 +1473,9 @@
14591473 animationItem.addItemListener(this);
14601474 animationItem.setState(Globals.ANIMATION);
14611475
1476
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1477
+ archiveItem.addActionListener(this);
1478
+
14621479 menu.add("-");
14631480 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14641481 parseverticesItem.addActionListener(this);
....@@ -1628,6 +1645,20 @@
16281645
16291646 makeSomething(shadow);
16301647 }
1648
+
1649
+ private void ClearUnpinned()
1650
+ {
1651
+ //for (Object3D obj : listUI)
1652
+ for (int i=listUI.size(); --i>=0;)
1653
+ {
1654
+ Object3D obj = listUI.elementAt(i);
1655
+ if (!obj.pinned)
1656
+ {
1657
+ obj.CloseUI();
1658
+ listUI.remove(i);
1659
+ }
1660
+ }
1661
+ }
16311662
16321663 /**
16331664 * applyExample
....@@ -2107,25 +2138,25 @@
21072138 Composite csg = new GroupLeaf();
21082139 csg.count = 5;
21092140 group(csg);
2110
- Composite child = new cGroup();
2141
+ Composite child = new cGroup("Branch");
21112142 csg.addChild(child);
21122143 child.addChild(csg);
21132144 } else
21142145 if (source == doubleItem)
21152146 {
2116
- Composite csg = new GroupLeaf();
2147
+ Composite csg = new GroupLeaf("Fork");
21172148 csg.count = 5;
21182149 group(csg);
2119
- Composite child = new cGroup();
2150
+ Composite child = new cGroup("Branch A");
21202151 csg.addChild(child);
21212152 child.addChild(csg);
2122
- child = new cGroup();
2153
+ child = new cGroup("Branch B");
21232154 csg.addChild(child);
21242155 child.addChild(csg);
21252156 } else
21262157 if (source == tripleItem)
21272158 {
2128
- Composite csg = new GroupLeaf();
2159
+ Composite csg = new GroupLeaf("Trident");
21292160 csg.count = 4;
21302161 group(csg);
21312162 Composite child = new cGroup();
....@@ -2189,7 +2220,8 @@
21892220 } else
21902221 if (source == undoButton)
21912222 {
2192
- Undo();
2223
+ if (!Undo())
2224
+ java.awt.Toolkit.getDefaultToolkit().beep();
21932225 } else
21942226 if (source == redoButton)
21952227 {
....@@ -2197,7 +2229,8 @@
21972229 } else
21982230 if (source == saveButton)
21992231 {
2200
- Save();
2232
+ if (!Save(true))
2233
+ java.awt.Toolkit.getDefaultToolkit().beep();
22012234 } else
22022235 if (source == oneStepButton)
22032236 {
....@@ -2206,17 +2239,14 @@
22062239 } else
22072240 if (source == screenfitButton)
22082241 {
2209
- //Reload(lastConverter, lastFilename, true);
22102242 ScreenFit();
22112243 } else
22122244 if (source == screenfitpointButton)
22132245 {
2214
- //Reload(lastConverter, lastFilename, true);
22152246 ScreenFitPoint();
22162247 } else
22172248 if (source == snapobjectButton)
22182249 {
2219
- //Reload(lastConverter, lastFilename, true);
22202250 SnapObject();
22212251 } else
22222252 // if (event.getSource() == recompileButton)
....@@ -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,12 +4727,14 @@
46894727 {
46904728 editButton.setEnabled(enabled);
46914729 uneditButton.setEnabled(enabled);
4730
+ unselectButton.setEnabled(enabled);
4731
+ flashSelectionButton.setEnabled(enabled);
46924732 }
46934733
46944734 void refreshContents(boolean cp)
46954735 {
46964736 if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4697
- if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4737
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
46984738 {
46994739 objEditor.ClearInfo(); // .GetMaterial());
47004740
....@@ -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