ij.gui
Class AbstractRoi

java.lang.Object
  extended by ij.gui.AbstractRoi
All Implemented Interfaces:
RoiBeans, RoiConstance
Direct Known Subclasses:
AttributeRoi

public abstract class AbstractRoi
extends java.lang.Object
implements RoiBeans

Title:

Description:

Copyright: Copyright (c) 2011

Company:


Field Summary
 
Fields inherited from interface ij.gui.RoiConstance
ADD_TO_ROI, ANGLE, COMPOSITE, CONSTRUCTING, FREELINE, FREEROI, HANDLE_SIZE, LINE, MOVING, MOVING_HANDLE, NO_MODS, NORMAL, NOT_PASTING, OVAL, POINT, POLYGON, POLYLINE, RECTANGLE, RESIZING, SUBTRACT_FROM_ROI, TRACED_ROI
 
Constructor Summary
AbstractRoi()
           
 
Method Summary
protected abstract  int clipRectMargin()
           
 java.lang.Object clone()
          Returns a copy of this roi.
static java.awt.Color getColor()
          Returns the default (global) color used for drawing ROI outlines.
static int getCurrentPasteMode()
          Returns the current paste transfer mode.
static java.awt.Color getDefaultFillColor()
           
protected abstract  double getMagnification()
           
protected abstract  java.awt.BasicStroke getScaledStroke()
           
protected abstract  void grow(int sx, int sy)
           
protected abstract  void handleMouseDown(int sx, int sy)
           
protected abstract  void handleMouseDrag(int sx, int sy, int flags)
           
protected abstract  void handleMouseUp(int screenX, int screenY)
           
protected abstract  void mouseDownInHandle(int handle, int sx, int sy)
           
protected abstract  void moveHandle(int sx, int sy)
           
protected abstract  int screenX(int ox)
           
protected abstract  int screenXD(double ox)
           
protected abstract  int screenY(int oy)
           
protected abstract  int screenYD(double oy)
           
static void setColor(java.awt.Color c)
          Sets the default (global) color used for ROI outlines.
static void setDefaultFillColor(java.awt.Color color)
          Sets the color used by this ROI to draw its outline.
static void setPasteMode(int transferMode)
          Sets the Paste transfer mode.
protected abstract  void showStatus()
           
static float[] toFloat(int[] arr)
          Converts an int array to a float array.
static int[] toInt(float[] arr)
          Converts a float array to an int array using truncation.
static int[] toInt(float[] arr, int[] arr2, int size)
           
static int[] toIntR(float[] arr)
          Converts a float array to an int array using rounding.
protected abstract  void updateClipRect()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ij.gui.RoiBeans
abortPaste, contains, copyAttributes, draw, drawHandle, drawOverlay, drawPixels, drawPixels, endPaste, equals, getAngle, getBoundingRect, getBounds, getConvexHull, getCornerDiameter, getDrawOffset, getFeretsDiameter, getFeretValues, getFillColor, getFloatBounds, getFloatPolygon, getHandleSize, getImage, getImageID, getLength, getMask, getName, getPasteMode, getPolygon, getPosition, getPrototypeOverlay, getRoundRectArcSize, getState, getStroke, getStrokeColor, getStrokeWidth, getType, getTypeAsString, isArea, isDrawingTool, isHandle, isLine, isVisible, nudge, nudgeCorner, setCornerDiameter, setDrawOffset, setFillColor, setImage, setInstanceColor, setLineWidth, setLocation, setName, setNonScalable, setPosition, setPosition, setPrototypeOverlay, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth, startPaste, subPixelResolution, toString, update, updateWideLine
 

Constructor Detail

AbstractRoi

public AbstractRoi()
Method Detail

grow

protected abstract void grow(int sx,
                             int sy)

moveHandle

protected abstract void moveHandle(int sx,
                                   int sy)

updateClipRect

protected abstract void updateClipRect()

clipRectMargin

protected abstract int clipRectMargin()

handleMouseDrag

protected abstract void handleMouseDrag(int sx,
                                        int sy,
                                        int flags)

mouseDownInHandle

protected abstract void mouseDownInHandle(int handle,
                                          int sx,
                                          int sy)

handleMouseDown

protected abstract void handleMouseDown(int sx,
                                        int sy)

handleMouseUp

protected abstract void handleMouseUp(int screenX,
                                      int screenY)

showStatus

protected abstract void showStatus()

setColor

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

See Also:
getColor(), RoiBeans.setStrokeColor(Color)

getColor

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

See Also:
setColor(Color), RoiBeans.getStrokeColor()

setDefaultFillColor

public static void setDefaultFillColor(java.awt.Color color)
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.

See Also:
RoiBeans.getStrokeColor(), #setStrokeWidth(int), ImagePlus.setOverlay(ij.gui.Overlay)

getDefaultFillColor

public static java.awt.Color getDefaultFillColor()

getScaledStroke

protected abstract java.awt.BasicStroke getScaledStroke()

setPasteMode

public static void setPasteMode(int transferMode)
Sets the Paste transfer mode.

See Also:
Blitter

getCurrentPasteMode

public static int getCurrentPasteMode()
Returns the current paste transfer mode.


getMagnification

protected abstract double getMagnification()

clone

public java.lang.Object clone()
Returns a copy of this roi. See Thinking is Java by Bruce Eckel (www.eckelobjects.com) for a good description of object cloning.

Overrides:
clone in class java.lang.Object

screenX

protected abstract int screenX(int ox)

screenY

protected abstract int screenY(int oy)

screenXD

protected abstract int screenXD(double ox)

screenYD

protected abstract int screenYD(double oy)

toInt

public static int[] toInt(float[] arr)
Converts a float array to an int array using truncation.


toInt

public static int[] toInt(float[] arr,
                          int[] arr2,
                          int size)

toIntR

public static int[] toIntR(float[] arr)
Converts a float array to an int array using rounding.


toFloat

public static float[] toFloat(int[] arr)
Converts an int array to a float array.