Class JaxoDefaultHandle

  • All Implemented Interfaces:
    JaxoHandle

    public class JaxoDefaultHandle
    extends AbstractJaxoHandle
    A default implementation for handles.
    Since:
    2.0
    • Constructor Detail

      • JaxoDefaultHandle

        public JaxoDefaultHandle()
    • Method Detail

      • paint

        public void paint​(JaxoGraphics2D g2,
                          int x,
                          int y,
                          boolean marked,
                          java.awt.Color handleColor)
        Paints the handle to the given graphics context. This implementation paints the default squares.
        Specified by:
        paint in class AbstractJaxoHandle
        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.