biz.chitec.quarterback.swing
Class LocaleFlag
java.lang.Object
biz.chitec.quarterback.swing.LocaleFlag
- public class LocaleFlag
- extends java.lang.Object
Management class for locale flags.
Knows how to load a flag for a certain locale and returns it through its static method.
Flag design is controlled via the flag mode and depends on whether the locale contains
a country or only a language. Flag modes are defined in LocaleFlagTypes
:
- NONE: No flag is ever returned.
- COUNTRYONLY: Flag depends only on country. A language-only locale gets no flag.
- GRAYEDLANGUAGE: A language-only locale gets a grayed version of the flag for the default country for this language.
- NORMALLANGUAGE: A language-only locale gets the flag for the default country for this language.
- BRIGHTENEDLANGUAGE: A language-only locale gets a brightened version of the flag for the default country for this language.
The default-country for a language is defined in the resources for this class.
Flag objects are cached so that loading and scaling only happens once per locale and flag height.
- Version:
- $Id: e373acc92a7ceecd4b38a94f45446adc9ba0aa78 $
- Author:
- cantamen/Dirk Hillbrecht 2006
Method Summary |
private static java.awt.Image |
createLanguageOnlyImage(java.awt.Image i,
int flagmode)
|
static javax.swing.ImageIcon |
getLocaleFlag(java.util.Locale locale,
int flagmode,
int flagheight)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
emptyflagcache
private static java.util.Map emptyflagcache
localetoiconcache
private static java.util.Map localetoiconcache
rb
private static java.util.ResourceBundle rb
LocaleFlag
private LocaleFlag()
createLanguageOnlyImage
private static java.awt.Image createLanguageOnlyImage(java.awt.Image i,
int flagmode)
getLocaleFlag
public static javax.swing.ImageIcon getLocaleFlag(java.util.Locale locale,
int flagmode,
int flagheight)