public class Polyline extends HomeObject implements Selectable, Elevatable
Modifier and Type | Class and Description |
---|---|
static class |
Polyline.ArrowStyle |
static class |
Polyline.CapStyle |
static class |
Polyline.DashStyle |
static class |
Polyline.JoinStyle |
static class |
Polyline.Property
The properties of a polyline that may change.
|
Constructor and Description |
---|
Polyline(float[][] points)
Creates a polyline from the given coordinates.
|
Polyline(float[][] points,
float thickness,
Polyline.CapStyle capStyle,
Polyline.JoinStyle joinStyle,
Polyline.DashStyle dashStyle,
Polyline.ArrowStyle startArrowStyle,
Polyline.ArrowStyle endArrowStyle,
boolean closedPath,
int color)
Creates a polyline from the given coordinates.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(float x,
float y)
Adds a point at the end of polyline points.
|
void |
addPoint(float x,
float y,
int index)
Adds a point at the given
index . |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds the property change
listener in parameter to this wall. |
Polyline |
clone()
Returns a clone of this polyline.
|
boolean |
containsPoint(float x,
float y,
float margin)
Returns
true if this polyline contains
the point at (x , y ) with a given margin . |
Polyline.CapStyle |
getCapStyle()
Returns the cap style of this polyline.
|
int |
getColor()
Returns the color of this polyline.
|
Polyline.DashStyle |
getDashStyle()
Returns the dash style of this polyline.
|
Polyline.ArrowStyle |
getEndArrowStyle()
Returns the arrow style at the end of this polyline.
|
Polyline.JoinStyle |
getJoinStyle()
Returns the join style of this polyline.
|
float |
getLength()
Returns an approximate length of this polyline.
|
Level |
getLevel()
Returns the level which this dimension line belongs to.
|
int |
getPointCount()
Returns the number of points of the polygon matching this polyline.
|
int |
getPointIndexAt(float x,
float y,
float margin)
Returns the index of the point of this polyline equal to
the point at (
x , y ) with a given margin . |
float[][] |
getPoints()
Returns the points of the polygon matching this polyline.
|
Polyline.ArrowStyle |
getStartArrowStyle()
Returns the arrow style at the start of this polyline.
|
float |
getThickness()
Returns the thickness of this polyline.
|
boolean |
intersectsRectangle(float x0,
float y0,
float x1,
float y1)
Returns
true if this polyline intersects
with the horizontal rectangle which opposite corners are at points
(x0 , y0 ) and (x1 , y1 ). |
boolean |
isAtLevel(Level level)
Returns
true if this dimension line is at the given level
or at a level with the same elevation and a smaller elevation index. |
boolean |
isClosedPath()
Returns
true if the first and last points of this polyline should be joined to form a polygon. |
void |
move(float dx,
float dy)
Moves this polyline of (
dx , dy ) units. |
void |
removePoint(int index)
Removes the point at the given
index . |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the property change
listener in parameter from this wall. |
void |
setCapStyle(Polyline.CapStyle capStyle)
Sets the cap style of this polyline.
|
void |
setClosedPath(boolean closedPath)
Sets whether the first and last points of this polyline should be joined.
|
void |
setColor(int color)
Sets the color of this polyline.
|
void |
setDashStyle(Polyline.DashStyle dashStyle)
Sets the dash style of this polyline.
|
void |
setEndArrowStyle(Polyline.ArrowStyle endArrowStyle)
Sets the arrow style at the end of this polyline.
|
void |
setJoinStyle(Polyline.JoinStyle joinStyle)
Sets the join style of this polyline.
|
void |
setLevel(Level level)
Sets the level of this dimension line.
|
void |
setPoint(float x,
float y,
int index)
Sets the point at the given
index . |
void |
setPoints(float[][] points)
Sets the points of the polygon matching this polyline.
|
void |
setStartArrowStyle(Polyline.ArrowStyle startArrowStyle)
Sets the arrow style at the start of this polyline.
|
void |
setThickness(float thickness)
Sets the thickness of this polyline.
|
getProperty, getPropertyNames, setProperty
public Polyline(float[][] points)
public Polyline(float[][] points, float thickness, Polyline.CapStyle capStyle, Polyline.JoinStyle joinStyle, Polyline.DashStyle dashStyle, Polyline.ArrowStyle startArrowStyle, Polyline.ArrowStyle endArrowStyle, boolean closedPath, int color)
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
in parameter to this wall.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
in parameter from this wall.public float[][] getPoints()
getPoints
in interface Selectable
public int getPointCount()
public void setPoints(float[][] points)
public void addPoint(float x, float y)
public void addPoint(float x, float y, int index)
index
.IndexOutOfBoundsException
- if index
is negative or > getPointCount()
public void setPoint(float x, float y, int index)
index
.IndexOutOfBoundsException
- if index
is negative or >= getPointCount()
public void removePoint(int index)
index
.IndexOutOfBoundsException
- if index
is negative or >= getPointCount()
public float getThickness()
public void setThickness(float thickness)
public Polyline.CapStyle getCapStyle()
public void setCapStyle(Polyline.CapStyle capStyle)
public Polyline.JoinStyle getJoinStyle()
public void setJoinStyle(Polyline.JoinStyle joinStyle)
public Polyline.DashStyle getDashStyle()
public void setDashStyle(Polyline.DashStyle dashStyle)
public Polyline.ArrowStyle getStartArrowStyle()
public void setStartArrowStyle(Polyline.ArrowStyle startArrowStyle)
public Polyline.ArrowStyle getEndArrowStyle()
public void setEndArrowStyle(Polyline.ArrowStyle endArrowStyle)
public boolean isClosedPath()
true
if the first and last points of this polyline should be joined to form a polygon.public void setClosedPath(boolean closedPath)
public int getColor()
public void setColor(int color)
public Level getLevel()
getLevel
in interface Elevatable
public void setLevel(Level level)
public boolean isAtLevel(Level level)
true
if this dimension line is at the given level
or at a level with the same elevation and a smaller elevation index.isAtLevel
in interface Elevatable
public float getLength()
public boolean intersectsRectangle(float x0, float y0, float x1, float y1)
true
if this polyline intersects
with the horizontal rectangle which opposite corners are at points
(x0
, y0
) and (x1
, y1
).intersectsRectangle
in interface Selectable
public boolean containsPoint(float x, float y, float margin)
true
if this polyline contains
the point at (x
, y
) with a given margin
.containsPoint
in interface Selectable
public int getPointIndexAt(float x, float y, float margin)
x
, y
) with a given margin
.public void move(float dx, float dy)
dx
, dy
) units.move
in interface Selectable
public Polyline clone()
clone
in interface Selectable
clone
in class HomeObject
© Copyrights 2006-2016 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License