geofasc.swing.model
public class DefaultLineSegmentModel extends DefaultFigureModel implements LineSegmentModel
DefaultLineSegmentModel is the default implementation of
LineSegmentModel. This class is inherited from
DefaultFigureModel.| Constructor and Description |
|---|
DefaultLineSegmentModel() |
| Modifier and Type | Method and Description |
|---|---|
Rectangle |
getBounds()
Gets the bounds (size and location) of this model's figure.
|
Point |
getFirstPoint()
Gets the first point of this model's line segment (the coordinates of the
point refer to the coordinate system of this model's line segment).
|
int |
getFirstPointX()
Gets the x-location of the first point of this model's line segment (the
coordinate refers to the coordinate system of this model's line segment).
|
int |
getFirstPointY()
Gets the y-location of the first point of this model's line segment (the
coordinate refers to the coordinate system of this model's line segment).
|
int |
getLength()
Gets the length of this model's line segment.
|
Point |
getSecondPoint()
Gets the second point of this model's line segment (the coordinates of
the point refer to the coordinate system of this model's line segment).
|
int |
getSecondPointX()
Gets the x-location of the second point of this model's line segment (the
coordinate refers to the coordinate system of this model's line segment).
|
int |
getSecondPointY()
Gets the y-location of the second point of this model's line segment (the
coordinate refers to the coordinate system of this model's line segment).
|
boolean |
isFilled()
Determines whether this model's figure is filled when it is drawn.
|
void |
setFirstPoint(int x,
int y)
Sets the first point of this model's line segment (the coordinates refer
to the coordinate system of this model's line segment).
|
void |
setFirstPoint(Point firstPoint)
Sets the first point of this model's line segment (the coordinates of the
point refer to the coordinate system of this model's line segment).
|
void |
setFirstPointX(int x)
Sets the x-location of the first point of this model's line segment (the
coordinate refers to the coordinate system of this model's line segment).
|
void |
setFirstPointY(int y)
Sets the y-location of the first point of this model's line segment (the
coordinate refers to the coordinate system of this model's line segment).
|
void |
setSecondPoint(int x,
int y)
Sets the second point of this model's line segment (the coordinates refer
to the coordinate system of this model's line segment).
|
void |
setSecondPoint(Point secondPoint)
Sets the second point of this model's line segment (the coordinates of
the point refer to the coordinate system of this model's line segment).
|
void |
setSecondPointX(int x)
Sets the x-location of the second point of this model's line segment (the
coordinate refers to the coordinate system of this model's line segment).
|
void |
setSecondPointY(int y)
Sets the y-location of the second point of this model's line segment (the
coordinate refers to the coordinate system of this model's line segment).
|
addChangeListener, getBounds, getDirection, getFillColor, getHeight, getLineColor, getLocation, getLocationX, getLocationY, getSize, getWidth, 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, moveLocationBy, moveLocationBy, moveLocationBy, moveLocationXBy, moveLocationYBy, removeChangeListener, setDirection, setFillColor, setFilled, setLineColor, setLocation, setLocation, setLocationX, setLocationY, turnDirectionBy, turnDirectionTopublic Point getFirstPoint()
getFirstPoint in interface LineSegmentModelLineSegmentModel.getFirstPointX(),
LineSegmentModel.getFirstPointY()public int getFirstPointX()
getFirstPointX in interface LineSegmentModelLineSegmentModel.getFirstPointY(),
LineSegmentModel.getFirstPoint()public int getFirstPointY()
getFirstPointY in interface LineSegmentModelLineSegmentModel.getFirstPointX(),
LineSegmentModel.getFirstPoint()public int getLength()
getLength in interface LineSegmentModelpublic Point getSecondPoint()
getSecondPoint in interface LineSegmentModelLineSegmentModel.getSecondPointX(),
LineSegmentModel.getSecondPointY()public int getSecondPointX()
getSecondPointX in interface LineSegmentModelLineSegmentModel.getSecondPointY(),
LineSegmentModel.getSecondPoint()public int getSecondPointY()
getSecondPointY in interface LineSegmentModelLineSegmentModel.getSecondPointX(),
LineSegmentModel.getSecondPoint()public boolean isFilled()
isFilled in interface FigureModelisFilled in class DefaultFigureModelFigureModel.setFilled(boolean),
FigureModel.setFillColor(Color)public void setFirstPoint(int x,
int y)
setFirstPoint in interface LineSegmentModelx - the new x-locationy - the new y-locationLineSegmentModel.setFirstPoint(Point),
LineSegmentModel.setFirstPointX(int),
LineSegmentModel.setFirstPointY(int)public void setFirstPoint(Point firstPoint)
setFirstPoint in interface LineSegmentModelfirstPoint - the new first pointLineSegmentModel.setFirstPoint(int, int),
LineSegmentModel.setFirstPointX(int),
LineSegmentModel.setFirstPointY(int)public void setFirstPointX(int x)
setFirstPointX in interface LineSegmentModelx - the new x-locationLineSegmentModel.setFirstPointY(int),
LineSegmentModel.setFirstPoint(Point),
LineSegmentModel.setFirstPoint(int, int)public void setFirstPointY(int y)
setFirstPointY in interface LineSegmentModely - the new y-locationLineSegmentModel.setFirstPointX(int),
LineSegmentModel.setFirstPoint(Point),
LineSegmentModel.setFirstPoint(int, int)public void setSecondPoint(int x,
int y)
setSecondPoint in interface LineSegmentModelx - the new x-location of the second pointy - the new y-location of the second pointLineSegmentModel.setSecondPoint(Point),
LineSegmentModel.setSecondPointX(int),
LineSegmentModel.setSecondPointY(int)public void setSecondPoint(Point secondPoint)
setSecondPoint in interface LineSegmentModelsecondPoint - the new second pointLineSegmentModel.setSecondPoint(int, int),
LineSegmentModel.setSecondPointX(int),
LineSegmentModel.setSecondPointY(int)public void setSecondPointX(int x)
setSecondPointX in interface LineSegmentModelx - the new x-locationLineSegmentModel.setSecondPointY(int),
LineSegmentModel.setSecondPoint(Point),
LineSegmentModel.setSecondPoint(int, int)public void setSecondPointY(int y)
setSecondPointY in interface LineSegmentModely - the new y-locationLineSegmentModel.setSecondPointX(int),
LineSegmentModel.setSecondPoint(Point),
LineSegmentModel.setSecondPoint(int, int)public Rectangle getBounds()
DefaultFigureModelgetBounds in interface FigureModelgetBounds in class DefaultFigureModelFigureModel.getBounds(Rectangle),
FigureModel.getLocation(),
FigureModel.getSize()