|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object buoy.event.EventSource buoy.widget.Widget buoy.widget.WidgetContainer buoy.widget.BScrollPane
public class BScrollPane
A BScrollPane is a WidgetContainer with up to five children: an arbitrary "content" Widget that fills most of the BScrollPane, optional "row header" and "column header" Widgets along the left and top edges, respectively, and optional BScrollBars along the right and bottom edges. It displays only a portion of the content, row header, and column header Widgets, and allows the user to scroll through them by means of the two BScrollBars.
If the BScrollPane does not have a horizontal and/or vertical scrollbar, then by default it will force the corresponding dimension of the content and header Widgets to exactly match the size of the visible area. For example, if the content is a BTextArea with word wrap enabled, you would normally only have a vertical scrollbar. The width of the BTextArea should then be forced to exactly match the width of the visible area, so that words will wrap at the correct place. You can override this behavior by calling setForceWidth() and setForceHeight(). For example, you might want to control the scroll position through some external means, in which case the BScrollPane would not provide scrollbars but should still allow the content Widget to be its preferred size.
Nested Class Summary | |
---|---|
static class |
BScrollPane.ScrollbarPolicy
This inner class represents a scrollbar policy for the horizontal or vertical scrollbar. |
Field Summary | |
---|---|
static BScrollPane.ScrollbarPolicy |
SCROLLBAR_ALWAYS
|
static BScrollPane.ScrollbarPolicy |
SCROLLBAR_AS_NEEDED
|
static BScrollPane.ScrollbarPolicy |
SCROLLBAR_NEVER
|
Constructor Summary | |
---|---|
BScrollPane()
Create a new BScrollPane with no content or header Widgets. |
|
BScrollPane(BScrollPane.ScrollbarPolicy horizontalPolicy,
BScrollPane.ScrollbarPolicy verticalPolicy)
Create a new BScrollPane with no content or header Widgets. |
|
BScrollPane(Widget contentWidget)
Create a new BScrollPane with the specified Widget as its content. |
|
BScrollPane(Widget contentWidget,
BScrollPane.ScrollbarPolicy horizontalPolicy,
BScrollPane.ScrollbarPolicy verticalPolicy)
Create a new BScrollPane with the specified Widget as its content. |
Method Summary | |
---|---|
int |
getChildCount()
Get the number of children in this container. |
java.util.Collection<Widget> |
getChildren()
Get a Collection containing all child Widgets of this container. |
Widget |
getColHeader()
Get the column header Widget. |
javax.swing.JScrollPane |
getComponent()
Get the java.awt.Component corresponding to this Widget. |
Widget |
getContent()
Get the content Widget. |
boolean |
getForceHeight()
Get whether the BScrollPane should force the height of the content and row header Widgets to exactly match the height of the visible area. |
boolean |
getForceWidth()
Get whether the BScrollPane should force the width of the content and column header Widgets to exactly match the width of the visible area. |
BScrollBar |
getHorizontalScrollBar()
Get the horizontal BScrollBar. |
BScrollPane.ScrollbarPolicy |
getHorizontalScrollbarPolicy()
Get the horizontal scrollbar policy. |
java.awt.Dimension |
getMinimumSize()
Get the smallest size at which this Widget can reasonably be drawn. |
java.awt.Dimension |
getPreferredSize()
Get the preferred size at which this Widget will look best. |
java.awt.Dimension |
getPreferredViewSize()
Get the preferred size for the content's view area. |
Widget |
getRowHeader()
Get the row header Widget. |
BScrollBar |
getVerticalScrollBar()
Get the vertical BScrollBar. |
BScrollPane.ScrollbarPolicy |
getVerticalScrollbarPolicy()
Get the vertical scrollbar policy. |
java.awt.Dimension |
getViewSize()
Get the current size of the content's view area. |
void |
layoutChildren()
Layout the child Widgets. |
void |
remove(Widget widget)
Remove a child Widget from this container. |
void |
removeAll()
Remove the content, row header, and column header Widgets from this container. |
void |
setBackground(java.awt.Color background)
Set the background color of this Widget. |
void |
setColHeader(Widget widget)
Set the column header Widget. |
void |
setContent(Widget widget)
Set the content Widget. |
void |
setForceHeight(boolean force)
Set whether the BScrollPane should force the height of the content and row header Widgets to exactly match the height of the visible area. |
void |
setForceWidth(boolean force)
Set whether the BScrollPane should force the width of the content and column header Widgets to exactly match the width of the visible area. |
void |
setHorizontalScrollbarPolicy(BScrollPane.ScrollbarPolicy policy)
Set the horizontal scrollbar policy. |
void |
setPreferredViewSize(java.awt.Dimension size)
Set the preferred size for the content's view area. |
void |
setRowHeader(Widget widget)
Set the row header Widget. |
void |
setVerticalScrollbarPolicy(BScrollPane.ScrollbarPolicy policy)
Set the vertical scrollbar policy. |
Methods inherited from class buoy.widget.WidgetContainer |
---|
isOpaque, setOpaque |
Methods inherited from class buoy.widget.Widget |
---|
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getName, getParent, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, 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 |
Field Detail |
---|
public static final BScrollPane.ScrollbarPolicy SCROLLBAR_NEVER
public static final BScrollPane.ScrollbarPolicy SCROLLBAR_AS_NEEDED
public static final BScrollPane.ScrollbarPolicy SCROLLBAR_ALWAYS
Constructor Detail |
---|
public BScrollPane()
public BScrollPane(Widget contentWidget)
contentWidget
- the Widget to use as the content of the BScrollPanepublic BScrollPane(BScrollPane.ScrollbarPolicy horizontalPolicy, BScrollPane.ScrollbarPolicy verticalPolicy)
horizontalPolicy
- specifies when the horizontal scrollbar should be displayed. This should
be equal to SCROLLBAR_ALWAYS, SCROLLBAR_AS_NEEDED, or SCROLLBAR_NEVER.verticalPolicy
- specifies when the vertical scrollbar should be displayed. This should
be equal to SCROLLBAR_ALWAYS, SCROLLBAR_AS_NEEDED, or SCROLLBAR_NEVER.public BScrollPane(Widget contentWidget, BScrollPane.ScrollbarPolicy horizontalPolicy, BScrollPane.ScrollbarPolicy verticalPolicy)
contentWidget
- the Widget to use as the content of the BScrollPanehorizontalPolicy
- specifies when the horizontal scrollbar should be displayed. This should
be equal to SCROLLBAR_ALWAYS, SCROLLBAR_AS_NEEDED, or SCROLLBAR_NEVER.verticalPolicy
- specifies when the vertical scrollbar should be displayed. This should
be equal to SCROLLBAR_ALWAYS, SCROLLBAR_AS_NEEDED, or SCROLLBAR_NEVER.Method Detail |
---|
public javax.swing.JScrollPane getComponent()
Widget
getComponent
in class Widget
public Widget getContent()
public void setContent(Widget widget)
public Widget getRowHeader()
public void setRowHeader(Widget widget)
public Widget getColHeader()
public void setColHeader(Widget widget)
public BScrollBar getHorizontalScrollBar()
public BScrollBar getVerticalScrollBar()
public BScrollPane.ScrollbarPolicy getHorizontalScrollbarPolicy()
public void setHorizontalScrollbarPolicy(BScrollPane.ScrollbarPolicy policy)
public BScrollPane.ScrollbarPolicy getVerticalScrollbarPolicy()
public void setVerticalScrollbarPolicy(BScrollPane.ScrollbarPolicy policy)
public java.awt.Dimension getPreferredViewSize()
public void setPreferredViewSize(java.awt.Dimension size)
public java.awt.Dimension getViewSize()
public boolean getForceWidth()
Note that even if this option is enabled, the BScrollPane will never make the content Widget smaller than its minimum size or larger than its maximum size.
public void setForceWidth(boolean force)
Note that even if this option is enabled, the BScrollPane will never make the content Widget smaller than its minimum size or larger than its maximum size.
public boolean getForceHeight()
Note that even if this option is enabled, the BScrollPane will never make the content Widget smaller than its minimum size or larger than its maximum size.
public void setForceHeight(boolean force)
Note that even if this option is enabled, the BScrollPane will never make the content Widget smaller than its minimum size or larger than its maximum size.
public int getChildCount()
getChildCount
in class WidgetContainer
public java.util.Collection<Widget> getChildren()
getChildren
in class WidgetContainer
public void remove(Widget widget)
remove
in class WidgetContainer
public void removeAll()
removeAll
in class WidgetContainer
public void layoutChildren()
layoutChildren
in class WidgetContainer
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class Widget
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class Widget
public void setBackground(java.awt.Color background)
setBackground
in class Widget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |