home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 834 b | 38 lines |
- // KeypadButton.java
- // 28.02.96
- //
- // a button on a keypad, logical not graphical
-
- package cybcerone.utils;
-
- import java.awt.Rectangle;
- import java.awt.Image;
- import java.awt.Graphics;
- import java.awt.image.ImageObserver;
-
- public class KeypadButton {
- private Object value;
- private Rectangle placement;
-
- public KeypadButton (Object value, Rectangle placement) {
- this.value = value;
- this.placement = placement;
- }
-
- public KeypadButton (Object value, int x, int y, int width, int height) {
- this (value, new Rectangle (x, y, width, height));
- }
-
- public boolean inside (int x, int y) {
- return placement.inside (x, y);
- }
-
- public Object getValue () { return value; }
- Rectangle getPlacement () { return placement; }
-
- public String toString () {
- return ("Button[" + value + ", " + placement);
- }
-
- }
-