Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
buoy.event.EventSource
buoy.widget.Widget
public abstract class Widget
extends EventSource
Method Summary | |
void |
|
void |
|
Color |
|
Rectangle |
|
Component |
|
Cursor |
|
Font |
|
Dimension |
|
Dimension |
|
String |
|
WidgetContainer |
|
Dimension |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class buoy.event.EventSource | |
addEventLink , addEventLink , addEventLink , dispatchEvent , removeEventLink |
public void addEventLink(Class eventType, Object target, Method method)
Create an event link from this object. When events of the desired class (or any of its subclasses) are generated by this object, the specified method will be called on the target object.
- Overrides:
- addEventLink in interface EventSource
- Parameters:
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(Object event)
Send out an object representing an event to every appropriate event link that has been added to this object.
- Overrides:
- dispatchEvent in interface EventSource
public Color getBackground()
Get the background color of this Widget. If that is null and this Widget has been added to a WidgetContainer, this returns the background color of the parent container.
public Rectangle getBounds()
Get the current location and size of this Widget.
public Component getComponent()
Get the java.awt.Component corresponding to this Widget.
public Cursor getCursor()
Get the Cursor to display when the mouse is over this Widget.
public Font getFont()
Get the font used to draw text in this Widget.
public Dimension getMaximumSize()
Get the largest size at which this Widget can reasonably be drawn. When a WidgetContainer lays out its contents, it will attempt never to make this Widget larger than its maximum size.
public Dimension getMinimumSize()
Get the smallest size at which this Widget can reasonably be drawn. When a WidgetContainer lays out its contents, it will attempt never to make this Widget smaller than its minimum size.
public String getName()
Get the name of this Widget. This is used primarily to identify Widgets when they are serialized to XML files.
public WidgetContainer getParent()
Get this Widget's parent in the layout hierarchy (may be null).
public Dimension getPreferredSize()
Get the preferred size at which this Widget will look best. When a WidgetContainer lays out its contents, it will attempt to make this Widget as close as possible to its preferred size.
public boolean hasFocus()
Determine whether this Widget currently has keyboard focus, so that WidgetKeyEvents will be sent to it.
public boolean isEnabled()
Determine whether this Widget is currently enabled.
public boolean isFocusable()
Determine whether this Widget can receive keyboard focus through the user pressing Tab or Shift-Tab to cycle between Widgets.
public boolean isVisible()
Determine whether this Widget is currently visible.
public void repaint()
Request that this Widget be repainted. This method does not actually paint the Widget immediately. Instead, it causes a repaint request to be placed onto the global event queue. As a result, this method can be safely called from any thread.
public void requestFocus()
Request that keyboard focus be transferred to this Widget, so that WidgetKeyEvents will be sent to it.
public void setBackground(Color background)
Set the background color of this Widget. If this is set to null, the Widget will use the background color of its parent WidgetContainer.
public void setCursor(Cursor cursor)
Set the Cursor to display when the mouse is over this Widget.
public void setEnabled(boolean enabled)
Set whether this Widget should be enabled.
public void setFocusable(boolean focusable)
Set whether this Widget can receive keyboard focus through the user pressing Tab or Shift-Tab to cycle between Widgets.
public void setFont(Font font)
Set the font used to draw text in this Widget. If this is set to null, the Widget will use the Font of its parent WidgetContainer.
public void setName(String name)
Set the name of this Widget. This is used primarily to identify Widgets when they are serialized to XML files.
public void setVisible(boolean visible)
Set whether this Widget should be visible.