buoy.widget

Class BOutline


public class BOutline
extends WidgetContainer

A BOutline is a WidgetContainer that draws an outline around another Widget. The appearance of the outline is determined by a javax.swing.border.Border object. There are static methods for creating several common types of outlines, or you can use a different type by providing your own Border object.
Author:
Peter Eastman

Constructor Summary

BOutline()
Create a new BOutline with no content Widget and no border.
BOutline(Widget content, Border border)
Create a new BOutline.

Method Summary

static BOutline
createBevelBorder(Widget content, boolean raised)
Create a BOutline with a beveled border.
static BOutline
createEmptyBorder(Widget content, int thickness)
Create a BOutline with an empty border.
static BOutline
createEtchedBorder(Widget content, boolean raised)
Create a BOutline with an etched border.
static BOutline
createLineBorder(Widget content, Color color, int thickness)
Create a BOutline with a line border.
Border
getBorder()
Get the Border object which draws this Widget's outline.
int
getChildCount()
Get the number of children in this container.
Collection
getChildren()
Get a Collection containing all child Widgets of this container.
Widget
getContent()
Get the content Widget.
Dimension
getMaximumSize()
Get the largest size at which this Widget can reasonably be drawn.
Dimension
getMinimumSize()
Get the smallest size at which this Widget can reasonably be drawn.
Dimension
getPreferredSize()
Get the preferred size at which this Widget will look best.
void
layoutChildren()
Layout the child Widgets.
void
remove(Widget widget)
Remove a child Widget from this container.
void
removeAll()
Remove the content Widget from this container.
void
setBorder(Border border)
Set the Border object which draws this Widget's outline.
void
setContent(Widget contentWidget)
Set the content Widget.

Methods inherited from class buoy.widget.WidgetContainer

getChildCount, getChildren, isOpaque, layoutChildren, remove, removeAll, setOpaque

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

BOutline

public BOutline()
Create a new BOutline with no content Widget and no border.

BOutline

public BOutline(Widget content,
                Border border)
Create a new BOutline.
Parameters:
content - the Widget to use as the content of the BOutline
border - the outline to draw around the content Widget

Method Details

createBevelBorder

public static BOutline createBevelBorder(Widget content,
                                         boolean raised)
Create a BOutline with a beveled border.
Parameters:
content - the Widget to use as the content of the BOutline
raised - if true, the border will have a raised appearance. If false, it will have a lowered appearance.

createEmptyBorder

public static BOutline createEmptyBorder(Widget content,
                                         int thickness)
Create a BOutline with an empty border.
Parameters:
content - the Widget to use as the content of the BOutline
thickness - the thickness of the border

createEtchedBorder

public static BOutline createEtchedBorder(Widget content,
                                          boolean raised)
Create a BOutline with an etched border.
Parameters:
content - the Widget to use as the content of the BOutline
raised - if true, the border will have a raised appearance. If false, it will have a lowered appearance.

createLineBorder

public static BOutline createLineBorder(Widget content,
                                        Color color,
                                        int thickness)
Create a BOutline with a line border.
Parameters:
content - the Widget to use as the content of the BOutline
color - the color of the border
thickness - the thickness of the border

getBorder

public Border getBorder()
Get the Border object which draws this Widget's outline.

getChildCount

public int getChildCount()
Get the number of children in this container.
Overrides:
getChildCount in interface WidgetContainer

getChildren

public Collection getChildren()
Get a Collection containing all child Widgets of this container.
Overrides:
getChildren in interface WidgetContainer

getContent

public Widget getContent()
Get the content Widget.

getMaximumSize

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.
Overrides:
getMaximumSize in interface Widget

getMinimumSize

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.
Overrides:
getMinimumSize in interface Widget

getPreferredSize

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.
Overrides:
getPreferredSize in interface Widget

layoutChildren

public void layoutChildren()
Layout the child Widgets. This may be invoked whenever something has changed (the size of this WidgetContainer, the preferred size of one of its children, etc.) that causes the layout to no longer be correct. If a child is itself a WidgetContainer, its layoutChildren() method will be called in turn.
Overrides:
layoutChildren in interface WidgetContainer

remove

public void remove(Widget widget)
Remove a child Widget from this container.
Overrides:
remove in interface WidgetContainer

removeAll

public void removeAll()
Remove the content Widget from this container.
Overrides:
removeAll in interface WidgetContainer

setBorder

public void setBorder(Border border)
Set the Border object which draws this Widget's outline.

setContent

public void setContent(Widget contentWidget)
Set the content Widget.

Written by Peter Eastman.