ij.gui
Class Line

java.lang.Object
  extended by ij.gui.Roi
      extended by ij.gui.Line
All Implemented Interfaces:
java.lang.Cloneable

public class Line
extends Roi

This class represents a straight line selection.


Field Summary
 int x1
           
 int x2
           
 int y1
           
 int y2
           
 
Fields inherited from class ij.gui.Roi
clipboard, clipHeight, clipWidth, clipX, clipY, constrain, CONSTRUCTING, FREELINE, FREEROI, HANDLE_SIZE, ic, imp, LINE, MOVING, NORMAL, oldHeight, oldWidth, oldX, oldY, OVAL, pasteMode, POLYGON, POLYLINE, previousRoi, RECTANGLE, RESIZING, ROIColor, TRACED_ROI, type, updateFullWindow, xMax, yMax
 
Constructor Summary
Line(int ox, int oy, ImagePlus imp)
          Creates a new user-generated straight line selection.
Line(int ox1, int oy1, int ox2, int oy2, ImagePlus imp)
          Creates a new straight line selection using the specified starting and ending offscreen coordinates.
 
Method Summary
 boolean contains(int x, int y)
           
 void draw(java.awt.Graphics g)
          Draws this line in the image.
 void drawPixels()
           
 double getLength()
          Returns the length of this line.
 double[] getPixels()
          Returns the pixel values along this line.
 double getRawLength()
          Returns the length of this line in pixels.
static int getWidth()
           
protected  void grow(int xend, int yend)
           
 void nudgeCorner(int key)
          Nudge end point of line by one pixel.
static void setWidth(int w)
           
 
Methods inherited from class ij.gui.Roi
abortPaste, clone, endPaste, getAngle, getBoundingRect, getColor, getMask, getState, getType, handleMouseDown, handleMouseDrag, handleMouseUp, nudge, setColor, setImage, setLocation, setPasteMode, showStatus, toString, updateClipRect
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x1

public int x1

y1

public int y1

x2

public int x2

y2

public int y2
Constructor Detail

Line

public Line(int ox,
            int oy,
            ImagePlus imp)
Creates a new user-generated straight line selection. 'ox' and 'oy' are offscreen coordinates that specify the start of the line. The user will determine the end of the line interactively using rubber banding.


Line

public Line(int ox1,
            int oy1,
            int ox2,
            int oy2,
            ImagePlus imp)
Creates a new straight line selection using the specified starting and ending offscreen coordinates.

Method Detail

grow

protected void grow(int xend,
                    int yend)
Overrides:
grow in class Roi

draw

public void draw(java.awt.Graphics g)
Draws this line in the image.

Overrides:
draw in class Roi

getLength

public double getLength()
Returns the length of this line.

Overrides:
getLength in class Roi

getRawLength

public double getRawLength()
Returns the length of this line in pixels.


getPixels

public double[] getPixels()
Returns the pixel values along this line.


drawPixels

public void drawPixels()
Overrides:
drawPixels in class Roi

contains

public boolean contains(int x,
                        int y)
Overrides:
contains in class Roi

getWidth

public static int getWidth()

setWidth

public static void setWidth(int w)

nudgeCorner

public void nudgeCorner(int key)
Nudge end point of line by one pixel.

Overrides:
nudgeCorner in class Roi