Package fr.igred.omero.roi
Class RectangleWrapper
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<T>
-
- fr.igred.omero.AnnotatableWrapper<T>
-
- fr.igred.omero.roi.GenericShapeWrapper<RectangleData>
-
- fr.igred.omero.roi.RectangleWrapper
-
public class RectangleWrapper extends GenericShapeWrapper<RectangleData>
Class containing an RectangleData.Wraps function calls to the RectangleData contained.
-
-
Field Summary
-
Fields inherited from class fr.igred.omero.roi.GenericShapeWrapper
ANNOTATION_LINK
-
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 rectangle)
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.java.lang.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(java.lang.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.java.awt.Shape
toAWTShape()
Converts the shape to anShape
.Roi
toImageJ()
Converts shape to ImageJ ROI.-
Methods inherited from class fr.igred.omero.roi.GenericShapeWrapper
annotationLinkType, asShapeData, copyFromIJRoi, copyToIJRoi, createTransformedAWTShape, getBoundingBox, getC, getFill, getFontSize, getStroke, getT, getZ, link, setC, setCZT, setFill, setFontSize, setStroke, setT, setTransform, setTransform, setZ, toAWTTransform
-
Methods inherited from class fr.igred.omero.AnnotatableWrapper
addAndReplaceFile, addAndReplaceFile, addAndReplaceTable, addAndReplaceTable, addFile, addFileAnnotation, addKeyValuePair, addMapAnnotation, addPairKeyValue, addTable, addTag, addTag, addTag, addTags, addTags, copyAnnotationLinks, getAnnotations, getFileAnnotations, getKeyValuePairs, getMapAnnotations, getMyRating, getTable, getTables, getTags, getValue, isLinked, link, link, linkIfNotLinked, rate, removeLink, unlink
-
Methods inherited from class fr.igred.omero.GenericObjectWrapper
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, delete, distinct, flatten, getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString, wrap, wrap
-
-
-
-
Constructor Detail
-
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 Detail
-
getText
public java.lang.String getText()
Gets the text on the ShapeData.- Specified by:
getText
in classGenericShapeWrapper<RectangleData>
- Returns:
- the text
-
setText
public void setText(java.lang.String text)
Sets the text on the ShapeData.- Specified by:
setText
in classGenericShapeWrapper<RectangleData>
- Parameters:
text
- the text
-
toAWTShape
public java.awt.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.
-
-