Class RectangleWrapper


public class RectangleWrapper extends GenericShapeWrapper<RectangleData>
Class containing an RectangleData.

Wraps function calls to the RectangleData contained.

  • Constructor Details

    • RectangleWrapper

      public RectangleWrapper(RectangleData rectangle)
      Constructor of the RectangleWrapper class using a RectangleData.
      Parameters:
      rectangle - The RectangleData to wrap.
    • RectangleWrapper

      public RectangleWrapper()
      Constructor of the RectangleWrapper class using a new empty RectangleData.
    • RectangleWrapper

      public RectangleWrapper(Roi ijRoi)
      Constructor of the RectangleWrapper class using bounds from an ImageJ ROI.
      Parameters:
      ijRoi - An ImageJ ROI.
    • RectangleWrapper

      public RectangleWrapper(double x, double y, double width, double height)
      Constructor of the RectangleWrapper class using a new RectangleData.
      Parameters:
      x - The x-coordinate of the top-left corner.
      y - The y-coordinate of the top-left corner.
      width - The width of the rectangle.
      height - The height of the rectangle.
  • Method Details

    • getText

      public String getText()
      Gets the text on the ShapeData.
      Specified by:
      getText in class GenericShapeWrapper<RectangleData>
      Returns:
      the text
    • setText

      public void setText(String text)
      Sets the text on the ShapeData.
      Specified by:
      setText in class GenericShapeWrapper<RectangleData>
      Parameters:
      text - the text
    • toAWTShape

      public Shape toAWTShape()
      Converts the shape to an Shape.
      Specified by:
      toAWTShape in class GenericShapeWrapper<RectangleData>
      Returns:
      The converted AWT Shape.
    • getX

      public double getX()
      Returns the x-coordinate of the shape.
      Returns:
      See above.
    • setX

      public void setX(double x)
      Sets the x-coordinate of the shape.
      Parameters:
      x - See above.
    • getY

      public double getY()
      Returns the y coordinate of the shape.
      Returns:
      See above.
    • setY

      public void setY(double y)
      Sets the y-coordinate of the shape.
      Parameters:
      y - See above.
    • getWidth

      public double getWidth()
      Returns the width untransformed rectangle.
      Returns:
      See above.
    • setWidth

      public void setWidth(double width)
      Sets width of an untransformed rectangle.
      Parameters:
      width - See above.
    • getHeight

      public double getHeight()
      Returns the height untransformed rectangle.
      Returns:
      See above.
    • setHeight

      public void setHeight(double height)
      Sets the height of an untransformed rectangle.
      Parameters:
      height - See above.
    • setCoordinates

      public void setCoordinates(double x, double y, double width, double height)
      Sets the coordinates of the RectangleData shape.
      Parameters:
      x - The x-coordinate of the top-left corner.
      y - The y-coordinate of the top-left corner.
      width - The width of the rectangle.
      height - The height of the rectangle.
    • getCoordinates

      public double[] getCoordinates()
      Gets the coordinates of the RectangleData shape.
      Returns:
      Array of coordinates containing {X,Y,Width,Height}.
    • setCoordinates

      public void setCoordinates(double[] coordinates)
      Sets the coordinates of the RectangleData shape.
      Parameters:
      coordinates - Array of coordinates containing {X,Y,Width,Height}.
    • toImageJ

      public Roi toImageJ()
      Converts shape to ImageJ ROI.
      Overrides:
      toImageJ in class GenericShapeWrapper<RectangleData>
      Returns:
      An ImageJ ROI.