Class Handle

java.lang.Object
java.awt.geom.Point2D
java.awt.Point
com.xinapse.multisliceimage.roi.Handle
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
AxisHandle, CentreHandle, CornerHandle, EdgeHandle, EndHandle, InsertionPointHandle, VertexHandle

public abstract class Handle extends Point
A Class representing an ROI Handle, used for changing the shape of an ROI.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class Point2D

    Point2D.Double, Point2D.Float
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The design size of Handles (in screen pixels) when they are drawn large, with no HiDPI scaling.
    static final int
    The design size of Handles (in screen pixels) when they are drawn small, with no HiDPI scaling.
    static final int
    The design size of Handles (in screen pixels) when they are drawn large, with no HiDPI scaling.
    static final int
    The design size of Handles (in screen pixels) when they are drawn small, with no HiDPI scaling.

    Fields inherited from class Point

    x, y
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Draws this Handle using the given Graphics context.
    boolean
     
    static Color
    Returns the Color with which ROI Handle borders are to be drawn.
    static Color
    Returns the Color with which ROI Handles are to be drawn.
    final int
    Returns the size of this ROI in screen pixels.
    static int
    getSize(int separation)
    Returns a suitable size of Handle for drawing an ROI of the given size.
    static int
    getSize(int objectWidth, int objectHeight)
    Returns a suitable size of Handle for drawing an ROI of the given width and height.
    int
     
    boolean
    Returns true if the specified point is over this handle; false otherwise.
    static void
    Sets the Color with which ROI Handle borders are to be drawn.
    static void
    Sets the Color with which ROI Handles are to be drawn.
    final void
    setSize(int size)
    Sets the size of this ROI in screen pixels.
    abstract String
    Returns a java.lang.String describing this Handle.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DESIGN_SIZE_SMALL

      public static final int DESIGN_SIZE_SMALL
      The design size of Handles (in screen pixels) when they are drawn small, with no HiDPI scaling.
      See Also:
    • DESIGN_SIZE_LARGE

      public static final int DESIGN_SIZE_LARGE
      The design size of Handles (in screen pixels) when they are drawn large, with no HiDPI scaling.
      See Also:
    • SIZE_SMALL

      public static final int SIZE_SMALL
      The design size of Handles (in screen pixels) when they are drawn small, with no HiDPI scaling.
    • SIZE_LARGE

      public static final int SIZE_LARGE
      The design size of Handles (in screen pixels) when they are drawn large, with no HiDPI scaling.
  • Method Details

    • setSize

      public final void setSize(int size)
      Sets the size of this ROI in screen pixels.
      Parameters:
      size - the new size of this ROI in screen pixels.
    • getSize

      public final int getSize()
      Returns the size of this ROI in screen pixels.
      Returns:
      the size of this ROI in screen pixels.
    • pointOver

      public boolean pointOver(Point point)
      Returns true if the specified point is over this handle; false otherwise.
      Parameters:
      point - the Point to test.
      Returns:
      true if the specified point is over this handle; false otherwise.
    • draw

      public void draw(Graphics g)
      Draws this Handle using the given Graphics context.
      Parameters:
      g - the Graphics object on which the drawing operation is to be peformed.
    • getSize

      public static int getSize(int objectWidth, int objectHeight)
      Returns a suitable size of Handle for drawing an ROI of the given width and height.
      Parameters:
      objectWidth - the width of the ROI to which this handle is to be attached in screen pixels.
      objectHeight - the height of the ROI to which this handle is to be attached in screen pixels.
      Returns:
      a Handle size in screen pixels.
    • getSize

      public static int getSize(int separation)
      Returns a suitable size of Handle for drawing an ROI of the given size.
      Parameters:
      separation - the distance in screen pixels between adjacent vertices of an ROI.
      Returns:
      a Handle size in screen pixels.
    • getColor

      public static Color getColor()
      Returns the Color with which ROI Handles are to be drawn.
      Returns:
      the Color with which ROI Handles are to be drawn.
    • getBorderColor

      public static Color getBorderColor()
      Returns the Color with which ROI Handle borders are to be drawn.
      Returns:
      the Color with which ROI Handle borders are to be drawn.
    • setColor

      public static void setColor(Color c)
      Sets the Color with which ROI Handles are to be drawn.
      Parameters:
      c - the new Color with which ROI Handles are to be drawn.
    • setBorderColor

      public static void setBorderColor(Color c)
      Sets the Color with which ROI Handle borders are to be drawn.
      Parameters:
      c - the new Color with which ROI Handle borders are to be drawn.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Point
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Point2D
    • toString

      public abstract String toString()
      Returns a java.lang.String describing this Handle.
      Overrides:
      toString in class Point
      Returns:
      a String describing this Handle.