01: package com.xoetrope.event;
02:
03: /**
04: * An interface required by the XClickListener class.The interface is used to
05: * set the response selected by a user from a set of responses
06: *
07: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
08: * the GNU Public License (GPL), please see license.txt for more details. If
09: * you make commercial use of this software you must purchase a commercial
10: * license from Xoetrope.</p>
11: * <p> $Revision: 1.4 $</p>
12: */
13: public interface XStateListener {
14: /**
15: * Find a response state based on the coordinates of the mouse click
16: * @param x the x coordinate of the mouse click
17: * @param y the y coordinate of the mouse click
18: * @param defResponse the default response
19: * @return true if a response was found
20: */
21: public boolean setState(int x, int y, int defResponse);
22:
23: /**
24: * Notification that a state change has taken place
25: */
26: public void updateSelectedState();
27:
28: /**
29: * Repaint the response states
30: */
31: public void paintStates();
32:
33: /**
34: * Find the response corresponding to the current point
35: * @param x the x coordinate of the mouse click
36: * @param y the y coordinate of the mouse click
37: * @return the response value if the mouse were click at the specified location,
38: * or -1 if not selection is available
39: */
40: public int findCurrentResponse(int x, int y);
41: }
|