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
Title pane for Radiance look and feel.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Actions used toclose
theWindow
.private class
Actions used toiconify
theFrame
.private class
Actions used torestore
theFrame
.private class
PropertyChangeListener installed on the Window.class
Class responsible for drawing the system menu.private class
Actions used torestore
theFrame
.protected class
Layout manager for the title pane.private class
WindowListener installed on the Window, updates the state as necessary.Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Image
The application icon to be displayed.private Action
Action used to close the Window.private JButton
Button used to close the frame.private Action
Action used to iconify the Frame.private boolean
private Action
Action to restore the Frame size.protected JMenuBar
JMenuBar, typically renders the system menu items.private JButton
Button used to minimize the frameprivate int
private PropertyChangeListener
PropertyChangeListener added to the JRootPane.private PropertyChangeListener
Listens on changes tocomponentOrientation
andRadianceSynapse.CONTENTS_MODIFIED
properties.private Action
Action to restore the Frame size.protected JRootPane
JRootPane rendering for.private RadianceRootPaneUI
RadianceRootPaneUI that created us.private int
Buffered Frame.state property.private TitlePaneButtonsProvider
private JButton
Button used to maximize or restore the frame.protected Window
Window we're currently in.private WindowListener
Listens for changes in the state of the Window listener to update the state of the widgets.Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.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 void
addMenuItems
(JMenu menu) Adds the necessaryJMenuItem
s to the specified menu.void
private void
Create theAction
s that get associated with the buttons and menu items.private void
Creates the Buttons that will be placed on the TitlePane.protected LayoutManager
Returns theLayoutManager
that should be installed on theRadianceTitlePane
.private JMenu
Returns theJMenu
displaying the appropriate menu items for manipulating the Frame.private JMenuBar
Returns theJMenuBar
displaying the appropriate system menu items.private JButton
Returns aJButton
appropriate for placement on the TitlePane.private int
private int
private int
private String
private Frame
getFrame()
Returns the Frame rendering in.private int
Returns theJRootPane
this was created for.private String
getTitle()
Returns the String to display as the title.private int
Returns the decoration style of theJRootPane
.private void
Installs the fonts and necessary properties.private void
Installs the necessary listeners.private void
Adds any sub-Components contained in theRadianceTitlePane
.void
void
private void
setActive
(boolean isActive) Updates state dependant upon the Window's active state.void
void
setPreferredHeight
(int preferredHeight) private void
setState
(int state) Sets the state of the Window.private void
setState
(int state, boolean updateRegardless) Sets the state of the window.private void
private void
Synchronizes the tooltip of the close button.void
Uninstalls the necessary state.private void
Uninstalls the necessary listeners.private void
Updates the application icon.private void
updateToggleButton
(Action action, Icon icon, String tooltip) Updates the toggle button to contain the Iconicon
, and Actionaction
.Methods inherited from class javax.swing.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, updateUI
Methods inherited from class java.awt.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, validateTree
Methods inherited from class java.awt.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 tocomponentOrientation
andRadianceSynapse.CONTENTS_MODIFIED
properties. -
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 theJRootPane
this was created for.- Overrides:
getRootPane
in classJComponent
-
getWindowDecorationStyle
private int getWindowDecorationStyle()Returns the decoration style of theJRootPane
.- Returns:
- Decoration style of the
JRootPane
.
-
addNotify
public void addNotify()- Overrides:
addNotify
in classJComponent
-
removeNotify
public void removeNotify()- Overrides:
removeNotify
in classJComponent
-
installSubcomponents
private void installSubcomponents()Adds any sub-Components contained in theRadianceTitlePane
. -
installDefaults
private void installDefaults()Installs the fonts and necessary properties. -
createMenuBar
Returns theJMenuBar
displaying the appropriate system menu items.- Returns:
JMenuBar
displaying the appropriate system menu items.
-
createActions
private void createActions()Create theAction
s that get associated with the buttons and menu items. -
createMenu
Returns theJMenu
displaying the appropriate menu items for manipulating the Frame.- Returns:
JMenu
displaying the appropriate menu items for manipulating the Frame.
-
addMenuItems
Adds the necessaryJMenuItem
s to the specified menu.- Parameters:
menu
- Menu.
-
createTitleButton
Returns aJButton
appropriate for placement on the TitlePane.- Returns:
- Title button.
-
createButtons
private void createButtons()Creates the Buttons that will be placed on the TitlePane. -
createLayout
Returns theLayoutManager
that 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. IfupdateRegardless
is 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
Updates the toggle button to contain the Iconicon
, and Actionaction
.- Parameters:
action
- Action.icon
- Icon.
-
getFrame
Returns the Frame rendering in. This will return null if theJRootPane
is not contained in aFrame
.- Returns:
- Frame.
-
getTitle
Returns the String to display as the title.- Returns:
- Display title.
-
getDisplayTitle
-
paintComponent
- Overrides:
paintComponent
in 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
-