bibliothek.gui.dock.title
Class AbstractMultiDockTitle

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by bibliothek.gui.dock.util.BackgroundPanel
                      extended by bibliothek.gui.dock.util.ConfiguredBackgroundPanel
                          extended by bibliothek.gui.dock.title.AbstractMultiDockTitle
All Implemented Interfaces:
DockComponentRoot, DockElementRepresentative, DockTitle, PaintableComponent, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
AbstractDockTitle

@FrameworkOnly
public abstract class AbstractMultiDockTitle
extends ConfiguredBackgroundPanel
implements DockTitle

An abstract implementation of DockTitle. This title can have an icon and some text, but it does not show buttons for DockActions.
Clients should make use of AbstractDockTitle which is also the super-class for all the DockTitles that are used by the framework.

Author:
Benjamin Sigg
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
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
 
Nested classes/interfaces inherited from interface bibliothek.gui.dock.title.DockTitle
DockTitle.Orientation
 
Field Summary
 
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 bibliothek.gui.dock.title.DockTitle
ORIENTATION_STRATEGY
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
protected AbstractMultiDockTitle()
          Constructor which does not do anything.
  AbstractMultiDockTitle(Dockable dockable, DockTitleVersion origin)
          Standard constructor
 
Method Summary
protected  void addColor(AbstractDockColor color)
          Adds a color to the list of colors, this title will ensure that color gets connected to a ColorManager as soon as this title is bound.
protected  void addConditionalFont(String id, Path kind, Condition condition, FontModifier backup)
          Adds a new conditional font to this title, the conditional font will be applied to setFont(Font) when its condition is met.
protected  void addFont(AbstractDockFont font)
          Adds a font to the list of fonts, this title will ensure that font gets connected to a FontManager as soon as this title is bound.
 void addMouseInputListener(MouseInputListener listener)
          Adds a listener to all Components of this title which are visible and which may be "grabbed" by the mouse.
 void bind()
          Called before this title is displayed.
 void changed(DockTitleEvent event)
          Called if a property changed that might be important for painting this title.
protected  BasicTitleViewItem<JComponent> createItemFor(DockAction action, Dockable dockable)
          Creates a new item for action which will be shown on this title.
protected  DockComponentRootHandler createRootHandler()
          Creates the DockComponentRootHandler which is responsible for informing the client about the Components that are shown on this title.
 void doLayout()
           
protected  void doTitleLayout()
          Updates the layout (position and size of all children) of this title.
 DockComponentConfiguration getComponentConfiguration()
          Gets the currently applied configuration.
 Dockable getDockable()
          Gets the owner of this title.
 DockElement getElement()
          Gets the element which is represented by this.
protected  Icon getIcon()
          Gets the icon of this title.
 Rectangle getIconBounds()
          Gets the location and the size of the icon.
 int getIconTextGap()
          Gets the number of pixels to paint between icon and text
protected  Insets getInnerInsets()
          Gets the insets that have to be applied between the border and the content (icon, text, actions) of this title.
protected  OrientedLabel getLabel()
          Grants access to the OrientedLabel which paints the title text.
 Dimension getMinimumSize()
           
 DockTitle.Orientation getOrientation()
          Gets the current orientation.
 DockTitleVersion getOrigin()
          Gets information about how this title was created.
 Point getPopupLocation(Point click, boolean popupTrigger)
          Tells whether a popup menu should be opened when the user clicks at click with the mouse.
 Dimension getPreferredSize()
           
protected  String getText()
          Gets the text which is shown on this title.
protected  void init(Dockable dockable, DockTitleVersion origin)
          Initializer called by the constructor.
 boolean isActive()
          Tells whether this title is selected (active) or not.
 boolean isBound()
          Tells whether this title is bound to a Dockable or not.
protected  boolean isDisabled()
          Tells whether this title is disabled, a disabled title does not react to any user input.
 boolean isUsedAsTitle()
          Tells whether this DockElementRepresentative is used as title.
Some modules grant more rights to titles than to non-titles, i.e.
 void paintBackground(Graphics g)
          Invokes the standard algorithm that paints the background of the component.
protected  void paintBackground(Graphics g, JComponent component)
          Paints the whole background of this title.
 void paintForeground(Graphics g)
          Invokes the standard algorithm that paints the foreground of the component.
protected  void paintForeground(Graphics g, JComponent component)
          Paints the whole foreground of this title.
protected  void paintIcon(Graphics g, JComponent component)
          Paints the icon of this title.
protected  void removeAllConditionalFonts()
          Removes all fonts which were set using addConditionalFont(String, Path, Condition, FontModifier)
protected  void removeColor(AbstractDockColor color)
          Removes a color from this title
protected  void removeFont(AbstractDockFont font)
          Removes a font from this title.
 void removeMouseInputListener(MouseInputListener listener)
          Removes a listener.
 void setActive(boolean active)
          Sets whether this title should be painted as focused or not.
 void setBackground(Color fg)
           
 void setBorder(String key, Border border)
          Sets the border and the BorderModifier that should be used by this title.
 void setComponentConfiguration(DockComponentConfiguration configuration)
          Sets a configuration which is to be applied to all Components (and maybe their children) of this DockComponentRoot.
protected  void setDisabled(boolean disabled)
          Tells this title whether it should be disabled or not.
 void setFont(Font font)
           
 void setFontModifier(FontModifier modifier)
           
 void setForeground(Color fg)
           
protected  void setIcon(Icon icon)
          Sets the icon of this title.
 void setIconTextGap(int iconTextGap)
          Sets the number of pixels to paint between icon and text.
 void setOrientation(DockTitle.Orientation orientation)
          Sets the orientation of this title.
protected  void setText(String text)
          Sets the text of this title.
protected  void setTooltip(String text)
          Sets the tooltip that will be shown on this title.
protected  void setupRenderingHints(Graphics g)
          Called before painting on this panel happens.
 boolean shouldFocus()
          Tells whether a click onto this component should transfer the focus either to this component or to the Dockable.
 boolean shouldTransfersFocus()
          Tells whether a click onto this component should transfer the focus to the Dockable or not.
protected  Insets titleInsets()
          Gets the Insets of this title, tells how much space is not to be covered by children Components.
 void unbind()
          The reverse of DockTitle.bind().
protected  void updateFonts()
          Checks the state of this title and may replace the font of the title.
protected  void updateIcon()
          Called when the icon of this title should be updated.
protected  void updateText()
          Called when the text of this title should be updated.
protected  void updateTooltip()
          Called when the tooltip of this title should be updated.
 
Methods inherited from class bibliothek.gui.dock.util.ConfiguredBackgroundPanel
configure
 
Methods inherited from class bibliothek.gui.dock.util.BackgroundPanel
getBackgroundAlgorithm, getComponent, getTransparency, paint, paintBorder, paintChildren, paintComponent, paintOverlay, setBackground, setTransparency
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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
 
Methods inherited from interface bibliothek.gui.dock.title.DockTitle
getComponent
 

Constructor Detail

AbstractMultiDockTitle

public AbstractMultiDockTitle(Dockable dockable,
                              DockTitleVersion origin)
Standard constructor

Parameters:
dockable - The Dockable whose title this will be
origin - The version which was used to create this title

AbstractMultiDockTitle

protected AbstractMultiDockTitle()
Constructor which does not do anything. Subclasses should call init(Dockable, DockTitleVersion) to initialize the title.

Method Detail

init

protected void init(Dockable dockable,
                    DockTitleVersion origin)
Initializer called by the constructor.

Parameters:
dockable - The Dockable whose title this will be
origin - The version which was used to create this title

createRootHandler

protected DockComponentRootHandler createRootHandler()
Creates the DockComponentRootHandler which is responsible for informing the client about the Components that are shown on this title.

Returns:
the new handler

setIconTextGap

public void setIconTextGap(int iconTextGap)
Sets the number of pixels to paint between icon and text.

Parameters:
iconTextGap - the number of pixels to paint

getIconTextGap

public int getIconTextGap()
Gets the number of pixels to paint between icon and text

Returns:
the number of pixels

addColor

