Class JCommandButtonPanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.pushingpixels.radiance.component.api.common.JCommandButtonPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Scrollable
Direct Known Subclasses:
AbstractFileViewPanel, JRibbonApplicationMenuPopupPanelSecondary

public class JCommandButtonPanel extends JComponent implements Scrollable
Panel that hosts command buttons. Provides support for button groups, single selection mode (for toggle command buttons), same icon state / dimension and column-fill / row-fill layout. Note that while this class is a part of public API, it is highly recommended to use the CommandPanelContentModel and CommandPanelPresentationModel instances used to project the command button panel on screen for any dynamic manipulation of the state.

Under the default PanelRowFillSpec, the buttons are laid out in rows, never exceeding the available horizontal space. A vertical scroll bar will kick in once there is not enough vertical space to show all the buttons. The schematic below shows a row-fill command button panel:

 +-----------------------------+-+
 |                             |o|
 | +----+ +----+ +----+ +----+ |o|
 | | 01 | | 02 | | 03 | | 04 | |o|
 | +----+ +----+ +----+ +----+ |o|
 |                             | |
 | +----+ +----+ +----+ +----+ | |
 | | 05 | | 06 | | 07 | | 07 | | |
 | +----+ +----+ +----+ +----+ | |
 |                             | |
 | +----+ +----+ +----+ +----+ | |
 | | 09 | | 10 | | 11 | | 12 | | |
 | +----+ +----+ +----+ +----+ | |
 |                             | |
 | +----+ +----+ +----+ +----+ | |
 | | 13 | | 14 | | 15 | | 16 | | |
 +-----------------------------+-+
 

Each row hosts four buttons, and the vertical scroll bar allows scrolling the content up and down.

Under the PanelColumnFillSpec, the buttons are laid out in columns, never exceeding the available vertical space. A horizontal scroll bar will kick in once there is not enough horizontal space to show all the buttons. The schematic below shows a column-fill command button panel:

 +---------------------------------+
 |                                 |
 | +----+ +----+ +----+ +----+ +---|
 | | 01 | | 04 | | 07 | | 10 | | 13|
 | +----+ +----+ +----+ +----+ +---|
 |                                 |
 | +----+ +----+ +----+ +----+ +---|
 | | 02 | | 05 | | 08 | | 11 | | 14|
 | +----+ +----+ +----+ +----+ +---|
 |                                 |
 | +----+ +----+ +----+ +----+ +---|
 | | 03 | | 06 | | 09 | | 12 | | 15|
 | +----+ +----+ +----+ +----+ +---|
 |                                 |
 +---------------------------------+
 |oooo                             |
 +---------------------------------+
 

Each column hosts three buttons, and the horizontal scroll bar allows scrolling the content left and right.

See Also: