|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij.gui.AbstractRoi
ij.gui.AttributeRoi
ij.gui.Roi
ij.gui.Line
public class Line
This class represents a straight line selection.
Field Summary | |
---|---|
int |
x1
|
double |
x1d
|
int |
x2
|
double |
x2d
|
int |
y1
|
double |
y1d
|
int |
y2
|
double |
y2d
|
Fields inherited from class ij.gui.Roi |
---|
onePixelWide, previousRoi, roundRect |
Fields inherited from interface ij.gui.RoiConstance |
---|
ADD_TO_ROI, ANGLE, COMPOSITE, CONSTRUCTING, DRAW_HANDLE, EVT_HANDLE_SIZE, FILL_HANDLE, FREELINE, FREEROI, HANDLE_SIZE, LINE, MOVING, MOVING_HANDLE, MOVING_ROUNDRECT_HANDLE, NO_MODS, NORMAL, NOT_PASTING, OVAL, POINT, POLYGON, POLYLINE, RECTANGLE, RESIZING, SUBTRACT_FROM_ROI, TRACED_ROI |
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 | |
---|---|
boolean |
contains(int x,
int y)
|
void |
draw(java.awt.Graphics g)
Draws this line on the image. |
void |
drawPixels(ImageProcessor ip)
Draws the selection outline on the specified ImageProcessor. |
java.awt.Rectangle |
getBounds()
Return the bounding rectangle of this line. |
double |
getLength()
Returns the length of this line. |
double[] |
getPixels()
Returns the pixel values along this line. |
java.awt.Polygon |
getPolygon()
Returns the outline of this selection as a Polygon, or null if this is a straight line selection. |
double |
getRawLength()
Returns the length of this line in pixels. |
static int |
getWidth()
|
int |
isHandle(int sx,
int sy)
Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1. |
void |
nudgeCorner(int key)
Nudge end point of line by one pixel. |
void |
setStrokeWidth(float width)
Sets the width of the line used to draw this ROI. |
static void |
setWidth(int w)
|
Methods inherited from class ij.gui.AttributeRoi |
---|
copyAttributes, getAngle, getColor, getConvexHull, getCPosition, getDefaultFillColor, getFeretsDiameter, getFeretValues, getFillColor, getImage, getImageID, getName, getPosition, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getZPosition, setColor, setDefaultFillColor, setFillColor, setName, setPosition, setPosition, setStroke, setStrokeColor, setStrokeWidth |
Methods inherited from class java.lang.Object |
---|
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
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 |
---|
public void draw(java.awt.Graphics g)
draw
in interface RoiBeans
draw
in class Roi
public double getLength()
getLength
in interface RoiBeans
getLength
in class Roi
public double getRawLength()
public double[] getPixels()
public java.awt.Polygon getPolygon()
Roi
getPolygon
in interface RoiBeans
getPolygon
in class Roi
ImageProcessor.setRoi(java.awt.Rectangle)
,
ImageProcessor.drawPolygon(java.awt.Polygon)
,
ImageProcessor.fillPolygon(java.awt.Polygon)
public void drawPixels(ImageProcessor ip)
Roi
drawPixels
in interface RoiBeans
drawPixels
in class Roi
ImageProcessor.setColor(java.awt.Color)
,
ImageProcessor.setLineWidth(int)
public boolean contains(int x, int y)
contains
in interface RoiBeans
contains
in class Roi
public int isHandle(int sx, int sy)
isHandle
in interface RoiBeans
isHandle
in class Roi
public static int getWidth()
public static void setWidth(int w)
public void setStrokeWidth(float width)
AttributeRoi
setStrokeWidth
in interface RoiBeans
setStrokeWidth
in class AttributeRoi
AttributeRoi.setStrokeColor(Color)
,
ImagePlus.setOverlay(ij.gui.Overlay)
public java.awt.Rectangle getBounds()
getBounds
in interface RoiBeans
getBounds
in class Roi
public void nudgeCorner(int key)
nudgeCorner
in interface RoiBeans
nudgeCorner
in class Roi
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |