Package fr.igred.omero.roi
Class RectangleWrapper
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<T>
-
- fr.igred.omero.roi.GenericShapeWrapper<RectangleData>
-
- fr.igred.omero.roi.RectangleWrapper
-
public class RectangleWrapper extends GenericShapeWrapper<RectangleData>
-
-
Field Summary
-
Fields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
-
Constructor Summary
Constructors Constructor Description RectangleWrapper()
Constructor of the RectangleWrapper class using a new empty RectangleData.RectangleWrapper(double x, double y, double width, double height)
Constructor of the RectangleWrapper class using a new RectangleData.RectangleWrapper(Roi ijRoi)
Constructor of the RectangleWrapper class using bounds from an ImageJ ROI.RectangleWrapper(RectangleData shape)
Constructor of the RectangleWrapper class using a RectangleData.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getCoordinates()
Gets the coordinates of the RectangleData shape.double
getHeight()
Returns the height untransformed rectangle.String
getText()
Gets the text on the ShapeData.double
getWidth()
Returns the width untransformed rectangle.double
getX()
Returns the x-coordinate of the shape.double
getY()
Returns the y coordinate of the shape.void
setCoordinates(double[] coordinates)
Sets the coordinates of the RectangleData shape.void
setCoordinates(double x, double y, double width, double height)
Sets the coordinates of the RectangleData shape.void
setHeight(double height)
Sets the height of an untransformed rectangle.void
setText(String text)
Sets the text on the ShapeData.void
setWidth(double width)
Sets width of an untransformed rectangle.void
setX(double x)
Sets the x-coordinate of the shape.void
setY(double y)
Sets the y-coordinate of the shape.Shape
toAWTShape()
Converts the shape to anShape
.Roi
toImageJ()
Converts shape to ImageJ ROI.-
Methods inherited from class fr.igred.omero.roi.GenericShapeWrapper
asShapeData, copy, createTransformedAWTShape, getBoundingBox, getC, getFontSize, getStroke, getT, getZ, setC, setCZT, setFontSize, setStroke, setT, setTransform, setTransform, setZ, toAWTTransform
-
Methods inherited from class fr.igred.omero.GenericObjectWrapper
canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, delete, distinct, getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString, wrap, wrap
-
-
-
-
Constructor Detail
-
RectangleWrapper
public RectangleWrapper(RectangleData shape)
Constructor of the RectangleWrapper class using a RectangleData.- Parameters:
shape
- the shape
-
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 Detail
-
getText
public String getText()
Gets the text on the ShapeData.- Specified by:
getText
in classGenericShapeWrapper<RectangleData>
- Returns:
- the text
-
setText
public void setText(String text)
Sets the text on the ShapeData.- Specified by:
setText
in classGenericShapeWrapper<RectangleData>
- Parameters:
text
- the text
-
toAWTShape
public Shape toAWTShape()
Converts the shape to anShape
.- Specified by:
toAWTShape
in classGenericShapeWrapper<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 classGenericShapeWrapper<RectangleData>
- Returns:
- An ImageJ ROI.
-
-