Class BasicCommandButtonPanelUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.PanelUI
org.pushingpixels.radiance.component.internal.ui.common.CommandButtonPanelUI
org.pushingpixels.radiance.component.internal.ui.common.BasicCommandButtonPanelUI
- Direct Known Subclasses:
RadianceCommandButtonPanelUI
Basic UI for command button panel
JCommandButtonPanel.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classColumn-fill layout for the button panel.private static classprivate static enumprotected classRow-fill layout for the button panel. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CommandToggleGroupModelThe button group for the single selection mode.protected JCommandButtonPanelThe associated command button panel.private List<List<JCommandButton>> List of all button groups.private ChangeListenerprotected JLabel[]Labels of the button panel groups.private Rectangle[]Bounds of button panel groups.List of titles for all button groups.private ChangeListenerstatic final StringClient property to mark the command button panel to not draw the background fill -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddButtonToGroup(String buttonGroupName, int indexInGroup, Command command, JCommandButton commandButton) private voidaddButtonToLastGroup(Command command, JCommandButton commandButton) private CommandButtonPresentationModelprivate JCommandButtonfindFirstFocusableDown(int row, int column) private JCommandButtonfindFirstFocusableRight(int row, int column) private JCommandButtonfindLastFocusableLeft(int row, int column) private JCommandButtonfindLastFocusableUp(int row, int column) booleanbooleanbooleanbooleanprivate booleanfocusMove(BasicCommandButtonPanelUI.FocusMoveDirection focusMoveDirection) booleanbooleanfocusUp()protected abstract intgetGroupTitleHeight(int groupIndex) Returns the height of the group title strip.intgetPreferredHeight(int buttonVisibleRows, int titleVisibleRows) Returns the preferred size of the associated button panel for the specified parameters.booleanhasFocus()protected voidInstalls sub-components on the associated button panel.protected voidInstalls defaults on the associated button panel.protected voidInstalls listeners on the associated button panel.voidvoidpaint(Graphics g, JComponent c) protected abstract voidpaintGroupBackground(Graphics g, int groupIndex, int x, int y, int width, int height) Paints the background of the specified button panel group.protected abstract voidpaintGroupTitleBackground(Graphics g, int groupIndex, int x, int y, int width, int height) Paints the background of the title of specified button panel group.voidprivate voidprotected voidUninstalls sub-components from the associated button panel.protected voidUninstalls defaults from the associated button panel.protected voidUninstalls listeners from the associated button panel.voidprivate voidUpdates the layout manager for the associated button panel.Methods inherited from class ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, update
-
Field Details
-
SKIP_BACKGROUND_FILL
Client property to mark the command button panel to not draw the background fill- See Also:
-
buttonPanel
The associated command button panel. -
groupTitles
-
buttons
List of all button groups. -
groupLabels
Labels of the button panel groups. -
buttonGroup
The button group for the single selection mode. -
groupRects
Bounds of button panel groups. -
contentModelChangeListener
-
presentationModelChangeListener
-
layoutManager
-
-
Constructor Details
-
BasicCommandButtonPanelUI
public BasicCommandButtonPanelUI()
-
-
Method Details
-
installUI
- Overrides:
installUIin classComponentUI
-
installDefaults
protected void installDefaults()Installs defaults on the associated button panel. -
installComponents
protected void installComponents()Installs sub-components on the associated button panel. -
installListeners
protected void installListeners()Installs listeners on the associated button panel. -
uninstallUI
- Overrides:
uninstallUIin classComponentUI
-
uninstallDefaults
protected void uninstallDefaults()Uninstalls defaults from the associated button panel. -
uninstallComponents
protected void uninstallComponents()Uninstalls sub-components from the associated button panel. -
uninstallListeners
protected void uninstallListeners()Uninstalls listeners from the associated button panel. -
updateLayoutManager
private void updateLayoutManager()Updates the layout manager for the associated button panel. -
paint
- Overrides:
paintin classComponentUI
-
paintGroupBackground
protected abstract void paintGroupBackground(Graphics g, int groupIndex, int x, int y, int width, int height) Paints the background of the specified button panel group.- Parameters:
g- Graphics context.groupIndex- Group index.x- X coordinate of the button group bounds.y- Y coordinate of the button group bounds.width- Width of the button group bounds.height- Height of the button group bounds.
-
paintGroupTitleBackground
protected abstract void paintGroupTitleBackground(Graphics g, int groupIndex, int x, int y, int width, int height) Paints the background of the title of specified button panel group.- Parameters:
g- Graphics context.groupIndex- Group index.x- X coordinate of the button group title bounds.y- Y coordinate of the button group title bounds.width- Width of the button group title bounds.height- Height of the button group title bounds.
-
getGroupTitleHeight
protected abstract int getGroupTitleHeight(int groupIndex) Returns the height of the group title strip.- Parameters:
groupIndex- Group index.- Returns:
- The height of the title strip of the specified group.
-
createBaseCommandPresentation
-
syncContent
private void syncContent() -
addButtonToLastGroup
-
addButtonToGroup
private void addButtonToGroup(String buttonGroupName, int indexInGroup, Command command, JCommandButton commandButton) -
scrollToSelectedCommand
public void scrollToSelectedCommand()- Specified by:
scrollToSelectedCommandin classCommandButtonPanelUI
-
getPreferredHeight
public int getPreferredHeight(int buttonVisibleRows, int titleVisibleRows) Returns the preferred size of the associated button panel for the specified parameters.- Parameters:
buttonVisibleRows- Target number of visible button rows.titleVisibleRows- Target number of visible group title rows.- Returns:
- The preferred size of the associated button panel for the specified parameters.
-
findFirstFocusableRight
-
findLastFocusableLeft
-
findLastFocusableUp
-
findFirstFocusableDown
-
focusFirst
public boolean focusFirst()- Specified by:
focusFirstin classCommandButtonPanelUI
-
focusLast
public boolean focusLast()- Specified by:
focusLastin classCommandButtonPanelUI
-
hasFocus
public boolean hasFocus()- Specified by:
hasFocusin classCommandButtonPanelUI
-
focusMove
-
focusUp
public boolean focusUp()- Specified by:
focusUpin classCommandButtonPanelUI
-
focusDown
public boolean focusDown()- Specified by:
focusDownin classCommandButtonPanelUI
-
focusRight
public boolean focusRight()- Specified by:
focusRightin classCommandButtonPanelUI
-
focusLeft
public boolean focusLeft()- Specified by:
focusLeftin classCommandButtonPanelUI
-