buoy.widget
Class CustomWidget

java.lang.Object
  extended by buoy.event.EventSource
      extended by buoy.widget.Widget
          extended by buoy.widget.CustomWidget

public class CustomWidget
extends Widget

A CustomWidget is used for defining new graphical objects. It occupies a rectangular region of a window, and its preferred, minimum, and maximum sizes can all be modified.

In addition to the event types generated by all Widgets, CustomWidgets generate the following event types:

Author:
Peter Eastman

Constructor Summary
CustomWidget()
          Create a new CustomWidget.
 
Method Summary
 boolean isOpaque()
          Determine whether this Widget is set to be opaque.
 void setMaximumSize(java.awt.Dimension size)
          Set the largest size at which this Widget can reasonably be drawn.
 void setMinimumSize(java.awt.Dimension size)
          Set the smallest size at which this Widget can reasonably be drawn.
 void setOpaque(boolean opaque)
          Set whether this Widget should be opaque.
 void setPreferredSize(java.awt.Dimension size)
          Set the preferred size at which this Widget will look best.
 
Methods inherited from class buoy.widget.Widget
addEventLink, dispatchEvent, getBackground, getBounds, getComponent, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
 
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
 

Constructor Detail

CustomWidget

public CustomWidget()
Create a new CustomWidget.

Method Detail

setMinimumSize

public void setMinimumSize(java.awt.Dimension size)
Set 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.


setMaximumSize

public void setMaximumSize(java.awt.Dimension size)
Set 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.


setPreferredSize

public void setPreferredSize(java.awt.Dimension size)
Set 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.


isOpaque

public boolean isOpaque()
Determine whether this Widget is set to be opaque. If true, then it will be filled with its background color before RepaintEvents are sent out. If false, the parent container will show through.


setOpaque

public void setOpaque(boolean opaque)
Set whether this Widget should be opaque. If true, then it will be filled with its background color before RepaintEvents are sent out. If false, the parent container will show through.



Written by Peter Eastman.