protected void addColor(AbstractDockColor color)
Adds a color to the list of colors, this title will ensure that color gets connected to a ColorManager as soon as this title is bound.

Parameters:
color - the new color

removeColor

protected void removeColor(AbstractDockColor color)
Removes a color from this title

Parameters:
color - the color to remove

addFont

protected void addFont(AbstractDockFont font)
Adds a font to the list of fonts, this title will ensure that font gets connected to a FontManager as soon as this title is bound.

Parameters:
font - the new font

removeFont

protected void removeFont(AbstractDockFont font)
Removes a font from this title.

Parameters:
font - the font to remove

addConditionalFont

protected void addConditionalFont(String id,
                                  Path kind,
                                  Condition condition,
                                  FontModifier backup)
Adds a new conditional font to this title, the conditional font will be applied to setFont(Font) when its condition is met. If there is more than one font whose condition is met, then the first one that was registered is used.

Parameters:
id - the id of the font which is to be used
kind - what kind of title this is
condition - the condition to met
backup - to be used when there is not font set in the FontManager

removeAllConditionalFonts

protected void removeAllConditionalFonts()
Removes all fonts which were set using addConditionalFont(String, Path, Condition, FontModifier)


getIconBounds

public Rectangle getIconBounds()
Gets the location and the size of the icon.

Returns:
the bounds or null if no icon is registered

setDisabled

protected void setDisabled(boolean disabled)
Tells this title whether it should be disabled or not. This method is called when the DisablingStrategy changes. A disabled title should react to any InputEvent, and should be painted differently than an enabled title.

Parameters:
disabled - whether this title is disabled
See Also:
isDisabled()

isDisabled

protected boolean isDisabled()
Tells whether this title is disabled, a disabled title does not react to any user input.

Returns:
whether the title is disabled
See Also:
setDisabled(boolean)

setupRenderingHints

protected void setupRenderingHints(Graphics g)
Description copied from class: BackgroundPanel
Called before painting on this panel happens. Allows to apply rendering hints (or other settings) to g.

Overrides:
setupRenderingHints in class ConfiguredBackgroundPanel
Parameters:
g - the painting context

paintBackground

public void paintBackground(Graphics g)
Description copied from interface: PaintableComponent
Invokes the standard algorithm that paints the background of the component. This method should be called at most once.

Specified by:
paintBackground in interface PaintableComponent
Overrides:
paintBackground in class BackgroundPanel
Parameters:
g - the graphics context to use, null to just inform this component that the background should not be painted automatically

paintBackground

protected void paintBackground(Graphics g,
                               JComponent component)
Paints the whole background of this title. The default implementation just fills the background with the background color of component.

Parameters:
g - the graphics context used to paint
component - the Component which represents this title

paintForeground

public void paintForeground(Graphics g)
Description copied from interface: PaintableComponent
Invokes the standard algorithm that paints the foreground of the component. This method should be called at most once.

Specified by:
paintForeground in interface PaintableComponent
Overrides:
paintForeground in class BackgroundPanel
Parameters:
g - the graphics context to use, null to just inform this component that the foreground should not be painted automatically

paintForeground

protected void paintForeground(Graphics g,
                               JComponent component)
Paints the whole foreground of this title. The default implementation only paints an icon.

Parameters:
g - the graphics context to use
component - the Component which represents this title

paintIcon

protected void paintIcon(Graphics g,
                         JComponent component)
Paints the icon of this title.

Parameters:
g - the graphics context to use
component - the Component which represents this title

setIcon

protected void setIcon(Icon icon)
Sets the icon of this title. The icon is shown on the top or the left edge.

Parameters:
icon - the icon, can be null

getIcon

protected Icon getIcon()
Gets the icon of this title.

Returns:
the icon or null
See Also:
setIcon(Icon)

getLabel

protected OrientedLabel getLabel()
Grants access to the OrientedLabel which paints the title text.

Returns:
the label, never null

setText

protected void setText(String text)
Sets the text of this title. The text either painted horizontally or vertically.

Parameters:
text - the text or null

getText

protected String getText()
Gets the text which is shown on this title.

Returns:
the text

setTooltip

