be.ugent.caagt.swirl.mouse

Class MouseTool

Implemented Interfaces:
Iterable

public class MouseTool
extends java.lang.Object
implements Iterable

Wraps a list of mouse handlers for use with a MouseOverlay.

Constructor Summary

MouseTool()
Default constructor.

Method Summary

void
addHandler(MouseHandler handler)
Add a handler to this tool.
boolean
canHandle(JComponent parent)
Returns true if and only if all handlers registered with this tool can handle the given component.
Iterator
iterator()
Return an iterator over the handlers of this tool.

Constructor Details

MouseTool

public MouseTool()
Default constructor.

Method Details

addHandler

public void addHandler(MouseHandler handler)
Add a handler to this tool. The order in which handlers are registered determines the order in which they are tried when the mouse is pressed on the overlay which uses this tool.

Do not call this method while the tool is registered with some overlay.


canHandle

public boolean canHandle(JComponent parent)
Returns true if and only if all handlers registered with this tool can handle the given component.

iterator

public Iterator iterator()
Return an iterator over the handlers of this tool.