JIDE 3.5.15

com.jidesoft.plaf.windows
Class XPStyle

java.lang.Object
  extended by com.jidesoft.plaf.windows.XPStyle

public class XPStyle
extends Object

Implements Windows XP Styles for the Windows Look and Feel.

Author:
Leif Samuelsson

Nested Class Summary
static class XPStyle.Skin
          A class which encapsulates attributes for a given part (component type) and which provides methods for painting backgrounds and glyphs
 
Method Summary
 Border getBorder(Component c, TMSchema.Part part)
          Get a named Border value from the current style
 Color getColor(XPStyle.Skin skin, TMSchema.Prop prop, Color fallback)
          Get a named Color value from the current style
 Dimension getDimension(Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)
          Get a named Dimension value from the current style
 int getInt(Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop, int fallback)
          Get a named int value from the current style
 Insets getMargin(Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)
          Get a named Insets value from the current style
 Point getPoint(Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)
          Get a named Point (e.g.
 XPStyle.Skin getSkin(Component c, TMSchema.Part part)
          Get a Skin object from the current style for a named part (component type)
 String getString(Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)
          Get a named String value from the current style
 TMSchema.TypeEnum getTypeEnum(Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)
           
static XPStyle getXP()
          Get the singleton instance of this class
static void invalidateStyle()
          Static method for clearing the hashmap and loading the current XP style and theme
 boolean isSkinDefined(Component c, TMSchema.Part part)
           
static boolean isVista()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

invalidateStyle

public static void invalidateStyle()
Static method for clearing the hashmap and loading the current XP style and theme


getXP

public static XPStyle getXP()
Get the singleton instance of this class

Returns:
the singleton instance of this class or null if XP styles are not active or if this is not Windows XP

isVista

public static boolean isVista()

getString

public String getString(Component c,
                        TMSchema.Part part,
                        TMSchema.State state,
                        TMSchema.Prop prop)
Get a named String value from the current style

Parameters:
part - a Part
state - a String
prop - a String
Returns:
a String or null if key is not found in the current style

This is currently only used by WindowsInternalFrameTitlePane for painting title foreground and can be removed when no longer needed


getTypeEnum

public TMSchema.TypeEnum getTypeEnum(Component c,
                                     TMSchema.Part part,
                                     TMSchema.State state,
                                     TMSchema.Prop prop)

getInt

public int getInt(Component c,
                  TMSchema.Part part,
                  TMSchema.State state,
                  TMSchema.Prop prop,
                  int fallback)
Get a named int value from the current style

Parameters:
part - a Part
Returns:
an int or null if key is not found in the current style

getDimension

public Dimension getDimension(Component c,
                              TMSchema.Part part,
                              TMSchema.State state,
                              TMSchema.Prop prop)
Get a named Dimension value from the current style

Returns:
a Dimension or null if key is not found in the current style

This is currently only used by WindowsProgressBarUI and the value should probably be cached there instead of here.


getPoint

public Point getPoint(Component c,
                      TMSchema.Part part,
                      TMSchema.State state,
                      TMSchema.Prop prop)
Get a named Point (e.g. a location or an offset) value from the current style

Returns:
a Point or null if key is not found in the current style

This is currently only used by WindowsInternalFrameTitlePane for painting title foregound and can be removed when no longer needed


getMargin

public Insets getMargin(Component c,
                        TMSchema.Part part,
                        TMSchema.State state,
                        TMSchema.Prop prop)
Get a named Insets value from the current style

Returns:
an Insets object or null if key is not found in the current style

This is currently only used to create borders and by WindowsInternalFrameTitlePane for painting title foregound. The return value is already cached in those places.


getColor

public Color getColor(XPStyle.Skin skin,
                      TMSchema.Prop prop,
                      Color fallback)
Get a named Color value from the current style

Returns:
a Color or null if key is not found in the current style

getBorder

public Border getBorder(Component c,
                        TMSchema.Part part)
Get a named Border value from the current style

Parameters:
part - a Part
Returns:
a Border or null if key is not found in the current style or if the style for the particular part is not defined as "borderfill".

isSkinDefined

public boolean isSkinDefined(Component c,
                             TMSchema.Part part)

getSkin

public XPStyle.Skin getSkin(Component c,
                            TMSchema.Part part)
Get a Skin object from the current style for a named part (component type)

Parameters:
part - a Part
Returns:
a Skin object

JIDE 3.5.15