diff options
author | Yana Stamcheva <yana@jitsi.org> | 2008-01-15 09:19:04 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2008-01-15 09:19:04 +0000 |
commit | fcbfc1768d7146feeaf3175a027b327a191a70b0 (patch) | |
tree | 7bf7e8ab25f768a8af2b8a8c03bc57018c4176fa | |
parent | 6f61638e0ef67bafabe70180ee731a46dc86558e (diff) | |
download | jitsi-fcbfc1768d7146feeaf3175a027b327a191a70b0.zip jitsi-fcbfc1768d7146feeaf3175a027b327a191a70b0.tar.gz jitsi-fcbfc1768d7146feeaf3175a027b327a191a70b0.tar.bz2 |
branding colors are obtained from the main color.properties file
5 files changed, 41 insertions, 7 deletions
@@ -1565,6 +1565,8 @@ javax.swing.event, javax.swing.border"/> prefix="resources/images/plugin/branding"/> <zipfileset dir="${resources}/styles" prefix="resources/styles"/> + <zipfileset dir="${resources}/colors" + prefix="resources/colors"/> </jar> </target> diff --git a/src/net/java/sip/communicator/plugin/branding/AboutWindow.java b/src/net/java/sip/communicator/plugin/branding/AboutWindow.java index 7a9018f..fa84519 100644 --- a/src/net/java/sip/communicator/plugin/branding/AboutWindow.java +++ b/src/net/java/sip/communicator/plugin/branding/AboutWindow.java @@ -59,7 +59,7 @@ public class AboutWindow extends JDialog implements HyperlinkListener, this.textPanel.setOpaque(false);
this.titleLabel.setFont(Constants.FONT.deriveFont(Font.BOLD, 28));
- this.titleLabel.setForeground(Constants.DARK_BLUE);
+ this.titleLabel.setForeground(Constants.TITLE_COLOR);
this.titleLabel.setAlignmentX(Component.RIGHT_ALIGNMENT);
this.versionLabel.setFont(Constants.FONT.deriveFont(Font.BOLD, 18));
@@ -67,7 +67,7 @@ public class AboutWindow extends JDialog implements HyperlinkListener, this.versionLabel.setAlignmentX(Component.RIGHT_ALIGNMENT);
this.logoArea.setFont(Constants.FONT.deriveFont(Font.BOLD, 14));
- this.logoArea.setForeground(Constants.DARK_BLUE);
+ this.logoArea.setForeground(Constants.TITLE_COLOR);
this.logoArea.setOpaque(false);
this.logoArea.setLineWrap(true);
this.logoArea.setWrapStyleWord(true);
diff --git a/src/net/java/sip/communicator/plugin/branding/Constants.java b/src/net/java/sip/communicator/plugin/branding/Constants.java index 3d15f21..05e0cfe 100644 --- a/src/net/java/sip/communicator/plugin/branding/Constants.java +++ b/src/net/java/sip/communicator/plugin/branding/Constants.java @@ -29,7 +29,8 @@ public class Constants /**
* Dark blue color used in the About Window.
*/
- public static final Color DARK_BLUE = new Color(23, 65, 125);
+ public static final Color TITLE_COLOR
+ = new Color(Resources.getColor("controlDarkShadow"));
/*
* ======================================================================
diff --git a/src/net/java/sip/communicator/plugin/branding/Resources.java b/src/net/java/sip/communicator/plugin/branding/Resources.java index 238bf6c..6eafdcd 100644 --- a/src/net/java/sip/communicator/plugin/branding/Resources.java +++ b/src/net/java/sip/communicator/plugin/branding/Resources.java @@ -9,6 +9,8 @@ package net.java.sip.communicator.plugin.branding; import java.text.*;
import java.util.*;
+import net.java.sip.communicator.util.*;
+
/**
* The Messages class manages the access to the internationalization properties
* files.
@@ -17,12 +19,20 @@ import java.util.*; */
public class Resources
{
+ private static Logger log = Logger.getLogger(Resources.class);
+
private static final String RESOUCRE_LOCATION
= "net.java.sip.communicator.plugin.branding.resources";
private static final ResourceBundle resourceBundle
= ResourceBundle.getBundle(RESOUCRE_LOCATION);
+ private static final String COLOR_BUNDLE_NAME
+ = "resources.colors.colorResources";
+
+ private static final ResourceBundle COLOR_RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(COLOR_BUNDLE_NAME);
+
/**
* Returns an internationalized string corresponding to the given key.
*
@@ -64,9 +74,32 @@ public class Resources }
catch (MissingResourceException e)
{
+ log.error("Missing string resource.", e);
+
resourceString = '!' + key + '!';
}
return resourceString;
}
+
+ /**
+ * Returns an int RGB color corresponding to the given key.
+ *
+ * @param key The key of the string.
+ *
+ * @return An internationalized string corresponding to the given key.
+ */
+ public static int getColor(String key)
+ {
+ try
+ {
+ return Integer.parseInt(COLOR_RESOURCE_BUNDLE.getString(key), 16);
+ }
+ catch (MissingResourceException e)
+ {
+ log.error("Missing color resource.", e);
+
+ return 0xFFFFFF;
+ }
+ }
}
diff --git a/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java b/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java index 98f3a62..1bb98ef 100644 --- a/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java +++ b/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java @@ -26,8 +26,6 @@ public class WelcomeWindow extends JDialog private JPanel textPanel = new JPanel(); - private static final Color DARK_BLUE = new Color(23, 65, 125); - private JPanel loadingPanel = new JPanel(new BorderLayout()); private JLabel loadingLabel = new JLabel( @@ -49,7 +47,7 @@ public class WelcomeWindow extends JDialog this.textPanel.setOpaque(false); this.titleLabel.setFont(Constants.FONT.deriveFont(Font.BOLD, 28)); - this.titleLabel.setForeground(DARK_BLUE); + this.titleLabel.setForeground(Constants.TITLE_COLOR); this.titleLabel.setAlignmentX(Component.RIGHT_ALIGNMENT); this.versionLabel.setFont(Constants.FONT.deriveFont(Font.BOLD, 18)); @@ -57,7 +55,7 @@ public class WelcomeWindow extends JDialog this.versionLabel.setAlignmentX(Component.RIGHT_ALIGNMENT); this.logoArea.setFont(Constants.FONT.deriveFont(Font.BOLD, 12)); - this.logoArea.setForeground(DARK_BLUE); + this.logoArea.setForeground(Constants.TITLE_COLOR); this.logoArea.setOpaque(false); this.logoArea.setLineWrap(true); this.logoArea.setWrapStyleWord(true); |