public class SimpleLineStyle extends AbstractStyle implements CartographicSupport, ISimpleLineStyle
http://www.oreilly.com/catalog/java2d/chapter/ch04.html| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleLineStyle.RegisterPersistence |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SIMPLE_LINE_STYLE_PERSISTENCE_DEFINITION_NAME |
STYLE_PERSISTENCE_DEFINITION_NAMEPAPER, WORLD| Constructor and Description |
|---|
SimpleLineStyle()
Constructor method
|
SimpleLineStyle(float width,
int cap,
int join,
float miterlimit,
float[] dash,
float dash_phase)
Constructor method
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Creates a copy of the object.
|
void |
drawInsideRectangle(java.awt.Graphics2D g,
java.awt.Rectangle r)
Useful to render the symbol inside the TOC, or inside little
rectangles.
|
void |
drawOutline(java.awt.Graphics2D g,
java.awt.Rectangle r)
Used to show an outline of the style to graphically show its properties.
|
IArrowDecoratorStyle |
getArrowDecorator()
Gets the arrow decorator style that has the line
|
double |
getCartographicSize(ViewPort viewPort,
double dpi,
Geometry geom)
Gets the size (in pixels) of the cartographic element according
to the current rendering context (output dpi, map scale, map units) and the
symbol cartgraphic settings (unit, size, and unit reference system).
|
java.lang.String |
getClassName() |
float |
getLineWidth()
Returns the width of the line
|
double |
getOffset()
Returns the offset of the line
|
int |
getReferenceSystem()
Returns the Reference System used to draw the elements of the image.
|
java.awt.Stroke |
getStroke()
Returns the stroke of the line
|
int |
getUnit()
Returns the unit used to express measures.
|
boolean |
isSuitableFor(ISymbol symbol)
True if this symbol is ok for the style or class.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setArrowDecorator(IArrowDecoratorStyle arrowDecoratorStyle)
Sets the arrow decorator style of the line
|
void |
setCartographicSize(double cartographicSize,
Geometry geom)
Sets the size of the cartographic element in pixels.
|
void |
setLineWidth(float width)
Establishes the width of the line
|
void |
setOffset(double offset)
Establishes the offset of the line
|
void |
setReferenceSystem(int referenceSystem)
Sets the Reference System that defines how this units have to be
handled.
|
void |
setStroke(java.awt.Stroke stroke)
Sets the stroke of the line
|
void |
setUnit(int unitIndex)
Defines the unit used to express measures.
|
double |
toCartographicSize(ViewPort viewPort,
double dpi,
Geometry geom)
Computes and sets the size (in pixels) of the cartographic element according
to the current rendering context (output dpi, map scale, map units) and the
symbol cartgraphic settings (unit, size, and unit reference system).
|
getDescription, setDescriptionequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDescription, setDescriptionpublic static final java.lang.String SIMPLE_LINE_STYLE_PERSISTENCE_DEFINITION_NAME
public SimpleLineStyle()
public SimpleLineStyle(float width,
int cap,
int join,
float miterlimit,
float[] dash,
float dash_phase)
width - cap - join - miterlimit - dash - dash_phase - public void drawInsideRectangle(java.awt.Graphics2D g,
java.awt.Rectangle r)
IStyledrawInsideRectangle in interface IStyleg - Graphics2Dr - Rectanglepublic java.lang.String getClassName()
public java.awt.Stroke getStroke()
ILineStylegetStroke in interface ILineStylepublic float getLineWidth()
ILineStylegetLineWidth in interface ILineStylepublic void setLineWidth(float width)
ILineStylesetLineWidth in interface ILineStylewidth - of the linepublic boolean isSuitableFor(ISymbol symbol)
IStyleisSuitableFor in interface IStylesymbol - ISymbolpublic void setStroke(java.awt.Stroke stroke)
ILineStylesetStroke in interface ILineStylepublic void drawOutline(java.awt.Graphics2D g,
java.awt.Rectangle r)
IStyledrawOutline in interface IStylepublic double getOffset()
ILineStylegetOffset in interface ILineStylepublic void setOffset(double offset)
ILineStylesetOffset in interface ILineStylepublic IArrowDecoratorStyle getArrowDecorator()
ILineStylegetArrowDecorator in interface ILineStylepublic void setArrowDecorator(IArrowDecoratorStyle arrowDecoratorStyle)
ILineStylesetArrowDecorator in interface ILineStylepublic void setUnit(int unitIndex)
CartographicSupportsetUnit in interface CartographicSupportpublic int getUnit()
CartographicSupportgetUnit in interface CartographicSupportpublic int getReferenceSystem()
CartographicSupport
The elements have to be scaled to pixel when the image is bein drawn in
order to compose the map. The elements of the map may define its size in
other units than pixel.
CartographicSupport enables the elements to define the size in
measure units but these units may refer to different reference system. Two
kinds of Reference Systems are allowed in this context: CartographicSupport.WORLD,
and CartographicSupport.PAPER.
Depending on which Reference System is used the unit used by this element
refers to distances in the real world (then they are map's CRS-dependant)
or screen or printer output (then they are output DPI-dependant)
In case the unit used is pixel then the reference system does not
have any effect since the source unit is the same than the target unit.
getReferenceSystem in interface CartographicSupportpublic void setReferenceSystem(int referenceSystem)
CartographicSupportsetReferenceSystem in interface CartographicSupportpublic double toCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupporttoCartographicSize in interface CartographicSupportpublic void setCartographicSize(double cartographicSize,
Geometry geom)
CartographicSupportsetCartographicSize in interface CartographicSupportpublic double getCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupportgetCartographicSize in interface CartographicSupportpublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Cloneableclone in class AbstractStylejava.lang.CloneNotSupportedException - if the instance of the object cannot
be cloned. As this is extending Cloneable so
its sure it implements it, so this exception may be used for problems
on specific object instances.Object#clone()}.public void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentloadFromState in class AbstractStylePersistenceExceptionpublic void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentsaveToState in class AbstractStylePersistenceException