|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.micello.mapapi.data.MStyle
public class MStyle
This class holds the styling information for rendering a geometry. This includes the body color, the outline color and width and the text color.
There are three main types of geometry on the map. Area geometry has a fill color given by the body color and an stroke given by outline width and outline color. Line is rendered as a stroke, with a color given by the body color and a width given by the outline width. Linear area geometry is rendered as a stroke with the color given by the body color and the width defined by the geometry itself. The width for a linear geometry represents an actual phyiscal width, as opposed to the width in a line geometry which is purely symbolic.
To configure the paint objects for these different geometry, some initialization methods
should be called before an object is rendered: configGeomCoordType to set the
object type and configPhysicalWidth or configStrokeWidth to set the stroke
characteristics.
| Constructor Summary | |
|---|---|
MStyle(java.lang.Integer bodyColor,
java.lang.Integer outlineColor,
float outlineWidth,
java.lang.Integer textColor)
Constructor. |
|
| Method Summary | |
|---|---|
void |
configGeomCoordType(int type)
This method should be called before rendering to make sure the body color is properly configured |
void |
configPhysicalWidth(float width)
This method configures the render width to match a physical width in map coordinates. |
void |
configStrokeWidth(float zoomScale,
boolean useOutlinePaint)
This method configures the render width to match a fixed stroke width, accounting for the current zoom scale. |
Paint |
getBodyPaint()
This mehod returns that paint that should be used for the body. |
Paint |
getOutlinePaint()
This method returns the paint that should be used for the outline. |
Paint |
getTextPaint()
This method returns the paint that should be used for the text. |
boolean |
hasWidth()
This method returns true if the style has an outline associated with it. |
static MStyle |
load(JSONObject json)
This method loads the style from a JSON object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MStyle(java.lang.Integer bodyColor,
java.lang.Integer outlineColor,
float outlineWidth,
java.lang.Integer textColor)
| Method Detail |
|---|
public Paint getBodyPaint()
public Paint getOutlinePaint()
public Paint getTextPaint()
public boolean hasWidth()
public void configPhysicalWidth(float width)
public void configStrokeWidth(float zoomScale,
boolean useOutlinePaint)
public void configGeomCoordType(int type)
public static MStyle load(JSONObject json)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||