org.pf.swing
Class ComponentPoint

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by java.awt.Point
          extended by org.pf.swing.ComponentPoint
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ComponentPoint
extends java.awt.Point

Represents a point relative to a component.

Version:
1.0
Author:
M.Duchrow
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
 
Field Summary
 
Fields inherited from class java.awt.Point
x, y
 
Constructor Summary
ComponentPoint(java.awt.Component component)
          Initialize the new instance with a component and relative position x=0, y=0.
ComponentPoint(java.awt.Component component, int x, int y)
          Initialize the new instance with a component and relative coordinates.
ComponentPoint(java.awt.Component component, java.awt.Point p)
          Initialize the new instance with a component and a point.
ComponentPoint(java.awt.event.MouseEvent mouseEvent)
          Initialize the new instance with values to derive from the given mouse event.
 
Method Summary
 java.awt.Component getComponent()
          Returns the component the point is relative to.
 java.awt.Point getPoint()
          Returns the point coordinates without the component.
 
Methods inherited from class java.awt.Point
equals, getLocation, getX, getY, move, setLocation, setLocation, setLocation, toString, translate
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentPoint

public ComponentPoint(java.awt.Component component)
Initialize the new instance with a component and relative position x=0, y=0.

Parameters:
component - The component to which the point is relative

ComponentPoint

public ComponentPoint(java.awt.Component component,
                      java.awt.Point p)
Initialize the new instance with a component and a point.

Parameters:
component - The component to which the point is relative
p - The point within the component

ComponentPoint

public ComponentPoint(java.awt.Component component,
                      int x,
                      int y)
Initialize the new instance with a component and relative coordinates.

Parameters:
component - The component to which the point is relative
x - The point's x coordinate
y - The point's y coordinate

ComponentPoint

public ComponentPoint(java.awt.event.MouseEvent mouseEvent)
Initialize the new instance with values to derive from the given mouse event.

Parameters:
mouseEvent - The event that contains the component and coordinates of the mouse click
Method Detail

getComponent

public java.awt.Component getComponent()
Returns the component the point is relative to.


getPoint

public java.awt.Point getPoint()
Returns the point coordinates without the component.