|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.event.KeyAdapter jpicedt.graphic.toolkit.MouseTool jpicedt.graphic.toolkit.DrawToolFactory.GenericDrawTool
protected class DrawToolFactory.GenericDrawTool
A MouseTool
aimed at drawing new Element
s. It works like an iterator, by
iterating (cyclically, creating a new Element at each cycle) through a given array of point indexes, or
(if the latter are not provided in the constructor) by computing it from the available control points
for the given element.
GenericDrawTool
targets Element having a finite number of control points ONLY !
Nested Class Summary |
---|
Nested classes/interfaces inherited from class jpicedt.graphic.toolkit.MouseTool |
---|
MouseTool.MouseToolType |
Field Summary |
---|
Fields inherited from class jpicedt.graphic.toolkit.MouseTool |
---|
lastMouseEvent, mouseOutside |
Constructor Summary | |
---|---|
DrawToolFactory.GenericDrawTool(Element prototype,
EditPointConstraint.EditConstraint constraint)
The drawPoints array gets computed
from all available control-points for the given element. |
|
DrawToolFactory.GenericDrawTool(Element prototype,
EditPointConstraint.EditConstraint constraint,
int[][] drawPoints)
|
Method Summary | |
---|---|
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. a right click on Unix/Windows) : switches back to SELECT_MODE if the task-iterator is completed
or cancels the current task if the task-iterator is underway. |
void |
paint(Graphics2D g,
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). |
Methods inherited from class jpicedt.graphic.toolkit.MouseTool |
---|
getLastMouseEvent, keyPressed, keyReleased, mouseClicked, mouseEntered, mouseExited, mouseReleased, processKeyEvent |
Methods inherited from class java.awt.event.KeyAdapter |
---|
keyTyped |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DrawToolFactory.GenericDrawTool(Element prototype, EditPointConstraint.EditConstraint 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.setCtrlPt(int, jpicedt.graphic.PicPoint)
public DrawToolFactory.GenericDrawTool(Element prototype, EditPointConstraint.EditConstraint 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).constraint
- Point edition constraint to be fulfilled during editionMethod Detail |
---|
public void mousePressed(PEMouseEvent e)
SELECT_MODE
if the task-iterator is completed
mousePressed
in interface PEMouseInputListener
mousePressed
in class MouseTool
public void mouseDragged(PEMouseEvent e)
mouseDragged
in interface PEMouseInputListener
mouseDragged
in class MouseTool
public void mouseMoved(PEMouseEvent e)
mouseMoved
in interface PEMouseInputListener
mouseMoved
in class MouseTool
public void setCurrentPoint(PEMouseEvent e)
public void init()
init
in class MouseTool
public void flush()
flush
in class MouseTool
public void paint(Graphics2D g, Rectangle2D allocation, double scale)
paint
in class MouseTool
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |