Class RadianceTitlePane

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
    Direct Known Subclasses:
    RadianceRibbonFrameTitlePane

    public class RadianceTitlePane
    extends javax.swing.JComponent
    Title pane for Radiance look and feel.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.Image appIcon
      The application icon to be displayed.
      private javax.swing.Action closeAction
      Action used to close the Window.
      private javax.swing.JButton closeButton
      Button used to close the frame.
      private javax.swing.Action iconifyAction
      Action used to iconify the Frame.
      private boolean isControlOnlyMode  
      private javax.swing.Action maximizeAction
      Action to restore the Frame size.
      protected javax.swing.JMenuBar menuBar
      JMenuBar, typically renders the system menu items.
      private javax.swing.JButton minimizeButton
      Button used to minimize the frame
      private int preferredHeight  
      private java.beans.PropertyChangeListener propertyChangeListener
      PropertyChangeListener added to the JRootPane.
      private java.beans.PropertyChangeListener propertyListener
      Listens on changes to componentOrientation and RadianceSynapse.CONTENTS_MODIFIED properties.
      private javax.swing.Action restoreAction
      Action to restore the Frame size.
      protected javax.swing.JRootPane rootPane
      JRootPane rendering for.
      private RadianceRootPaneUI rootPaneUI
      RadianceRootPaneUI that created us.
      private int state
      Buffered Frame.state property.
      private TitlePaneButtonsProvider titlePaneButtonsProvider  
      private javax.swing.JButton toggleButton
      Button used to maximize or restore the frame.
      protected java.awt.Window window
      Window we're currently in.
      private java.awt.event.WindowListener 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addMenuItems​(javax.swing.JMenu menu)
      Adds the necessary JMenuItems to the specified menu.
      void addNotify()  
      private void createActions()
      Create the Actions that get associated with the buttons and menu items.
      private void createButtons()
      Creates the Buttons that will be placed on the TitlePane.
      javax.swing.JButton createControlButton()  
      protected java.awt.LayoutManager createLayout()
      Returns the LayoutManager that should be installed on the RadianceTitlePane.
      private javax.swing.JMenu createMenu()
      Returns the JMenu displaying the appropriate menu items for manipulating the Frame.
      private javax.swing.JMenuBar createMenuBar()
      Returns the JMenuBar displaying the appropriate system menu items.
      private javax.swing.JButton createTitleButton()
      Returns a JButton appropriate for placement on the TitlePane.
      javax.swing.AbstractButton getCloseButton()  
      private int getControlButtonSize()  
      private int getControlButtonsLargeGap()  
      private int getControlButtonsSmallGap()  
      java.awt.Insets getControlInsets()  
      private java.lang.String getDisplayTitle()  
      private java.awt.Frame getFrame()
      Returns the Frame rendering in.
      private int getPaneHeight()  
      javax.swing.JRootPane getRootPane()
      Returns the JRootPane this was created for.
      private java.lang.String getTitle()
      Returns the String to display as the title.
      private int getWindowDecorationStyle()
      Returns the decoration style of the JRootPane.
      private void installDefaults()
      Installs the fonts and necessary properties.
      private void installListeners()
      Installs the necessary listeners.
      private void installSubcomponents()
      Adds any sub-Components contained in the RadianceTitlePane.
      void paintComponent​(java.awt.Graphics g)  
      void removeNotify()  
      private void setActive​(boolean isActive)
      Updates state dependant upon the Window's active state.
      void setControlOnlyMode()  
      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 syncButtons()  
      private void syncCloseButtonTooltip()
      Synchronizes the tooltip of the close button.
      void uninstall()
      Uninstalls the necessary state.
      private void uninstallListeners()
      Uninstalls the necessary listeners.
      private void updateAppIcon()
      Updates the application icon.
      private void updateToggleButton​(javax.swing.Action action, javax.swing.Icon icon, java.lang.String tooltip)
      Updates the toggle button to contain the Icon icon, and Action action.
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • propertyChangeListener

        private java.beans.PropertyChangeListener propertyChangeListener
        PropertyChangeListener added to the JRootPane.
      • menuBar

        protected javax.swing.JMenuBar menuBar
        JMenuBar, typically renders the system menu items.
      • isControlOnlyMode

        private boolean isControlOnlyMode
      • preferredHeight

        private int preferredHeight
      • closeAction

        private javax.swing.Action closeAction
        Action used to close the Window.
      • iconifyAction

        private javax.swing.Action iconifyAction
        Action used to iconify the Frame.
      • restoreAction

        private javax.swing.Action restoreAction
        Action to restore the Frame size.
      • maximizeAction

        private javax.swing.Action maximizeAction
        Action to restore the Frame size.
      • toggleButton

        private javax.swing.JButton toggleButton
        Button used to maximize or restore the frame.
      • minimizeButton

        private javax.swing.JButton minimizeButton
        Button used to minimize the frame
      • closeButton

        private javax.swing.JButton closeButton
        Button used to close the frame.
      • windowListener

        private java.awt.event.WindowListener windowListener
        Listens for changes in the state of the Window listener to update the state of the widgets.
      • window

        protected java.awt.Window window
        Window we're currently in.
      • rootPane

        protected javax.swing.JRootPane rootPane
        JRootPane rendering for.
      • state

        private int state
        Buffered Frame.state property. As state isn't bound, this is kept to determine when to avoid updating widgets.
      • propertyListener

        private java.beans.PropertyChangeListener propertyListener
        Listens on changes to componentOrientation and RadianceSynapse.CONTENTS_MODIFIED properties.
      • appIcon

        private java.awt.Image appIcon
        The application icon to be displayed.
    • Constructor Detail

      • RadianceTitlePane

        public RadianceTitlePane​(javax.swing.JRootPane root,
                                 RadianceRootPaneUI ui)
        Creates a new title pane.
        Parameters:
        root - Root pane.
        ui - Root pane UI.
    • Method Detail

      • 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

        public javax.swing.JRootPane getRootPane()
        Returns the JRootPane this was created for.
        Overrides:
        getRootPane in class javax.swing.JComponent
      • getWindowDecorationStyle

        private int getWindowDecorationStyle()
        Returns the decoration style of the JRootPane.
        Returns:
        Decoration style of the JRootPane.
      • addNotify

        public void addNotify()
        Overrides:
        addNotify in class javax.swing.JComponent
      • removeNotify

        public void removeNotify()
        Overrides:
        removeNotify in class javax.swing.JComponent
      • installSubcomponents

        private void installSubcomponents()
        Adds any sub-Components contained in the RadianceTitlePane.
      • installDefaults

        private void installDefaults()
        Installs the fonts and necessary properties.
      • createMenuBar

        private javax.swing.JMenuBar createMenuBar()
        Returns the JMenuBar displaying the appropriate system menu items.
        Returns:
        JMenuBar displaying the appropriate system menu items.
      • createActions

        private void createActions()
        Create the Actions that get associated with the buttons and menu items.
      • createMenu

        private javax.swing.JMenu createMenu()
        Returns the JMenu displaying the appropriate menu items for manipulating the Frame.
        Returns:
        JMenu displaying the appropriate menu items for manipulating the Frame.
      • addMenuItems

        private void addMenuItems​(javax.swing.JMenu menu)
        Adds the necessary JMenuItems to the specified menu.
        Parameters:
        menu - Menu.
      • createTitleButton

        private javax.swing.JButton createTitleButton()
        Returns a JButton appropriate for placement on the TitlePane.
        Returns:
        Title button.
      • createButtons

        private void createButtons()
        Creates the Buttons that will be placed on the TitlePane.
      • createLayout

        protected java.awt.LayoutManager createLayout()
        Returns the LayoutManager that should be installed on the RadianceTitlePane.
        Returns:
        Layout manager.
      • setActive

        private void setActive​(boolean isActive)
        Updates state dependant upon the Window's active state.
        Parameters:
        isActive - if true, 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. If updateRegardless is true and the state has not changed, this will update anyway.
        Parameters:
        state - Window state.
        updateRegardless - if true, the update is done in any case.
      • updateToggleButton

        private void updateToggleButton​(javax.swing.Action action,
                                        javax.swing.Icon icon,
                                        java.lang.String tooltip)
        Updates the toggle button to contain the Icon icon, and Action action.
        Parameters:
        action - Action.
        icon - Icon.
      • getFrame

        private java.awt.Frame getFrame()
        Returns the Frame rendering in. This will return null if the JRootPane is not contained in a Frame.
        Returns:
        Frame.
      • getTitle

        private java.lang.String getTitle()
        Returns the String to display as the title.
        Returns:
        Display title.
      • getDisplayTitle

        private java.lang.String getDisplayTitle()
      • paintComponent

        public void paintComponent​(java.awt.Graphics g)
        Overrides:
        paintComponent in class javax.swing.JComponent
      • syncCloseButtonTooltip

        private void syncCloseButtonTooltip()
        Synchronizes the tooltip of the close button.
      • syncButtons

        private void syncButtons()
      • updateAppIcon

        private void updateAppIcon()
        Updates the application icon.
      • getCloseButton

        public javax.swing.AbstractButton getCloseButton()
      • getControlButtonSize

        private int getControlButtonSize()
      • getControlButtonsSmallGap

        private int getControlButtonsSmallGap()
      • getControlButtonsLargeGap

        private int getControlButtonsLargeGap()
      • setControlOnlyMode

        public void setControlOnlyMode()
      • setPreferredHeight

        public void setPreferredHeight​(int preferredHeight)
      • createControlButton

        public javax.swing.JButton createControlButton()
      • getPaneHeight

        private int getPaneHeight()
      • getControlInsets

        public java.awt.Insets getControlInsets()