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

public class RadianceTitlePane extends JComponent
Title pane for Radiance look and feel.
See Also:
  • Field Details

    • propertyChangeListener

      private PropertyChangeListener propertyChangeListener
      PropertyChangeListener added to the JRootPane.
    • isControlOnlyMode

      private boolean isControlOnlyMode
    • preferredHeight

      private int preferredHeight
    • titlePaneButtonsProvider

      private TitlePaneButtonsProvider titlePaneButtonsProvider
    • closeAction

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

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

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

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

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

      private JButton minimizeButton
      Button used to minimize the frame
    • closeButton

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

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

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

      protected 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.
    • rootPaneUI

      private RadianceRootPaneUI rootPaneUI
      RadianceRootPaneUI that created us.
    • propertyListener

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

      private Image appIcon
      The application icon to be displayed.
  • Constructor Details

    • RadianceTitlePane

      public RadianceTitlePane(JRootPane root, RadianceRootPaneUI ui)
      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

      public JRootPane getRootPane()
      Returns the JRootPane this was created for.
      Overrides:
      getRootPane in class 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 JComponent
    • removeNotify

      public void removeNotify()
      Overrides:
      removeNotify in class 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 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 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(JMenu menu)
      Adds the necessary JMenuItems to the specified menu.
      Parameters:
      menu - Menu.
    • createTitleButton

      private 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 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(Action action, Icon icon, String tooltip)
      Updates the toggle button to contain the Icon icon, and Action action.
      Parameters:
      action - Action.
      icon - Icon.
    • getFrame

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

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

      private String getDisplayTitle()
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class 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 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 JButton createControlButton()
    • getPaneHeight

      private int getPaneHeight()
    • getControlInsets

      public Insets getControlInsets()