- java.lang.Object
-
- ij.gui.Roi
-
- ij.gui.Line
-
- ij.gui.Arrow
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Point>
public class Arrow extends Line
This is an Roi subclass for creating and displaying arrows.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ij.gui.Line
Line.PointIterator
-
-
Field Summary
Fields Modifier and Type Field Description static intBARstatic StringDOUBLE_HEADED_KEYstatic intFILLEDstatic intHEADLESSstatic intNOTCHEDstatic intOPENstatic StringOUTLINE_KEYstatic StringSIZE_KEYstatic StringSTYLE_KEYstatic String[]stylesstatic StringWIDTH_KEY-
Fields inherited from class ij.gui.Line
startxd, startyd, x1, x1d, x1R, x2, x2d, x2R, y1, y1d, y1R, y2, y2d, y2R
-
Fields inherited from class ij.gui.Roi
ANGLE, asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, defaultColor, defaultFillColor, FERET_ARRAY_POINTOFFSET, FERET_ARRAYSIZE, fillColor, flattenScale, FREELINE, FREEROI, HANDLE_SIZE, handleColor, hyperstackPosition, ic, ignoreClipRect, imp, instanceColor, LINE, lineWidth, mag, MOVING, MOVING_HANDLE, nonScalable, NORMAL, NOT_PASTING, oldHeight, oldWidth, oldX, oldY, onePixelWide, OVAL, overlay, pasteMode, POINT, POLYGON, POLYLINE, previousRoi, RECTANGLE, RESIZING, ROIColor, stroke, strokeColor, TRACED_ROI, type, updateFullWindow, wideLine, xMax, yMax
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intclipRectMargin()booleancontains(int x, int y)Returns whether the center of pixel (x,y) is contained in the Roi.voidcopyAttributes(Roi roi2)Copy the attributes (outline color, fill color, outline width) of 'roi2' to the this selection.voiddraw(Graphics g)Draws this arrow on the image.voiddrawPixels(ImageProcessor ip)If the width of this line is less than or equal to one, draws the line.RectanglegetBounds()Return the bounding rectangle of this arrow.static booleangetDefaultDoubleHeaded()static doublegetDefaultHeadSize()static booleangetDefaultOutline()static intgetDefaultStyle()static doublegetDefaultWidth()booleangetDoubleHeaded()doublegetHeadSize()ImageProcessorgetMask()Always returns null for rectangular Roi'sbooleangetOutline()intgetStyle()protected voidhandleMouseDown(int sx, int sy)booleanisDrawingTool()Returns 'true' if this is an ROI primarily used from drawing (e.g., TextRoi or Arrow).static voidsetDefaultDoubleHeaded(boolean b)static voidsetDefaultHeadSize(double size)static voidsetDefaultOutline(boolean b)static voidsetDefaultStyle(int style)static voidsetDefaultWidth(double width)voidsetDoubleHeaded(boolean b)voidsetHeadSize(double headSize)voidsetOutline(boolean b)voidsetStyle(int style)voidsetStyle(String style)-
Methods inherited from class ij.gui.Line
create, drawLine, getAngle, getFloatPoints, getFloatPolygon, getFloatPolygon, getLength, getPixels, getPoints, getPolygon, getRawLength, getRotationCenter, getWidth, grow, handleMouseUp, isHandle, iterator, mouseDownInHandle, mouseMoved, moveHandle, nudgeCorner, setLocation, setLocation, setStrokeWidth, setWidth, showStatus, size, subPixelResolution
-
Methods inherited from class ij.gui.Roi
abortModification, abortPaste, addRoiListener, clone, containsPoint, convertLineToArea, convertToPolygon, create, drawOverlay, drawPixels, enableSubPixelResolution, endPaste, equals, getAngle, getAntiAlias, getBoundingRect, getColor, getContainedFloatPoints, getContainedPoints, getContourCentroid, getConvexHull, getCornerDiameter, getCPosition, getCurrentPasteMode, getDebugInfo, getDefaultFillColor, getDefaultGroup, getDefaultHandleSize, getDefaultStrokeWidth, getDrawOffset, getFeretsDiameter, getFeretValues, getFillColor, getFloatAngle, getFloatBounds, getFloatConvexHull, getFloatHeight, getFloatPolygon, getFloatWidth, getGroup, getGroupName, getGroupNames, getHandleSize, getHashCode, getImage, getImageID, getInterpolatedPolygon, getInterpolatedPolygon, getInterpolatedPolygon, getInverse, getListeners, getMagnification, getName, getPasteMode, getPosition, getPreviousRoi, getProperties, getProperty, getPropertyCount, getPrototypeOverlay, getRoundRectArcSize, getScaledStroke, getScaleStrokeWidth, getState, getStatistics, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getTypeAsString, getXBase, getYBase, getZPosition, handleMouseDrag, hasHyperStackPosition, isActiveOverlayRoi, isArea, isCursor, isInteger, isLine, isLineOrPoint, isVisible, lineCircleIntersection, magnificationForSubPixel, magnificationForSubPixel, mouseDragged, mouseReleased, notifyListeners, nudge, offScreenX, offScreenXD, offScreenY, offScreenYD, removeRoiListener, resetDefaultHandleSize, saveGroupNames, screenX, screenXD, screenY, screenYD, setAntiAlias, setBounds, setColor, setCornerDiameter, setDefaultColor, setDefaultFillColor, setDefaultGroup, setDefaultStrokeWidth, setDrawOffset, setFillColor, setFlattenScale, setGroup, setGroupName, setGroupNames, setHandleSize, setIgnoreClipRect, setImage, setInstanceColor, setIsCursor, setLineWidth, setName, setNonScalable, setPasteMode, setPosition, setPosition, setPosition, setPreviousRoi, setProperties, setProperty, setPrototypeOverlay, setRenderingHint, setRotationCenter, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, setUnscalableStrokeWidth, startPaste, temporarilyHide, toFloat, toInt, toInt, toIntR, toString, translate, update, updateClipRect, updateWideLine, useLineSubpixelConvention, xor
-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
STYLE_KEY
public static final String STYLE_KEY
- See Also:
- Constant Field Values
-
WIDTH_KEY
public static final String WIDTH_KEY
- See Also:
- Constant Field Values
-
SIZE_KEY
public static final String SIZE_KEY
- See Also:
- Constant Field Values
-
DOUBLE_HEADED_KEY
public static final String DOUBLE_HEADED_KEY
- See Also:
- Constant Field Values
-
OUTLINE_KEY
public static final String OUTLINE_KEY
- See Also:
- Constant Field Values
-
FILLED
public static final int FILLED
- See Also:
- Constant Field Values
-
NOTCHED
public static final int NOTCHED
- See Also:
- Constant Field Values
-
OPEN
public static final int OPEN
- See Also:
- Constant Field Values
-
HEADLESS
public static final int HEADLESS
- See Also:
- Constant Field Values
-
BAR
public static final int BAR
- See Also:
- Constant Field Values
-
styles
public static final String[] styles
-
-
Constructor Detail
-
Arrow
public Arrow(double ox1, double oy1, double ox2, double oy2)
-
Arrow
public Arrow(int sx, int sy, ImagePlus imp)
-
-
Method Detail
-
getMask
public ImageProcessor getMask()
Description copied from class:RoiAlways returns null for rectangular Roi's
-
drawPixels
public void drawPixels(ImageProcessor ip)
Description copied from class:LineIf the width of this line is less than or equal to one, draws the line. Otherwise draws the outline of the area of this line.- Overrides:
drawPixelsin classLine- See Also:
ImageProcessor.setColor(java.awt.Color),ImageProcessor.setLineWidth(int)
-
contains
public boolean contains(int x, int y)Description copied from class:RoiReturns whether the center of pixel (x,y) is contained in the Roi. The position of a pixel center determines whether a pixel is selected. Points exactly at the left (right) border are considered outside (inside); points exactly on horizontal borders are considered outside (inside) at the border with the lower (higher) y. This convention is opposite to that of the java.awt.Shape class.
-
getBounds
public Rectangle getBounds()
Return the bounding rectangle of this arrow.
-
handleMouseDown
protected void handleMouseDown(int sx, int sy)- Overrides:
handleMouseDownin classLine
-
clipRectMargin
protected int clipRectMargin()
- Overrides:
clipRectMarginin classLine
-
isDrawingTool
public boolean isDrawingTool()
Description copied from class:RoiReturns 'true' if this is an ROI primarily used from drawing (e.g., TextRoi or Arrow).- Overrides:
isDrawingToolin classRoi
-
setDefaultWidth
public static void setDefaultWidth(double width)
-
getDefaultWidth
public static double getDefaultWidth()
-
setStyle
public void setStyle(int style)
-
setStyle
public void setStyle(String style)
-
getStyle
public int getStyle()
-
setDefaultStyle
public static void setDefaultStyle(int style)
-
getDefaultStyle
public static int getDefaultStyle()
-
setHeadSize
public void setHeadSize(double headSize)
-
getHeadSize
public double getHeadSize()
-
setDefaultHeadSize
public static void setDefaultHeadSize(double size)
-
getDefaultHeadSize
public static double getDefaultHeadSize()
-
setDoubleHeaded
public void setDoubleHeaded(boolean b)
-
getDoubleHeaded
public boolean getDoubleHeaded()
-
setDefaultDoubleHeaded
public static void setDefaultDoubleHeaded(boolean b)
-
getDefaultDoubleHeaded
public static boolean getDefaultDoubleHeaded()
-
setOutline
public void setOutline(boolean b)
-
getOutline
public boolean getOutline()
-
setDefaultOutline
public static void setDefaultOutline(boolean b)
-
getDefaultOutline
public static boolean getDefaultOutline()
-
copyAttributes
public void copyAttributes(Roi roi2)
Description copied from class:RoiCopy the attributes (outline color, fill color, outline width) of 'roi2' to the this selection.- Overrides:
copyAttributesin classRoi
-
-