|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ij.gui.Roi ij.gui.PolygonRoi pointHandler
class pointHandler
This class is responsible for dealing with the list of point coordinates and for their visual appearance.
Field Summary | |
---|---|
private static int |
CROSS_HALFSIZE
|
private int |
currentPoint
|
protected static int |
GAMUT
|
private static int |
ID
|
private ij.ImagePlus |
imp
|
private java.util.Vector<java.lang.Integer> |
listColors
|
private java.util.Vector<java.lang.Integer> |
listIDs
|
private java.util.Vector<java.awt.Point> |
listPoints
|
protected static int |
MONOCHROME
|
private int |
nextColor
|
private int |
numPoints
|
private pointAction |
pa
|
protected static int |
RAINBOW
|
private static long |
serialVersionUID
|
private java.awt.Color[] |
spectrum
|
private boolean |
started
|
private pointToolbar |
tb
|
private boolean[] |
usedColor
|
Fields inherited from class ij.gui.PolygonRoi |
---|
maxPoints, nPoints, splinePoints, xp, xp2, xpf, xSpline, yp, yp2, ypf, ySpline |
Fields inherited from class ij.gui.Roi |
---|
ANGLE, asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, defaultFillColor, fillColor, FREELINE, FREEROI, HANDLE_SIZE, handleColor, ic, ignoreClipRect, 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 |
Constructor Summary | |
---|---|
protected |
pointHandler(ij.ImagePlus imp,
pointToolbar tb)
This constructor stores a local copy of its parameters and initializes the current spectrum. |
Method Summary | |
---|---|
protected void |
addPoint(int x,
int y)
This method adds a new point to the list, with a color that is as different as possible from all those that are already in use. |
protected void |
addPoint(int x,
int y,
int color)
This method adds a new point to the list, with a specific color. |
void |
draw(java.awt.Graphics g)
Draw the landmarks and outline the current point if there is one. |
protected void |
findClosest(int x,
int y)
Let the point that is closest to the given coordinates become the current landmark. |
protected java.util.Vector<java.lang.Integer> |
getColors()
Return the list of colors. |
protected java.lang.Integer |
getCurrentColor()
Return the color of the current object. |
protected java.util.Vector<java.lang.Integer> |
getIDs()
Return the list of IDs. |
protected java.awt.Point |
getPoint()
Return the current point as a Point object. |
protected java.util.Vector<java.awt.Point> |
getPoints()
Return the list of points. |
protected boolean |
isUsedColor(int color)
Return true if color is free. |
protected void |
movePoint(int x,
int y)
Modify the location of the current point. |
protected void |
movePoint(int x,
int y,
java.lang.Integer color)
Modify the location of the current point. |
protected void |
removePoint()
Remove the current point. |
protected void |
removePoint(java.lang.Integer color)
Remove a point of a given index. |
protected void |
removePoints()
Remove all points and make every color available. |
protected void |
setPointAction(pointAction pa)
Stores a local copy of its parameter and allows the graphical operations to proceed. |
protected void |
setSpectrum(int colorization)
Setup the color scheme. |
private int |
stirColor(int color)
|
Methods inherited from class ij.gui.PolygonRoi |
---|
addOffset, clipRectMargin, clone, contains, deleteHandle, drawPixels, exitConstructingMode, fitSpline, fitSpline, fitSplineForStraightening, getAngle, getConvexHull, getDrawOffset, getFloatPolygon, getInterpolatedPolygon, getLength, getMask, getNCoordinates, getNonSplineCoordinates, getNonSplineFloatCoordinates, getPolygon, getUncalibratedLength, getXCoordinates, getYCoordinates, grow, handleMouseUp, isHandle, isSplineFit, mouseDownInHandle, moveHandle, removeSplineFit, setDrawOffset, subPixelResolution, updatePolygon |
Methods inherited from class ij.gui.Roi |
---|
abortPaste, copyAttributes, drawOverlay, drawPixels, endPaste, equals, getAngle, getBoundingRect, getBounds, getColor, getCornerDiameter, getCPosition, getCurrentPasteMode, getDefaultFillColor, getFeretsDiameter, getFeretValues, getFillColor, getFloatAngle, getFloatBounds, getImage, getImageID, getInterpolatedPolygon, getInterpolatedPolygon, getMagnification, getName, getPasteMode, getPosition, getPrototypeOverlay, getRoundRectArcSize, getScaledStroke, getState, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getTypeAsString, getZPosition, handleMouseDown, handleMouseDrag, isActiveOverlayRoi, isArea, isDrawingTool, isLine, isVisible, mouseDragged, mouseReleased, nudge, nudgeCorner, screenX, screenXD, screenY, screenYD, setColor, setCornerDiameter, setDefaultFillColor, setFillColor, setIgnoreClipRect, setImage, setInstanceColor, setLineWidth, setLocation, setName, setNonScalable, setPasteMode, setPosition, setPosition, setPrototypeOverlay, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth, showStatus, startPaste, temporarilyHide, toFloat, toInt, toInt, toIntR, toString, update, updateClipRect, updateWideLine |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int RAINBOW
protected static final int MONOCHROME
protected static final int GAMUT
private static final int CROSS_HALFSIZE
private static final long serialVersionUID
private static int ID
private final java.awt.Color[] spectrum
private final boolean[] usedColor
private final java.util.Vector<java.lang.Integer> listColors
private final java.util.Vector<java.lang.Integer> listIDs
private final java.util.Vector<java.awt.Point> listPoints
private ij.ImagePlus imp
private pointAction pa
private pointToolbar tb
private int nextColor
private int currentPoint
private int numPoints
private boolean started
Constructor Detail |
---|
protected pointHandler(ij.ImagePlus imp, pointToolbar tb)
imp
- ImagePlus
object where points are being picked.tb
- pointToolbar
object that handles the toolbar.Method Detail |
---|
public void draw(java.awt.Graphics g)
draw
in class ij.gui.PolygonRoi
g
- Graphics environment.protected void addPoint(int x, int y)
x
- Horizontal coordinate, in canvas units.y
- Vertical coordinate, in canvas units.protected void addPoint(int x, int y, int color)
x
- Horizontal coordinate, in canvas units.y
- Vertical coordinate, in canvas units.color
- Specific color.protected void findClosest(int x, int y)
x
- Horizontal coordinate, in canvas units.y
- Vertical coordinate, in canvas units.protected java.util.Vector<java.lang.Integer> getColors()
protected java.lang.Integer getCurrentColor()
protected java.util.Vector<java.lang.Integer> getIDs()
protected java.awt.Point getPoint()
Point
object.
protected java.util.Vector<java.awt.Point> getPoints()
protected boolean isUsedColor(int color)
true
if color is free.
Return false
if color is in use.
protected void movePoint(int x, int y)
x
- Desired new horizontal coordinate in canvas units.y
- Desired new vertical coordinate in canvas units.protected void movePoint(int x, int y, java.lang.Integer color)
x
- Desired new horizontal coordinate in canvas units.y
- Desired new vertical coordinate in canvas units.color
- Color index of the point to move.protected void removePoint()
protected void removePoint(java.lang.Integer color)
color
- Color index of the point to remove.protected void removePoints()
protected void setPointAction(pointAction pa)
pa
- pointAction
object.protected void setSpectrum(int colorization)
colorization
- Colorization code. Admissible values are
{RAINBOW
, MONOCHROME
}.private int stirColor(int color)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |