bibliothek.gui.dock.title
Interface DockTitle

All Superinterfaces:
DockElementRepresentative
All Known Implementing Classes:
AbstractBubbleDockTitle, AbstractDockTitle, BasicButtonDockTitle, BasicDockTitle, BasicStationTitle, BasicTabDockTitle, BubbleButtonDockTitle, BubbleDockTitle, EclipseButtonTitle, FlatButtonTitle, SmoothDefaultButtonTitle, SmoothDefaultStationTitle, SmoothDefaultTitle

public interface DockTitle
extends DockElementRepresentative

A Component which is shown aside a Dockable. A DockTitle displays some information about its Dockable, for example a title-text.
Every DockTitle is owned by exactly one Dockable. The owner cannot be changed.
Every title is either in the state bound or unbound. As long as a title is unbound, it has not to do anything. As soon as it is bound, it has to ensure that it shows the correct properties. A title can assume that it is only bound when its Dockable knows the DockController.

Author:
Benjamin Sigg

Nested Class Summary
static class DockTitle.Orientation
          How to layout a DockTitle
 
Field Summary
static PropertyKey<OrientationToRotationStrategy> ORIENTATION_STRATEGY
          Key for a OrientationToRotationStrategy.
 
Method Summary
 void addMouseInputListener(javax.swing.event.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.
 java.awt.Component getComponent()
          Gets a Component which paints this DockTitle.
 Dockable getDockable()
          Gets the owner of this title.
 DockTitle.Orientation getOrientation()
          Gets the orientation of this title.
 DockTitleVersion getOrigin()
          Gets information about how this title was created.
 boolean isActive()
          Tells whether this title is selected (active) or not.
 void removeMouseInputListener(javax.swing.event.MouseInputListener listener)
          Removes a listener.
 void setOrientation(DockTitle.Orientation orientation)
          Sets the orientation of this title.
 void unbind()
          The reverse of bind().
 
Methods inherited from interface bibliothek.gui.dock.DockElementRepresentative
getElement, getPopupLocation, isUsedAsTitle, shouldFocus, shouldTransfersFocus
 

Field Detail

ORIENTATION_STRATEGY

static final PropertyKey<OrientationToRotationStrategy> ORIENTATION_STRATEGY
Key for a OrientationToRotationStrategy. The strategy can tell this title how to render its text given the orientation of this title.

Method Detail

getComponent

java.awt.Component getComponent()
Gets a Component which paints this DockTitle. This method must always return the same Component.

Specified by:
getComponent in interface DockElementRepresentative
Returns:
always the same Component

addMouseInputListener

void addMouseInputListener(javax.swing.event.MouseInputListener listener)
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
Parameters:
listener - the new listener

removeMouseInputListener

void removeMouseInputListener(javax.swing.event.MouseInputListener listener)
Removes a listener.

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

getDockable

Dockable getDockable()
Gets the owner of this title.

Returns:
the owner

setOrientation

void setOrientation(DockTitle.Orientation orientation)
Sets the orientation of this title. The layout of this title should be influenced by the orientation.

Parameters:
orientation - the orientation

getOrientation

DockTitle.Orientation getOrientation()
Gets the orientation of this title.

Returns:
the orientation
See Also:
setOrientation(bibliothek.gui.dock.title.DockTitle.Orientation)

changed

void changed(DockTitleEvent event)
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.

Parameters:
event - information about the current state

isActive

boolean isActive()
Tells whether this title is selected (active) or not. The title knows its state through the event-object of the method changed.

Returns:
the selection state

bind

void bind()
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.


unbind

void unbind()
The reverse of 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.


getOrigin

DockTitleVersion getOrigin()
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.

Returns:
the title-version, might be null