ij.gui
Class OvalRoi

java.lang.Object
  extended by ij.gui.AbstractRoi
      extended by ij.gui.AttributeRoi
          extended by ij.gui.Roi
              extended by ij.gui.OvalRoi
All Implemented Interfaces:
RoiBeans, RoiConstance, java.io.Serializable, java.lang.Cloneable

public class OvalRoi
extends Roi

Oval region of interest

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ij.gui.Roi
asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipHeightd, clipWidth, clipWidthd, clipX, clipXd, clipY, clipYd, constrain, defaultFillColor, handleColor, ic, imageID, instanceColor, lineWidth, mag, nonScalable, oldHeight, oldHeightd, oldWidth, oldWidthd, oldX, oldXd, oldY, oldYd, onePixelWide, overlay, pasteMode, previousRoi, roundRect, updateFullWindow
 
Fields inherited from class ij.gui.AttributeRoi
drawDoubleClick, fillColor, fillDoubleClick, imp, ROIColor, stroke, strokeColor, type, wideLine, xMax, yMax
 
Fields inherited from interface ij.gui.RoiConstance
ADD_TO_ROI, ANGLE, COMPOSITE, CONSTRUCTING, DRAW_HANDLE, EVT_HANDLE_SIZE, FILL_HANDLE, FREELINE, FREEROI, HANDLE_SIZE, LINE, MOVING, MOVING_HANDLE, MOVING_ROUNDRECT_HANDLE, NO_MODS, NORMAL, NOT_PASTING, OVAL, POINT, POLYGON, POLYLINE, RECTANGLE, RESIZING, SUBTRACT_FROM_ROI, TRACED_ROI
 
Constructor Summary
OvalRoi(double x, double y, double width, double height)
          Creates a new OvalRoi.
OvalRoi(int x, int y, ImagePlus imp)
          Starts the process of creating a user-defined OvalRoi.
OvalRoi(int x, int y, int width, int height)
          Creates a new OvalRoi.
OvalRoi(int x, int y, int width, int height, ImagePlus imp)
          Deprecated.  
 
Method Summary
 boolean contains(int ox, int oy)
          Tests if the specified point is inside the boundary of this OvalRoi.
 void draw(java.awt.Graphics g)
           
 void drawPixels(ImageProcessor ip)
          Draws an outline of this OvalRoi on the image.
static java.awt.Color getColor()
          Returns the default (global) color used for drawing ROI outlines.
static java.awt.Color getDefaultFillColor()
           
 java.awt.Color getFillColor()
          Returns the color used to fill this ROI, or null if it is not filled.
 double getLength()
          Returns the perimeter length.
 ImageProcessor getMask()
          Always returns null for rectangular Roi's
 java.awt.Polygon getPolygon()
          Returns this OvalRoi as a polygon.
 java.awt.Color getStrokeColor()
          Returns the the color used to draw the ROI outline or null if the default color is being used.
 int isHandle(int sx, int sy)
          Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1.
protected  void moveHandle(int sx, int sy)
           
static void setColor(java.awt.Color c)
          Sets the default (global) color used for ROI outlines.
static void setDefaultFillColor(java.awt.Color color)
           
 void setFillColor(java.awt.Color color)
          Sets the color used to fill ROIs when they are in an overlay.
 void setStrokeColor(java.awt.Color c)
          Sets the color used by this ROI to draw its outline.
 
Methods inherited from class ij.gui.Roi
abortPaste, clipRectMargin, clone, drawfillOverlay, drawHandle, drawOverlay, drawPixels, drawPixels, drawRoiHandle, drawStroke, endPaste, equals, fillRoiHandle, getBoundingRect, getBounds, getCornerDiameter, getCurrentPasteMode, getDrawOffset, getFloatBounds, getFloatPolygon, getHandleSize, getMagnification, getPasteMode, getPrototypeOverlay, getRoundRectArcSize, getScaledStroke, getState, getTypeAsString, grow, handleMouseDown, handleMouseDrag, handleMouseUp, isArea, isDrawingTool, isLine, isVisible, mouseDownInHandle, nudge, nudgeCorner, screenX, screenXD, screenY, screenYD, setCornerDiameter, setDrawOffset, setImage, setInstanceColor, setLineWidth, setLocation, setNonScalable, setPasteMode, setPrototypeOverlay, setRoundRectArcSize, showStatus, startPaste, subPixelResolution, temporarilyHide, toFloat, toInt, toInt, toIntR, toString, update, updateClipRect, updateWideLine
 
