JIDE 3.5.15

com.jidesoft.plaf.basic
Class BasicDockableFrameTitlePane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.jidesoft.plaf.basic.BasicDockableFrameTitlePane
All Implemented Interfaces:
MouseListener, ImageObserver, MenuContainer, Serializable, EventListener
Direct Known Subclasses:
AquaDockableFrameTitlePane, EclipseDockableFrameTitlePane, XertoDockableFrameUI.XertoDockableFrameTitlePane

public class BasicDockableFrameTitlePane
extends JComponent
implements MouseListener

Basic L&f implementation of title bar for DockableFrame

See Also:
Serialized Form

Nested Class Summary
 class BasicDockableFrameTitlePane.NoFocusButton
           
 class BasicDockableFrameTitlePane.PropertyChangeHandler
          This inner class is marked "public" due to a compiler bug.
 class BasicDockableFrameTitlePane.TitlePaneLayout
          This inner class is marked "public" due to a compiler bug.
 
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
protected  LinkedHashMap<Action,AbstractButton> _additionalButtons
           
protected  boolean _alwaysShowAllButtons
           
protected  Icon _autohideActiveIcon
           
protected  AbstractButton _autohideButton
           
protected  String _autohideButtonToolTip
           
protected  Icon _autohideIcon
           
protected  Icon _autohideRolloverActiveIcon
           
protected  Icon _autohideRolloverIcon
           
protected  String _autohideText
           
protected  Color _backgroundColor
           
protected  int _buttonGap
           
protected  int _buttonsAlignment
           
protected  Icon _closeActiveIcon
           
protected  AbstractButton _closeButton
           
protected  String _closeButtonToolTip
           
protected  Icon _closeIcon
           
protected  Icon _closeRolloverActiveIcon
           
protected  Icon _closeRolloverIcon
           
protected  String _closeText
           
protected  boolean _contentFilledButtons
           
protected  String _dockableText
           
protected  Icon _floatActiveIcon
           
protected  AbstractButton _floatButton
           
protected  String _floatButtonToolTip
           
protected  Icon _floatIcon
           
protected  String _floatingText
           
protected  Icon _floatRolloverActiveIcon
           
protected  Icon _floatRolloverIcon
           
protected  DockableFrame _frame
           
protected  Gripper _gripper
           
protected  Painter _gripperPainter
           
protected  int _gripperWidth
           
protected  Icon _hideAutohideActiveIcon
           
protected  AbstractButton _hideAutohideButton
           
protected  String _hideAutohideButtonToolTip
           
protected  Icon _hideAutohideIcon
           
protected  Icon _hideAutohideRolloverActiveIcon
           
protected  Icon _hideAutohideRolloverIcon
           
protected  String _hideAutohideText
           
protected  Icon _maximizeActiveIcon
           
protected  AbstractButton _maximizeButton
           
protected  String _maximizeButtonToolTip
           
protected  Icon _maximizeIcon
           
protected  Icon _maximizeRolloverActiveIcon
           
protected  Icon _maximizeRolloverIcon
           
protected  String _maximizeText
           
protected  Color _notSelectedTextColor
           
protected  Color _notSelectedTitleBorderColor
           
protected  Color _notSelectedTitleColor
           
protected  JPopupMenu _popupMenu
           
protected  PropertyChangeListener _propertyChangeListener
           
protected  Icon _restoreActiveIcon
           
protected  Icon _restoreIcon
           
protected  Icon _restoreRolloverActiveIcon
           
protected  Icon _restoreRolloverIcon
           
protected  Color _selectedTextColor
           
protected  Color _selectedTitleBorderColor
           
protected  Color _selectedTitleColor
           
protected  boolean _showIcon
           
protected  Icon _stopAutohideActiveIcon
           
protected  Icon _stopAutohideIcon
           
protected  Icon _stopAutohideRolloverActiveIcon
           
protected  Icon _stopAutohideRolloverIcon
           
protected  JComponent _title
           
protected  int _titleAlignment
           
protected  boolean _titleBarComponentCanBeOneSameLine
           
protected  String _titleButtonUI
           
protected  Insets _titleInsets
           
protected  Icon _unfloatActiveIcon
           
protected  Icon _unfloatIcon
           
protected  Icon _unfloatRolloverActiveIcon
           
protected  Icon _unfloatRolloverIcon
           
protected  boolean _use3DButtons
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
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
BasicDockableFrameTitlePane(DockableFrame f)
           
 
Method Summary
protected  void addPopupMenuItems(JPopupMenu popup)
           
protected  void addSubComponents()
           
protected  int calculateButtonWidth()
           
protected  void changeButtonType(AbstractButton button, int type)
           
protected  void createActions()
           
protected  void createComponents()
           
protected  JComponent createDefaultTitleLabel()
          Creates the default title label for the DockableFrameTitlePane.
protected  LayoutManager createLayout()
           
protected  JPopupMenu createPopupMenu()
           
protected  PropertyChangeListener createPropertyChangeListener()
           
protected  AbstractButton createTitleBarButton()
           
protected  boolean dockableFrameHasFocus()
           
protected  void enableButton(AbstractButton button, boolean enabled)
           
protected  int getExtraHeight()
           
protected  int getLeftmostButtonX(int width, Container c)
           
protected  Dimension getMaximumButtonSize()
          Gets maximum button but no less than 8x8.
 ThemePainter getPainter()
           
protected  String getTitle(String text, FontMetrics fm, int availTextWidth)
           
protected  int getTitleBarHeight()
           
protected  void installDefaults()
           
protected  void installListeners()
           
protected  void installTitlePane()
           
protected  boolean isAutohideButtonVisible()
           
protected  boolean isCloseButtonVisible()
           
protected  boolean isFloatingButtonVisible()
           
protected  boolean isHideAutohideButtonVisible()
           
protected  boolean isMaximizeButtonVisible()
           
protected  boolean isSameLine(Container c)
           
 void mouseClicked(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void paintComponent(Graphics g)
           
protected  void paintGripper(Graphics g)
           
protected  void paintTitleBackground(Graphics g)
          Invoked from paintComponent.
 void popupMenu(MouseEvent e)
           
protected  void setButtonIcons()
           
protected  void setupButton(AbstractButton button, Action action)
           
protected  void uninstallDefaults()
           
protected  void uninstallListeners()
           
protected  void uninstallTitlePane()
           
protected  void updateAdditionalButtons()
           
protected  void updateButtonFromAction(Action action, AbstractButton button)
           
protected  void updateButtonVisibilities()
          Updates all title bar button visibilities based on the action.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, transferFocusBackward, 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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_autohideButton

protected AbstractButton _autohideButton

_closeButton

protected AbstractButton _closeButton

_hideAutohideButton

protected AbstractButton _hideAutohideButton

_floatButton

protected AbstractButton _floatButton

_maximizeButton

protected AbstractButton _maximizeButton

_additionalButtons

protected final LinkedHashMap<Action,AbstractButton> _additionalButtons

_title

protected JComponent _title

_gripper

protected Gripper _gripper

_popupMenu

protected JPopupMenu _popupMenu

_frame

protected DockableFrame _frame

_backgroundColor

protected Color _backgroundColor

_selectedTitleColor

protected Color _selectedTitleColor

_selectedTextColor

protected Color _selectedTextColor

_selectedTitleBorderColor

protected Color _selectedTitleBorderColor

_notSelectedTitleColor

protected Color _notSelectedTitleColor

_notSelectedTextColor

protected Color _notSelectedTextColor

_notSelectedTitleBorderColor

protected Color _notSelectedTitleBorderColor

_propertyChangeListener

protected PropertyChangeListener _propertyChangeListener

_closeText

protected String _closeText

_hideAutohideText

protected String _hideAutohideText

_dockableText

protected String _dockableText

_autohideText

protected String _autohideText

_floatingText

protected String _floatingText

_maximizeText

protected String _maximizeText

_closeButtonToolTip

protected String _closeButtonToolTip

_hideAutohideButtonToolTip

protected String _hideAutohideButtonToolTip

_autohideButtonToolTip

protected String _autohideButtonToolTip

_floatButtonToolTip

protected String _floatButtonToolTip

_maximizeButtonToolTip

protected String _maximizeButtonToolTip

_closeIcon

protected Icon _closeIcon

_closeActiveIcon

protected Icon _closeActiveIcon

_closeRolloverIcon

protected Icon _closeRolloverIcon

_closeRolloverActiveIcon

protected Icon _closeRolloverActiveIcon

_hideAutohideIcon

protected Icon _hideAutohideIcon

_hideAutohideActiveIcon

protected Icon _hideAutohideActiveIcon

_hideAutohideRolloverIcon

protected Icon _hideAutohideRolloverIcon

_hideAutohideRolloverActiveIcon

protected Icon _hideAutohideRolloverActiveIcon

_autohideIcon

protected Icon _autohideIcon

_autohideActiveIcon

protected Icon _autohideActiveIcon

_autohideRolloverIcon

protected Icon _autohideRolloverIcon

_autohideRolloverActiveIcon

protected Icon _autohideRolloverActiveIcon

_stopAutohideIcon

protected Icon _stopAutohideIcon

_stopAutohideActiveIcon

protected Icon _stopAutohideActiveIcon

_stopAutohideRolloverIcon

protected Icon _stopAutohideRolloverIcon

_stopAutohideRolloverActiveIcon

protected Icon _stopAutohideRolloverActiveIcon

_floatIcon

protected Icon _floatIcon

_floatActiveIcon

protected Icon _floatActiveIcon

_floatRolloverIcon

protected Icon _floatRolloverIcon

_floatRolloverActiveIcon

protected Icon _floatRolloverActiveIcon

_unfloatIcon

protected Icon _unfloatIcon

_unfloatActiveIcon

protected Icon _unfloatActiveIcon

_unfloatRolloverIcon

protected Icon _unfloatRolloverIcon

_unfloatRolloverActiveIcon

protected Icon _unfloatRolloverActiveIcon

_maximizeIcon

protected Icon _maximizeIcon

_maximizeActiveIcon

protected Icon _maximizeActiveIcon

_maximizeRolloverIcon

protected Icon _maximizeRolloverIcon

_maximizeRolloverActiveIcon

protected Icon _maximizeRolloverActiveIcon

_restoreIcon

protected Icon _restoreIcon

_restoreActiveIcon

protected Icon _restoreActiveIcon

_restoreRolloverIcon

protected Icon _restoreRolloverIcon

_restoreRolloverActiveIcon

protected Icon _restoreRolloverActiveIcon

_gripperWidth

protected int _gripperWidth

_titleButtonUI

protected String _titleButtonUI

_titleBarComponentCanBeOneSameLine

protected boolean _titleBarComponentCanBeOneSameLine

_alwaysShowAllButtons

protected boolean _alwaysShowAllButtons

_showIcon

protected boolean _showIcon

_use3DButtons

protected boolean _use3DButtons

_contentFilledButtons

protected boolean _contentFilledButtons

_buttonsAlignment

protected int _buttonsAlignment

_titleAlignment

protected int _titleAlignment

_buttonGap

protected int _buttonGap

_titleInsets

protected Insets _titleInsets

_gripperPainter

protected Painter _gripperPainter
Constructor Detail

BasicDockableFrameTitlePane

public BasicDockableFrameTitlePane(DockableFrame f)
Method Detail

installTitlePane

protected void installTitlePane()

uninstallTitlePane

protected void uninstallTitlePane()

getMaximumButtonSize

protected Dimension getMaximumButtonSize()
Gets maximum button but no less than 8x8.

Returns:
the maximum button size of all title bar buttons.

addSubComponents

protected void addSubComponents()

updateAdditionalButtons

protected void updateAdditionalButtons()

createActions

protected void createActions()

installListeners

protected void installListeners()

uninstallListeners

protected void uninstallListeners()

installDefaults

protected void installDefaults()

dockableFrameHasFocus

protected boolean dockableFrameHasFocus()

uninstallDefaults

protected void uninstallDefaults()

createComponents

protected void createComponents()

createDefaultTitleLabel

protected JComponent createDefaultTitleLabel()
Creates the default title label for the DockableFrameTitlePane.

Returns:
the default title label for the DockableFrameTitlePane.

setupButton

protected void setupButton(AbstractButton button,
                           Action action)

updateButtonFromAction

protected void updateButtonFromAction(Action action,
                                      AbstractButton button)

updateButtonVisibilities

protected void updateButtonVisibilities()
Updates all title bar button visibilities based on the action.


createTitleBarButton

protected AbstractButton createTitleBarButton()

changeButtonType

protected void changeButtonType(AbstractButton button,
                                int type)

setButtonIcons

protected void setButtonIcons()

addPopupMenuItems

protected void addPopupMenuItems(JPopupMenu popup)

createPopupMenu

protected JPopupMenu createPopupMenu()

paintComponent

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

paintGripper

protected void paintGripper(Graphics g)

paintTitleBackground

protected void paintTitleBackground(Graphics g)
Invoked from paintComponent. Paints the background of the title pane. All text and icons will then be rendered on top of this background.

Parameters:
g - the graphics to use to render the background
Since:
1.4

getTitle

protected String getTitle(String text,
                          FontMetrics fm,
                          int availTextWidth)

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener()

createLayout

protected LayoutManager createLayout()

popupMenu

public void popupMenu(MouseEvent e)

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

getLeftmostButtonX

protected int getLeftmostButtonX(int width,
                                 Container c)

isCloseButtonVisible

protected boolean isCloseButtonVisible()

isHideAutohideButtonVisible

protected boolean isHideAutohideButtonVisible()

isAutohideButtonVisible

protected boolean isAutohideButtonVisible()

isFloatingButtonVisible

protected boolean isFloatingButtonVisible()

isMaximizeButtonVisible

protected boolean isMaximizeButtonVisible()

getTitleBarHeight

protected int getTitleBarHeight()

calculateButtonWidth

protected int calculateButtonWidth()

isSameLine

protected boolean isSameLine(Container c)

enableButton

protected void enableButton(AbstractButton button,
                            boolean enabled)

getPainter

public ThemePainter getPainter()

getExtraHeight

protected int getExtraHeight()

JIDE 3.5.15