public class ShapeDecorator extends java.lang.Object implements Revertable
Modifier and Type | Field and Description |
---|---|
static double |
FLATNESS
The flatness used for Shape.getPathIterator()
|
Constructor and Description |
---|
ShapeDecorator()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDecoration(ShapeDecoration decoration)
Adds a Decoration at the end of the list.
|
void |
draw(java.awt.Graphics g,
float[] xcoords,
float[] ycoords)
Draws a decorated polyline
|
void |
draw(java.awt.Graphics g,
int[] xcoords,
int[] ycoords)
Draws a decorated polyline
|
protected void |
draw(java.awt.Graphics g,
java.util.LinkedList points)
Draws a decorated polyline Calls ShapeDecoration.draw(...) for
each decoration on an subsetted polyline with the same length
than the decoration, cycling until all the path is consumed.
|
void |
draw(java.awt.Graphics g,
java.awt.geom.Point2D[] points)
Draws a decorated polyline
|
void |
draw(java.awt.Graphics g,
java.awt.Shape s)
Draws a decorated shape
|
java.util.List<ShapeDecoration> |
getDecorations()
Returns the decorations.
|
void |
insertDecoration(int index,
ShapeDecoration decoration)
Inserts a Decoration.
|
ShapeDecoration |
removeDecoration(int index)
Removes a Decoration.
|
boolean |
removeDecoration(ShapeDecoration decoration)
Removes a Decoration.
|
void |
revert()
Reverts all the decorations
|
public java.util.List<ShapeDecoration> getDecorations()
public void insertDecoration(int index, ShapeDecoration decoration)
index
- the index where to insert the new decorationdecoration
- the new decorationpublic void addDecoration(ShapeDecoration decoration)
decoration
- the new decorationpublic ShapeDecoration removeDecoration(int index)
index
- the index of the Decoration to be removedpublic boolean removeDecoration(ShapeDecoration decoration)
decoration
- the decoration to removepublic void revert()
revert
in interface Revertable
Revertable.revert()
public void draw(java.awt.Graphics g, java.awt.Shape s)
g
- the Graphics to uses
- the shape to renderpublic void draw(java.awt.Graphics g, float[] xcoords, float[] ycoords)
g
- the Graphics to usexcoords
- array of x floating coordinatesycoords
- array of y floating coordinatespublic void draw(java.awt.Graphics g, int[] xcoords, int[] ycoords)
g
- the Graphics to usexcoords
- array of x integer coordinatesycoords
- array of y integer coordinatespublic void draw(java.awt.Graphics g, java.awt.geom.Point2D[] points)
g
- the Graphics to usepoints
- array of pointsprotected void draw(java.awt.Graphics g, java.util.LinkedList points)
g
- the Graphics to usepoints
- array of points (instances of Point2D)Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details