public class TextTool extends Tool
Modifier and Type | Field and Description |
---|---|
private PaintController |
controller
The controller corresponding to the canvas on which the text will be drawn
|
private TextDialog |
textDialog |
Constructor and Description |
---|
TextTool(javafx.scene.control.Button button,
javafx.scene.control.CheckMenuItem menuItem,
PaintController controller)
Create a TextTool
|
Modifier and Type | Method and Description |
---|---|
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 |
handleText()
Show the text dialog and wait for input
|
getButton, getMenuItem, matches
private PaintController controller
private TextDialog textDialog
public TextTool(javafx.scene.control.Button button, javafx.scene.control.CheckMenuItem menuItem, PaintController controller)
button
- the tool button corresponding to this toolmenuItem
- the menu item corresponding to this toolcontroller
- the controller corresponding to the canvas on which the text should be drawnpublic 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 handleText()