bibliothek.gui.dock.station
Interface DockableDisplayer

All Superinterfaces:
DockComponentRoot
All Known Implementing Classes:
BasicDockableDisplayer, BubbleDisplayer, EclipseBasicDockableDisplayer, EclipseDockableDisplayer, FlatDockableDisplayer, NoTitleBarDisplayer

public interface DockableDisplayer
extends DockComponentRoot

A panel which shows one Dockable and one DockTitle. The location of the DockTitle is at one of the four borders (left, right, top, bottom). The title may be null, in this case only the Dockable is shown.
Clients using a displayer should try to set the controller and the station property.

Author:
Benjamin Sigg
See Also:
DisplayerCollection, DisplayerFactory

Nested Class Summary
static class DockableDisplayer.Location
          The four possible locations of the title
 
Method Summary
 void addDockableDisplayerListener(DockableDisplayerListener listener)
          Adds listener to this displayer.
 Component getComponent()
          Gets the Component which represents this displayer.
 DockController getController()
          Gets the controller for which this displayer is used.
 Dockable getDockable()
          Gets the Dockable which is shown on this displayer.
 Insets getDockableInsets()
          Gets an estimate of the insets around the Dockable of this displayer compared to the whole size of this displayer.
 DockElementRepresentative getMoveableElement()
          Gets a representation of the Dockable that can be used for grabbing and moving around the displayer.
 DockStation getStation()
          Gets the station on which this displayer might be shown.
 DockTitle getTitle()
          Gets the title which is shown on this displayer.
 Point getTitleCenter()
          Gets the center point of the title or any Component that behaves as if it would be the title.
 DockableDisplayer.Location getTitleLocation()
          Gets the location of the title in respect to the Dockable.
 DisplayerCombinerTarget prepareCombination(CombinerSource source, Enforcement force)
          This method tells how this displayer would like to combine itself with a Dockable that is dropped over it.
 void removeDockableDisplayerListener(DockableDisplayerListener listener)
          Removes listener from this displayer.
 void setController(DockController controller)
          Sets the controller for which this displayer is used.
 void setDockable(Dockable dockable)
          Sets the Dockable which should be shown on this displayer.
 void setStation(DockStation station)
          Sets the station on which this displayer is shown.
 void setTitle(DockTitle title)
          Sets the title of this displayer.
 void setTitleLocation(DockableDisplayer.Location location)
          Sets the location of the title in respect to the Dockable.
 boolean titleContains(int x, int y)
          Tells whether the point x/y is inside the title of this displayer or not.
 
Methods inherited from interface bibliothek.gui.dock.component.DockComponentRoot
getComponentConfiguration, setComponentConfiguration
 

Method Detail

setController

void setController(DockController controller)
Sets the controller for which this displayer is used. That property must be set by the client. Note that there is no guarantee, that a client sets this property.

Parameters:
controller - the controller, can be null

getController

DockController getController()
Gets the controller for which this displayer is used. Note that there is no guarantee, that this property is set.

Returns:
the controller or null

addDockableDisplayerListener

void addDockableDisplayerListener(DockableDisplayerListener listener)
Adds listener to this displayer.

Parameters:
listener - the new listener, not null

removeDockableDisplayerListener

void removeDockableDisplayerListener(DockableDisplayerListener listener)
Removes listener from this displayer.

Parameters:
listener - the listener to remove

setStation

void setStation(DockStation station)
Sets the station on which this displayer is shown. That property must be set by the station itself. Note that there is no guarantee, that a station sets this property.

Parameters:
station - the station or null

getStation

DockStation getStation()
Gets the station on which this displayer might be shown. Note that there is no guarantee, that a parent-station sets this property.

Returns:
the station or null

getDockable

Dockable getDockable()
Gets the Dockable which is shown on this displayer.

Returns:
the child, can be null

setDockable

void setDockable(Dockable dockable)
Sets the Dockable which should be shown on this displayer. A value of null means that no Dockable should be visible at all.

Parameters:
dockable - the child, can be null

getTitleLocation

DockableDisplayer.Location getTitleLocation()
Gets the location of the title in respect to the Dockable.

Returns:
the location

setTitleLocation

void setTitleLocation(DockableDisplayer.Location location)
Sets the location of the title in respect to the Dockable.

Parameters:
location - the location, a value of null is transformed into the default-value

getMoveableElement

DockElementRepresentative getMoveableElement()
Gets a representation of the Dockable that can be used for grabbing and moving around the displayer. The result of this method should be the first match of this list:
  1. A DockTitle
  2. Any kind of DockElementRepresentative
  3. The Dockable itself
  4. null
Changes of the result of this method should be communicated through the DockableDisplayerListeners.

Returns:
an element for moving around this displayer, can be null

getTitle

DockTitle getTitle()
Gets the title which is shown on this displayer.

Returns:
the title, can be null

getTitleCenter

Point getTitleCenter()
Gets the center point of the title or any Component that behaves as if it would be the title. Some DockStations may use this information to make sure, that the user can always grab and move around the Dockable.

Returns:
the center point, may be null

setTitle

void setTitle(DockTitle title)
Sets the title of this displayer. If the title is set to null, no title is visible. The displayer will change the orientation of the title.

Parameters:
title - the title or null

titleContains

boolean titleContains(int x,
                      int y)
Tells whether the point x/y is inside the title of this displayer or not.

Parameters:
x - the x-coordinate, relatively to this component
y - the y-coordinate, relatively to this component
Returns:
true if the title contains the point

getDockableInsets

Insets getDockableInsets()
Gets an estimate of the insets around the Dockable of this displayer compared to the whole size of this displayer.

Returns:
the estimate of the insets

getComponent

Component getComponent()
Gets the Component which represents this displayer.

Returns:
the component

prepareCombination

DisplayerCombinerTarget prepareCombination(CombinerSource source,
                                           Enforcement force)
This method tells how this displayer would like to combine itself with a Dockable that is dropped over it. This method is usually called by a Combiner or by a DockStation, but other modules may call this method as well.

Parameters:
source - information about the dockable that is dropped, the location of the mouse, etc...
force - tells how much the caller would like the result not to be null, if the force property is high, then the result should more likely not be null. Note that a result of null is always a valid result, even if the caller does not like it.
Returns:
the operation that could be performed or null if this displayer does not have any specific information