Methods inherited from class ij.gui.AttributeRoi
copyAttributes, getAngle, getConvexHull, getCPosition, getFeretsDiameter, getFeretValues, getImage, getImageID, getName, getPosition, getStroke, getStrokeWidth, getTPosition, getType, getZPosition, setName, setPosition, setPosition, setStroke, setStrokeWidth, setStrokeWidth
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OvalRoi

public OvalRoi(int x,
               int y,
               int width,
               int height)
Creates a new OvalRoi.


OvalRoi

public OvalRoi(double x,
               double y,
               double width,
               double height)
Creates a new OvalRoi.


OvalRoi

public OvalRoi(int x,
               int y,
               ImagePlus imp)
Starts the process of creating a user-defined OvalRoi.


OvalRoi

public OvalRoi(int x,
               int y,
               int width,
               int height,
               ImagePlus imp)
Deprecated. 

Method Detail

moveHandle

protected void moveHandle(int sx,
                          int sy)
Overrides:
moveHandle in class Roi

draw

public void draw(java.awt.Graphics g)
Specified by:
draw in interface RoiBeans
Overrides:
draw in class Roi

drawPixels

public void drawPixels(ImageProcessor ip)
Draws an outline of this OvalRoi on the image.

Specified by:
drawPixels in interface RoiBeans
Overrides:
drawPixels in class Roi
See Also:
ImageProcessor.setColor(java.awt.Color), ImageProcessor.setLineWidth(int)

getPolygon

public java.awt.Polygon getPolygon()
Returns this OvalRoi as a polygon.

Specified by:
getPolygon in interface RoiBeans
Overrides:
getPolygon in class Roi
See Also:
ImageProcessor.setRoi(java.awt.Rectangle), ImageProcessor.drawPolygon(java.awt.Polygon), ImageProcessor.fillPolygon(java.awt.Polygon)

contains

public boolean contains(int ox,
                        int oy)
Tests if the specified point is inside the boundary of this OvalRoi.

Specified by:
contains in interface RoiBeans
Overrides:
contains in class Roi

isHandle

public int isHandle(int sx,
                    int sy)
Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1.

Specified by:
isHandle in interface RoiBeans
Overrides:
isHandle in class Roi

getMask

public ImageProcessor getMask()
Description copied from class: Roi
Always returns null for rectangular Roi's

Specified by:
getMask in interface RoiBeans
Overrides:
getMask in class Roi

getLength

public double getLength()
Returns the perimeter length.

Specified by:
getLength in interface RoiBeans
Overrides:
getLength in class Roi

setColor

public static void setColor(java.awt.Color c)
Sets the default (global) color used for ROI outlines.

See Also:
getColor(), setStrokeColor(Color)

getColor

public static java.awt.Color getColor()
Returns the default (global) color used for drawing ROI outlines.

See Also:
setColor(Color), getStrokeColor()

setStrokeColor

public void setStrokeColor(java.awt.Color c)
Sets the color used by this ROI to draw its outline. This color, if not null, overrides the global color set by the static setColor() method.

Specified by:
setStrokeColor in interface RoiBeans
Overrides:
setStrokeColor in class AttributeRoi
See Also:
getStrokeColor(), #setStrokeWidth(int), ImagePlus.setOverlay(ij.gui.Overlay)

getStrokeColor

public java.awt.Color getStrokeColor()
Returns the the color used to draw the ROI outline or null if the default color is being used.

Specified by:
getStrokeColor in interface RoiBeans
Overrides:
getStrokeColor in class AttributeRoi
See Also:
setStrokeColor(Color)

setFillColor

public void setFillColor(java.awt.Color color)
Sets the color used to fill ROIs when they are in an overlay.

Specified by:
setFillColor in interface RoiBeans
Overrides:
setFillColor in class AttributeRoi
See Also:
ImagePlus.setOverlay(ij.gui.Overlay)

getFillColor

public java.awt.Color getFillColor()
Returns the color used to fill this ROI, or null if it is not filled.

Specified by:
getFillColor in interface RoiBeans
Overrides:
getFillColor in class AttributeRoi
See Also:
getStrokeColor()

setDefaultFillColor

public static void setDefaultFillColor(java.awt.Color color)

getDefaultFillColor

public static java.awt.Color getDefaultFillColor()