net.sf.jaxodraw.gui.handle
Class JaxoRoundHandle

java.lang.Object
  extended by net.sf.jaxodraw.gui.handle.AbstractJaxoHandle
      extended by net.sf.jaxodraw.gui.handle.JaxoRoundHandle
All Implemented Interfaces:
JaxoHandle

public class JaxoRoundHandle
extends AbstractJaxoHandle

A circle 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
JaxoRoundHandle()
          Constructor.
 
Method Summary
 boolean 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxoRoundHandle

public JaxoRoundHandle()
Constructor.

Method Detail

paint

public void paint(JaxoGraphics2D g2,
                  int x,
                  int y,
                  boolean marked,
                  Color handleColor)
Paints the handle to the given graphics context. This implementation paints circles.

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 circle 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.


Copyright © 2003-2011 The JaxoDraw team. All Rights Reserved.