|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gwtopenmaps.openlayers.client.util.JSObjectWrapper
org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper
org.gwtopenmaps.openlayers.client.Style
public class Style
From OpenLayers documentation: "OpenLayers features can have a number of style attributes. The 'default' style will typically be used if no other style is specified. These styles correspond for the most part, to the styling properties defined by the SVG standard. Information on fill properties: http://www.w3.org/TR/SVG/painting.html#FillProperties Information on stroke properties: http://www.w3.org/TR/SVG/painting.html#StrokeProperties"
Field Summary | |
---|---|
static String |
STROKE_DASHSTYLE_DASHDOT
|
static String |
STROKE_DASHSTYLE_SOLID
|
Constructor Summary | |
---|---|
|
Style()
|
protected |
Style(JSObject element)
|
|
Style(String string)
This constructor is to be used when you want to get an empty Style object, instead of a Style initialized to default. |
Method Summary | |
---|---|
String |
getBackgroundGraphic()
Url to a graphic to be used as the background under an externalGraphic. |
int |
getBackgroundGraphicZIndex()
The integer z-index value to use in rendering the background graphic. |
int |
getBackgroundHeight()
The height of the background graphic. |
int |
getBackgroundWidth()
The width of the background width. |
String |
getCursor()
Cursor. |
String |
getExternalGraphic()
Url to an external graphic that will be used for rendering points. |
boolean |
getFill()
Set to false if no fill is desired. |
String |
getFillColor()
Hex fill color. |
double |
getFillOpacity()
Fill opacity (0-1). |
boolean |
getGraphic()
Set to false if no graphic is desired. |
int |
getGraphicHeight()
Pixel height for sizing an external graphic. |
String |
getGraphicName()
Named graphic to use when rendering points. |
String |
getGraphicTitle()
Tooltip for an external graphic. |
int |
getGraphicWidth()
Pixel width for sizing an external graphic. |
int |
getGraphicZIndex()
The integer z-index value to use in rendering. |
String |
getId()
|
String |
getLabelAlign()
Vertical Label alignment. |
String |
getName()
|
double |
getPointRadius()
Deprecated. |
double |
getPointRadiusAsDouble()
Pixel point radius. |
String |
getPointRadiusAsString()
The name of the attribute which value determines the point radius |
String |
getRotation()
Url to an external graphic that will be used for rendering points. |
boolean |
getStroke()
Set to false if no stroke is desired. |
String |
getStrokeColor()
Hex stroke html color. |
String |
getStrokeDashstyle()
Stroke dash style. |
String |
getStrokeLinecap()
Stroke linecap. |
double |
getStrokeOpacity()
|
double |
getStrokeWidth()
Pixel stroke width. |
static Style |
narrowToOpenLayersStyle(JSObject element)
|
void |
setBackgroundGraphic(String graphicURL)
Url to a graphic to be used as the background under an externalGraphic. |
void |
setBackgroundGraphicSize(int backgroundWidth,
int backgroundHeight)
Sets the size of the background graphic. |
void |
setBackgroundGraphicZIndex(int backgroundGraphicZIndex)
The integer z-index value to use in rendering the background graphic. |
void |
setBackgroundHeight(int backgroundHeight)
The height of the background graphic. |
void |
setBackgroundOffset(int backgroundXOffset,
int backgroundYOffset)
Sets the offset for the displacement of the background graphic. |
void |
setBackgroundWidth(int backgroundWidth)
The width of the background width. |
void |
setCursor(String cursor)
Cursor. |
void |
setExternalGraphic(String graphicURL)
Url to an external graphic that will be used for rendering points. |
void |
setFill(boolean fill)
Set to false if no fill is desired. |
void |
setFillColor(String c)
Hex fill color. |
void |
setFillOpacity(double o)
Fill opacity (0-1). |
void |
setFontColor(String fontColor)
The font color for the label, to be provided like CSS. |
void |
setFontFamily(String fontFamily)
The font family for the label, to be provided like in CSS. |
void |
setFontSize(String fontSize)
The font size for the label, to be provided like in CSS. |
void |
setFontWeight(String fontWeight)
The font weight for the label, to be provided like in CSS. |
void |
setGraphic(boolean graphic)
Set to false if no graphic is desired. |
void |
setGraphicName(String graphicName)
Directly sets the named graphic to use when rendering points. |
void |
setGraphicOffset(int xOffset,
int yOffset)
Sets the offset for the displacement of the external graphic. |
void |
setGraphicSize(int width,
int height)
Convenient method to set the pixel width and height for sizing an external graphic. |
void |
setGraphicTitle(String graphicTitle)
Tooltip for an external graphic. |
void |
setGraphicZIndex(int graphicZIndex)
The integer z-index value to use in rendering. |
void |
setLabel(String label)
The text for an optional label. |
void |
setLabelAlign(String align)
Sets the Label alignment string directly. |
void |
setPointRadius(double r)
Pixel point radius. |
void |
setPointRadius(String r)
The passed String is the name of the attribute whose value will determine the point radius |
void |
setRotation(String rotation)
Url to an external graphic that will be used for rendering points. |
void |
setStroke(boolean stroke)
Set to false if no stroke is desired. |
void |
setStrokeColor(String c)
Hex stroke color. |
void |
setStrokeDashstyle(String strokeDashstyle)
Directly sets the stroke dash style string. |
void |
setStrokeLinecap(String strokeLinecap)
Directly sets the StrokeLineCap string. |
void |
setStrokeOpacity(double strokeOpacity)
Stroke opacity (0-1). |
void |
setStrokeWidth(double w)
Pixel stroke width. |
Methods inherited from class org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper |
---|
getClassName, getEvents, narrowToOpenLayersObjectWrapper |
Methods inherited from class org.gwtopenmaps.openlayers.client.util.JSObjectWrapper |
---|
getJSObject, setJSObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String STROKE_DASHSTYLE_SOLID
public static final String STROKE_DASHSTYLE_DASHDOT
Constructor Detail |
---|
protected Style(JSObject element)
public Style()
public Style(String string)
Style emptyStyle = new Style("{}");
- Parameters:
string
- The JSON representation of the properties used to initialize the Style object
Method Detail |
---|
public String getId()
public String getName()
public void setFillColor(String c)
c
- - hexidecimal color code or a W3C standard color namepublic String getFillColor()
public void setFillOpacity(double o)
public double getFillOpacity()
public void setPointRadius(double r)
public double getPointRadiusAsDouble()
@Deprecated public double getPointRadius()
public void setPointRadius(String r)
public String getPointRadiusAsString()
public void setStrokeColor(String c)
c
- - see setFillColorpublic String getStrokeColor()
public void setStrokeWidth(double w)
public double getStrokeWidth()
public void setExternalGraphic(String graphicURL)
public String getExternalGraphic()
public void setRotation(String rotation)
public String getRotation()
public void setGraphicSize(int width, int height)
width
- The width (in pixels) to setheight
- The height (in pixels) to setpublic int getGraphicWidth()
public int getGraphicHeight()
public void setGraphicOffset(int xOffset, int yOffset)
xOffset
- Pixel offset along the positive x axis for displacing an
external graphic.yOffset
- Pixel offset along the positive y axis for displacing an
external graphic.public void setBackgroundGraphicSize(int backgroundWidth, int backgroundHeight)
backgroundWidth
- The width of the background width.backgroundHeight
- The height of the background graphic.public void setBackgroundHeight(int backgroundHeight)
public int getBackgroundHeight()
public void setBackgroundWidth(int backgroundWidth)
public int getBackgroundWidth()
public void setBackgroundGraphic(String graphicURL)
public String getBackgroundGraphic()
public void setBackgroundOffset(int backgroundXOffset, int backgroundYOffset)
backgroundXOffset
- Pixel offset along the positive x axis for displacing an
background graphic.backgroundYOffset
- Pixel offset along the positive y axis for displacing an
background graphic.public void setGraphicZIndex(int graphicZIndex)
public int getGraphicZIndex()
public void setBackgroundGraphicZIndex(int backgroundGraphicZIndex)
public int getBackgroundGraphicZIndex()
public void setStrokeOpacity(double strokeOpacity)
public double getStrokeOpacity()
public void setLabel(String label)
Note: you can set a custom label for each feature added to a layer by
using tags in the label, and setting attributes using
Attributes
. For example, set the style.label to
"${customLabel}", then, for each feature added to the layer, add an
"customLabel" attribute with
attributes.setAttribute("customLabel","myLabel for this specific feature")
Note: this can also be used in any style field of type String, such as fillColor, fontColor, etc
public void setFontColor(String fontColor)
public void setFontSize(String fontSize)
public void setFontFamily(String fontFamily)
public void setFontWeight(String fontWeight)
public void setLabelAlign(String align)
The first character is for the horizontal alignment, the second for the vertical alignment.
Valid values for horizontal alignment: 'l'=left, 'c'=center, 'r'=right. Valid values for vertical alignment: 't'=top, 'm'=middle, 'b'=bottom. Example values: 'lt', 'cm', 'rb'. The canvas renderer does not support vertical alignment, it will always use 'b'.
public String getLabelAlign()
public String getStrokeLinecap()
public void setStrokeLinecap(String strokeLinecap)
public void setStrokeDashstyle(String strokeDashstyle)
public String getStrokeDashstyle()
public void setFill(boolean fill)
public boolean getFill()
public void setStroke(boolean stroke)
public boolean getStroke()
public void setGraphic(boolean graphic)
public boolean getGraphic()
public void setCursor(String cursor)
public String getCursor()
public void setGraphicName(String graphicName)
Supported values include 'circle' (default), 'square', 'star', 'x', 'cross', 'triangle'.
public String getGraphicName()
public void setGraphicTitle(String graphicTitle)
public String getGraphicTitle()
public static Style narrowToOpenLayersStyle(JSObject element)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |