| java.lang.Object com.blogofbug.swing.delegates.MouseTracker
MouseTracker | public class MouseTracker implements ContainerListener,MouseListener,MouseMotionListener(Code) | | A class which abstracts away some of the complexity of a mouse listener meaning that listeners (See MouseTrackerListener) need to implement fewer methods.
Furthermore, unlike a normal mouse listener it still considers the mouse to be inside
even if it is over a component inside a container, and will translate the co-ordintates to be
relative to the "listened to" component
author: nigel |
mouseInside | protected boolean mouseInside(Code) | | True if the mouse is inside
|
position | protected Point position(Code) | | The last known position
|
MouseTracker | public MouseTracker(Component component)(Code) | | Adds a mouse tracker to the specified component
Parameters: component - the component to track |
MouseTracker | public MouseTracker(Component component, MouseTrackerListener client)(Code) | | Adds a mouse tracker to the specified component, and adds the specified
listener
Parameters: component - The component to track Parameters: client - A listener |
addListener | public void addListener(MouseTrackerListener client)(Code) | | Adds a listener to the MouseTracker. The listener will get all of the mouse
tracker events
Parameters: client - The listener |
componentAdded | public void componentAdded(ContainerEvent e)(Code) | | Adds a mouseMotion listener to the added component
Parameters: e - The event when something is added |
componentRemoved | public void componentRemoved(ContainerEvent e)(Code) | | Removes the mouseMotion listener from the removed component
Parameters: e - |
getPosition | public Point getPosition()(Code) | | Retreives the point position, returns null if the pointer is outside the
component
The pointer position or null if the pointer is not inside the tracked object |
isMouseInside | public boolean isMouseInside()(Code) | | Determines if the mouse is inside the tracked component
true if it is, false if it isn't |
mouseClicked | public void mouseClicked(MouseEvent e)(Code) | | NOT USED
Parameters: e - Mouse Event |
mouseDragged | public void mouseDragged(MouseEvent e)(Code) | | NOT USED
Parameters: e - Mouse Event |
mouseEntered | public void mouseEntered(MouseEvent e)(Code) | | Tracks when the mouse moves into the component
Parameters: e - Mouse Event |
mouseExited | protected void mouseExited()(Code) | | Called when the mouse has been determined to have REALLY exited the component
|
mouseExited | public void mouseExited(MouseEvent e)(Code) | | Captures the exit event and checks to see if the compnent is a container. If it's
not it just passes on the event, otherwise the event is only passed on if the
component the mouse is now over is not contained in the container.
Parameters: e - Mouse Event |
mouseMoved | public void mouseMoved(MouseEvent e)(Code) | | When the mouse moves within the component, or one of the contained componets
determines the point within the tracked component and passes that on to the
listeners.
Parameters: e - Mouse Event |
mousePressed | public void mousePressed(MouseEvent e)(Code) | | NOT USED
Parameters: e - Mouse Event |
mouseReleased | public void mouseReleased(MouseEvent e)(Code) | | NOT USED
Parameters: e - Mouse Event |
removeListener | public void removeListener(MouseTrackerListener client)(Code) | | Removes a listener from the listener list
Parameters: client - the listener to remove from the list |
|
|