ucb.gui
Class Pad

java.lang.Object
  extended by ucb.gui.Widget
      extended by ucb.gui.Pad

public class Pad
extends Widget

A Pad is a blank slate that may be inserted into a TopLevel. It provides methods that set up responses to mouse events, and an overrideable paintComponent method that allows one to draw anything that may be rendered on a standard Java Graphics2D. Standard usage is to extend Pad, and to call most of its method from methods in the extended class.


Field Summary
 
Fields inherited from class ucb.gui.Widget
me
 
Constructor Summary
protected Pad()
           
 
Method Summary
 int getHeight()
          My current height in pixels.
 int getWidth()
          My current width in pixels.
protected  void paintComponent(Graphics2D g)
          Repaint myself on G.
 void repaint()
          Alert the system that I ought be asked to repaint myself.
protected  void setMaximumSize(int width, int height)
          Set my maximum size to WIDTHxHEIGHT pixels.
protected  void setMinimumSize(int width, int height)
          Set my minimum size to WIDTHxHEIGHT pixels.
protected  void setMouseHandler(String event, Object receiver, String funcName)
          Handle the mouse event EVENT by calling the FUNCNAME method on RECEIVER with the MouseEvent that describes the event.
protected  void setMouseHandler(String event, String funcName)
           
protected  void setPreferredSize(int width, int height)
          Set my preferred size to WIDTHxHEIGHT pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pad

protected Pad()
Method Detail

setPreferredSize

protected void setPreferredSize(int width,
                                int height)
Set my preferred size to WIDTHxHEIGHT pixels.


setMinimumSize

protected void setMinimumSize(int width,
                              int height)
Set my minimum size to WIDTHxHEIGHT pixels.


setMaximumSize

protected void setMaximumSize(int width,
                              int height)
Set my maximum size to WIDTHxHEIGHT pixels.


getWidth

public int getWidth()
My current width in pixels.


getHeight

public int getHeight()
My current height in pixels.


repaint

public void repaint()
Alert the system that I ought be asked to repaint myself.


setMouseHandler

protected void setMouseHandler(String event,
                               Object receiver,
                               String funcName)
Handle the mouse event EVENT by calling the FUNCNAME method on RECEIVER with the MouseEvent that describes the event. FUNCNAME must be a declared method of RECEIVER that takes a single MouseEvent argument. The default handling of any event is to ignore it. The possible values of EVENT are:

See Also:
MouseEvent

setMouseHandler

protected void setMouseHandler(String event,
                               String funcName)

paintComponent

protected void paintComponent(Graphics2D g)
Repaint myself on G. This default implementation does nothing.