public class LineROI extends AbstractROIShape
LineROI represents a straight line between two points.| Modifier and Type | Field and Description |
|---|---|
private Point2D |
endPoint
The end point of the line.
|
private double |
length
The length of the object.
|
private static long |
serialVersionUID
The UID for serialization.
|
private Point2D |
startPoint
The start point of the line.
|
SEG_CLOSE, SEG_CUBICTO, SEG_LINETO, SEG_MOVETO, SEG_QUADTO, WIND_EVEN_ODD, WIND_NON_ZERO| Modifier | Constructor and Description |
|---|---|
private |
LineROI(Area a)
A private constructor using an
Area object. |
|
LineROI(Point2D start,
Point2D end)
Constructs a new line using start and end point.
|
|
LineROI(Shape s)
A public constructor using a
Shape object. |
| Modifier and Type | Method and Description |
|---|---|
void |
calculateEndpoints()
Calculate the start and end point of the segment.
|
void |
calculateLength()
Calculates and sets the length of this shape.
|
Point2D |
getEndPoint()
Returns the coordinates of the last path segment.
|
double |
getLength() |
Point2D |
getStartPoint()
Get the first segment and return the start point.
|
void |
setEndPoint(Point2D endPoint) |
void |
setLength(double length) |
void |
setStartPoint(Point2D startPoint) |
String |
toString() |
getBoundaryCenter, getPathIterator, isClosed, segmentCodeToString, windingRuleToStringadd, contains, contains, contains, contains, contains, contains, contains, contains, exclusiveOr, getAsBitmask, getAsImage, getAsRectangleList, getAsRectangleList, getAsShape, getBounds, getBounds2D, intersect, intersects, intersects, intersects, intersects, subtract, transformprivate static final long serialVersionUID
private double length
private Point2D startPoint
private Point2D endPoint
private LineROI(Area a)
Area object. NOTE: this
constructor should not be used for a line object.a - public double getLength()
public void setLength(double length)
length - the length to setpublic void calculateLength()
public void calculateEndpoints()
public void setStartPoint(Point2D startPoint)
public Point2D getStartPoint()
AbstractROIShapegetStartPoint in class AbstractROIShapepublic void setEndPoint(Point2D endPoint)
public Point2D getEndPoint()
AbstractROIShapegetEndPoint in class AbstractROIShapeCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.