Package microsim.gui.space
Class LayerMouseListener
- java.lang.Object
-
- microsim.gui.space.LayerMouseListener
-
- All Implemented Interfaces:
ILayerMouseListener
public class LayerMouseListener extends java.lang.Object implements ILayerMouseListener
A generic implementation of the ILayerMouseListener interface. If you want to manage only one or two mouse events, you can extend this class, overriding only the useful methods. The methods not overridden return always false.Title: JAS
Description: Java Agent-based Simulation library
Copyright (C) 2002 Michele Sonnessa
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.- Author:
- Michele Sonnessa
-
-
Constructor Summary
Constructors Constructor Description LayerMouseListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
performDblClickActionAt(int atX, int atY)
Notify a double click event on a specific cell.boolean
performMouseMovedFromTo(int fromX, int fromY, int toX, int toY)
Notify a mouse dragging action.boolean
performRightClickActionAt(int atX, int atY)
Notify a right button click event on a specific cell.
-
-
-
Method Detail
-
performDblClickActionAt
public boolean performDblClickActionAt(int atX, int atY)
Description copied from interface:ILayerMouseListener
Notify a double click event on a specific cell.- Specified by:
performDblClickActionAt
in interfaceILayerMouseListener
- Parameters:
atX
- The x coordinate of the clicked cell.atY
- The y coordinate of the clicked cell.- Returns:
- True if the layer intercepted the event. False if the notify has been ignored.
-
performRightClickActionAt
public boolean performRightClickActionAt(int atX, int atY)
Description copied from interface:ILayerMouseListener
Notify a right button click event on a specific cell.- Specified by:
performRightClickActionAt
in interfaceILayerMouseListener
- Parameters:
atX
- The x coordinate of the clicked cell.atY
- The y coordinate of the clicked cell.- Returns:
- True if the layer intercepted the event. False if the notify has been ignored.
-
performMouseMovedFromTo
public boolean performMouseMovedFromTo(int fromX, int fromY, int toX, int toY)
Description copied from interface:ILayerMouseListener
Notify a mouse dragging action.- Specified by:
performMouseMovedFromTo
in interfaceILayerMouseListener
- Parameters:
fromX
- The x coordinate of the starting cell.fromY
- The y coordinate of the starting cell.toX
- The x coordinate of the target cell.toY
- The y coordinate of the target cell.- Returns:
- True if the layer intercepted the event. False if the notify has been ignored.
-
-