protected class DrawToolFactory.GenericDrawTool extends MouseTool
GenericDrawTool targets Element having a finite number of control points ONLY !
lastMouseEvent, mouseOutside| Constructor and Description |
|---|
GenericDrawTool(Element prototype,
EditPointConstraint constraint)
The
drawPoints array gets computed
from all available control-points for the given element. |
GenericDrawTool(Element prototype,
EditPointConstraint constraint,
int[][] drawPoints) |
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
called when this tool is being replaced by another mouse-tool in the hosting
editor kit ; this is mainly for mousetools using more than one sequence, for it
gives them a chance to clean themselves up for the next time
|
void |
init()
called when this tool is being activated in the hosting editor kit
|
void |
mouseDragged(PEMouseEvent e)
set current point
|
void |
mouseMoved(PEMouseEvent e)
set cursor for canvas, then call mouseDragged
|
void |
mousePressed(PEMouseEvent e)
A popup-trigger mouse event (e.g.
|
void |
paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D allocation,
double scale)
This method is called by the hosting EditorKit : this implementation paints
the current element's highlighter.
|
void |
setCurrentPoint(PEMouseEvent e)
move the points indexed in drawPoints[currentTaskIndex] to the current click-point
(possibly after grid alignment).
|
getLastMouseEvent, keyPressed, keyReleased, mouseClicked, mouseEntered, mouseExited, mouseReleased, processKeyEventpublic GenericDrawTool(Element prototype, EditPointConstraint constraint, int[][] drawPoints)
prototype - the Element that will serve as the prototype (getting cloned, then
added to the drawing).constraint - which constraint to use when moving control-pointsdrawPoints - an array of array of point indexes which the iterator will
iterate through (in ascending order) to draw the element (at each iteration, the corresponding list of points
will be updated together).Element.setPoint(int, jpicedt.graphic.PicPoint)public GenericDrawTool(Element prototype, EditPointConstraint constraint)
drawPoints array gets computed
from all available control-points for the given element.prototype - the Element that will serve as the prototype (getting cloned, then
added to the drawing).inputAttributes - the input attribute set for the Element to be created.public void mousePressed(PEMouseEvent e)
mousePressed in interface PEMouseInputListenermousePressed in class MouseToolpublic void mouseDragged(PEMouseEvent e)
mouseDragged in interface PEMouseInputListenermouseDragged in class MouseToolpublic void mouseMoved(PEMouseEvent e)
mouseMoved in interface PEMouseInputListenermouseMoved in class MouseToolpublic void setCurrentPoint(PEMouseEvent e)
public void init()
public void flush()
Submit a bug : syd@jpicedt.org