edu.iu.cnets.klatsch.gui
Class Widget

java.lang.Object
  extended by edu.iu.cnets.klatsch.gui.Widget
Direct Known Subclasses:
Pane, WidgetEntry, WidgetGraph, WidgetIndex

public abstract class Widget
extends java.lang.Object

This is the basic class of all the display widgets in the Klatsch GUI.


Field Summary
protected  KlatschGui parent
          the applet we're working for
protected  int x1
          the boundaries of the widget
protected  int x2
          the boundaries of the widget
protected  int y1
          the boundaries of the widget
protected  int y2
          the boundaries of the widget
 
Constructor Summary
Widget(KlatschGui parent, int x1, int y1, int x2, int y2)
          Default constructor.
 
Method Summary
protected  void clear()
          Clears the rectangle belonging to the widget.
protected abstract  void draw()
           
protected  boolean in(int x, int y)
          Returns true if the given position is in the widget.
protected  void keyPressed(int which)
           
protected  void keyReleased(int which)
           
protected  void mouseDragged(int which, int x, int y)
           
protected  void mousePressed(int which, int x, int y)
           
protected  void mouseReleased(int which, int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x1

protected int x1
the boundaries of the widget


y1

protected int y1
the boundaries of the widget


x2

protected int x2
the boundaries of the widget


y2

protected int y2
the boundaries of the widget


parent

protected KlatschGui parent
the applet we're working for

Constructor Detail

Widget

public Widget(KlatschGui parent,
              int x1,
              int y1,
              int x2,
              int y2)
Default constructor.

Parameters:
parent - the applet this widget belongs to
x1 - x-coordinate of the upper-left corner
y1 - y-coordinate of the upper-left corner
x2 - x-coordinate of the lower-right corner
y2 - y-coordinate of the lower-right corner
Method Detail

draw

protected abstract void draw()

keyPressed

protected void keyPressed(int which)

keyReleased

protected void keyReleased(int which)

mouseDragged

protected void mouseDragged(int which,
                            int x,
                            int y)

mousePressed

protected void mousePressed(int which,
                            int x,
                            int y)

mouseReleased

protected void mouseReleased(int which,
                             int x,
                             int y)

clear

protected void clear()
Clears the rectangle belonging to the widget.


in

protected boolean in(int x,
                     int y)
Returns true if the given position is in the widget.

Parameters:
x - x-coordinate to test
y - y-coordinate to test
Returns:
truth value of containment