public class SelectTool extends Tool
| Modifier and Type | Field and Description |
|---|---|
(package private) boolean |
dragging |
(package private) boolean |
draggingCutout |
(package private) Vector2D |
originalMousePosition |
application, objectContainer, view| Constructor and Description |
|---|
SelectTool(CutCADApplet application,
ObjectContainer container) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getIconName()
Return the name of the SVG for the icon for the tool.
|
void |
mouseButtonPressed(Vector2D position,
int button)
If the mouse pointer is above a shape, connection etc.
|
void |
mouseButtonReleased(Vector2D position,
int button)
Will be called by the application when a mouse button was released.
|
void |
mouseMoved(Vector2D position)
Checks (and set true) if the mouse pointer is above a shape, cutout edge etc
and - if a button is additionally pressed - translates object positions corresponding
to a basic drag and drop functionality
|
void |
toolWasSelected()
Will be called by the application when this tool was selected.
|
void |
toolWasUnselected()
Will be called by the application when another tool was selected.
|
canStaySelected, draw2D, getButtonboolean dragging
boolean draggingCutout
Vector2D originalMousePosition
public SelectTool(CutCADApplet application, ObjectContainer container)
public java.lang.String getIconName()
ToolgetIconName in class Toolpublic void mouseButtonPressed(Vector2D position, int button)
mouseButtonPressed in class Toolposition - the mouse pointer positionbutton - check, if left or right button pressedpublic void mouseButtonReleased(Vector2D position, int button)
ToolmouseButtonReleased in class Toolposition - The absolute position of the mouse cursor.button - The button that was released.public void mouseMoved(Vector2D position)
mouseMoved in class Toolposition - mouse pointer positionpublic void toolWasSelected()
TooltoolWasSelected in class Toolpublic void toolWasUnselected()
TooltoolWasUnselected in class Tool