Package net.sf.jaxodraw.gui.handle
Class JaxoDefaultHandle
java.lang.Object
net.sf.jaxodraw.gui.handle.AbstractJaxoHandle
net.sf.jaxodraw.gui.handle.JaxoDefaultHandle
- All Implemented Interfaces:
JaxoHandle
A default implementation for handles.
- Since:
- 2.0
-
Field Summary
Fields inherited from class net.sf.jaxodraw.gui.handle.AbstractJaxoHandle
DEFAULT_COLOR, DEFAULT_FILL_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_SIZE, DEFAULT_STROKE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(int handleX, int handleY, int x, int y) Determines whether the given point is contained in this handle.void
paint
(JaxoGraphics2D g2, int x, int y, boolean marked, Color handleColor) Paints the handle to the given graphics context.Methods inherited from class net.sf.jaxodraw.gui.handle.AbstractJaxoHandle
getBounds, getColor, getFillColor, getSecondaryColor, getSize, getStroke, paint, paint, paint, paintSecondary, paintSecondary, setColor, setFillColor, setSecondaryColor, setSize, setStroke
-
Constructor Details
-
JaxoDefaultHandle
public JaxoDefaultHandle()
-
-
Method Details
-
paint
Paints the handle to the given graphics context. This implementation paints the default squares.- Specified by:
paint
in classAbstractJaxoHandle
- Parameters:
g2
- The graphics context to paint to.x
- The x position of the handle.y
- The y position of the handle.marked
- True if the handle should be marked (selected).handleColor
- The color of the handle.
-
contains
public boolean contains(int handleX, int handleY, int x, int y) Determines whether the given point is contained in this handle. This implementation checks if the point is contained within a square of length getSize() around the handle point.- Parameters:
handleX
- The x position of the handle.handleY
- The y position of the handle.x
- The x position of the point to check.y
- The y position of the point to check.- Returns:
- True if the handle encloses the point, false otherwise.
-