public class Line extends Roi
| Modifier and Type | Field and Description |
|---|---|
protected double |
startxd |
protected double |
startyd |
int |
x1 |
double |
x1d |
protected double |
x1R |
int |
x2 |
double |
x2d |
protected double |
x2R |
int |
y1 |
double |
y1d |
protected double |
y1R |
int |
y2 |
double |
y2d |
protected double |
y2R |
ANGLE, asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, defaultFillColor, fillColor, FREELINE, FREEROI, HANDLE_SIZE, handleColor, ic, ignoreClipRect, imp, instanceColor, LINE, lineWidth, mag, MOVING, MOVING_HANDLE, nonScalable, NORMAL, NOT_PASTING, oldHeight, oldWidth, oldX, oldY, onePixelWide, OVAL, overlay, pasteMode, POINT, POLYGON, POLYLINE, previousRoi, RECTANGLE, RESIZING, ROIColor, stroke, strokeColor, TRACED_ROI, type, updateFullWindow, wideLine, xMax, yMax| Constructor and Description |
|---|
Line(double ox1,
double oy1,
double ox2,
double oy2)
Creates a new straight line selection using the specified
starting and ending offscreen double coordinates.
|
Line(int sx,
int sy,
ImagePlus imp)
Starts the process of creating a new user-generated straight line
selection.
|
Line(int ox1,
int oy1,
int ox2,
int oy2)
Creates a new straight line selection using the specified
starting and ending offscreen integer coordinates.
|
Line(int ox1,
int oy1,
int ox2,
int oy2,
ImagePlus imp)
Deprecated.
replaced by Line(int, int, int, int)
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
clipRectMargin() |
boolean |
contains(int x,
int y) |
void |
draw(java.awt.Graphics g)
Draws this line on the image.
|
protected void |
drawLine(int sx,
int sy) |
void |
drawPixels(ImageProcessor ip)
Draws the selection outline on the specified ImageProcessor.
|
double |
getAngle()
Overridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle).
|
java.awt.Rectangle |
getBounds()
Return the bounding rectangle of this line.
|
boolean |
getDrawOffset()
Returns true if this is a PolygonRoi that supports sub-pixel
resolution and polygons are drawn on zoomed images offset
down and to the right by 0.5 pixels..
|
FloatPolygon |
getFloatPoints()
Returns, as a FloatPolygon, the two points that define this line.
|
FloatPolygon |
getFloatPolygon()
If the width of this line is less than or equal to one, returns the
starting and ending coordinates as a 2-point FloatPolygon, or, if
the width is greater than one, returns an outline of the line as
a 4-point FloatPolygon.
|
double |
getLength()
Returns the length of this line.
|
double[] |
getPixels()
Returns the pixel values along this line.
|
java.awt.Polygon |
getPoints()
Returns, as a Polygon, the two points that define this line.
|
java.awt.Polygon |
getPolygon()
If the width of this line is less than or equal to one, returns the
starting and ending coordinates as a 2-point Polygon, or, if
the width is greater than one, returns an outline of the line as
a 4-point Polygon.
|
double |
getRawLength()
Returns the length of this line in pixels.
|
static int |
getWidth() |
protected void |
grow(int sx,
int sy) |
protected void |
handleMouseDown(int sx,
int sy) |
protected void |
handleMouseUp(int screenX,
int screenY) |
int |
isHandle(int sx,
int sy)
Returns a handle number if the specified screen coordinates are
inside or near a handle, otherwise returns -1.
|
protected void |
mouseDownInHandle(int handle,
int sx,
int sy) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
protected void |
moveHandle(int sx,
int sy) |
void |
nudgeCorner(int key)
Nudge end point of line by one pixel.
|
void |
setDrawOffset(boolean drawOffset) |
void |
setLocation(int x,
int y)
Set the location of the ROI in image coordinates.
|
void |
setStrokeWidth(float width)
Sets the width of the line used to draw this ROI.
|
static void |
setWidth(int w) |
boolean |
subPixelResolution()
Always returns true.
|
abortPaste, addRoiListener, clone, copyAttributes, drawOverlay, drawPixels, enableSubPixelResolution, endPaste, equals, getAngle, getBoundingRect, getColor, getConvexHull, getCornerDiameter, getCPosition, getCurrentPasteMode, getDebugInfo, getDefaultFillColor, getFeretsDiameter, getFeretValues, getFillColor, getFloatAngle, getFloatBounds, getFloatHeight, getFloatWidth, getHashCode, getImage, getImageID, getInterpolatedPolygon, getInterpolatedPolygon, getInterpolatedPolygon, getMagnification, getMask, getName, getPasteMode, getPosition, getProperties, getProperty, getPropertyCount, getPrototypeOverlay, getRoundRectArcSize, getScaledStroke, getState, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getTypeAsString, getXBase, getYBase, getZPosition, handleMouseDrag, isActiveOverlayRoi, isArea, isDrawingTool, isLine, isVisible, lineCircleIntersection, mouseDragged, mouseReleased, notifyListeners, nudge, removeRoiListener, screenX, screenXD, screenY, screenYD, setColor, setCornerDiameter, setDefaultFillColor, setFillColor, setIgnoreClipRect, setImage, setInstanceColor, setLineWidth, setLocation, setName, setNonScalable, setPasteMode, setPosition, setPosition, setProperties, setProperty, setPrototypeOverlay, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, showStatus, startPaste, temporarilyHide, toFloat, toInt, toInt, toIntR, toString, update, updateClipRect, updateWideLinepublic int x1
public int y1
public int x2
public int y2
public double x1d
public double y1d
public double x2d
public double y2d
protected double x1R
protected double y1R
protected double x2R
protected double y2R
protected double startxd
protected double startyd
public Line(int ox1,
int oy1,
int ox2,
int oy2)
public Line(double ox1,
double oy1,
double ox2,
double oy2)
public Line(int sx,
int sy,
ImagePlus imp)
public Line(int ox1,
int oy1,
int ox2,
int oy2,
ImagePlus imp)
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in class Roiprotected void handleMouseUp(int screenX,
int screenY)
handleMouseUp in class Roiprotected void drawLine(int sx,
int sy)
protected void moveHandle(int sx,
int sy)
moveHandle in class Roiprotected void mouseDownInHandle(int handle,
int sx,
int sy)
mouseDownInHandle in class Roipublic void draw(java.awt.Graphics g)
public double getAngle()
Roipublic double getLength()
public double getRawLength()
public double[] getPixels()
public java.awt.Polygon getPoints()
public FloatPolygon getFloatPoints()
public java.awt.Polygon getPolygon()
getPolygon in class RoigetFloatPolygon(),
getPoints()public FloatPolygon getFloatPolygon()
getFloatPolygon in class RoigetFloatPoints()public void drawPixels(ImageProcessor ip)
RoidrawPixels in class RoiImageProcessor.setColor(java.awt.Color),
ImageProcessor.setLineWidth(int)protected void handleMouseDown(int sx,
int sy)
handleMouseDown in class Roipublic int isHandle(int sx,
int sy)
public static int getWidth()
public static void setWidth(int w)
public void setStrokeWidth(float width)
RoisetStrokeWidth in class RoiRoi.setStrokeColor(Color),
ImagePlus.setOverlay(ij.gui.Overlay)public java.awt.Rectangle getBounds()
protected int clipRectMargin()
clipRectMargin in class Roipublic void nudgeCorner(int key)
nudgeCorner in class Roipublic boolean getDrawOffset()
RoigetDrawOffset in class Roipublic void setDrawOffset(boolean drawOffset)
setDrawOffset in class Roipublic boolean subPixelResolution()
subPixelResolution in class Roipublic void setLocation(int x,
int y)
RoisetLocation in class Roi