|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.lbs.maps.view.Style
public class Style
Represents a set of properties that define how an element should be drawn.
The properties that are currently controlled by this class include:
Constants that represent values for style properties are defined using
the pattern PROPERTY_VALUE. For example,
EDGE_SIZE_VERY_SMALL is a constant that represents a very small
edge size property. A value of INHERIT means that the property's
value will be inherited from another style (from the class level, from the
default values, and so on). A value of NULL means that the
property will not be displayed. For example, EDGE_SIZE_NULL
means that no edge will be drawn.
To define a property as inherited, you can pass one of the
*_INHERIT constants to the appropriate setter method in this
class. For example, to define the label font style as inherited, you can
invoke setLabelFontStyle(Style.FONT_STYLE_INHERIT).
| Field Summary | ||
|---|---|---|
static int |
COLOR_INHERIT
Indicates that the color is inherited. |
|
static int |
EDGE_SIZE_INHERIT
Indicates that the edge size is inherited. |
|
static int |
EDGE_SIZE_LARGE
Indicates that the edge size is large. |
|
static int |
EDGE_SIZE_MEDIUM
Indicates that the edge size is medium. |
|
static int |
EDGE_SIZE_NULL
Indicates that the edge is not drawn. |
|
static int |
EDGE_SIZE_SMALL
Indicates that the edge size is small. |
|
static int |
EDGE_SIZE_VERY_LARGE
Indicates that the edge size is very large. |
|
static int |
EDGE_SIZE_VERY_SMALL
Indicates that the edge size is very small. |
|
static int |
FONT_ALIGNMENT_CENTERED
Indicates that the font alignment is centered. |
|
static int |
FONT_ALIGNMENT_DEFAULT
Indicates that the font alignment is set to the default value. |
|
static int |
FONT_ALIGNMENT_INHERIT
Indicates that the font alignment is inherited. |
|
static int |
FONT_ALIGNMENT_LEFT
Indicates that the font alignment is left-aligned. |
|
static int |
FONT_ALIGNMENT_RIGHT
Indicates that the font alignment is right-aligned. |
|
static int |
FONT_STYLE_INHERIT
Indicates that the font style is inherited. |
|
static String |
LABEL_FONT_FAMILY_NAME_INHERIT
Indicates that the label font family name is inherited. |
|
static int |
LABEL_FONT_SIZE_INHERIT
Indicates that the label font size is inherited. |
|
static int |
LABEL_FONT_SIZE_NO_CHANGE
Indicates that the label font size is not changed. |
|
static int |
OPACITY_INHERIT
Indicates that the opacity is inherited. |
|
| Constructor Summary | ||
|---|---|---|
Style()
Constructs a new Style instance. |
||
| Method Summary | ||
|---|---|---|
void |
applyFillAsForegroundStyle(Graphics g)
Applies the fill characteristics of this style to the foreground properties of the specified Graphics object. |
|
void |
applyForegroundStyle(Graphics g)
Applies the edge characteristics of this style to the specified Graphics object. |
|
void |
applyLabelFontStyle(Graphics g)
Applies the label characteristics of this style to the specified Graphics object. |
|
int |
getEdgeColor()
Retrieves the edge color of this style. |
|
int |
getEdgeOpacity()
Retrieves the edge opacity of this style. |
|
int |
getEdgeSize()
Retrieves the edge size of this style. |
|
int |
getFillColor()
Retrieves the fill color of this style. |
|
int |
getFillOpacity()
Retrieves the fill opacity of this style. |
|
int |
getLabelFillColor()
Retrieves the label fill color of this style. |
|
int |
getLabelFillOpacity()
Retrieves the label fill opacity of this style. |
|
int |
getLabelFontAlignment()
Retrieves the label font alignment of this style. |
|
int |
getLabelFontColor()
Retrieves the label font color of this style. |
|
String |
getLabelFontFamilyName()
Retrieves the label font family name of this style. |
|
int |
getLabelFontOpacity()
Retrieves the label font opacity of this style. |
|
int |
getLabelFontSize()
Retrieves the label font size of this style. |
|
int |
getLabelFontStyle()
Retrieves the label font style of this style. |
|
void |
restoreGraphics(Graphics g)
Restores the specified Graphics object to the state that
is defined by this style. |
|
void |
setEdgeColor(int edgeColor)
Sets the edge color of this style. |
|
void |
setEdgeOpacity(int edgeOpacity)
Sets the edge opacity of this style. |
|
void |
setEdgeSize(int edgeSize)
Sets the edge size of this style. |
|
void |
setFillColor(int fillColor)
Sets the fill color of this style. |
|
void |
setFillOpacity(int fillOpacity)
Sets the fill opacity of this style. |
|
void |
setLabelFillColor(int labelFillColor)
Sets the label fill color of this style. |
|
void |
setLabelFillOpacity(int labelFillOpacity)
Sets the label fill opacity of this style. |
|
void |
setLabelFontAlignment(int labelFontAlignment)
Sets the label font alignment of this style. |
|
void |
setLabelFontColor(int labelFontColor)
Sets the label font color of this style. |
|
void |
setLabelFontFamilyName(String labelFontFamilyName)
Sets the label font family name of this style. |
|
void |
setLabelFontOpacity(int labelFontOpacity)
Sets the label font opacity of this style. |
|
void |
setLabelFontSize(int labelFontSize)
Sets the label font size of this style. |
|
void |
setLabelFontStyle(int labelFontStyle)
Sets the label font style of this style. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int EDGE_SIZE_INHERIT
public static final int EDGE_SIZE_NULL
public static final int EDGE_SIZE_VERY_SMALL
public static final int EDGE_SIZE_SMALL
public static final int EDGE_SIZE_MEDIUM
public static final int EDGE_SIZE_LARGE
public static final int EDGE_SIZE_VERY_LARGE
public static final int COLOR_INHERIT
public static final int OPACITY_INHERIT
public static final int FONT_STYLE_INHERIT
public static final int LABEL_FONT_SIZE_INHERIT
public static final int LABEL_FONT_SIZE_NO_CHANGE
public static final String LABEL_FONT_FAMILY_NAME_INHERIT
public static final int FONT_ALIGNMENT_INHERIT
public static final int FONT_ALIGNMENT_CENTERED
public static final int FONT_ALIGNMENT_LEFT
public static final int FONT_ALIGNMENT_RIGHT
public static final int FONT_ALIGNMENT_DEFAULT
| Constructor Detail |
|---|
public Style()
Style instance.
| Method Detail |
|---|
public int getEdgeColor()
public void setEdgeColor(int edgeColor)
edgeColor - The edge color to set.public int getEdgeSize()
public void setEdgeSize(int edgeSize)
edgeSize - The edge size to set.public int getEdgeOpacity()
public void setEdgeOpacity(int edgeOpacity)
edgeOpacity - The edge opacity to set.public int getFillColor()
public void setFillColor(int fillColor)
fillColor - The fill color to set.public int getFillOpacity()
public void setFillOpacity(int fillOpacity)
fillOpacity - The fill opacity to set.public String getLabelFontFamilyName()
Style.LABEL_FONT_FAMILY_NAME_INHERIT if the font family is inherited.public void setLabelFontFamilyName(String labelFontFamilyName)
labelFontFamilyName - The label font family name to set.public int getLabelFontSize()
public void setLabelFontSize(int labelFontSize)
labelFontSize - The label font size to set.public int getLabelFontColor()
public void setLabelFontColor(int labelFontColor)
labelFontColor - The label font color to set.public int getLabelFontOpacity()
public void setLabelFontOpacity(int labelFontOpacity)
labelFontOpacity - The label font opacity to set.public int getLabelFontStyle()
public void setLabelFontStyle(int labelFontStyle)
labelFontStyle - The label font style to set.Fontpublic int getLabelFontAlignment()
public void setLabelFontAlignment(int labelFontAlignment)
labelFontAlignment - The label font alignment to set.public int getLabelFillColor()
public void setLabelFillColor(int labelFillColor)
labelFillColor - The label fill color to set.public int getLabelFillOpacity()
public void setLabelFillOpacity(int labelFillOpacity)
labelFillOpacity - The label fill opacity to set.public void applyForegroundStyle(Graphics g)
Graphics object.
This method assumes that none of this style's properties are defined as inherited.
g - The Graphics object to apply the changes to.public void applyFillAsForegroundStyle(Graphics g)
Graphics object.
This method assumes that none of this style's properties are defined as inherited.
g - The Graphics object to apply the changes to.public void applyLabelFontStyle(Graphics g)
Graphics object.
This method assumes that none of this style's properties except the font style are defined as inherited.
g - The Graphics object to apply the changes to.public void restoreGraphics(Graphics g)
Graphics object to the state that
is defined by this style.
This method is designed to work with
StyleUtils.generateStyleFromForegroundGraphics(Graphics).
g - The Graphics object to apply this style to.StyleUtils.generateStyleFromForegroundGraphics(Graphics)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal