buoy.widget

Class 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(Dimension size)
Set the largest size at which this Widget can reasonably be drawn.
void
setMinimumSize(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(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, addEventLink, dispatchEvent, removeEventLink

Constructor Details

CustomWidget

public CustomWidget()
Create a new CustomWidget.

Method Details

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.

setMaximumSize

public void setMaximumSize(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.

setMinimumSize

public void setMinimumSize(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.

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.

setPreferredSize

public void setPreferredSize(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.

Written by Peter Eastman.