From 25cef97465f0bfa8959663754e9243006324c81c Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Wed, 01 May 2019 10:09:53 -0400
Subject: [PATCH] Nimbus L&F

---
 GroupEditor.java |   36 ++++++------------
 GrafreeD.java    |   43 +++++++++++++++++----
 cButton.java     |    6 ++
 3 files changed, 52 insertions(+), 33 deletions(-)

diff --git a/GrafreeD.java b/GrafreeD.java
index 44e3600..075e813 100644
--- a/GrafreeD.java
+++ b/GrafreeD.java
@@ -15,6 +15,8 @@
 //import com.jamonapi.*;
 public class GrafreeD extends Applet implements ActionListener
 {
+        static boolean NIMBUSLAF = false;
+        
     static int RENDERME = 0;
 
     static boolean epsequal = false;
@@ -801,19 +803,44 @@
 //        PlayAudio("/Users/nbriere/Downloads/Footsteps-6.wav", 4, 1);
         
         
-
-        try
+/**/
+        if (NIMBUSLAF)
         {
-            MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
-            MetalLookAndFeel.setCurrentTheme(new Theme(Constants.yellowTheme));
-            UIManager.setLookAndFeel(new MetalLookAndFeel());
-            //UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
+                try
+                {
+                    Object o = UIManager.getInstalledLookAndFeels();
+                        
+                    javax.swing.plaf.metal.MetalLookAndFeel.setCurrentTheme(new javax.swing.plaf.metal.DefaultMetalTheme());
+                    //MetalLookAndFeel.setCurrentTheme(new Theme(Constants.beigeTheme));
+                    UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel());
+                    
+                        UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
             //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel");
             //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
-        } catch (Exception e)
-        {
+                        //UIManager.put("nimbusBase", new Color(0,0,0));
+                }
+                catch (Exception e)
+                {
+                }
         }
+        else
+        {
+                try
+                {
+                    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+                    MetalLookAndFeel.setCurrentTheme(new Theme(Constants.yellowTheme));
+                    UIManager.setLookAndFeel(new MetalLookAndFeel());
+                    //UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
+                    //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel");
+                    //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
+                } catch (Exception e)
+                {
+                }
+        }
+/**/
 
+//        javax.swing.ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
+        
         //Monitor mon=MonitorFactory.start("myFirstMonitor");
         standAlone = true;
         grafreeD = new GrafreeD();
diff --git a/GroupEditor.java b/GroupEditor.java
index 9fa6f6d..60a98fd 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -434,31 +434,24 @@
         oe.radioPanel.add(dummyButton);
         oe.buttonGroup.add(dummyButton);
          */
-                aConstraints.gridy += 1;
-                
                 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
-                
-		oe.aConstraints.gridwidth = 1;
-        	oe.aConstraints.gridx = 0;
                 
                 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
                 liveCB.setToolTipText("Enabled animation");
                                 liveCB.addItemListener(this);
 
-        	oe.aConstraints.gridx += 1;
                 oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
                 trackCB.setToolTipText("Enable tracking");
                                 trackCB.addItemListener(this);
 
-        	oe.aConstraints.gridx += 1;
-		oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
+		oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
                 screenfitButton.setToolTipText("Screen fit");
 		screenfitButton.addActionListener(this);
-			oe.aConstraints.gridx += 1;
+
 //		oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
 //		screenfitpointButton.addActionListener(this);
 //			oe.aConstraints.gridx += 1;
-		oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
+		oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
 		snapobjectButton.addActionListener(this);
                 snapobjectButton.setToolTipText("Snap Object");
 			oe.aConstraints.gridx += 1;
@@ -468,39 +461,34 @@
 		oe.aConstraints.weighty = 0;
 		oe.aConstraints.gridwidth = 1;
 		
-		oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
+		oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
                 flashSelectionButton.setToolTipText("Show selection");
 		flashSelectionButton.addActionListener(this);
                 
-		oe.toolbarPanel.add(new cButton("     ", false));
+		oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
                 
-		oe.aConstraints.gridx += 1;
-		oe.aConstraints.weighty = 0;
-		oe.aConstraints.gridwidth = 1;
-                
-                //
-		oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
+		oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
                 twoButton.setToolTipText("Show center view only");
 		twoButton.addActionListener(this);
-		oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
+		oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
 		fourButton.addActionListener(this);
                 fourButton.setToolTipText("Show left panel only");
-		oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
+		oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
                 sixButton.setToolTipText("2-column layout left");
 		sixButton.addActionListener(this);
-		oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
+		oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
                 threeButton.setToolTipText("2-column layout right");
 		threeButton.addActionListener(this);
-		oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
+		oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
                 sevenButton.setToolTipText("3-column layout");
 		sevenButton.addActionListener(this);
                 //
 
-		oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
+		oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
                 rootButton.setToolTipText("Edit object in new tab");
 		rootButton.addActionListener(this);
 			oe.aConstraints.gridx += 1;
-		oe.toolbarPanel.add(closeButton = new cButton("  X  ")); //, oe.aConstraints);
+		oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
                 closeButton.setToolTipText("Close tab");
 		closeButton.addActionListener(this);
 		//oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
diff --git a/cButton.java b/cButton.java
index 1a6a27a..fb1d9a3 100644
--- a/cButton.java
+++ b/cButton.java
@@ -12,9 +12,13 @@
     {
         super(name);
         
+        setMargin(new java.awt.Insets(1, 1, 1, 1));
+        
         if (border)
                 setBorder(new javax.swing.border.EtchedBorder());
         else
-                setBorder(new javax.swing.border.EmptyBorder(0,0,0,0));
+        {
+                //setBorder(null); //new javax.swing.border.EmptyBorder(0,0,0,0));
+        }
     }
 }

--
Gitblit v1.6.2