|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JTabbedPane bibliothek.gui.dock.station.stack.DefaultStackDockComponent
public class DefaultStackDockComponent
The standard-implementation of StackDockComponent
. This implementation
uses a JTabbedPane
to display its children.
StackDockComponent
,
JTabbedPane
,
Serialized FormNested Class Summary | |
---|---|
class |
DefaultStackDockComponent.Tab
Representation of a single tab of this StackDockComponent . |
Nested classes/interfaces inherited from class javax.swing.JTabbedPane |
---|
JTabbedPane.AccessibleJTabbedPane, JTabbedPane.ModelListener |
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 |
Field Summary |
---|
Fields inherited from class javax.swing.JTabbedPane |
---|
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT |
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 javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DefaultStackDockComponent()
Constructs the component, sets the location of the tabs to bottom. |
Method Summary | |
---|---|
void |
addStackDockComponentListener(StackDockComponentListener listener)
Adds a listener to this component, it will be called if the selection changes. |
void |
addTab(String title,
Icon icon,
Component comp,
Dockable dockable)
Adds a new child at an unspecified location. |
DockElementRepresentative |
createDefaultRepresentation(DockElement target)
Creates and returns a new DockElementRepresentative representing target ,
the new representation is to be used to cover all the empty areas on this StackDockComponent . |
protected DefaultStackDockComponent.Tab |
createTab(Dockable dockable)
Creates a new representation of a tab on this component. |
Component |
getComponent()
Gets a Component on which the children of this
StackDockComponent will be displayed. |
Dockable |
getDockableAt(int index)
Gets the Dockable which was placed at the index 'th position. |
TabPlacement |
getDockTabPlacement()
Tells at which side tabs should be displayer. |
int |
getIndexOfTabAt(Point mouseLocation)
Gets the index of the tab that is beneath mouseLocation . |
Dimension |
getMinimumSize()
|
DockElementRepresentative |
getTabAt(int index)
The structure of the JTabbedPane does not allow its tabs to recognized as DockElementRepresentative ,
hence this method always returns null . |
boolean |
hasBorder()
Whether this kind of component already has a border. |
int |
indexOf(Dockable dockable)
|
void |
insertTab(String title,
Icon icon,
Component comp,
Dockable dockable,
int index)
Adds a new child at the location index . |
boolean |
isSingleTabComponent()
Tells whether this StackDockComponent should be shown even if
the StackDockStation has only one child. |
void |
moveTab(int source,
int destination)
Moves the tab at source to location destination . |
void |
remove(int index)
Removes the child at location index . |
void |
removeAll()
Removes all children from this component |
void |
removeStackDockComponentListener(StackDockComponentListener listener)
Removes listener from this component. |
void |
setController(DockController controller)
Sets the controller for which this component manages its children. |
void |
setDockTabPlacement(TabPlacement tabSide)
Sets at which side tabs should be displayed. |
void |
setTitleAt(int index,
String title)
Sets the title of the child at location index . |
void |
setTooltipAt(int index,
String newTooltip)
Sets the tooltip of the child at location index . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface bibliothek.gui.dock.station.stack.StackDockComponent |
---|
getBoundsAt, getSelectedIndex, getTabCount, setComponentAt, setIconAt, setSelectedIndex |
Constructor Detail |
---|
public DefaultStackDockComponent()
Method Detail |
---|
public void addStackDockComponentListener(StackDockComponentListener listener)
StackDockComponent
addStackDockComponentListener
in interface StackDockComponent
listener
- the new listener, not null
public void removeStackDockComponentListener(StackDockComponentListener listener)
StackDockComponent
listener
from this component.
removeStackDockComponentListener
in interface StackDockComponent
listener
- the listener to removepublic void setDockTabPlacement(TabPlacement tabSide)
StackDockComponent
setDockTabPlacement
in interface StackDockComponent
tabSide
- the side, not null
public TabPlacement getDockTabPlacement()
StackDockComponent
getDockTabPlacement
in interface StackDockComponent
null
StackDockComponent.setDockTabPlacement(TabPlacement)
public void insertTab(String title, Icon icon, Component comp, Dockable dockable, int index)
StackDockComponent
index
.
insertTab
in interface StackDockComponent
title
- the title of the childicon
- an icon to display for the child or null
comp
- the new child to displaydockable
- the Dockable for which the tab is usedindex
- the index that the new child should haveprotected DefaultStackDockComponent.Tab createTab(Dockable dockable)
dockable
- the element which is represented by the tab
public void addTab(String title, Icon icon, Component comp, Dockable dockable)
StackDockComponent
addTab
in interface StackDockComponent
title
- the title of the childicon
- an icon to display for the child or null
comp
- the new child to displaydockable
- the Dockable for which the tab is usedpublic Dockable getDockableAt(int index)
StackDockComponent
Dockable
which was placed at the index
'th position.
getDockableAt
in interface StackDockComponent
index
- the position of the element
public DockElementRepresentative getTabAt(int index)
JTabbedPane
does not allow its tabs to recognized as DockElementRepresentative
,
hence this method always returns null
.
getTabAt
in interface StackDockComponent
index
- ignored
null
public void moveTab(int source, int destination)
StackDockComponent
source
to location destination
.
moveTab
in interface StackDockComponent
source
- the item to movedestination
- the target destinationpublic void removeAll()
StackDockComponent
removeAll
in interface StackDockComponent
removeAll
in class JTabbedPane
public void remove(int index)
StackDockComponent
index
.
remove
in interface StackDockComponent
remove
in class JTabbedPane
index
- the index of the childpublic Component getComponent()
StackDockComponent
Component
on which the children of this
StackDockComponent
will be displayed.
getComponent
in interface StackDockComponent
Component
public void setTitleAt(int index, String title)
StackDockComponent
index
.
setTitleAt
in interface StackDockComponent
setTitleAt
in class JTabbedPane
index
- the index of the childtitle
- the new titlepublic void setTooltipAt(int index, String newTooltip)
StackDockComponent
index
.
setTooltipAt
in interface StackDockComponent
index
- the index of the childnewTooltip
- the new tooltip, can be null
public void setController(DockController controller)
StackDockComponent
setController
in interface StackDockComponent
controller
- the controller or null
public boolean hasBorder()
StackDockComponent
hasBorder
in interface StackDockComponent
true
if this has a border, false
if the parent should paint one.public boolean isSingleTabComponent()
StackDockComponent
StackDockComponent
should be shown even if
the StackDockStation
has only one child.
isSingleTabComponent
in interface StackDockComponent
true
if this component should always be shownpublic DockElementRepresentative createDefaultRepresentation(DockElement target)
StackDockComponent
DockElementRepresentative
representing target
,
the new representation is to be used to cover all the empty areas on this StackDockComponent
.
createDefaultRepresentation
in interface StackDockComponent
target
- the target for the new representative, may or may not be a child of this component, not null
null
if this StackDockComponent
does not allow to
use its free spacespublic int getIndexOfTabAt(Point mouseLocation)
StackDockComponent
mouseLocation
.
getIndexOfTabAt
in interface StackDockComponent
mouseLocation
- the location of the mouse on the component
-1
public int indexOf(Dockable dockable)
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |