|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.ui.StyleSheet
public final class StyleSheet
Manages all defined styles of a specific project.
This class is actually pre-processed to get the styles specific for the project and the device.
history
05-Jan-2004 - rob creation
| Field Summary | |
|---|---|
static AnimationThread |
animationThread
Access to the AnimationThread responsible for animating all user interface components |
static Command |
CANCEL_CMD
default CANCEL command |
static Screen |
currentScreen
Access to the currently shown J2ME Polish screen, if any |
static Style |
defaultStyle
default style |
static Display |
display
Access to the application's Display |
static Style |
focusedStyle
default style for focused/hovered items |
protected static Hashtable |
imagesByName
|
static Style |
labelStyle
default style for labels |
static Style |
menuStyle
default style for the commands menu |
static MIDlet |
midlet
Access to the currently running MIDlet |
static Command |
OK_CMD
default OK command |
| Method Summary | |
|---|---|
static void |
addMediaQuery(String condition,
Style[] styles)
Adds a media query to this set of styles if the condition is fulfilled. |
static Style[] |
getDynamicStyles()
|
static Image |
getImage(String url,
Object parent,
boolean cache)
Retrieves the image with the given name. |
static Style |
getStyle(Item item)
Retrieves the style for the given item. |
static Style |
getStyle(Screen screen)
Retrieves a dynamic style for the given screen. |
static Style |
getStyle(String name)
Gets the style with the specified name. |
static Hashtable |
getStyles()
Retrieves all registered styles in a Hashtable. |
static void |
notifyImageConsumers(String name,
Image image)
Notifies the GUI items which requested images about the successful loading of thoses images. |
static void |
releaseResources()
Releases all (memory intensive) resources such as images or RGB arrays of this style sheet. |
static void |
replaceStyleAttributes(Style oldAttributesStyle,
Style newAttributesStyle,
String styleNameMatch)
Replaces any old attributes in all matching styles with the given new attributes. |
static void |
showNotify()
placeholder for showNotify method which is added when using media queries |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Hashtable imagesByName
public static Style defaultStyle
public static Style focusedStyle
public static Style labelStyle
public static Style menuStyle
public static Screen currentScreen
public static Display display
public static MIDlet midlet
public static AnimationThread animationThread
public static Command OK_CMD
public static Command CANCEL_CMD
| Method Detail |
|---|
public static Image getImage(String url,
Object parent,
boolean cache)
throws IOException
url - the URL of the Image, e.g. "/background.png"parent - the object which needs the image, when the image should be loaded
in the background, the parent need to implement
the ImageConsumer interface when it wants to be notified when
the picture has been loaded.cache - true when the image should be cached for later retrieval.
This costs RAM obviously, so you should decide carefully if
large images should be cached.
IOException - when the image could not be loaded directlyImageConsumer.setImage(String, Image)
public static void notifyImageConsumers(String name,
Image image)
name - the URL of the imageimage - the imagepublic static Style getStyle(String name)
name - the name of the style
public static Hashtable getStyles()
public static Style getStyle(Item item)
item - the item for which the style should be retrieved
public static Style getStyle(Screen screen)
screen - the screen for which a style should be retrieved
public static void showNotify()
public static void addMediaQuery(String condition,
Style[] styles)
polish.css.mediaquery is true.
condition - the condition, compare http://www.w3.org/TR/css3-mediaqueries/styles - the styles that should be modified by this condition
public static void replaceStyleAttributes(Style oldAttributesStyle,
Style newAttributesStyle,
String styleNameMatch)
oldAttributesStyle - the old attributes that should be replacednewAttributesStyle - the new attributes that should be usedstyleNameMatch - a string like "feature" (matching all styles with names that contain "feature"), "feature*" (names start with "feature") or "*feature" (names end with "feature"). Use null to match _all_ styles.public static void releaseResources()
public static Style[] getDynamicStyles()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||