Package com.jidesoft.plaf.windows
Class XPStyle
- java.lang.Object
-
- com.jidesoft.plaf.windows.XPStyle
-
public class XPStyle extends java.lang.ObjectImplements Windows XP Styles for the Windows Look and Feel.- Author:
- Leif Samuelsson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXPStyle.SkinA class which encapsulates attributes for a given part (component type) and which provides methods for painting backgrounds and glyphs
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.border.BordergetBorder(java.awt.Component c, TMSchema.Part part)Get a namedBordervalue from the current stylejava.awt.ColorgetColor(XPStyle.Skin skin, TMSchema.Prop prop, java.awt.Color fallback)Get a namedColorvalue from the current stylejava.awt.DimensiongetDimension(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)Get a namedDimensionvalue from the current styleintgetInt(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop, int fallback)Get a namedintvalue from the current stylejava.awt.InsetsgetMargin(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)Get a namedInsetsvalue from the current stylejava.awt.PointgetPoint(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)Get a namedPoint(e.g.XPStyle.SkingetSkin(java.awt.Component c, TMSchema.Part part)Get aSkinobject from the current style for a named part (component type)java.lang.StringgetString(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)Get a namedStringvalue from the current styleTMSchema.TypeEnumgetTypeEnum(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)static XPStylegetXP()Get the singleton instance of this classstatic voidinvalidateStyle()Static method for clearing the hashmap and loading the current XP style and themebooleanisSkinDefined(java.awt.Component c, TMSchema.Part part)static booleanisVista()
-
-
-
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 java.lang.String getString(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)Get a namedStringvalue from the current style- Parameters:
part- aPartstate- aStringprop- aString- Returns:
- a
Stringor 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(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)
-
getInt
public int getInt(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop, int fallback)Get a namedintvalue from the current style- Parameters:
part- aPart- Returns:
- an
intor null if key is not found in the current style
-
getDimension
public java.awt.Dimension getDimension(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)Get a namedDimensionvalue from the current style- Returns:
- a
Dimensionor 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 java.awt.Point getPoint(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)Get a namedPoint(e.g. a location or an offset) value from the current style- Returns:
- a
Pointor 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 java.awt.Insets getMargin(java.awt.Component c, TMSchema.Part part, TMSchema.State state, TMSchema.Prop prop)Get a namedInsetsvalue from the current style- Returns:
- an
Insetsobject 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 java.awt.Color getColor(XPStyle.Skin skin, TMSchema.Prop prop, java.awt.Color fallback)
Get a namedColorvalue from the current style- Returns:
- a
Coloror null if key is not found in the current style
-
getBorder
public javax.swing.border.Border getBorder(java.awt.Component c, TMSchema.Part part)Get a namedBordervalue from the current style- Parameters:
part- aPart- Returns:
- a
Borderor 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(java.awt.Component c, TMSchema.Part part)
-
getSkin
public XPStyle.Skin getSkin(java.awt.Component c, TMSchema.Part part)
Get aSkinobject from the current style for a named part (component type)- Parameters:
part- aPart- Returns:
- a
Skinobject
-
-