Package fr.igred.omero.roi
Class RectangleWrapper
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
ConstructorsConstructorDescriptionConstructor 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
Modifier and TypeMethodDescriptiondouble[]
Gets the coordinates of the RectangleData shape.double
Returns the height untransformed rectangle.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
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.Converts the shape to anShape
.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, getRatings, 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, getUpdated, saveAndUpdate, toString, wrap, wrap
-
Constructor Details
-
RectangleWrapper
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
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
Gets the text on the ShapeData.- Specified by:
getText
in classGenericShapeWrapper<RectangleData>
- Returns:
- the text
-
setText
Sets the text on the ShapeData.- Specified by:
setText
in classGenericShapeWrapper<RectangleData>
- Parameters:
text
- the text
-
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
Converts shape to ImageJ ROI.- Overrides:
toImageJ
in classGenericShapeWrapper<RectangleData>
- Returns:
- An ImageJ ROI.
-