bibliothek.gui.dock.station.stack
Interface StackDockComponent

All Known Implementing Classes:
BubbleStackDockComponent, CombinedStackDockComponent, DefaultStackDockComponent, EclipseDockableDisplayer, EclipseStackDockComponent, FlatTab

public interface StackDockComponent

A StackDockComponent is a Component that can show other Components. StackDockComponents are used by StackDockStations to display their children.
The component has one child which is "selected" (assuming there is at least one child). This one child should be visible, the other children should be hidden. The user must have an interface to change the selection at any time.

Author:
Janni Kovacs
See Also:
StackDockStation, DefaultStackDockComponent, JTabbedPane

Method Summary
 void addChangeListener(ChangeListener listener)
          Adds a ChangeListener to this component.
 void addTab(String title, Icon icon, Component comp, Dockable dockable)
          Adds a new child at an unspecified location.
 Rectangle getBoundsAt(int index)
          Gets the location and size of the graphical element that allows the user to select the index'th child.
 Component getComponent()
          Gets a Component on which the children of this StackDockComponent will be displayed.
 int getSelectedIndex()
          Gets the index of the currently selected component
 int getTabCount()
          Gets the number of children that are added to this StackDockComponent.
 void insertTab(String title, Icon icon, Component comp, Dockable dockable, int index)
          Adds a new child at the location index.
 void remove(int index)
          Removes the child at location index.
 void removeAll()
          Removes all children from this component
 void removeChangeListener(ChangeListener listener)
          Removes a ChangeListener which was added earlier.
 void setController(DockController controller)
          Sets the controller for which this component manages its children.
 void setIconAt(int index, Icon newIcon)
          Sets the icon of the child at location index.
 void setSelectedIndex(int index)
          Selects the component at location index.
 void setTitleAt(int index, String newTitle)
          Sets the title of the child at location index.
 

Method Detail

addChangeListener

void addChangeListener(ChangeListener listener)
Adds a ChangeListener to this component. The listener will be called when the selected component changes.

Parameters:
listener - the new listener

removeChangeListener

void removeChangeListener(ChangeListener listener)
Removes a ChangeListener which was added earlier.

Parameters:
listener - the listener to remove

getSelectedIndex

int getSelectedIndex()
Gets the index of the currently selected component

Returns:
the index

setSelectedIndex

void setSelectedIndex(int index)
Selects the component at location index.

Parameters:
index - the index of the selected component

getBoundsAt

Rectangle getBoundsAt(int index)
Gets the location and size of the graphical element that allows the user to select the index'th child.

Parameters:
index - the index of the child
Returns:
the bounds of the graphical selection-element

addTab

void addTab(String title,
            Icon icon,
            Component comp,
            Dockable dockable)
Adds a new child at an unspecified location.

Parameters:
title - the title of the child
icon - an icon to display for the child or null
comp - the new child to display
dockable - the Dockable for which the tab is used

insertTab

void insertTab(String title,
               Icon icon,
               Component comp,
               Dockable dockable,
               int index)
Adds a new child at the location index.

Parameters:
title - the title of the child
icon - an icon to display for the child or null
comp - the new child to display
dockable - the Dockable for which the tab is used
index - the index that the new child should have

getTabCount

int getTabCount()
Gets the number of children that are added to this StackDockComponent.

Returns:
the number of children

removeAll

void removeAll()
Removes all children from this component


remove

void remove(int index)
Removes the child at location index.

Parameters:
index - the index of the child

setTitleAt

void setTitleAt(int index,
                String newTitle)
Sets the title of the child at location index.

Parameters:
index - the index of the child
newTitle - the new title

setIconAt

void setIconAt(int index,
               Icon newIcon)
Sets the icon of the child at location index.

Parameters:
index - the index of the child
newIcon - the new icon, null if no icon should be displayed

getComponent

Component getComponent()
Gets a Component on which the children of this StackDockComponent will be displayed.

Returns:
the Component

setController

void setController(DockController controller)
Sets the controller for which this component manages its children.

Parameters:
controller - the controller or null