|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectij.gui.Roi
ij.gui.Line
public class Line
This class represents a straight line selection.
| Field Summary | |
|---|---|
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
|
| Fields inherited from class ij.gui.Roi |
|---|
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 Summary | |
|---|---|
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) |
|
| Method Summary | |
|---|---|
protected int |
clipRectMargin()
|
boolean |
contains(int x,
int y)
|
void |
draw(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). |
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. |
Polygon |
getPoints()
Returns, as a Polygon, the two points that define this line. |
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(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 |
setStrokeWidth(float width)
Sets the width of the line used to draw this ROI. |
static void |
setWidth(int w)
|
boolean |
subPixelResolution()
Always returns true. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public 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
| Constructor Detail |
|---|
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)
| Method Detail |
|---|
protected void grow(int sx,
int sy)
grow in class Roipublic void mouseMoved(MouseEvent e)
mouseMoved in class Roi
protected void handleMouseUp(int screenX,
int screenY)
handleMouseUp in class Roi
protected void drawLine(int sx,
int sy)
protected void moveHandle(int sx,
int sy)
moveHandle in class Roi
protected void mouseDownInHandle(int handle,
int sx,
int sy)
mouseDownInHandle in class Roipublic void draw(Graphics g)
draw in class Roipublic double getAngle()
Roi
getAngle in class Roipublic double getLength()
getLength in class Roipublic double getRawLength()
public double[] getPixels()
public Polygon getPoints()
public FloatPolygon getFloatPoints()
public Polygon getPolygon()
getPolygon in class RoigetFloatPolygon(),
getPoints()public FloatPolygon getFloatPolygon()
getFloatPolygon in class RoigetFloatPoints()public void drawPixels(ImageProcessor ip)
Roi
drawPixels in class RoiImageProcessor.setColor(java.awt.Color),
ImageProcessor.setLineWidth(int)
public boolean contains(int x,
int y)
contains in class Roi
protected void handleMouseDown(int sx,
int sy)
handleMouseDown in class Roi
public int isHandle(int sx,
int sy)
isHandle in class Roipublic static int getWidth()
public static void setWidth(int w)
public void setStrokeWidth(float width)
Roi
setStrokeWidth in class RoiRoi.setStrokeColor(Color),
ImagePlus.setOverlay(ij.gui.Overlay)public Rectangle getBounds()
getBounds in class Roiprotected int clipRectMargin()
clipRectMargin in class Roipublic void nudgeCorner(int key)
nudgeCorner in class Roipublic boolean getDrawOffset()
Roi
getDrawOffset in class Roipublic void setDrawOffset(boolean drawOffset)
setDrawOffset in class Roipublic boolean subPixelResolution()
subPixelResolution in class Roi
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||