public class MoveTool extends Tool
Modifier and Type | Field and Description |
---|---|
private boolean |
awaitingPlace
Whether an image is currently selected for placing
|
private boolean |
justPlaced
Whether an image was just placed
|
private double[] |
lastPos
The position of the mouse when it was pressed
|
private Paint |
paint
The main class of the program
|
private java.awt.image.BufferedImage |
selection
The current selection
|
Constructor and Description |
---|
MoveTool(javafx.scene.control.Button button,
javafx.scene.control.CheckMenuItem menuItem,
Paint paint)
Create a MoveTool
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAwaitingPlace() |
java.awt.image.BufferedImage |
getSelection() |
void |
handleMouse(javafx.scene.input.MouseEvent e,
javafx.event.EventType<? extends javafx.scene.input.MouseEvent> type,
PaintController controller)
Handles canvas mouse events while this tool is selected
|
void |
reset() |
void |
setAwaitingPlace() |
void |
setSelection(java.awt.image.BufferedImage bi) |
getButton, getMenuItem, matches
private Paint paint
private boolean awaitingPlace
private boolean justPlaced
private java.awt.image.BufferedImage selection
private double[] lastPos
public MoveTool(javafx.scene.control.Button button, javafx.scene.control.CheckMenuItem menuItem, Paint paint)
button
- the tool button corresponding to this toolmenuItem
- the menu item corresponding to this toolpaint
- the main class of the programpublic void handleMouse(javafx.scene.input.MouseEvent e, javafx.event.EventType<? extends javafx.scene.input.MouseEvent> type, PaintController controller)
Tool
handleMouse
in class Tool
e
- the mouse eventtype
- the type of the mouse eventcontroller
- the program's controllerpublic void setSelection(java.awt.image.BufferedImage bi)
public java.awt.image.BufferedImage getSelection()
public void setAwaitingPlace()
public boolean getAwaitingPlace()
public void reset()