|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbuoy.event.EventSource
buoy.widget.Widget
public abstract class Widget
A Widget is a graphical object. It occupies a fixed region of the screen, and can respond to user actions. This is an abstract class. There are subclasses corresponding to particular kinds of Widgets.
Every Widget is mapped to a specific AWT/Swing Component. This class can therefore be thought of as a wrapper around the Component class.
All Widgets generate the following types of events:
FocusGainedEvent
FocusLostEvent
KeyPressedEvent
KeyReleasedEvent
KeyTypedEvent
MousePressedEvent
MouseReleasedEvent
MouseClickedEvent
MouseEnteredEvent
MouseExitedEvent
MouseMovedEvent
MouseDraggedEvent
MouseScrolledEvent
ToolTipEvent
Method Summary | |
---|---|
void |
addEventLink(java.lang.Class eventType,
java.lang.Object target,
java.lang.reflect.Method method)
Create an event link from this object. |
void |
dispatchEvent(java.lang.Object event)
Send out an object representing an event to every appropriate event link that has been added to this object. |
java.awt.Color |
getBackground()
Get the background color of this Widget. |
java.awt.Rectangle |
getBounds()
Get the current location and size of this Widget. |
java.awt.Component |
getComponent()
Get the java.awt.Component corresponding to this Widget. |
java.awt.Cursor |
getCursor()
Get the Cursor to display when the mouse is over this Widget. |
java.awt.Font |
getFont()
Get the font used to draw text in this Widget. |
java.awt.Dimension |
getMaximumSize()
Get the largest size at which this Widget can reasonably be drawn. |
java.awt.Dimension |
getMinimumSize()
Get the smallest size at which this Widget can reasonably be drawn. |
java.lang.String |
getName()
Get the name of this Widget. |
WidgetContainer |
getParent()
Get this Widget's parent in the layout hierarchy (may be null). |
java.awt.Dimension |
getPreferredSize()
Get the preferred size at which this Widget will look best. |
boolean |
hasFocus()
Determine whether this Widget currently has keyboard focus, so that WidgetKeyEvents will be sent to it. |
boolean |
isEnabled()
Determine whether this Widget is currently enabled. |
boolean |
isFocusable()
Determine whether this Widget can receive keyboard focus through the user pressing Tab or Shift-Tab to cycle between Widgets. |
boolean |
isVisible()
Determine whether this Widget is currently visible. |
void |
repaint()
Request that this Widget be repainted. |
void |
requestFocus()
Request that keyboard focus be transferred to this Widget, so that WidgetKeyEvents will be sent to it. |
void |
setBackground(java.awt.Color background)
Set the background color of this Widget. |
void |
setCursor(java.awt.Cursor cursor)
Set the Cursor to display when the mouse is over this Widget. |
void |
setEnabled(boolean enabled)
Set whether this Widget should be enabled. |
void |
setFocusable(boolean focusable)
Set whether this Widget can receive keyboard focus through the user pressing Tab or Shift-Tab to cycle between Widgets. |
void |
setFont(java.awt.Font font)
Set the font used to draw text in this Widget. |
void |
setName(java.lang.String name)
Set the name of this Widget. |
void |
setVisible(boolean visible)
Set whether this Widget should be visible. |
Methods inherited from class buoy.event.EventSource |
---|
addEventLink, addEventLink, removeEventLink |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.awt.Component getComponent()
public WidgetContainer getParent()
public java.awt.Dimension getMinimumSize()
public java.awt.Dimension getMaximumSize()
public java.awt.Dimension getPreferredSize()
public java.awt.Rectangle getBounds()
public void repaint()
public boolean isVisible()
public void setVisible(boolean visible)
public boolean isEnabled()
public void setEnabled(boolean enabled)
public java.awt.Cursor getCursor()
public void setCursor(java.awt.Cursor cursor)
public java.awt.Color getBackground()
public void setBackground(java.awt.Color background)
public java.awt.Font getFont()
public void setFont(java.awt.Font font)
public boolean hasFocus()
public void requestFocus()
public boolean isFocusable()
public void setFocusable(boolean focusable)
public java.lang.String getName()
public void setName(java.lang.String name)
public void addEventLink(java.lang.Class eventType, java.lang.Object target, java.lang.reflect.Method method)
addEventLink
in class EventSource
eventType
- the event class or interface which the target method wants to receivetarget
- the object to send the events tomethod
- the method to invoke on the target object. The method must either take no
arguments, or take an object of class eventType (or any of its superclasses or
interfaces) as its only argument.public void dispatchEvent(java.lang.Object event)
dispatchEvent
in class EventSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |