public abstract class Tool
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected javafx.scene.control.Button |
button
The button corresponding to this tool
|
protected javafx.scene.control.CheckMenuItem |
menuItem
The menu item corresponding to this tool
|
Constructor and Description |
---|
Tool(javafx.scene.control.Button button,
javafx.scene.control.CheckMenuItem menuItem) |
Modifier and Type | Method and Description |
---|---|
javafx.scene.control.Button |
getButton() |
javafx.scene.control.CheckMenuItem |
getMenuItem() |
abstract 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
|
boolean |
matches(javafx.event.EventTarget target)
Checks whether the tool button or menu item pressed matches this tool
|
protected javafx.scene.control.Button button
protected javafx.scene.control.CheckMenuItem menuItem
public Tool(javafx.scene.control.Button button, javafx.scene.control.CheckMenuItem menuItem)
public boolean matches(javafx.event.EventTarget target)
target
- the tool button or menu item pressedpublic javafx.scene.control.CheckMenuItem getMenuItem()
public javafx.scene.control.Button getButton()
public abstract void handleMouse(javafx.scene.input.MouseEvent e, javafx.event.EventType<? extends javafx.scene.input.MouseEvent> type, PaintController controller)
e
- the mouse eventtype
- the type of the mouse eventcontroller
- the program's controller