/**************************************************************************************************
 **
 ** $Id: MouseManager.java 831 2006-05-01 00:27:23Z Desruisseaux $
 **
 ** $URL: http://svn.code.sf.net/p/geoapi/code/branches/2.0.x/geoapi/src/main/java/org/opengis/go/display/event/MouseManager.java $
 **
 ** Copyright (C) 2003-2005 Open GIS Consortium, Inc.
 ** All Rights Reserved. http://www.opengis.org/legal/
 **
 *************************************************************************************************/
package org.opengis.go.display.event;

/**
 * Defines a common abstraction for classes that handle mouse events.
 * It prescribes a stack mechanism for managing MouseHandlers.
 * 
 * @author OpenGIS® consortium
 * @version $Revision: 658 $, $Date: 2006-02-23 12:09:34 +1100 (jeu., 23 févr. 2006) $
 */
public interface MouseManager extends EventManager {

    /**
     * The window will pass mouse events to only this MouseHandler,
     * until the MouseHandler is changed or removed.
     *
     * @param mouseHandler  the current mouse handler.
     */
    public void enableMouseHandler(MouseHandler mouseHandler);

    /**
     * Enable the given MouseHandler, and push it on the stack
     * so that if another MouseHandler gets enabled, this one
     * will be reenabled when that MouseHandler is removed.
     *
     * @param mouseHandler  The MouseHandler to enable and push.
     * @see #enableMouseHandler
     */
    public void pushMouseHandler(MouseHandler mouseHandler);

    /**
     * Remove the given MouseHandler and reinstate the
     * MouseHandler at the top of the stack, if any.
     *
     * @param mouseHandler  the MouseHandler to disable and remove.
     */
    public void removeMouseHandler(MouseHandler mouseHandler);

    /**
     * Replace a MouseHandler in the stack with another
     * MouseHandler.
     *
     * @param existingHandler the MouseHandler to be replaced.
     * @param replacementHandler the MouseHandler that is replacing
     *        the existingHandler.
     * @return true if existingHandler was found and replaced
     *         by replacementHandler.
     */
    public boolean replaceMouseHandler(MouseHandler existingHandler,
        MouseHandler replacementHandler);

    /**
     * Returns the current MouseHandler or {@code null} if none.
     *
     * @return the current MouseHandler or {@code null} if none.
     */
    public MouseHandler getCurrentMouseHandler();

    /**
     * Returns an array of additional MouseHandlers to call for a given
     * MouseEvent, if the current mouse handler doesn't handle it. These
     * handlers will be called in ascending index order until the MouseEvent
     * {@linkplain java.awt.event.InputEvent#isConsumed() is consumed}.
     *
     * @return the array of additional MouseHandlers.
     */
    public MouseHandler[] getFallbackMouseHandlers();

}


 

Ads help maintain this website.