public class PolygonTool extends Tool
Modifier and Type | Field and Description |
---|---|
private float |
boundingBoxSize |
private Vector2D |
lastKnownMousePositon |
private float |
scalingFactor |
private java.util.List<Vector2D> |
vertices |
application, objectContainer, view
Constructor and Description |
---|
PolygonTool(CutCADApplet application,
ObjectContainer container) |
Modifier and Type | Method and Description |
---|---|
void |
draw2D(processing.core.PGraphics p,
Transformation t)
Will be called by the drawing runloop of the application whenever the screen is redrawn.
|
private void |
drawCloseRect(processing.core.PGraphics p) |
java.lang.String |
getIconName()
Return the name of the SVG for the icon for the tool.
|
void |
mouseButtonReleased(Vector2D position,
int button)
Will be called by the application when a mouse button was released.
|
void |
mouseMoved(Vector2D position)
Will be called by the application when the mouse was moved.
|
private boolean |
mouseOverCloseShape() |
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, getButton, mouseButtonPressed
private java.util.List<Vector2D> vertices
private Vector2D lastKnownMousePositon
private float scalingFactor
private float boundingBoxSize
public PolygonTool(CutCADApplet application, ObjectContainer container)
public java.lang.String getIconName()
Tool
getIconName
in class Tool
public 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.private boolean mouseOverCloseShape()
public void mouseMoved(Vector2D position)
Tool
mouseMoved
in class Tool
position
- The absolute position of the mouse cursor.public void draw2D(processing.core.PGraphics p, Transformation t)
Tool
draw2D
in interface Drawable2D
draw2D
in class Tool
p
- The graphics context to draw into.t
- The transformation currently applied to the context.private void drawCloseRect(processing.core.PGraphics p)
public void toolWasSelected()
Tool
toolWasSelected
in class Tool
public void toolWasUnselected()
Tool
toolWasUnselected
in class Tool