Class BaseTitlePane

All Implemented Interfaces:
TitlePane, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
AcrylTitlePane, AeroTitlePane, AluminiumTitlePane, BernsteinTitlePane, FastTitlePane, GraphiteTitlePane, HiFiTitlePane, LunaTitlePane, McWinTitlePane, MintTitlePane, SmartTitlePane, TextureTitlePane

public class BaseTitlePane extends JComponent implements TitlePane
This class is a modified copy of the javax.swing.plaf.metal.MetalTitlePaneUI Class that manages a JLF awt.Window-descendant class's title bar.

This class assumes it will be created with a particular window decoration style, and that if the style changes, a new one will be created.

Since:
1.4
Version:
1.12 01/23/03 Author Terry Kellerman Author Michael Hagen
See Also:
  • Field Details

    • PAINT_ACTIVE

      public static final String PAINT_ACTIVE
      Constant PAINT_ACTIVE="paintActive"
      See Also:
    • ICONIFY

      public static final String ICONIFY
      Constant ICONIFY="Iconify"
      See Also:
    • MAXIMIZE

      public static final String MAXIMIZE
      Constant MAXIMIZE="Maximize"
      See Also:
    • CLOSE

      public static final String CLOSE
      Constant CLOSE="Close"
      See Also:
    • propertyChangeListener

      protected PropertyChangeListener propertyChangeListener
    • closeAction

      protected Action closeAction
    • iconifyAction

      protected Action iconifyAction
    • restoreAction

      protected Action restoreAction
    • maximizeAction

      protected Action maximizeAction
    • customTitlePanel

      protected JPanel customTitlePanel
    • iconifyButton

      protected JButton iconifyButton
    • maxButton

      protected JButton maxButton
    • closeButton

      protected JButton closeButton
    • iconifyIcon

      protected final Icon iconifyIcon
    • maximizeIcon

      protected final Icon maximizeIcon
    • minimizeIcon

      protected final Icon minimizeIcon
    • closeIcon

      protected final Icon closeIcon
    • windowListener

      protected WindowListener windowListener
    • window

      protected Window window
    • rootPane

      protected final JRootPane rootPane
    • rootPaneUI

      protected final BaseRootPaneUI rootPaneUI
    • buttonsWidth

      protected int buttonsWidth
    • state

      protected int state
    • wasMaximized

      protected boolean wasMaximized
    • wasMaximizeError

      protected boolean wasMaximizeError
    • backgroundImage

      protected BufferedImage backgroundImage
    • alphaValue

      protected float alphaValue
  • Constructor Details

  • Method Details

    • addNotify

      public void addNotify()
      Overrides:
      addNotify in class JComponent
    • calculateMaxBounds

      protected Rectangle calculateMaxBounds(Frame frame)

      calculateMaxBounds.

      Parameters:
      frame - a Frame object.
      Returns:
      a Rectangle object.
    • centerButtons

      protected boolean centerButtons()

      centerButtons.

      Returns:
      a boolean.
    • close

      public void close()

      close.

      Specified by:
      close in interface TitlePane
    • createActions

      protected void createActions()

      createActions.

    • createButtons

      public void createButtons()

      createButtons.

    • createLayout

      public LayoutManager createLayout()

      createLayout.

      Returns:
      a LayoutManager object.
    • createMenuBar

      protected void createMenuBar()

      createMenuBar.

    • createWindowListener

      protected WindowListener createWindowListener()

      createWindowListener.

      Returns:
      a WindowListener object.
    • createWindowPropertyChangeListener

      protected PropertyChangeListener createWindowPropertyChangeListener()

      createWindowPropertyChangeListener.

      Returns:
      a PropertyChangeListener object.
    • getFrame

      protected Frame getFrame()

      getFrame.

      Returns:
      a Frame object.
    • getFrameIconImage

      protected Image getFrameIconImage()

      getFrameIconImage.

      Returns:
      a Image object.
    • getHorSpacing

      protected int getHorSpacing()

      getHorSpacing.

      Returns:
      a Integer object.
    • getIconWidth

      protected int getIconWidth()

      getIconWidth.

      Returns:
      a Integer object.
    • getRootPane

      public JRootPane getRootPane()
      Overrides:
      getRootPane in class JComponent
    • getTitle

      protected String getTitle()

      getTitle.

      Returns:
      a String object.
    • getVerSpacing

      protected int getVerSpacing()

      getVerSpacing.

      Returns:
      a Integer object.
    • getWindow

      protected Window getWindow()

      Getter for the field window.

      Returns:
      a Window object.
    • iconify

      public void iconify()

      iconify.

      Specified by:
      iconify in interface TitlePane
    • installListeners

      protected void installListeners()

      installListeners.

    • isActive

      protected boolean isActive()

      isActive.

      Returns:
      a boolean.
    • isLeftToRight

      protected boolean isLeftToRight()

      isLeftToRight.

      Returns:
      a boolean.
    • isMacStyleWindowDecoration

      protected boolean isMacStyleWindowDecoration()

      isMacStyleWindowDecoration.

      Returns:
      a boolean.
    • maximize

      public void maximize()

      maximize.

      Specified by:
      maximize in interface TitlePane
    • paintBackground

      public void paintBackground(Graphics g)

      paintBackground.

      Parameters:
      g - a Graphics object.
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • paintIcon

      protected int paintIcon(Graphics g, int x)

      paintIcon.

      Parameters:
      g - a Graphics object.
      x - a Integer object.
      Returns:
      a Integer object.
    • paintText

      public void paintText(Graphics g, int x, int y, String title)

      paintText.

      Parameters:
      g - a Graphics object.
      x - a Integer object.
      y - a Integer object.
      title - a String object.
    • removeNotify

      public void removeNotify()
      Overrides:
      removeNotify in class JComponent
    • restore

      public void restore()

      restore.

      Specified by:
      restore in interface TitlePane
    • setActive

      protected void setActive(boolean flag)

      setActive.

      Parameters:
      flag - a boolean.
    • setAlphaTransparency

      public void setAlphaTransparency(float alpha)

      setAlphaTransparency.

      Parameters:
      alpha - a float.
    • setCustomizedTitlePanel

      public void setCustomizedTitlePanel(JPanel panel)

      setCustomizedTitlePanel.

      Parameters:
      panel - a JPanel object.
    • setState

      protected void setState(int state)

      Setter for the field state.

      Parameters:
      state - a Integer object.
    • setState

      protected void setState(int state, boolean updateRegardless)

      Setter for the field state.

      Parameters:
      state - a Integer object.
      updateRegardless - a boolean.
    • uninstallDefaults

      protected void uninstallDefaults()

      uninstallDefaults.

    • uninstallListeners

      protected void uninstallListeners()

      uninstallListeners.

    • updateMaxButton

      protected void updateMaxButton(Action action, Icon icon)

      updateMaxButton.

      Parameters:
      action - a Action object.
      icon - a Icon object.
    • validateMaximizedBounds

      protected void validateMaximizedBounds()

      validateMaximizedBounds.