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, getButton
boolean dragging
boolean draggingCutout
Vector2D originalMousePosition
public SelectTool(CutCADApplet application, ObjectContainer container)
public java.lang.String getIconName()
Tool
getIconName
in class Tool
public void mouseButtonPressed(Vector2D position, int button)
mouseButtonPressed
in class Tool
position
- the mouse pointer positionbutton
- check, if left or right button pressedpublic void mouseButtonReleased(Vector2D position, int button)
Tool
mouseButtonReleased
in class Tool
position
- The absolute position of the mouse cursor.button
- The button that was released.public void mouseMoved(Vector2D position)
mouseMoved
in class Tool
position
- mouse pointer positionpublic void toolWasSelected()
Tool
toolWasSelected
in class Tool
public void toolWasUnselected()
Tool
toolWasUnselected
in class Tool