From 6119ab9a8445fae48d116280ec0c09a3cb9cb0bf Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 27 Nov 2006 08:02:55 +0000 Subject: [PATCH] * New look and feel and theme selection UI. The old editor is still there but not used. * Make compiere swing components works better under window and plastic look and feel. * Rename org.compiere.plaf.Adempiere*UI classes back to org.compiere.plaf.Compiere*UI. This is to make a clean separation between the new AdempiereLookAndFeel and the old CompiereLookAndFeel. Any class used by AdempiereLookAndFeel should goes into the org.adempiere.plaf package instead. As part of the exercise, AdempierePLAF is moved from org.compiere.plaf to org.adempiere.plaf * Fixed some bug related UI painting issue after switching of look and feel. It is still not perfect but much better. * Added a logout icon. Feel free to replace this if you have a better one. Please email me or post into the SF Developer forum is I break anything. Also, I haven't tested the new code under Linux yet and some localization work to be done. --- dbPort/src/org/compiere/Adempiere.java | 10 ++++---- .../org/compiere/db/CConnectionDialog.java | 2 ++ .../org/compiere/db/CConnectionEditor.java | 1 + dbPort/src/org/compiere/util/Env.java | 24 +++++++++++++++++++ 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/dbPort/src/org/compiere/Adempiere.java b/dbPort/src/org/compiere/Adempiere.java index e28ac76a34..5d3ccdc109 100644 --- a/dbPort/src/org/compiere/Adempiere.java +++ b/dbPort/src/org/compiere/Adempiere.java @@ -22,10 +22,13 @@ import java.net.*; import java.util.logging.*; import javax.jnlp.*; import javax.swing.*; + +import org.adempiere.plaf.AdempierePLAF; import org.compiere.db.*; import org.compiere.model.*; import org.compiere.plaf.*; import org.compiere.util.*; + import com.qoppa.pdf.*; /** @@ -453,12 +456,7 @@ public final class Adempiere { if (CLogMgt.isLevelAll()) log.log(Level.FINEST, System.getProperties().toString()); - // - //begin vpj-cd e-evolution - //CompiereTheme.load(); - AdempiereThemeInnova.load(); - //end vpj-cd e-evolution - AdempierePLAF.setPLAF (null); + AdempierePLAF.setPLAF (); } // Set Default Database Connection from Ini diff --git a/dbPort/src/org/compiere/db/CConnectionDialog.java b/dbPort/src/org/compiere/db/CConnectionDialog.java index aba7f85942..23f3b41967 100644 --- a/dbPort/src/org/compiere/db/CConnectionDialog.java +++ b/dbPort/src/org/compiere/db/CConnectionDialog.java @@ -21,6 +21,8 @@ import java.awt.event.*; import java.util.*; import java.util.logging.*; import javax.swing.*; + +import org.adempiere.plaf.AdempierePLAF; import org.compiere.plaf.*; import org.compiere.swing.*; import org.compiere.util.*; diff --git a/dbPort/src/org/compiere/db/CConnectionEditor.java b/dbPort/src/org/compiere/db/CConnectionEditor.java index d363404d58..b4824e349b 100644 --- a/dbPort/src/org/compiere/db/CConnectionEditor.java +++ b/dbPort/src/org/compiere/db/CConnectionEditor.java @@ -20,6 +20,7 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; +import org.adempiere.plaf.AdempierePLAF; import org.compiere.plaf.*; import org.compiere.swing.*; diff --git a/dbPort/src/org/compiere/util/Env.java b/dbPort/src/org/compiere/util/Env.java index 5ca5a7458e..960ecc93ce 100644 --- a/dbPort/src/org/compiere/util/Env.java +++ b/dbPort/src/org/compiere/util/Env.java @@ -1429,6 +1429,30 @@ public final class Env s_log.info("End"); } // sleep + /** + * Update all windows after look and feel changes. + * @since 2006-11-27 + */ + public static SetupdateUI() + { + Set updated = new HashSet(); + for (Container c : s_windows) + { + Window w = getFrame(c); + if (w == null) continue; + if (updated.contains(w)) continue; + SwingUtilities.updateComponentTreeUI(c); + updated.add(w); + } + for (Window w : s_hiddenWindows) + { + if (updated.contains(w)) continue; + SwingUtilities.updateComponentTreeUI(w); + updated.add(w); + } + return updated; + } + /************************************************************************** * Static Variables