net.rim.device.api.lbs.maps.view
Class Style

java.lang.Object
  extended by net.rim.device.api.lbs.maps.view.Style
All Implemented Interfaces:
Persistable

public class Style
extends Object
implements Persistable

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).

Since:
BlackBerry API 7.0.0

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

EDGE_SIZE_INHERIT

public static final int EDGE_SIZE_INHERIT
Indicates that the edge size is inherited.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

EDGE_SIZE_NULL

public static final int EDGE_SIZE_NULL
Indicates that the edge is not drawn.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

EDGE_SIZE_VERY_SMALL

public static final int EDGE_SIZE_VERY_SMALL
Indicates that the edge size is very small.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

EDGE_SIZE_SMALL

public static final int EDGE_SIZE_SMALL
Indicates that the edge size is small.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

EDGE_SIZE_MEDIUM

public static final int EDGE_SIZE_MEDIUM
Indicates that the edge size is medium.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

EDGE_SIZE_LARGE

public static final int EDGE_SIZE_LARGE
Indicates that the edge size is large.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

EDGE_SIZE_VERY_LARGE

public static final int EDGE_SIZE_VERY_LARGE
Indicates that the edge size is very large.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

COLOR_INHERIT

public static final int COLOR_INHERIT
Indicates that the color is inherited.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

OPACITY_INHERIT

public static final int OPACITY_INHERIT
Indicates that the opacity is inherited.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

FONT_STYLE_INHERIT

public static final int FONT_STYLE_INHERIT
Indicates that the font style is inherited.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

LABEL_FONT_SIZE_INHERIT

public static final int LABEL_FONT_SIZE_INHERIT
Indicates that the label font size is inherited.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

LABEL_FONT_SIZE_NO_CHANGE

public static final int LABEL_FONT_SIZE_NO_CHANGE
Indicates that the label font size is not changed.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

LABEL_FONT_FAMILY_NAME_INHERIT

public static final String LABEL_FONT_FAMILY_NAME_INHERIT
Indicates that the label font family name is inherited.

Since:
BlackBerry API 7.0.0

FONT_ALIGNMENT_INHERIT

public static final int FONT_ALIGNMENT_INHERIT
Indicates that the font alignment is inherited.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

FONT_ALIGNMENT_CENTERED

public static final int FONT_ALIGNMENT_CENTERED
Indicates that the font alignment is centered.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

FONT_ALIGNMENT_LEFT

public static final int FONT_ALIGNMENT_LEFT
Indicates that the font alignment is left-aligned.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

FONT_ALIGNMENT_RIGHT

public static final int FONT_ALIGNMENT_RIGHT
Indicates that the font alignment is right-aligned.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

FONT_ALIGNMENT_DEFAULT

public static final int FONT_ALIGNMENT_DEFAULT
Indicates that the font alignment is set to the default value.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0


Constructor Detail

Style

public Style()
Constructs a new Style instance.

Since:
BlackBerry API 7.0.0


Method Detail

getEdgeColor

public int getEdgeColor()
Retrieves the edge color of this style.

Returns:
The edge color.
Since:
BlackBerry API 7.0.0

setEdgeColor

public void setEdgeColor(int edgeColor)
Sets the edge color of this style.

Parameters:
edgeColor - The edge color to set.
Since:
BlackBerry API 7.0.0

getEdgeSize

public int getEdgeSize()
Retrieves the edge size of this style.

Returns:
The edge size.
Since:
BlackBerry API 7.0.0

setEdgeSize

public void setEdgeSize(int edgeSize)
Sets the edge size of this style.

Parameters:
edgeSize - The edge size to set.
Since:
BlackBerry API 7.0.0

getEdgeOpacity

public int getEdgeOpacity()
Retrieves the edge opacity of this style.

Returns:
The edge opacity.
Since:
BlackBerry API 7.0.0

setEdgeOpacity

public void setEdgeOpacity(int edgeOpacity)
Sets the edge opacity of this style.

Parameters:
edgeOpacity - The edge opacity to set.
Since:
BlackBerry API 7.0.0

getFillColor

public int getFillColor()
Retrieves the fill color of this style.

Returns:
The fill color.
Since:
BlackBerry API 7.0.0

setFillColor

public void setFillColor(int fillColor)
Sets the fill color of this style.

Parameters:
fillColor - The fill color to set.
Since:
BlackBerry API 7.0.0

getFillOpacity

public int getFillOpacity()
Retrieves the fill opacity of this style.

Returns:
The fill opacity.
Since:
BlackBerry API 7.0.0

setFillOpacity

public void setFillOpacity(int fillOpacity)
Sets the fill opacity of this style.

