Class Line

java.lang.Object
org.micromanager.ndviewer.overlay.Roi
org.micromanager.ndviewer.overlay.Line
All Implemented Interfaces:
Serializable, Cloneable

public class Line
extends Roi
This class represents a straight line selection.
See Also:
Serialized Form
  • Field Details

    • x1

      public int x1
    • y1

      public int y1
    • x2

      public int x2
    • y2

      public int y2
    • x1d

      public double x1d
    • y1d

      public double y1d
    • x2d

      public double x2d
    • y2d

      public double y2d
    • x1R

      protected double x1R
    • y1R

      protected double y1R
    • x2R

      protected double x2R
    • y2R

      protected double y2R
    • startxd

      protected double startxd
    • startyd

      protected double startyd
  • Constructor Details

    • Line

      public 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

      public Line​(double ox1, double oy1, double ox2, double oy2)
      Creates a new straight line selection using the specified starting and ending offscreen double coordinates.
  • Method Details

    • grow

      protected void grow​(int sx, int sy)
    • mouseMoved

      public void mouseMoved​(MouseEvent e)
    • drawLine

      protected void drawLine​(int sx, int sy)
    • draw

      public void draw​(Graphics g)
      Draws this line on the image.
      Overrides:
      draw in class Roi
    • getRawLength

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

      public Polygon getPoints()
      Returns, as a Polygon, the two points that define this line.
    • 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)
    • setStrokeWidth

      public void setStrokeWidth​(float width)
      Description copied from class: Roi
      Sets the width of the line used to draw this ROI. Set the width to 0.0 and the ROI will be drawn using a a 1 pixel stroke width regardless of the magnification.
      Overrides:
      setStrokeWidth in class Roi
      See Also:
      Roi.setStrokeColor(Color)
    • getBounds

      public Rectangle getBounds()
      Return the bounding rectangle of this line.
      Overrides:
      getBounds in class Roi
    • clipRectMargin

      protected int clipRectMargin()
      Overrides:
      clipRectMargin in class Roi
    • getDrawOffset

      public boolean getDrawOffset()
      Description copied from class: Roi
      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..
      Overrides:
      getDrawOffset in class Roi
    • setDrawOffset

      public void setDrawOffset​(boolean drawOffset)
      Overrides:
      setDrawOffset in class Roi
    • subPixelResolution

      public boolean subPixelResolution()
      Always returns true.
      Overrides:
      subPixelResolution in class Roi
    • setLocation

      public void setLocation​(int x, int y)
      Description copied from class: Roi
      Set the location of the ROI in image coordinates.
      Overrides:
      setLocation in class Roi