Class RadianceTitlePane
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.pushingpixels.radiance.theming.internal.utils.RadianceTitlePane
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
- Direct Known Subclasses:
RadianceRibbonFrameTitlePane
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classActions used toclosetheWindow.private classActions used toiconifytheFrame.private classActions used torestoretheFrame.private classPropertyChangeListener installed on the Window.classClass responsible for drawing the system menu.private classActions used torestoretheFrame.protected classLayout manager for the title pane.private classWindowListener installed on the Window, updates the state as necessary.Nested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ImageThe application icon to be displayed.private ActionAction used to close the Window.private JButtonButton used to close the frame.private ActionAction used to iconify the Frame.private booleanprivate ActionAction to restore the Frame size.protected JMenuBarJMenuBar, typically renders the system menu items.private JButtonButton used to minimize the frameprivate intprivate PropertyChangeListenerPropertyChangeListener added to the JRootPane.private PropertyChangeListenerListens on changes tocomponentOrientationandRadianceSynapse.CONTENTS_MODIFIEDproperties.private ActionAction to restore the Frame size.protected JRootPaneJRootPane rendering for.private RadianceRootPaneUIRadianceRootPaneUI that created us.private intBuffered Frame.state property.private TitlePaneButtonsProviderprivate JButtonButton used to maximize or restore the frame.protected WindowWindow we're currently in.private WindowListenerListens for changes in the state of the Window listener to update the state of the widgets.Fields inherited from class JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionRadianceTitlePane(JRootPane root, RadianceRootPaneUI ui) Creates a new title pane. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddMenuItems(JMenu menu) Adds the necessaryJMenuItems to the specified menu.voidprivate voidCreate theActions that get associated with the buttons and menu items.private voidCreates the Buttons that will be placed on the TitlePane.protected LayoutManagerReturns theLayoutManagerthat should be installed on theRadianceTitlePane.private JMenuReturns theJMenudisplaying the appropriate menu items for manipulating the Frame.private JMenuBarReturns theJMenuBardisplaying the appropriate system menu items.private JButtonReturns aJButtonappropriate for placement on the TitlePane.private intprivate intprivate intprivate Stringprivate FramegetFrame()Returns the Frame rendering in.private intReturns theJRootPanethis was created for.private StringgetTitle()Returns the String to display as the title.private intReturns the decoration style of theJRootPane.private voidInstalls the fonts and necessary properties.private voidInstalls the necessary listeners.private voidAdds any sub-Components contained in theRadianceTitlePane.voidvoidprivate voidsetActive(boolean isActive) Updates state dependant upon the Window's active state.voidvoidsetPreferredHeight(int preferredHeight) private voidsetState(int state) Sets the state of the Window.private voidsetState(int state, boolean updateRegardless) Sets the state of the window.private voidprivate voidSynchronizes the tooltip of the close button.voidUninstalls the necessary state.private voidUninstalls the necessary listeners.private voidUpdates the application icon.private voidupdateToggleButton(Action action, Icon icon, String tooltip) Updates the toggle button to contain the Iconicon, and Actionaction.Methods inherited from class JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
propertyChangeListener
PropertyChangeListener added to the JRootPane. -
isControlOnlyMode
private boolean isControlOnlyMode -
preferredHeight
private int preferredHeight -
titlePaneButtonsProvider
-
closeAction
Action used to close the Window. -
iconifyAction
Action used to iconify the Frame. -
restoreAction
Action to restore the Frame size. -
maximizeAction
Action to restore the Frame size. -
toggleButton
Button used to maximize or restore the frame. -
minimizeButton
Button used to minimize the frame -
closeButton
Button used to close the frame. -
windowListener
Listens for changes in the state of the Window listener to update the state of the widgets. -
window
Window we're currently in. -
rootPane
JRootPane rendering for. -
state
private int stateBuffered Frame.state property. As state isn't bound, this is kept to determine when to avoid updating widgets. -
rootPaneUI
RadianceRootPaneUI that created us. -
propertyListener
Listens on changes tocomponentOrientationandRadianceSynapse.CONTENTS_MODIFIEDproperties. -
appIcon
The application icon to be displayed.
-
-
Constructor Details
-
RadianceTitlePane
Creates a new title pane.- Parameters:
root- Root pane.ui- Root pane UI.
-
-
Method Details
-
uninstall
public void uninstall()Uninstalls the necessary state. -
installListeners
private void installListeners()Installs the necessary listeners. -
uninstallListeners
private void uninstallListeners()Uninstalls the necessary listeners. -
getRootPane
Returns theJRootPanethis was created for.- Overrides:
getRootPanein classJComponent
-
getWindowDecorationStyle
private int getWindowDecorationStyle()Returns the decoration style of theJRootPane.- Returns:
- Decoration style of the
JRootPane.
-
addNotify
public void addNotify()- Overrides:
addNotifyin classJComponent
-
removeNotify
public void removeNotify()- Overrides:
removeNotifyin classJComponent
-
installSubcomponents
private void installSubcomponents()Adds any sub-Components contained in theRadianceTitlePane. -
installDefaults
private void installDefaults()Installs the fonts and necessary properties. -
createMenuBar
Returns theJMenuBardisplaying the appropriate system menu items.- Returns:
JMenuBardisplaying the appropriate system menu items.
-
createActions
private void createActions()Create theActions that get associated with the buttons and menu items. -
createMenu
Returns theJMenudisplaying the appropriate menu items for manipulating the Frame.- Returns:
JMenudisplaying the appropriate menu items for manipulating the Frame.
-
addMenuItems
Adds the necessaryJMenuItems to the specified menu.- Parameters:
menu- Menu.
-
createTitleButton
Returns aJButtonappropriate for placement on the TitlePane.- Returns:
- Title button.
-
createButtons
private void createButtons()Creates the Buttons that will be placed on the TitlePane. -
createLayout
Returns theLayoutManagerthat should be installed on theRadianceTitlePane.- Returns:
- Layout manager.
-
setActive
private void setActive(boolean isActive) Updates state dependant upon the Window's active state.- Parameters:
isActive- iftrue, the window is in active state.
-
setState
private void setState(int state) Sets the state of the Window.- Parameters:
state- Window state.
-
setState
private void setState(int state, boolean updateRegardless) Sets the state of the window. IfupdateRegardlessis true and the state has not changed, this will update anyway.- Parameters:
state- Window state.updateRegardless- iftrue, the update is done in any case.
-
updateToggleButton
-
getFrame
Returns the Frame rendering in. This will return null if theJRootPaneis not contained in aFrame.- Returns:
- Frame.
-
getTitle
-
getDisplayTitle
-
paintComponent
- Overrides:
paintComponentin classJComponent
-
syncCloseButtonTooltip
private void syncCloseButtonTooltip()Synchronizes the tooltip of the close button. -
syncButtons
private void syncButtons() -
updateAppIcon
private void updateAppIcon()Updates the application icon. -
getCloseButton
-
getControlButtonSize
private int getControlButtonSize() -
getControlButtonsSmallGap
private int getControlButtonsSmallGap() -
getControlButtonsLargeGap
private int getControlButtonsLargeGap() -
setControlOnlyMode
public void setControlOnlyMode() -
setPreferredHeight
public void setPreferredHeight(int preferredHeight) -
createControlButton
-
getPaneHeight
private int getPaneHeight() -
getControlInsets
-