protected void setTooltip(String text)
Sets the tooltip that will be shown on this title.

Parameters:
text - the new tooltip, can be null

setOrientation

public void setOrientation(DockTitle.Orientation orientation)
Description copied from interface: DockTitle
Sets the orientation of this title. The layout of this title should be influenced by the orientation.

Specified by:
setOrientation in interface DockTitle
Parameters:
orientation - the orientation

getOrientation

public DockTitle.Orientation getOrientation()
Gets the current orientation.

Specified by:
getOrientation in interface DockTitle
Returns:
the orientation
See Also:
setOrientation(bibliothek.gui.dock.title.DockTitle.Orientation)

getOrigin

public DockTitleVersion getOrigin()
Description copied from interface: DockTitle
Gets information about how this title was created. This DockTitleVersion can be used to create a DockTitleRequest which should create the same title again. If this title was not created through the regular methods, then this method is allowed to return null. However, some features will only work correctly if this value is not null.

Specified by:
getOrigin in interface DockTitle
Returns:
the title-version, might be null

setForeground

public void setForeground(Color fg)
Overrides:
setForeground in class JComponent

setBackground

public void setBackground(Color fg)
Overrides:
setBackground in class JComponent

setFont

public void setFont(Font font)
Overrides:
setFont in class JComponent

setFontModifier

public void setFontModifier(FontModifier modifier)

getMinimumSize

public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent

setBorder

public void setBorder(String key,
                      Border border)
Sets the border and the BorderModifier that should be used by this title.

Parameters:
key - the identifier of the modifier or null
border - the default title, can be null

getInnerInsets

protected Insets getInnerInsets()
Gets the insets that have to be applied between the border and the content (icon, text, actions) of this title. Subclasses may use this method to create free space in which they can paint additional items.

Returns:
the insets, not null

titleInsets

protected Insets titleInsets()
Gets the Insets of this title, tells how much space is not to be covered by children Components.

Returns:
the insets, never null

doLayout

public void doLayout()
Overrides:
doLayout in class Container

doTitleLayout

protected void doTitleLayout()
Updates the layout (position and size of all children) of this title.


addMouseInputListener

public void addMouseInputListener(MouseInputListener listener)
Description copied from interface: DockTitle
Adds a listener to all Components of this title which are visible and which may be "grabbed" by the mouse.

Specified by:
addMouseInputListener in interface DockElementRepresentative
Specified by:
addMouseInputListener in interface DockTitle
Parameters:
listener - the new listener

removeMouseInputListener

public void removeMouseInputListener(MouseInputListener listener)
Description copied from interface: DockTitle
Removes a listener.

Specified by:
removeMouseInputListener in interface DockElementRepresentative
Specified by:
removeMouseInputListener in interface DockTitle
Parameters:
listener - the listener to remove

getPopupLocation

public Point getPopupLocation(Point click,
                              boolean popupTrigger)
Description copied from interface: DockElementRepresentative
Tells whether a popup menu should be opened when the user clicks at click with the mouse. If yes, then the top left edge of the popup should be returned, otherwise null should be returned.

Specified by:
getPopupLocation in interface DockElementRepresentative
Parameters:
click - the location where the user clicked with the mouse
popupTrigger - whether the invocation is the systems popup trigger or not. Many implementations of this method will return click in case of true, and null in case of false
Returns:
the preferred location of a popup or null if no popup-menu should be opened

getDockable

public Dockable getDockable()
Description copied from interface: DockTitle
Gets the owner of this title.

Specified by:
getDockable in interface DockTitle
Returns:
the owner

getElement

public DockElement getElement()
Description copied from interface: DockElementRepresentative
Gets the element which is represented by this. The result of this method must not change.

Specified by:
getElement in interface DockElementRepresentative
Returns:
the element, never null

isUsedAsTitle

public boolean isUsedAsTitle()
Description copied from interface: DockElementRepresentative
Tells whether this DockElementRepresentative is used as title.
Some modules grant more rights to titles than to non-titles, i.e. a DockRelocator can allow drag & drop only for titles.
Normally a Dockable should have only one element that is a title, so if in doubt return false.

Specified by:
isUsedAsTitle in interface DockElementRepresentative
Returns:
true if this representative should be seen as title

shouldTransfersFocus

public boolean shouldTransfersFocus()
Description copied from interface: DockElementRepresentative
Tells whether a click onto this component should transfer the focus to the Dockable or not. If this object is a Dockable, then a result of true might change the currently focused item of itself. This property is ignored if DockElementRepresentative.shouldFocus() returns false.

Specified by:
shouldTransfersFocus in interface DockElementRepresentative
Returns:
whether to change the focused component or not

shouldFocus

public boolean shouldFocus()
Description copied from interface: DockElementRepresentative
Tells whether a click onto this component should transfer the focus either to this component or to the Dockable.

Specified by:
shouldFocus in interface DockElementRepresentative
Returns:
true if clicking this component should influence focus

setActive

public void setActive(boolean active)
Sets whether this title should be painted as focused or not.

Parameters:
active - true if the Dockable of this title has the focus.

changed

public void changed(DockTitleEvent event)
Description copied from interface: DockTitle
Called if a property changed that might be important for painting this title. The property can be anything, it does not necessarily have to be a property of this title nor of its owner. Modules using this title might send subclasses of DockTitleEvent to transmit more information to this title than DockTitleEvent would allow.

Specified by:
changed in interface DockTitle
Parameters:
event - information about the current state

isActive

public boolean isActive()
Description copied from interface: DockTitle
Tells whether this title is selected (active) or not. The title knows its state through the event-object of the method changed.

Specified by:
isActive in interface DockTitle
Returns:
the selection state

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

createItemFor

protected BasicTitleViewItem<JComponent> createItemFor(DockAction action,
                                                       Dockable dockable)
Creates a new item for action which will be shown on this title.

Parameters:
action - The action which will be triggered by the button
dockable - The Dockable which will be affected by the action
Returns:
the new graphical representation of the action

bind

public void bind()
Description copied from interface: DockTitle
Called before this title is displayed. This method should connect the title with other objects such as its owner. If the title wants to show some DockActions (see the method DockController.listOffers(Dockable)), then this method should bind them too.
Clients should never call this method directly, they should call Dockable.bind(DockTitle). The DockController will call the bind-method, as soon as the Dockable knows the controller.

Specified by:
bind in interface DockTitle

unbind

public void unbind()
Description copied from interface: DockTitle
The reverse of DockTitle.bind(). The title should remove any connections to other objects and unbind its DockActions.
Clients should never call this method directly, they should call Dockable.unbind(DockTitle). The DockController will call the unbind-method before the Dockable looses the controller.

Specified by:
unbind in interface DockTitle

setComponentConfiguration

public void setComponentConfiguration(DockComponentConfiguration configuration)
Description copied from interface: DockComponentRoot
Sets a configuration which is to be applied to all Components (and maybe their children) of this DockComponentRoot.

Specified by:
setComponentConfiguration in interface DockComponentRoot
Parameters:
configuration - the new configuration or null.

getComponentConfiguration

public DockComponentConfiguration getComponentConfiguration()
Description copied from interface: DockComponentRoot
Gets the currently applied configuration.

Specified by:
getComponentConfiguration in interface DockComponentRoot
Returns:
the current configuration, may be null

updateIcon

protected void updateIcon()
Called when the icon of this title should be updated. This title never calls setIcon(Icon) directly, it always calls this method which then calls setIcon(Icon) (the only exception: on unbinding the icon is set to null)


updateText

protected void updateText()
Called when the text of this title should be updated. This title never calls setText(String) directly, it always calls this method which then calls setText(String) (the only exception: on unbinding the text is set to null)


updateTooltip

protected void updateTooltip()
Called when the tooltip of this title should be updated. This title never calls setTooltip(String) directly, it always calls this method which then calls setTooltip(String) (the only exception: on unbinding the tooltip is set to null)


isBound

public boolean isBound()
Tells whether this title is bound to a Dockable or not.

Returns:
true if the title is bound, false otherwise

updateFonts

protected void updateFonts()
Checks the state of this title and may replace the font of the title.