public class CreateHandler extends Handler
NoAnchor, NorthEastAnchor, NorthWestAnchor, SouthEastAnchor, SouthWestAnchor
Constructor and Description |
---|
CreateHandler(Model model,
DrawingPalette view) |
Modifier and Type | Method and Description |
---|---|
boolean |
complete(java.awt.Point pt,
int modifiers,
java.util.Optional<Element> elt)
Add the given object to the actual model.
|
boolean |
drag(java.awt.Point starting,
int modifiers,
java.util.Optional<Element> elt,
java.awt.Point current)
Act on the mouse drag.
|
void |
paint(java.awt.Graphics g)
Each handler gets the chance to override and provide specific paint capabilities after elements are drawn.
|
boolean |
start(java.awt.Point start,
int modifiers,
java.util.Optional<Element> elt)
Initiate the beginning of a drag action.
|
completeAnchor, dragAnchor, getNext, isInterested, move, setNext, startAnchor
public CreateHandler(Model model, DrawingPalette view)
public boolean start(java.awt.Point start, int modifiers, java.util.Optional<Element> elt)
start
in interface IActionInterface
start
in class Handler
start
- starting an element action at this mouse locationmodifiers
- keyboard modifiers in effectelt
- optional element in playpublic boolean complete(java.awt.Point pt, int modifiers, java.util.Optional<Element> elt)
complete
in interface IActionInterface
complete
in class Handler
pt
- ending mouse location of this mouse actionmodifiers
- keyboard modifiers in effectelt
- optional element in playpublic boolean drag(java.awt.Point starting, int modifiers, java.util.Optional<Element> elt, java.awt.Point current)
IActionInterface
drag
in interface IActionInterface
drag
in class Handler
starting
- original starting mouse location of this drag actionmodifiers
- keyboard modifiers in effectelt
- optional element in playcurrent
- current mouse locationpublic void paint(java.awt.Graphics g)
Handler
paint
in interface IActionInterface
paint
in class Handler
g
- Graphics context into which to draw whatever is necessary based on the tool