bibliothek.gui.dock.event
Class DockTitleEvent

java.lang.Object
  extended by bibliothek.gui.dock.event.DockTitleEvent
Direct Known Subclasses:
EclipseDockTitleEvent

public class DockTitleEvent
extends java.lang.Object

These events are used for DockTitles, to transfer information between station and title. See the method DockTitle.changed(DockTitleEvent) for more details.

Author:
Benjamin Sigg

Constructor Summary
DockTitleEvent(Dockable dockable, boolean active)
          Constructs a new event.
DockTitleEvent(DockStation station, Dockable dockable, boolean active)
          Constructs a new event.
 
Method Summary
 Dockable getDockable()
          Gets the Dockable for which the target-title is used.
 DockStation getStation()
          Gets the title which created the event, and on which the target-title is displayed.
 boolean isActive()
          Returns whether the target-title should be painted in a "focused"-state.
 boolean isPreferred()
          Tells whether the Dockable is preferred in some way by the station.
 void setPreferred(boolean preferred)
          Sets whether the Dockable is preferred.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DockTitleEvent

public DockTitleEvent(Dockable dockable,
                      boolean active)
Constructs a new event.

Parameters:
dockable - the Dockable for which the target-title is rendered
active - true if dockable is the selected and focused child, false otherwise

DockTitleEvent

public DockTitleEvent(DockStation station,
                      Dockable dockable,
                      boolean active)
Constructs a new event. This constructor should only be called if a DockStation itself sends the event. Other components should use DockTitleEvent(Dockable, boolean).

Parameters:
station - the station on which the target-title is displayed
dockable - the Dockable for which the target-title is rendered
active - true if dockable is the selected and focused child, false otherwise
Method Detail

getStation

public DockStation getStation()
Gets the title which created the event, and on which the target-title is displayed.

Returns:
the station, null if the event was not sent by the station

getDockable

public Dockable getDockable()
Gets the Dockable for which the target-title is used.

Returns:
the owner of the title

isActive

public boolean isActive()
Returns whether the target-title should be painted in a "focused"-state.

Returns:
true if the Dockable is focused, false otherwise.

isPreferred

public boolean isPreferred()
Tells whether the Dockable is preferred in some way by the station. If so, a DockTitle can be drawn slightly different than a normal title.

Returns:
true if the Dockable is a very special Dockable

setPreferred

public void setPreferred(boolean preferred)
Sets whether the Dockable is preferred.

Parameters:
preferred - true if the target-title should be painted in a special way
See Also:
isPreferred()