Parameters:
fillOpacity - The fill opacity to set.
Since:
BlackBerry API 7.0.0

getLabelFontFamilyName

public String getLabelFontFamilyName()
Retrieves the label font family name of this style.

Returns:
The label font family name, or Style.LABEL_FONT_FAMILY_NAME_INHERIT if the font family is inherited.
Since:
BlackBerry API 7.0.0

setLabelFontFamilyName

public void setLabelFontFamilyName(String labelFontFamilyName)
Sets the label font family name of this style.

Parameters:
labelFontFamilyName - The label font family name to set.
Since:
BlackBerry API 7.0.0

getLabelFontSize

public int getLabelFontSize()
Retrieves the label font size of this style.

Returns:
The label font size.
Since:
BlackBerry API 7.0.0

setLabelFontSize

public void setLabelFontSize(int labelFontSize)
Sets the label font size of this style.

Parameters:
labelFontSize - The label font size to set.
Since:
BlackBerry API 7.0.0

getLabelFontColor

public int getLabelFontColor()
Retrieves the label font color of this style.

Returns:
The label font color.
Since:
BlackBerry API 7.0.0

setLabelFontColor

public void setLabelFontColor(int labelFontColor)
Sets the label font color of this style.

Parameters:
labelFontColor - The label font color to set.
Since:
BlackBerry API 7.0.0

getLabelFontOpacity

public int getLabelFontOpacity()
Retrieves the label font opacity of this style.

Returns:
The label font opacity.
Since:
BlackBerry API 7.0.0

setLabelFontOpacity

public void setLabelFontOpacity(int labelFontOpacity)
Sets the label font opacity of this style.

Parameters:
labelFontOpacity - The label font opacity to set.
Since:
BlackBerry API 7.0.0

getLabelFontStyle

public int getLabelFontStyle()
Retrieves the label font style of this style.

Returns:
The label font style.
Since:
BlackBerry API 7.0.0

setLabelFontStyle

public void setLabelFontStyle(int labelFontStyle)
Sets the label font style of this style.

Parameters:
labelFontStyle - The label font style to set.
See Also:
Font
Since:
BlackBerry API 7.0.0

getLabelFontAlignment

public int getLabelFontAlignment()
Retrieves the label font alignment of this style.

Returns:
The label font alignment.
Since:
BlackBerry API 7.0.0

setLabelFontAlignment

public void setLabelFontAlignment(int labelFontAlignment)
Sets the label font alignment of this style.

Parameters:
labelFontAlignment - The label font alignment to set.
Since:
BlackBerry API 7.0.0

getLabelFillColor

public int getLabelFillColor()
Retrieves the label fill color of this style.

Returns:
The label fill color.
Since:
BlackBerry API 7.0.0

setLabelFillColor

public void setLabelFillColor(int labelFillColor)
Sets the label fill color of this style.

Parameters:
labelFillColor - The label fill color to set.
Since:
BlackBerry API 7.0.0

getLabelFillOpacity

public int getLabelFillOpacity()
Retrieves the label fill opacity of this style.

Returns:
The label fill opacity.
Since:
BlackBerry API 7.0.0

setLabelFillOpacity

public void setLabelFillOpacity(int labelFillOpacity)
Sets the label fill opacity of this style.

Parameters:
labelFillOpacity - The label fill opacity to set.
Since:
BlackBerry API 7.0.0

applyForegroundStyle

public void applyForegroundStyle(Graphics g)
Applies the edge characteristics of this style to the specified Graphics object.

This method assumes that none of this style's properties are defined as inherited.

Parameters:
g - The Graphics object to apply the changes to.
Since:
BlackBerry API 7.0.0

applyFillAsForegroundStyle

public void applyFillAsForegroundStyle(Graphics g)
Applies the fill characteristics of this style to the foreground properties of the specified Graphics object.

This method assumes that none of this style's properties are defined as inherited.

Parameters:
g - The Graphics object to apply the changes to.
Since:
BlackBerry API 7.0.0

applyLabelFontStyle

public void applyLabelFontStyle(Graphics g)
Applies the label characteristics of this style to the specified Graphics object.

This method assumes that none of this style's properties except the font style are defined as inherited.

Parameters:
g - The Graphics object to apply the changes to.
Since:
BlackBerry API 7.0.0

restoreGraphics

public void restoreGraphics(Graphics g)
Restores the specified Graphics object to the state that is defined by this style.

This method is designed to work with StyleUtils.generateStyleFromForegroundGraphics(Graphics).

Parameters:
g - The Graphics object to apply this style to.
See Also:
StyleUtils.generateStyleFromForegroundGraphics(Graphics)
Since:
BlackBerry API 7.0.0





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