org.apache.pivot.wtk
Class BoxPane

java.lang.Object
  extended by org.apache.pivot.wtk.Component
      extended by org.apache.pivot.wtk.Container
          extended by org.apache.pivot.wtk.BoxPane
All Implemented Interfaces:
Iterable<Component>, Sequence<Component>, ConstrainedVisual, Visual
Direct Known Subclasses:
ButtonDataRenderer, ListViewItemRenderer, MenuBarItemDataRenderer, TableViewCheckboxCellRenderer, TableViewHeaderDataRenderer, TerraFileBrowserSkin.DriveRenderer, TerraFileBrowserSkin.FileRenderer, TreeViewNodeRenderer

public class BoxPane
extends Container

Container that arranges components in a line, either vertically or horizontally.

Layout considerations: Note that by default, a BoxPane does not pass any preferred size information to its components. That means, for example, that the preferred width of a horizontal BoxPane is simply the sum of the preferred widths of its components, plus whatever extra space is dictated by its padding and spacing styles. This is also true in the orthogonal dimension if the fill style is not set: the preferred height of a horizontal BoxPane is the maximum preferred height of its components (plus padding, if any).

If a BoxPane is given less than its preferred size by its parent container, then the contents will be clipped; if given more than its preferred size, the contents will not be stretched to fill the space.

This behavior of BoxPane can be useful for "canceling" the layout effects of a parent container and/or to align a component that does not have its own alignment styles. For example, if you place a PushButton in a cell of a TablePane, the button will expand to fill the whole cell. If instead you place the button inside a BoxPane in the cell, it will retain its natural size, and you can set the horizontalAlignment and verticalAlignment styles of the BoxPane to, say, center the button within the cell.

Setting the fill style to true will cause the BoxPane to completely fill the space allotted by its container in the direction orthogonal to the layout direction. So, for a vertical layout, the width will be the width of its container and the children of the BoxPane will also be sized accordingly (i.e., full width of the space). And so for a horizontal layout, with fill set to true the height of the BoxPane will be the height allotted by its container and the children of the BoxPane will have their heights set accordingly.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container
Container.EDT_Checker
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
 
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence
Sequence.Tree<T>
 
Constructor Summary
BoxPane()
           
BoxPane(Orientation orientation)
           
 
Method Summary
 ListenerList<BoxPaneListener> getBoxPaneListeners()
           
 Orientation getOrientation()
           
 void setOrientation(Orientation orientation)
           
 
Methods inherited from class org.apache.pivot.wtk.Container
add, assertEventDispatchThread, assertEventDispatchThread, clear, containsFocus, descendantAdded, descendantGainedFocus, descendantLostFocus, descendantRemoved, get, getComponentAt, getContainerListeners, getContainerMouseListeners, getDescendantAt, getFocusTraversalPolicy, getGraphics, getLength, getNamedComponent, indexOf, insert, invalidate, isAncestor, isDoubleBuffered, iterator, layout, load, mouseClick, mouseDown, mouseMove, mouseOut, mouseUp, mouseWheel, move, paint, remove, remove, removeAll, repaint, requestFocus, setDoubleBuffered, setEventDispatchThreadChecker, setFocusTraversalPolicy, setParent, setVisible, store, transferFocus, update
 
Methods inherited from class org.apache.pivot.wtk.Component
clearFocus, contains, getAncestor, getAncestor, getAttribute, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getComponentStyleListeners, getComponentTooltipListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getHeight, getHeightLimits, getLocation, getMaximumHeight, getMaximumWidth, getMenuHandler, getMinimumHeight, getMinimumWidth, getMouseLocation, getName, getNamedStyles, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getSize, getSkin, getStyles, getTooltipDelay, getTooltipText, getTooltipWrapText, getTypedStyles, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWidthLimits, getWindow, getX, getY, indexBoundsCheck, installSkin, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseOver, reenterMouse, repaint, repaint, repaint, repaint, repaint, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setCursor, setDragSource, setDropTarget, setEnabled, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setSkin, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setWidth, setWidthLimits, setWidthLimits, setX, setY, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoxPane

public BoxPane()

BoxPane

public BoxPane(Orientation orientation)
Method Detail

getOrientation

public Orientation getOrientation()

setOrientation

public void setOrientation(Orientation orientation)

getBoxPaneListeners

public ListenerList<BoxPaneListener> getBoxPaneListeners()