public abstract class ROI2DShape extends ROI2D implements java.awt.Shape
Modifier and Type | Class and Description |
---|---|
class |
ROI2DShape.ROI2DShapePainter |
ROI2D.ROI2DPainter
ROI.ROIIdComparator, ROI.ROINameComparator, ROI.ROIPainter
DEFAULT_COLOR, DEFAULT_NORMAL_COLOR, DEFAULT_OPACITY, DEFAULT_STROKE, ID_CLASSNAME, ID_COLOR, ID_ID, ID_NAME, ID_OPACITY, ID_READONLY, ID_ROI, ID_SELECTED, ID_SHOWNAME, ID_STROKE, idComparator, nameComparator, PROPERTY_COLOR, PROPERTY_CREATING, PROPERTY_ICON, PROPERTY_NAME, PROPERTY_OPACITY, PROPERTY_READONLY, PROPERTY_SHOWNAME, PROPERTY_STROKE
Constructor and Description |
---|
ROI2DShape(java.awt.Shape shape) |
Modifier and Type | Method and Description |
---|---|
Anchor2D |
addNewPoint(java.awt.geom.Point2D pos,
boolean insert)
Add a new point to this shape ROI.
|
void |
addPoint(Anchor2D pt,
int index)
Internal use only, use
addNewPoint(Point2D, boolean) instead. |
boolean |
addPoint(java.awt.geom.Point2D pos,
boolean insert)
Deprecated.
Use
addNewPoint(Point2D, boolean) instead. |
boolean |
addPointAt(java.awt.geom.Point2D pos,
boolean insert)
Deprecated.
Use
addNewPoint(Point2D, boolean) instead. |
boolean |
canAddPoint()
Return true if this ROI support adding new point
|
boolean |
canRemovePoint()
Return true if this ROI support removing point
|
boolean |
canTranslate()
Returns
true if the ROI support translate operation. |
java.awt.geom.Rectangle2D |
computeBounds2D()
Calculate and returns the 2D bounding box of the
ROI . |
boolean |
contains(double x,
double y)
Tests if the specified coordinates are inside the
ROI . |
boolean |
contains(double x,
double y,
double w,
double h)
Tests if the
ROI entirely contains the specified rectangular area. |
boolean |
contains(java.awt.geom.Point2D p)
Tests if a specified
Point2D is inside the ROI. |
boolean |
contains(java.awt.geom.Rectangle2D r)
Tests if the interior of the
ROI entirely contains the specified
Rectangle2D . |
boolean |
contains(ROI roi)
Tests if the
ROI entirely contains the specified ROI . |
void |
controlPointOverlayChanged(OverlayEvent event)
Called when anchor overlay changed
|
void |
controlPointPositionChanged(Anchor2D source)
Called when anchor position changed
|
java.util.List<Anchor2D> |
getControlPoints()
Return the list of control points for this ROI.
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at) |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness) |
java.util.ArrayList<java.awt.geom.Point2D> |
getPoints()
Return the list of positions of control points for this ROI.
|
java.awt.Shape |
getShape() |
boolean |
hasSelectedPoint()
Returns true if the ROI has a (control) point which is currently focused/selected
|
boolean |
intersects(double x,
double y,
double w,
double h)
Tests if the interior of the
ROI intersects the interior of a specified
rectangular area. |
boolean |
intersects(java.awt.geom.Rectangle2D r)
Tests if the interior of the
ROI intersects the interior of a specified
Rectangle2D . |
boolean |
intersects(ROI roi)
Tests if the current
ROI intersects the specified ROI |
boolean |
isOverEdge(IcyCanvas canvas,
double x,
double y)
Returns true if specified point coordinates overlap the ROI edge.
|
void |
onChanged(EventHierarchicalChecker object)
roi changed
|
void |
painterChanged(PainterEvent event)
Called when anchor painter changed, provided only for backward compatibility.
|
boolean |
removePoint(Anchor2D pt)
This method give you lower level access on point remove operation but can be unsafe.
|
boolean |
removePointAt(IcyCanvas canvas,
java.awt.geom.Point2D imagePoint)
Deprecated.
Use
removeSelectedPoint(IcyCanvas) instead. |
boolean |
removeSelectedPoint(IcyCanvas canvas)
Remove the current selected point.
|
void |
setSelected(boolean value)
Set the selected state of this ROI.
|
void |
translate(double dx,
double dy)
Translate the ROI position by the specified delta X/Y.
|
canSetBounds, canSetPosition, computeBounds5D, computeNumberOfContourPoints, computeNumberOfPoints, contains, contains, getArea, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask2D, getBooleanMask2D, getBounds, getBounds2D, getC, getDimension, getPerimeter, getPosition, getPosition2D, getROI2DList, getROI2DList, getROI2DList, getT, getZ, intersects, isActiveFor, isActiveFor, isOver, isOver, isOverEdge, isOverEdge, isOverEdge, loadFromXML, merge, saveToXML, setBounds2D, setBounds5D, setC, setPosition, setPosition2D, setPosition5D, setT, setZ, substract, subtract
addListener, attachTo, beginUpdate, canvasToImageDeltaX, canvasToImageDeltaY, canvasToImageLogDeltaX, canvasToImageLogDeltaX, canvasToImageLogDeltaX, canvasToImageLogDeltaX, canvasToImageLogDeltaY, canvasToImageLogDeltaY, canvasToImageLogDeltaY, canvasToImageLogDeltaY, contains, contains, copyFrom, create, create, create, create, createFromXML, delete, delete, detachFrom, detachFromAll, detachFromAll, endUpdate, focusChanged, getAdjustedStroke, getAdjustedStroke, getBooleanMask2D, getBounds5D, getClassName, getColor, getCopy, getDisplayColor, getExclusiveUnion, getFirstSequence, getFocusedColor, getIcon, getId, getIntersection, getName, getNumberOfContourPoints, getNumberOfPoints, getOpacity, getOverlay, getPainter, getPosition5D, getPropertyValue, getROICount, getROIList, getROIList, getROIList, getROIsFromXML, getSelectedColor, getSequences, getShowName, getSimpleClassName, getStroke, getSubtraction, getUnion, getVolume, internalFocus, internalSelect, internalUnfocus, internalUnselect, intersects, isAttached, isCreating, isEditable, isFocused, isReadOnly, isSelected, isUpdating, loadFromXML, loadROIsFromXML, merge, nameChanged, painterChanged, propertyChanged, remove, remove, removeListener, roiChanged, roiChanged, saveROIsToXML, selectionChanged, setColor, setCreating, setEditable, setFocused, setIcon, setMousePos, setName, setOpacity, setPropertyValue, setReadOnly, setROIsFromXML, setSelected, setSelectedColor, setShowName, setStroke
public ROI2DShape(java.awt.Shape shape)
public java.awt.Shape getShape()
public void setSelected(boolean value)
ROI
Sequence.setSelectedROI(ROI)
for exclusive ROI selection.setSelected
in class ROI
value
- the selected to setpublic boolean hasSelectedPoint()
ROI
hasSelectedPoint
in class ROI
public boolean canAddPoint()
public boolean canRemovePoint()
public void addPoint(Anchor2D pt, int index)
addNewPoint(Point2D, boolean)
instead.@Deprecated public boolean addPoint(java.awt.geom.Point2D pos, boolean insert)
addNewPoint(Point2D, boolean)
instead.@Deprecated public boolean addPointAt(java.awt.geom.Point2D pos, boolean insert)
addNewPoint(Point2D, boolean)
instead.public Anchor2D addNewPoint(java.awt.geom.Point2D pos, boolean insert)
pos
- position of the new pointinsert
- if set to true
the new point will be inserted between the 2 closest
points (in pixels distance) else the new point is inserted at the end of the point
listnull
otherwise (if the ROI does not support this operation for instance)public boolean removePoint(Anchor2D pt)
removeSelectedPoint(IcyCanvas)
when possible.@Deprecated public boolean removePointAt(IcyCanvas canvas, java.awt.geom.Point2D imagePoint)
removeSelectedPoint(IcyCanvas)
instead.public boolean removeSelectedPoint(IcyCanvas canvas)
public boolean isOverEdge(IcyCanvas canvas, double x, double y)
isOverEdge
in class ROI2D
public java.util.List<Anchor2D> getControlPoints()
public java.util.ArrayList<java.awt.geom.Point2D> getPoints()
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
getPathIterator
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
getPathIterator
in interface java.awt.Shape
public boolean contains(java.awt.geom.Point2D p)
ROI2D
Point2D
is inside the ROI.public boolean contains(java.awt.geom.Rectangle2D r)
ROI2D
ROI
entirely contains the specified
Rectangle2D
. The ROI.contains()
method allows a implementation to
conservatively return false
when:
intersect
method returns true
and
ROI
entirely contains the
Rectangle2D
are prohibitively expensive.
false
even though the
ROI
contains the Rectangle2D
.contains
in interface java.awt.Shape
contains
in class ROI2D
r
- The specified Rectangle2D
true
if the interior of the ROI
entirely contains the
Rectangle2D
; false
otherwise or, if the ROI
contains the Rectangle2D
and the intersects
method returns
true
and the containment calculations would be too expensive to perform.ROI2D.contains(double, double, double, double)
public boolean contains(double x, double y)
ROI2D
ROI
.public boolean contains(double x, double y, double w, double h)
ROI2D
ROI
entirely contains the specified rectangular area. All
coordinates that lie inside the rectangular area must lie within the ROI
for the
entire rectangular area to be considered contained within the ROI
.
The ROI.contains()
method allows a ROI
implementation to conservatively
return false
when:
intersect
method returns true
and
ROI
entirely contains the
rectangular area are prohibitively expensive.
ROIs
this method might return false
even though the
ROI
contains the rectangular area.contains
in interface java.awt.Shape
contains
in class ROI2D
x
- the X coordinate of the upper-left corner of the specified rectangular areay
- the Y coordinate of the upper-left corner of the specified rectangular areaw
- the width of the specified rectangular areah
- the height of the specified rectangular areatrue
if the interior of the ROI
entirely contains the
specified rectangular area; false
otherwise or, if the ROI
contains the rectangular area and the intersects
method returns
true
and the containment calculations would be too expensive to perform.public boolean contains(ROI roi)
ROI
ROI
entirely contains the specified ROI
.public boolean intersects(java.awt.geom.Rectangle2D r)
ROI2D
ROI
intersects the interior of a specified
Rectangle2D
. The ROI.intersects()
method allows a ROI
implementation to conservatively return true
when:
Rectangle2D
and the ROI
intersect, but
ROIs
this method might return true
even though the
Rectangle2D
does not intersect the ROI
.intersects
in interface java.awt.Shape
intersects
in class ROI2D
r
- the specified Rectangle2D
true
if the interior of the ROI
and the interior of the
specified Rectangle2D
intersect, or are both highly likely to intersect
and intersection calculations would be too expensive to perform; false
otherwise.ROI2D.intersects(double, double, double, double)
public boolean intersects(double x, double y, double w, double h)
ROI2D
ROI
intersects the interior of a specified
rectangular area. The rectangular area is considered to intersect the ROI
if any
point is contained in both the interior of the ROI
and the specified rectangular
area.
The ROI.intersects()
method allows a ROI
implementation to conservatively
return true
when:
ROI
intersect,
but
ROIs
this method might return true
even though the
rectangular area does not intersect the ROI
.intersects
in interface java.awt.Shape
intersects
in class ROI2D
x
- the X coordinate of the upper-left corner of the specified rectangular areay
- the Y coordinate of the upper-left corner of the specified rectangular areaw
- the width of the specified rectangular areah
- the height of the specified rectangular areatrue
if the interior of the ROI
and the interior of the
rectangular area intersect, or are both highly likely to intersect and intersection
calculations would be too expensive to perform; false
otherwise.public boolean intersects(ROI roi)
ROI
ROI
intersects the specified ROI
intersects
in class ROI2D
true
if ROI
intersect, false
otherwise.public java.awt.geom.Rectangle2D computeBounds2D()
ROI2D
ROI
.ROI2D.getBounds2D()
which should try to cache the result as the
bounding box calculation can take some computation time for complex ROI.computeBounds2D
in class ROI2D
public boolean canTranslate()
ROI2D
true
if the ROI support translate operation.canTranslate
in class ROI2D
ROI2D.translate(double, double)
public void translate(double dx, double dy)
ROI2D
ROI2D.canTranslate()
first.translate
in class ROI2D
dx
- translation value to apply on X dimensiondy
- translation value to apply on Y dimensionROI2D.canTranslate()
,
ROI2D.setPosition2D(Point2D)
public void controlPointPositionChanged(Anchor2D source)
public void controlPointOverlayChanged(OverlayEvent event)
public void painterChanged(PainterEvent event)
public void onChanged(EventHierarchicalChecker object)
onChanged
in interface ChangeListener
onChanged
in class ROI