geofasc.swing.model
public class DefaultPolylineModel extends DefaultFigureModel implements PolylineModel
DefaultPolylineModel is the default implementation of
PolylineModel. This class is inherited from
DefaultFigureModel.| Constructor and Description |
|---|
DefaultPolylineModel() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addPoint(int x,
int y)
Adds a point to this model's poly[gon|line].
|
boolean |
addPoint(int index,
int x,
int y)
Adds a point to this model's poly[gon|line] at the specified index.
|
boolean |
addPoint(int index,
Point point)
Adds a point to this model's poly[gon|line] at the specified index.
|
boolean |
addPoint(Point point)
Adds a point to this model's poly[gon|line].
|
Rectangle |
getBounds()
Gets the bounds (size and location) of this model's figure.
|
int |
getIndexOfPoint(int x,
int y)
Gets the index of the point of this model's poly[gon|line] with the given
coordinates.
|
int |
getIndexOfPoint(Point point)
Gets the index of the point of this model's poly[gon|line].
|
int |
getNumberOfPoints()
Gets the total number of points defining this model's poly[gon|line].
|
Point |
getPoint(int index)
Gets the point of this model's poly[gon|line] with the given index.
|
Point[] |
getPoints()
Gets all points of this model's poly[gon|line].
|
int[] |
getXPoints()
Gets all x-locations of all points of this model's poly[gon|line].
|
int[] |
getYPoints()
Gets all y-locations of all points of this model's poly[gon|line].
|
boolean |
isClosed()
Determines whether this model's polyline is closed.
|
boolean |
removePoint(int index)
Removes the point with the given index from this model's poly[gon|line].
|
boolean |
removePoint(int x,
int y)
Removes the point with the given coordinates from this model's
poly[gon|line].
|
boolean |
removePoint(Point point)
Removes the given point from this model's poly[gon|line].
|
Point |
setPoint(int index,
int x,
int y)
Substitutes the point with the given index by a new one.
|
Point |
setPoint(int index,
Point point)
Substitutes the point with the given index by a new one.
|
boolean |
setPoints(Point[] points)
Substitutes all the points of this model's poly[gon|line].
|
Polygon |
toAWTPolygon() |
addChangeListener, getBounds, getDirection, getFillColor, getHeight, getLineColor, getLocation, getLocationX, getLocationY, getSize, getWidth, isFilled, moveLocationBy, moveLocationBy, moveLocationBy, moveLocationXBy, moveLocationYBy, removeChangeListener, setDirection, setFillColor, setFilled, setLineColor, setLocation, setLocation, setLocationX, setLocationY, turnDirectionBy, turnDirectionToequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, getBounds, getDirection, getFillColor, getHeight, getLineColor, getLocation, getLocationX, getLocationY, getSize, getWidth, isFilled, moveLocationBy, moveLocationBy, moveLocationBy, moveLocationXBy, moveLocationYBy, removeChangeListener, setDirection, setFillColor, setFilled, setLineColor, setLocation, setLocation, setLocationX, setLocationY, turnDirectionBy, turnDirectionTopublic boolean addPoint(int x,
int y)
addPoint in interface PolylineModelx - the x-location of the new pointy - the y-location of the new pointpublic boolean addPoint(int index,
int x,
int y)
addPoint in interface PolylineModelindex - the index the new point is added tox - the x-location of the new pointy - the y-location of the new pointpublic boolean addPoint(int index,
Point point)
addPoint in interface PolylineModelindex - the index the new point is added topoint - the new pointpublic boolean addPoint(Point point)
addPoint in interface PolylineModelpoint - the new pointpublic Rectangle getBounds()
DefaultFigureModelgetBounds in interface FigureModelgetBounds in class DefaultFigureModelFigureModel.getBounds(Rectangle),
FigureModel.getLocation(),
FigureModel.getSize()public int getIndexOfPoint(int x,
int y)
getIndexOfPoint in interface PolylineModelx - the x-location of the pointy - the y-location of the pointpublic int getIndexOfPoint(Point point)
getIndexOfPoint in interface PolylineModelpoint - the point whose index is computedpublic int getNumberOfPoints()
getNumberOfPoints in interface PolylineModelpublic Point getPoint(int index)
getPoint in interface PolylineModelindex - the index of the pointpublic Point[] getPoints()
getPoints in interface PolylineModelpublic int[] getXPoints()
getXPoints in interface PolylineModelpublic int[] getYPoints()
getYPoints in interface PolylineModelpublic boolean isClosed()
isClosed in interface PolylineModelpublic boolean removePoint(int index)
removePoint in interface PolylineModelindex - the index of the point to removepublic boolean removePoint(int x,
int y)
removePoint in interface PolylineModelx - the x-location of the pointy - the y-location of the pointpublic boolean removePoint(Point point)
removePoint in interface PolylineModelpoint - the point to removepublic Point setPoint(int index, int x, int y)
setPoint in interface PolylineModelindex - the index of the point to be substitutedx - the x-locationy - the y-locationpublic Point setPoint(int index, Point point)
setPoint in interface PolylineModelindex - the index of the point to be substitutedpoint - the new pointpublic boolean setPoints(Point[] points)
setPoints in interface PolylineModelpoints - the new pointspublic Polygon toAWTPolygon()
toAWTPolygon in interface PolylineModel