Package fr.igred.omero.roi
Class ShapeWrapper<T extends ShapeData>
- java.lang.Object
-
- fr.igred.omero.ObjectWrapper<T>
-
- fr.igred.omero.AnnotatableWrapper<T>
-
- fr.igred.omero.roi.ShapeWrapper<T>
-
- Type Parameters:
T
- Subclass ofShapeData
- All Implemented Interfaces:
Annotatable
,RemoteObject
,Shape
- Direct Known Subclasses:
EllipseWrapper
,LineWrapper
,MaskWrapper
,PointWrapper
,PolygonWrapper
,PolylineWrapper
,RectangleWrapper
,TextWrapper
public abstract class ShapeWrapper<T extends ShapeData> extends AnnotatableWrapper<T> implements Shape
Generic class containing a ShapeData (or a subclass) object.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ANNOTATION_LINK
Annotation link name for this type of object-
Fields inherited from class fr.igred.omero.ObjectWrapper
data
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ShapeWrapper(T s)
Constructor of the ShapeWrapper class using a ShapeData.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
annotationLinkType()
Returns the type of annotation link for this object.protected void
copyFromIJRoi(Roi ijRoi)
Copies details from an ImageJ ROI (position, stroke color, stroke width).protected void
copyToIJRoi(Roi ijRoi)
Copies details to an ImageJ ROI (name, position, stroke color, fill color, stroke width).Rectangle
getBoundingBox()
Returns a newRectangle
corresponding to the bounding box of the shape, once the relatedAffineTransform
has been applied.int
getC()
Gets the channel.java.awt.Color
getFill()
Gets ShapeData fill color.double
getFontSize()
Gets ShapeData font size.java.awt.Color
getStroke()
Gets the ShapeData stroke color.int
getT()
Sets the time-point.int
getZ()
Gets the z-section.void
setC(int c)
Sets the channel.void
setFill(java.awt.Color fillColour)
Sets the ShapeData fill color.void
setFontSize(double value)
Sets ShapeData font size.void
setStroke(java.awt.Color strokeColour)
Sets ShapeData stroke color.void
setT(int t)
Sets the time-point.void
setTransform(double a00, double a10, double a01, double a11, double a02, double a12)
Sets the transform to the matrix specified by the 6 double precision values.void
setZ(int z)
Sets the z-section.java.awt.geom.AffineTransform
toAWTTransform()
ConvertsAffineTransform
toAffineTransform
.Roi
toImageJ()
Converts shape to ImageJ ROI.-
Methods inherited from class fr.igred.omero.AnnotatableWrapper
addAndReplaceFile, addAndReplaceTable, addKeyValuePair, addTag, addTag, getAnnotations, getFileAnnotations, getMapAnnotations, getMyRating, getTable, getTags, rate, removeLink, unlink
-
Methods inherited from class fr.igred.omero.ObjectWrapper
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString, wrap, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface fr.igred.omero.Annotatable
addAndReplaceFile, addAndReplaceFile, addAndReplaceTable, addAndReplaceTable, addFile, addKeyValuePair, addTable, addTag, addTag, addTags, copyAnnotationLinks, getAnnotationData, getAnnotations, getFileAnnotations, getKeyValuePairs, getMapAnnotations, getMyRating, getTable, getTables, getTags, getValues, isLinked, link, link, linkIfNotLinked, rate, unlink
-
Methods inherited from interface fr.igred.omero.RemoteObject
canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, getCreated, getGroupId, getId, getOwner, saveAndUpdate
-
Methods inherited from interface fr.igred.omero.roi.Shape
asDataObject, createTransformedAWTShape, getCZT, getText, link, setCZT, setText, setTransform, toAWTShape
-
-
-
-
Field Detail
-
ANNOTATION_LINK
public static final java.lang.String ANNOTATION_LINK
Annotation link name for this type of object- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ShapeWrapper
protected ShapeWrapper(T s)
Constructor of the ShapeWrapper class using a ShapeData.- Parameters:
s
- The shape.
-
-
Method Detail
-
copyFromIJRoi
protected void copyFromIJRoi(Roi ijRoi)
Copies details from an ImageJ ROI (position, stroke color, stroke width).- Parameters:
ijRoi
- An ImageJ Roi.
-
copyToIJRoi
protected void copyToIJRoi(Roi ijRoi)
Copies details to an ImageJ ROI (name, position, stroke color, fill color, stroke width).- Parameters:
ijRoi
- An ImageJ Roi.
-
getC
public int getC()
Gets the channel.
-
setC
public void setC(int c)
Sets the channel.
-
getZ
public int getZ()
Gets the z-section.
-
setZ
public void setZ(int z)
Sets the z-section.
-
getT
public int getT()
Sets the time-point.
-
setT
public void setT(int t)
Sets the time-point.
-
getFontSize
public double getFontSize()
Gets ShapeData font size.- Specified by:
getFontSize
in interfaceShape
- Returns:
- The font size (in typography points)
-
setFontSize
public void setFontSize(double value)
Sets ShapeData font size.- Specified by:
setFontSize
in interfaceShape
- Parameters:
value
- The font size (in typography points)
-
getStroke
public java.awt.Color getStroke()
Gets the ShapeData stroke color.
-
setStroke
public void setStroke(java.awt.Color strokeColour)
Sets ShapeData stroke color.
-
getFill
public java.awt.Color getFill()
Gets ShapeData fill color.
-
setFill
public void setFill(java.awt.Color fillColour)
Sets the ShapeData fill color.
-
setTransform
public void setTransform(double a00, double a10, double a01, double a11, double a02, double a12)
Sets the transform to the matrix specified by the 6 double precision values.- Specified by:
setTransform
in interfaceShape
- Parameters:
a00
- the X coordinate scaling element of the 3x3 matrixa10
- the Y coordinate shearing element of the 3x3 matrixa01
- the X coordinate shearing element of the 3x3 matrixa11
- the Y coordinate scaling element of the 3x3 matrixa02
- the X coordinate translation element of the 3x3 matrixa12
- the Y coordinate translation element of the 3x3 matrix
-
toAWTTransform
public java.awt.geom.AffineTransform toAWTTransform()
ConvertsAffineTransform
toAffineTransform
.- Specified by:
toAWTTransform
in interfaceShape
- Returns:
- The converted affine transform.
-
getBoundingBox
public Rectangle getBoundingBox()
Returns a newRectangle
corresponding to the bounding box of the shape, once the relatedAffineTransform
has been applied.- Specified by:
getBoundingBox
in interfaceShape
- Returns:
- The bounding box.
-
toImageJ
public Roi toImageJ()
Converts shape to ImageJ ROI.
-
annotationLinkType
protected java.lang.String annotationLinkType()
Returns the type of annotation link for this object.- Specified by:
annotationLinkType
in classAnnotatableWrapper<T extends ShapeData>
- Returns:
- See above.
-
-