Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
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,6 +745,18 @@
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
747761 editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748762 editButton.setToolTipText("Edit selection");
....@@ -3326,6 +3340,12 @@
33263340 } else
33273341 if (source == editItem || source == editButton)
33283342 {
3343
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3344
+ {
3345
+ Object3D child = (Object3D)e.nextElement();
3346
+ child.pinned = true;
3347
+ }
3348
+
33293349 EditSelection(false);
33303350 } else
33313351 if (source == uneditButton)
....@@ -3335,6 +3355,7 @@
33353355 Object3D child = (Object3D)e.nextElement();
33363356 if(child.editWindow != null)
33373357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3358
+ child.pinned = false;
33383359 child.CloseUI();
33393360 listUI.remove(child);
33403361
....@@ -3351,6 +3372,7 @@
33513372 //copy.ClearUI();
33523373 for (Object3D obj : listUI)
33533374 {
3375
+ obj.pinned = true;
33543376 obj.CloseUI();
33553377 }
33563378 listUI.clear();
....@@ -3360,7 +3382,7 @@
33603382 {
33613383 assert(copy == group);
33623384
3363
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3385
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33643386
33653387 for (Object3D obj : listUI)
33663388 {
....@@ -4502,10 +4524,6 @@
45024524 // }
45034525 // }
45044526
4505
- static boolean allparams = true;
4506
-
4507
- static Vector<Object3D> listUI = new Vector<Object3D>();
4508
-
45094527 void EditSelection(boolean newWindow)
45104528 {
45114529 // aConstraints.gridy = 0;
....@@ -4599,6 +4617,17 @@
45994617
46004618 freezemodel = true;
46014619
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
+ }
4630
+
46024631 /**/
46034632 //switch (event.id)
46044633 {
....@@ -4631,7 +4660,7 @@
46314660 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
46324661 // a camera
46334662 {
4634
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4663
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
46354664 {
46364665 CameraPane.camerachangeframe = 0; // don't refuse it
46374666 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4640,6 +4669,13 @@
46404669 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
46414670 }
46424671
4672
+ if (tps != null && tps.length == 1)
4673
+ {
4674
+ EditSelection(false);
4675
+ }
4676
+
4677
+ SetPinStates(tps != null && tps.length > 0);
4678
+
46434679 refreshContents();
46444680 //return true;
46454681 }
....@@ -4649,6 +4685,12 @@
46494685 freezemodel = false;
46504686 }
46514687
4688
+ void SetPinStates(boolean enabled)
4689
+ {
4690
+ editButton.setEnabled(enabled);
4691
+ uneditButton.setEnabled(enabled);
4692
+ }
4693
+
46524694 void refreshContents(boolean cp)
46534695 {
46544696 if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
....@@ -5475,8 +5517,6 @@
54755517 cButton minButton;
54765518 cButton maxButton;
54775519 cButton fullButton;
5478
- cButton undoButton;
5479
- cButton redoButton;
54805520 cButton saveButton;
54815521 cButton oneStepButton;
54825522