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, turnDirectionTo
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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, turnDirectionTo
public Point getFirstPoint()
getFirstPoint
in interface LineSegmentModel
LineSegmentModel.getFirstPointX()
,
LineSegmentModel.getFirstPointY()
public int getFirstPointX()
getFirstPointX
in interface LineSegmentModel
LineSegmentModel.getFirstPointY()
,
LineSegmentModel.getFirstPoint()
public int getFirstPointY()
getFirstPointY
in interface LineSegmentModel
LineSegmentModel.getFirstPointX()
,
LineSegmentModel.getFirstPoint()
public int getLength()
getLength
in interface LineSegmentModel
public Point getSecondPoint()
getSecondPoint
in interface LineSegmentModel
LineSegmentModel.getSecondPointX()
,
LineSegmentModel.getSecondPointY()
public int getSecondPointX()
getSecondPointX
in interface LineSegmentModel
LineSegmentModel.getSecondPointY()
,
LineSegmentModel.getSecondPoint()
public int getSecondPointY()
getSecondPointY
in interface LineSegmentModel
LineSegmentModel.getSecondPointX()
,
LineSegmentModel.getSecondPoint()
public boolean isFilled()
isFilled
in interface FigureModel
isFilled
in class DefaultFigureModel
FigureModel.setFilled(boolean)
,
FigureModel.setFillColor(Color)
public void setFirstPoint(int x, int y)
setFirstPoint
in interface LineSegmentModel
x
- the new x-locationy
- the new y-locationLineSegmentModel.setFirstPoint(Point)
,
LineSegmentModel.setFirstPointX(int)
,
LineSegmentModel.setFirstPointY(int)
public void setFirstPoint(Point firstPoint)
setFirstPoint
in interface LineSegmentModel
firstPoint
- the new first pointLineSegmentModel.setFirstPoint(int, int)
,
LineSegmentModel.setFirstPointX(int)
,
LineSegmentModel.setFirstPointY(int)
public void setFirstPointX(int x)
setFirstPointX
in interface LineSegmentModel
x
- the new x-locationLineSegmentModel.setFirstPointY(int)
,
LineSegmentModel.setFirstPoint(Point)
,
LineSegmentModel.setFirstPoint(int, int)
public void setFirstPointY(int y)
setFirstPointY
in interface LineSegmentModel
y
- the new y-locationLineSegmentModel.setFirstPointX(int)
,
LineSegmentModel.setFirstPoint(Point)
,
LineSegmentModel.setFirstPoint(int, int)
public void setSecondPoint(int x, int y)
setSecondPoint
in interface LineSegmentModel
x
- 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 LineSegmentModel
secondPoint
- the new second pointLineSegmentModel.setSecondPoint(int, int)
,
LineSegmentModel.setSecondPointX(int)
,
LineSegmentModel.setSecondPointY(int)
public void setSecondPointX(int x)
setSecondPointX
in interface LineSegmentModel
x
- the new x-locationLineSegmentModel.setSecondPointY(int)
,
LineSegmentModel.setSecondPoint(Point)
,
LineSegmentModel.setSecondPoint(int, int)
public void setSecondPointY(int y)
setSecondPointY
in interface LineSegmentModel
y
- the new y-locationLineSegmentModel.setSecondPointX(int)
,
LineSegmentModel.setSecondPoint(Point)
,
LineSegmentModel.setSecondPoint(int, int)
public Rectangle getBounds()
DefaultFigureModel
getBounds
in interface FigureModel
getBounds
in class DefaultFigureModel
FigureModel.getBounds(Rectangle)
,
FigureModel.getLocation()
,
FigureModel.getSize()