public class FreeformTool extends OverlayTool
| Modifier and Type | Class and Description | 
|---|---|
| protected class  | FreeformTool.DistanceQueryWraps information about the distance from a point to a freeform object. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected static int | CHILLConstant for "wait" mode. | 
| protected float | downXPoint at which mouseDown occurs. | 
| protected float | downYPoint at which mouseDown occurs. | 
| protected static int | DRAWConsant for "draw" mode. | 
| protected static double | DRAW_THRESHWhen drawing or editing, how far mouse must be dragged before new node is
 added. | 
| protected static int | EDITConstant for "edit" mode. | 
| protected static double | EDIT_THRESHThreshhold within which click must occur to invoke edit mode. | 
| protected static int | ERASEConstant for "erase" mode. | 
| protected static double | ERASE_THRESHHow close a mouseDrag event must be to a node in order to erase it. | 
| protected OverlayFreeform | freeformCurve currently being drawn or modified. | 
| protected FreeformExtension | freeformExtensionFreeformExtension wraps info about an edit to a curve. | 
| protected static int | INITConstant for "init" mode. | 
| protected int | modeStores the current mode (INIT, ERASE, CHILL, DRAW, EDIT). | 
| protected Vector | otherFreefsOther freeforms on the canvas. | 
| protected static double | RECONNECT_THRESHThreshhold within which click must occur to invoke extend mode or reconnect
 a freeformExtension. | 
| protected static double | RESUME_THRESHHow close mouse must be to end node to resume drawing. | 
| protected static float | SSmoothing factor for "single exponential smoothing". | 
icon, name, overlay, tip| Constructor and Description | 
|---|
| FreeformTool(OverlayTransform overlay)Constructs a freeform creation tool. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | eraseNearestNodeWithin(float thresh,
                      float x,
                      float y)Erases the nearest node of freeforms nearby. | 
| protected FreeformTool.DistanceQuery | getClosestFreeform(DisplayImpl display,
                  double dpx,
                  double dpy,
                  double thresh)Returns the closest (subject to a threshhold) OverlayFreeform object to the
 given point. | 
| protected Vector | getFreeforms(boolean includeThis)Compiles a list of other freeforms at the current dimensional position. | 
| void | mouseDown(DisplayEvent e,
         int px,
         int py,
         float dx,
         float dy,
         int[] pos,
         int mods)Instructs this tool to respond to a mouse press. | 
| void | mouseDrag(DisplayEvent e,
         int px,
         int py,
         float dx,
         float dy,
         int[] pos,
         int mods)Instructs this tool to respond to a mouse drag. | 
| void | mouseUp(DisplayEvent e,
       int px,
       int py,
       float dx,
       float dy,
       int[] pos,
       int mods)Instructs this tool to respond to a mouse release. | 
| void | print(String methodName,
     String message)Prints a message for debugging. | 
| protected void | removeEmptyFreeforms(OverlayFreeform[] objs)Removes any freeforms with one or fewer nodes. | 
deselectAll, getIcon, getName, getTip, getTransform, keyPressed, keyReleased, mouseMovedprotected static final double DRAW_THRESH
protected static final double ERASE_THRESH
protected static final double EDIT_THRESH
protected static final double RECONNECT_THRESH
protected static final double RESUME_THRESH
protected static final float S
protected static final int ERASE
protected static final int CHILL
protected static final int DRAW
protected static final int EDIT
protected static final int INIT
protected OverlayFreeform freeform
protected Vector otherFreefs
protected FreeformExtension freeformExtension
protected int mode
protected float downX
protected float downY
public FreeformTool(OverlayTransform overlay)
public void mouseDown(DisplayEvent e, int px, int py, float dx, float dy, int[] pos, int mods)
mouseDown in class OverlayToole - DisplayEvent corresponding to this mouse press.px - X coordinate of mouse press in pixel coordinate system.py - Y coordinate of mouse press in pixel coordinate system.dx - X coordinate of mouse press in data coordinate system.dy - Y coordinate of mouse press in data coordinate system.pos - Dimensional position of mouse press.mods - Modifiers of mouse press.public void mouseDrag(DisplayEvent e, int px, int py, float dx, float dy, int[] pos, int mods)
mouseDrag in class OverlayToole - DisplayEvent corresponding to this mouse drag.px - X coordinate of mouse drag in pixel coordinate system.py - Y coordinate of mouse drag in pixel coordinate system.dx - X coordinate of mouse drag in data coordinate system.dy - Y coordinate of mouse drag in data coordinate system.pos - Dimensional position of mouse drag.mods - Modifiers of mouse drag.public void mouseUp(DisplayEvent e, int px, int py, float dx, float dy, int[] pos, int mods)
mouseUp in class OverlayToole - DisplayEvent corresponding to this mouse release.px - X coordinate of mouse release in pixel coordinate system.py - Y coordinate of mouse release in pixel coordinate system.dx - X coordinate of mouse release in data coordinate system.dy - Y coordinate of mouse release in data coordinate system.pos - Dimensional position of mouse release.mods - Modifiers of mouse release.protected Vector getFreeforms(boolean includeThis)
protected void eraseNearestNodeWithin(float thresh,
                                      float x,
                                      float y)
protected void removeEmptyFreeforms(OverlayFreeform[] objs)
protected FreeformTool.DistanceQuery getClosestFreeform(DisplayImpl display, double dpx, double dpy, double thresh)
Copyright © 2015–2022 SciJava. All rights reserved.