branding colors are obtained from the main color.properties file

cusax-fix
Yana Stamcheva 18 years ago
parent 6f61638e0e
commit fcbfc1768d

@ -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>

@ -59,7 +59,7 @@ public AboutWindow(Frame owner)
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 AboutWindow(Frame owner)
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);

@ -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"));
/*
* ======================================================================

@ -9,6 +9,8 @@
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 @@
*/
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 static String getString(String key, String[] params)
}
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;
}
}
}

@ -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 WelcomeWindow()
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 WelcomeWindow()
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);

Loading…
Cancel
Save