BSplitPane is a WidgetContainer whose space is divided between two child Widgets. A drag
bar is placed between them, which the user can move to change how much space is given to each child.
In addition to the event types generated by all Widgets, BSplitPanes generate the following event types:
add
public void add(Widget widget,
int index)
Add a Widget to this container. If there is already a Widget in the specified position,
it is removed before the new one is added.
widget
- the Widget to addindex
- the position at which to add it (0 or 1)
getChild
public Widget getChild(int index)
Get one of the child Widgets.
index
- the index of the Widget to get (0 or 1)
getDividerLocation
public int getDividerLocation()
Get the location of the divider (in pixels).
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.
- getMinimumSize in interface Widget
getOrientation
public BSplitPane.Orientation getOrientation()
Get which way the container is split, HORIZONTAL or VERTICAL.
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.
- getPreferredSize in interface Widget
getResizeWeight
public double getResizeWeight()
Get how extra space is divided between the two child widgets. A weight of 0 gives all extra
space to the second child, while a weight of 1 gives all extra space to the first child.
Values between 0 and 1 divide the extra space proportionally between the two.
isContinuousLayout
public boolean isContinuousLayout()
Get whether the container should continuously resize its children as the divider bar is dragged,
or only when the mouse is released.
isOneTouchExpandable
public boolean isOneTouchExpandable()
Get whether the divider provides a control to collapse or expand the split with a single click.
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.
- layoutChildren in interface WidgetContainer
remove
public void remove(Widget widget)
Remove a child Widget from this container.
- remove in interface WidgetContainer
widget
- the Widget to remove
remove
public void remove(int index)
Remove a child Widget from this container.
index
- the index of the Widget to remove (0 or 1)
resetToPreferredSizes
public void resetToPreferredSizes()
Reposition the divider based on the minimum and preferred sizes of the child widgets,
and the current resize weight.
setContinuousLayout
public void setContinuousLayout(boolean continuous)
Set whether the container should continuously resize its children as the divider bar is dragged,
or only when the mouse is released.
setDividerLocation
public void setDividerLocation(double location)
Set the location of the divider as a fraction of the total size of the container. 0.0 is
all the way to the top/left, and 1.0 is all the way to the bottom/right.
setDividerLocation
public void setDividerLocation(int location)
Set the location of the divider (in pixels).
setOneTouchExpandable
public void setOneTouchExpandable(boolean expandable)
Set whether the divider provides a control to collapse or expand the split with a single click.
setOrientation
public void setOrientation(BSplitPane.Orientation orient)
Set which way the container is split, HORIZONTAL or VERTICAL.
setResizeWeight
public void setResizeWeight(double weight)
Set how extra space is divided between the two child widgets. A weight of 0 gives all extra
space to the second child, while a weight of 1 gives all extra space to the first child.
Values between 0 and 1 divide the extra space proportionally between the two.