Package paintingcanvas.drawable
Interface Interactable
-
- All Known Implementing Classes:
Canvas
,Circle
,DrawableBase.InteractableShape
,Ellipse
,Rectangle
,Square
,Triangle
public interface Interactable
Allows for interaction with elements on the canvas.
This interface is pretty rough, if you need anything more precise it would be best to add your own
KeyListener
orMouseListener
toInternalCanvas.panel
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
clicked()
Check if the element has been clicked by the mouse.boolean
hovered()
Check if the element is currently being hovered over by the mouse.boolean
intersects(java.awt.Point pos)
Check if the point intersects with the element.
-
-
-
Method Detail
-
intersects
boolean intersects(java.awt.Point pos)
Check if the point intersects with the element.- Returns:
- true if the point intersects with the element, false otherwise.
-
hovered
boolean hovered()
Check if the element is currently being hovered over by the mouse.- Returns:
- true if the element is hovered, false otherwise.
-
clicked
boolean clicked()
Check if the element has been clicked by the mouse.- Returns:
- true if the element is clicked, false otherwise.
-
-