| java.lang.Object com.javujavu.javux.wings.WingSkin
WingSkin | public class WingSkin (Code) | | This class loads and manages hierarchical skin style sheets and associated resources
This is one of the core WingS classes required by all the components
This class is thread safe.
|
Method Summary | |
public static String | catKeys(String key1, String key2) Returns a string that represents the concatenation of the keys
where dot is a node separator. | public static Color | getColor(String key1, String key2) | public static Color | getColor(String key1, String key2, Color def) | public static WingFont | getFont(String key1, String key2) | public static WingFont | getFont(String key1, String key2, WingFont def) | public static WingImage | getImage(String key1, String key2) | public static WingImage | getImage(String key1, String key2, WingImage def) | public static int | getInteger(String key1, String key2, int def) | public static Insets | getMargin(String key1, String key2) | public static Insets | getMargin(String key1, String key2, Insets def) | public static Style | getStyle(String id1, String id2, Style def) | public static synchronized Style | getStyle(String id1, String id2, int state, Style def) | public static String[] | listImages() | public static synchronized boolean | loadSkin(String path, boolean pathUrl, Class pathRef) Tries to load all registered style sheets from the specified location. | public static synchronized void | registerStyleSheet(String styleSheet) | public static synchronized void | removeAllSkins() |
catKeys | public static String catKeys(String key1, String key2)(Code) | | Returns a string that represents the concatenation of the keys
where dot is a node separator.
If one of the keys is null returns the other one
in other case returns key1.key2
Parameters: key1 - key 1 Parameters: key2 - key 2 a string that represents the concatenation of the keys |
getColor | public static Color getColor(String key1, String key2)(Code) | | Returns the color specified by the key being concatenation
of key1 and key2
or null if not found
Parameters: key1 - first part of the key Parameters: key2 - second part of the key the color specified by the key or null if not found |
getColor | public static Color getColor(String key1, String key2, Color def)(Code) | | Returns the color specified by the key being concatenation
of key1 and key2
or def if not found
Parameters: key1 - first part of the key Parameters: key2 - second part of the key Parameters: def - default value returned if no color is found the color specified by the key or def if not found |
getFont | public static WingFont getFont(String key1, String key2)(Code) | | Returns the font specified by the key being concatenation
of key1 and key2
or null if not found
Parameters: key1 - first part of the key Parameters: key2 - second part of the key the font specified by the key or null if not found |
getFont | public static WingFont getFont(String key1, String key2, WingFont def)(Code) | | Returns the font specified by the key being concatenation
of key1 and key2
or def if not found
Parameters: key1 - first part of the key Parameters: key2 - second part of the key Parameters: def - default value returned if no font is found the font specified by the key or def if not found |
getImage | public static WingImage getImage(String key1, String key2)(Code) | | Returns the image specified by the key being concatenation
of key1 and key2
or a special image produced by getNotFoundImage() if not found
Parameters: key1 - first part of the key Parameters: key2 - second part of the key the image specified by the key or getNotFoundImage() if not found |
getImage | public static WingImage getImage(String key1, String key2, WingImage def)(Code) | | Returns the image specified by the key being concatenation
of key1 and key2
or def if not found
Parameters: key1 - first part of the key Parameters: key2 - second part of the key Parameters: def - default value returned if no image is found the image specified by the key or def if not found |
getInteger | public static int getInteger(String key1, String key2, int def)(Code) | | Returns the integer value specified by the key being concatenation
of key1 and key2
or def if not found
Parameters: key1 - first part of the key Parameters: key2 - second part of the key Parameters: def - default value returned if no property is found the property specified by the key or def if not found |
getMargin | public static Insets getMargin(String key1, String key2)(Code) | | Returns the margin specified by the key being concatenation
of key1 and key2
or DEF_MARGIN if not found
Parameters: key1 - first part of the key Parameters: key2 - second part of the key the margin specified by the key or DEF_MARGIN if not found |
getMargin | public static Insets getMargin(String key1, String key2, Insets def)(Code) | | Returns the margin specified by the key being concatenation
of key1 and key2
or def if not found
Parameters: key1 - first part of the key Parameters: key2 - second part of the key Parameters: def - default value returned if no margin is found the margin specified by the key or def if not found |
getStyle | public static Style getStyle(String id1, String id2, Style def)(Code) | | Returns the style specified by the key being concatenation
of id1 and id2
using settings from def style as defaults
the style specified by the key and def Parameters: id1 - first part of the key Parameters: id2 - second part of the key Parameters: def - style specifying default style values |
getStyle | public static synchronized Style getStyle(String id1, String id2, int state, Style def)(Code) | | Returns the style specified by the key being concatenation
of id1 and id2
and keys specified by the state value
using settings from def style as defaults
the style specified by the key and def Parameters: id1 - first part of the key Parameters: id2 - second part of the key Parameters: state - state representing by this style Parameters: def - style specifying default style values |
listImages | public static String[] listImages()(Code) | | Returns an array containing keys of all images defined by style sheets
array containing keys of all images defined by style sheets |
loadSkin | public static synchronized boolean loadSkin(String path, boolean pathUrl, Class pathRef)(Code) | | Tries to load all registered style sheets from the specified location.
It overrides but not removes properties from previously loaded style sheets.
There are 3 possible variants:
loadSkin("local file path", false, null);
loads the styles from local files
loadSkin("net URL", true, null);
loads the styles from the net
loadSkin("relative path", true, Reference_class);
loads the styles from the location relative to Reference_class ,
usually from the jar file
Parameters: path - path of the skin folder Parameters: pathUrl - determines wheter the path is an URL or local file path Parameters: pathRef - optional class to location of which the path is relative returns true if the style sheet wings.ini was found in this location |
registerStyleSheet | public static synchronized void registerStyleSheet(String styleSheet)(Code) | | Registers specified style sheet and loads it from all previously
processed skin locations.
By default WingS looks only for wings.ini stylesheet
Parameters: styleSheet - style sheet name without the .ini exension See Also: WingSkin.loadSkin(String,boolean,Class) |
removeAllSkins | public static synchronized void removeAllSkins()(Code) | | Removes all previously loaded skins
|
|
|