From 914255f70cf047897212839cbf3a6722703f4457 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 24 Jun 2019 13:19:16 -0400
Subject: [PATCH] Fix manip window + new icons.

---
 GroupEditor.java |   84 ++++++++++++++++++++++++------------------
 1 files changed, 48 insertions(+), 36 deletions(-)

diff --git a/GroupEditor.java b/GroupEditor.java
index 33acfd4..cce9b1b 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -580,43 +580,43 @@
                 //minButton.setToolTipText("Minimize window");
 		//minButton.addActionListener(this);
                 
-		oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 maxButton.setToolTipText("Maximize window");
 		maxButton.addActionListener(this);
                 
-		oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 fullButton.setToolTipText("Full-screen window");
 		fullButton.addActionListener(this);
                 
-		oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 undoButton.setToolTipText("Undo changes");
 		undoButton.addActionListener(this);
                 
-		oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 redoButton.setToolTipText("Redo changes");
 		redoButton.addActionListener(this);
                 
-		oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 saveButton.setToolTipText("Save changes");
 		saveButton.addActionListener(this);
                 
-                oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
+                oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
                 liveCB.setToolTipText("Enable animation");
                                 liveCB.addItemListener(this);
 
-		oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                oneStepButton.setToolTipText("Animate one step forward");
-		oneStepButton.addActionListener(this);
-                
-                oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
+                oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
                 fastCB.setToolTipText("Fast mode");
                                 fastCB.addItemListener(this);
                                 
-                oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
+		oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                oneStepButton.setToolTipText("Animate one step forward");
+		oneStepButton.addActionListener(this);
+                
+                oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
                 trackCB.setToolTipText("Enable tracking");
                                 trackCB.addItemListener(this);
 
-		oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 screenfitButton.setToolTipText("Screen fit");
 		screenfitButton.addActionListener(this);
 
@@ -630,8 +630,8 @@
                         snapobjectButton.setToolTipText("Snap Object");
                 }
 
-		oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                flashSelectionButton.setToolTipText("Show selection");
+		oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                flashSelectionButton.setToolTipText("Highlight selection");
 		flashSelectionButton.addActionListener(this);
                 
 		oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
@@ -815,6 +815,10 @@
                 shadowCB.setToolTipText("Compute shadows when live");
                                 shadowCB.addItemListener(this);
 
+                panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
+                autosaveCB.setToolTipText("Auto-save on structure change");
+                                autosaveCB.addItemListener(this);
+
             if (Globals.ADVANCED)
             {
                 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
@@ -864,25 +868,26 @@
             /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
         }
 
-        JCheckBox liveCB;
-        JCheckBox supportCB;
-        JCheckBox localCB;
-        JCheckBox crowdCB;
-        JCheckBox smoothCB;
-        JCheckBox fastCB;
-        JCheckBox slowCB;
-        JCheckBox boxCB;
-        JCheckBox zoomBoxCB;
-        JCheckBox trackCB;
-        JCheckBox smoothfocusCB;
+        cCheckBox liveCB;
+        cCheckBox supportCB;
+        cCheckBox localCB;
+        cCheckBox crowdCB;
+        cCheckBox smoothCB;
+        cCheckBox fastCB;
+        cCheckBox slowCB;
+        cCheckBox boxCB;
+        cCheckBox zoomBoxCB;
+        cCheckBox trackCB;
+        cCheckBox smoothfocusCB;
 //        JCheckBox speakerMocapCB;
-        JCheckBox speakerCameraCB;
-        JCheckBox speakerFocusCB;
-        JCheckBox debugCB;
+        cCheckBox speakerCameraCB;
+        cCheckBox speakerFocusCB;
+        cCheckBox debugCB;
         
-        JCheckBox oeilCB;
-        JCheckBox shadowCB;
-        JCheckBox lookAtCB;
+        cCheckBox oeilCB;
+        cCheckBox shadowCB;
+        cCheckBox autosaveCB;
+        cCheckBox lookAtCB;
         
 //        static int COLOR = 1;
 //        static int MATERIAL = 2;
@@ -890,9 +895,9 @@
         
         int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
         
-        JCheckBox colorCB;
-        JCheckBox materialCB;
-        JCheckBox textureCB;
+        cCheckBox colorCB;
+        cCheckBox materialCB;
+        cCheckBox textureCB;
         
         public void itemStateChanged(ItemEvent e)
         {
@@ -988,6 +993,10 @@
             else if(e.getSource() == shadowCB)
             {
                 Globals.COMPUTESHADOWWHENLIVE ^= true;
+            }
+            else if(e.getSource() == autosaveCB)
+            {
+                Globals.SAVEONMAKE ^= true;
             }
             else if(e.getSource() == lookAtCB)
             {
@@ -3159,7 +3168,8 @@
                                 buttonGroup.remove(ab);
                                 radioPanel.remove(ab);
                                 
-                                ab.GetObject().editWindow = null;
+                                //ab.GetObject().editWindow = null;
+                                ab.GetObject().manipWindow = null;
                             //    ab.GetObject().objectUI = null; // ?????????
                                 
                                 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
@@ -3273,6 +3283,7 @@
                     
 // fix "+" issue
                     //group.editWindow = this;
+                    group.manipWindow = this;
                     
                     /*
                     currentLayout = radio.layout;
@@ -4595,6 +4606,7 @@
                 
 		if (cut)
 		{
+        if (Globals.SAVEONMAKE)
                     Save();
 			//int indices[] = jList.getSelectedIndices();
 			//for (int i = indices.length - 1; i >= 0; i--)

--
Gitblit v1.6.2