QJCC homepage

biz.chitec.quarterback.swing
Class LocaleFlag

java.lang.Object
  extended bybiz.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:

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

Nested Class Summary
private static class LocaleFlag.BrightenFilter
           
 
Field Summary
private static java.util.Map emptyflagcache
           
private static java.util.Map localetoiconcache
           
private static java.util.ResourceBundle rb
           
 
Constructor Summary
private LocaleFlag()
           
 
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
 

Field Detail

emptyflagcache

private static java.util.Map emptyflagcache

localetoiconcache

private static java.util.Map localetoiconcache

rb

private static java.util.ResourceBundle rb
Constructor Detail

LocaleFlag

private LocaleFlag()
Method Detail

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)

QJCC homepage