Normand Briere
2019-06-27 1807e7752960ac229cddd34b100e92cadbac9459
GroupEditor.java
....@@ -605,10 +605,12 @@
605605 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606606 undoButton.setToolTipText("Undo changes");
607607 undoButton.addActionListener(this);
608
+ undoButton.setEnabled(false);
608609
609610 copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610611 redoButton.setToolTipText("Redo changes");
611612 redoButton.addActionListener(this);
613
+ redoButton.setEnabled(false);
612614
613615 copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614616 saveButton.setToolTipText("Save changes");
....@@ -743,17 +745,29 @@
743745 lightButton.setToolTipText("Create light");
744746 lightButton.addActionListener(this);
745747
748
+ for (int i=6; --i>=0;)
749
+ {
750
+ oe.toolboxPanel.Return();
751
+ oe.toolboxPanel.add(new cGridBag());
752
+ oe.toolboxPanel.add(new cGridBag());
753
+ oe.toolboxPanel.add(new cGridBag());
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
+ }
759
+
746760 // EDIT panel
747
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
- editButton.setToolTipText("Edit selection");
761
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ editButton.setToolTipText("Pin selection controls");
749763 editButton.addActionListener(this);
750764
751
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
- uneditButton.setToolTipText("Unedit selection");
765
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Remove selection controls");
753767 uneditButton.addActionListener(this);
754768
755769 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
- allParamsButton.setToolTipText("Edit all params");
770
+ allParamsButton.setToolTipText("Show all controle");
757771 allParamsButton.addActionListener(this);
758772
759773 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -770,6 +784,7 @@
770784
771785 editCommandsPanel.preferredHeight = 1;
772786
787
+ SetPinStates(false);
773788 // oe.treePanel.add(commandsPanel);
774789 // oe.treePanel.Return();
775790
....@@ -843,7 +858,7 @@
843858 boxCB.addItemListener(this);
844859
845860 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
846
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
861
+ zoomBoxCB.setToolTipText("Display only for wheel");
847862 zoomBoxCB.addItemListener(this);
848863
849864 if (true) // Globals.ADVANCED)
....@@ -905,7 +920,7 @@
905920 oeilCB.addItemListener(this);
906921
907922 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
- shadowCB.setToolTipText("Compute shadows when live");
923
+ shadowCB.setToolTipText("When live compute shadows");
909924 shadowCB.addItemListener(this);
910925
911926 panel.Return();
....@@ -918,7 +933,7 @@
918933 toggleSwitchCB.addItemListener(this);
919934
920935 panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
- autosaveCB.setToolTipText("Auto-save on structure change");
936
+ autosaveCB.setToolTipText("On structure change");
922937 autosaveCB.addItemListener(this);
923938
924939 panel.Return();
....@@ -1614,6 +1629,20 @@
16141629
16151630 makeSomething(shadow);
16161631 }
1632
+
1633
+ private void ClearUnpinned()
1634
+ {
1635
+ //for (Object3D obj : listUI)
1636
+ for (int i=listUI.size(); --i>=0;)
1637
+ {
1638
+ Object3D obj = listUI.elementAt(i);
1639
+ if (!obj.pinned)
1640
+ {
1641
+ obj.CloseUI();
1642
+ listUI.remove(i);
1643
+ }
1644
+ }
1645
+ }
16171646
16181647 /**
16191648 * applyExample
....@@ -3326,6 +3355,12 @@
33263355 } else
33273356 if (source == editItem || source == editButton)
33283357 {
3358
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3359
+ {
3360
+ Object3D child = (Object3D)e.nextElement();
3361
+ child.pinned = true;
3362
+ }
3363
+
33293364 EditSelection(false);
33303365 } else
33313366 if (source == uneditButton)
....@@ -3335,6 +3370,7 @@
33353370 Object3D child = (Object3D)e.nextElement();
33363371 if(child.editWindow != null)
33373372 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3373
+ child.pinned = false;
33383374 child.CloseUI();
33393375 listUI.remove(child);
33403376
....@@ -3351,6 +3387,7 @@
33513387 //copy.ClearUI();
33523388 for (Object3D obj : listUI)
33533389 {
3390
+ obj.pinned = false;
33543391 obj.CloseUI();
33553392 }
33563393 listUI.clear();
....@@ -3360,7 +3397,7 @@
33603397 {
33613398 assert(copy == group);
33623399
3363
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3400
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33643401
33653402 for (Object3D obj : listUI)
33663403 {
....@@ -3435,6 +3472,11 @@
34353472 currentLayout = sevenButton;
34363473 */
34373474 radio.layout.doClick();
3475
+
3476
+ ClearUnpinned();
3477
+ SetPinStates(group.selection.size() > 0);
3478
+ if (group.selection.size() == 1)
3479
+ EditSelection(false);
34383480 keepparent = group.parent;
34393481 // PARENT = NULL or not???
34403482 //group.parent = null; // ROOT
....@@ -4502,10 +4544,6 @@
45024544 // }
45034545 // }
45044546
4505
- static boolean allparams = true;
4506
-
4507
- static Vector<Object3D> listUI = new Vector<Object3D>();
4508
-
45094547 void EditSelection(boolean newWindow)
45104548 {
45114549 // aConstraints.gridy = 0;
....@@ -4598,7 +4636,8 @@
45984636 //new Exception().printStackTrace();
45994637
46004638 freezemodel = true;
4601
-
4639
+ ClearUnpinned();
4640
+
46024641 /**/
46034642 //switch (event.id)
46044643 {
....@@ -4631,7 +4670,7 @@
46314670 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
46324671 // a camera
46334672 {
4634
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4673
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
46354674 {
46364675 CameraPane.camerachangeframe = 0; // don't refuse it
46374676 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4640,6 +4679,13 @@
46404679 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
46414680 }
46424681
4682
+ if (tps != null && tps.length == 1)
4683
+ {
4684
+ EditSelection(false);
4685
+ }
4686
+
4687
+ SetPinStates(tps != null && tps.length > 0);
4688
+
46434689 refreshContents();
46444690 //return true;
46454691 }
....@@ -4649,6 +4695,14 @@
46494695 freezemodel = false;
46504696 }
46514697
4698
+ void SetPinStates(boolean enabled)
4699
+ {
4700
+ editButton.setEnabled(enabled);
4701
+ uneditButton.setEnabled(enabled);
4702
+ unselectButton.setEnabled(enabled);
4703
+ flashSelectionButton.setEnabled(enabled);
4704
+ }
4705
+
46524706 void refreshContents(boolean cp)
46534707 {
46544708 if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
....@@ -5475,8 +5529,6 @@
54755529 cButton minButton;
54765530 cButton maxButton;
54775531 cButton fullButton;
5478
- cButton undoButton;
5479
- cButton redoButton;
54805532 cButton saveButton;
54815533 cButton oneStepButton;
54825534