|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.javadocking.dockable.DefaultDockable
public class DefaultDockable
The default implementation for a dockable. The content component may not be null.
By default it can be docked anywhere, except in tool bars and tool grids.
It can have a title, an icon, but it doesn't have any actions associated with it.
| Constructor Summary | |
|---|---|
DefaultDockable(java.lang.String id,
java.awt.Component content)
Constructs a new dockable with the specified ID and content. |
|
DefaultDockable(java.lang.String id,
java.awt.Component content,
java.lang.String title)
Constructs a new dockable with the specified id, component and title. |
|
DefaultDockable(java.lang.String id,
java.awt.Component content,
java.lang.String title,
javax.swing.Icon icon)
Constructs a new dockable with the specified id, component, title and icon. |
|
DefaultDockable(java.lang.String id,
java.awt.Component content,
java.lang.String title,
javax.swing.Icon icon,
int dockingModes)
Constructs a new dockable with the specified id, content, title, icon and docking modes. |
|
| Method Summary | |
|---|---|
void |
addDockingListener(DockingListener listener)
Adds a listener for docking events of this dockable. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a java.beans.PropertyChangeListener. |
boolean |
equals(java.lang.Object object)
Returns true if the given object is a Dockable with the same ID
as this dockable. |
void |
fireDockingChanged(DockableEvent dockableEvent)
Notifies all listeners that have registered interest for notification on this event type. |
void |
fireDockingWillChange(DockableEvent dockableEvent)
Notifies all listeners that have registered interest for notification on this event type. |
javax.swing.Action[][] |
getActions()
Returns null. |
java.awt.Component |
getContent()
Gets the content of the dockable. |
java.lang.String |
getDescription()
Gets the description of the dockable. |
LeafDock |
getDock()
Gets the dock in which the dockable is docked. |
int |
getDockingModes()
Gets the modes how this dockable can be docked. |
javax.swing.Icon |
getIcon()
Gets the icon of the dockable. |
java.lang.String |
getID()
Gets the ID of the dockable. |
int |
getLastDockingMode()
Gets the mode how the dockable is docked in its current dock or how it was docked the last time it was in a dock. |
int |
getPossibleStates()
Gets the possible states of the dockable. |
int |
getState()
Gets the state of the dockable. |
java.lang.String |
getTitle()
Gets the title of the dockable. |
java.lang.Object |
getVisualizer()
Gets the object that currently shows the content of the dockable. |
int |
hashCode()
|
boolean |
isWithHeader()
Returns whether the dockable will have a header when it is docked alone. |
void |
removeDockingListener(DockingListener listener)
Removes a listener for docking events of this dockable. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a java.beans.PropertyChangeListener. |
void |
setDescription(java.lang.String description)
Sets the description of the dockable. |
void |
setDock(LeafDock dock)
Sets the dock in which the dockable is docked. |
void |
setDockingModes(int dockingModes)
Sets the modes how this dockable can be docked. |
void |
setIcon(javax.swing.Icon icon)
Sets the icon of the dockable. |
void |
setLastDockingMode(int dockPosition)
Sets the mode how the dockable is docked in its current dock or how it was docked the last time it was in a dock. |
void |
setPossibleStates(int possibleStates)
Sets the possible states of the dockable. |
void |
setState(int state,
java.lang.Object visualizer)
Tries to set the new state of the dockable. |
void |
setTitle(java.lang.String title)
Sets the title of the dockable. |
void |
setWithHeader(boolean withHeader)
Sets whether the dockable will have a header, when it is docked alone. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultDockable(java.lang.String id,
java.awt.Component content)
DockingMode.ALL.
id - The ID of the dockable. The IDs of all dockables should be different.content - The content of the dockable.
java.lang.IllegalArgumentException - If the given ID is null.
public DefaultDockable(java.lang.String id,
java.awt.Component content,
java.lang.String title)
DockingMode.ALL.
id - The ID of the dockable. The IDs of all dockables should be different.content - The content of the dockable.title - The title of the dockable.
java.lang.IllegalArgumentException - If the given ID is null.
public DefaultDockable(java.lang.String id,
java.awt.Component content,
java.lang.String title,
javax.swing.Icon icon)
DockingMode.ALL.
id - The ID of the dockable. The IDs of all dockables should be different.content - The content of the dockable.title - The title of the dockable.icon - The icon of the dockable.
java.lang.IllegalArgumentException - If the given ID is null.
public DefaultDockable(java.lang.String id,
java.awt.Component content,
java.lang.String title,
javax.swing.Icon icon,
int dockingModes)
id - The ID of the dockable. The IDs of all dockables should be different.content - The content of the dockable.title - The title of the dockable.icon - The icon of the dockable.dockingModes - The possible docking modes of the dockable. This integer should be combination of constants
defined by DockingMode.
java.lang.IllegalArgumentException - If the given ID is null.| Method Detail |
|---|
public java.lang.String getID()
Dockable
getID in interface Dockablepublic void setDock(LeafDock dock)
Dockable
setDock in interface Dockabledock - The dock in which the dockable is docked.
This can be null, if the dockable is not docked.public LeafDock getDock()
Dockable
getDock in interface Dockablepublic java.awt.Component getContent()
Dockable
getContent in interface Dockablepublic java.lang.String getTitle()
Dockable
getTitle in interface Dockablepublic java.lang.String getDescription()
Dockable
getDescription in interface Dockablepublic javax.swing.Icon getIcon()
Dockable
getIcon in interface Dockablepublic int getDockingModes()
Dockable
Gets the modes how this dockable can be docked. The integer should be a combination of constants defined by DockingMode.
Combinations of the different modes are made by using the bitwise or-operator.
getDockingModes in interface DockableDockingMode.public void setLastDockingMode(int dockPosition)
Dockable
setLastDockingMode in interface DockabledockPosition - The mode how the dockable is docked in its current dock or how it was docked the last time it was
in a dock. This integer should be a constant defined by DockingMode.public int getLastDockingMode()
Dockable
getLastDockingMode in interface DockableDockingMode.public boolean isWithHeader()
Dockable
isWithHeader in interface Dockable
public void setState(int state,
java.lang.Object visualizer)
Tries to set the new state of the dockable.
When the given state is DockableState.CLOSED, the dock of this dockable will be set to null.
When the given state is DockableState.NORMAL, the visualizer should be the LeafDock where the
dockable is docked in. The dock of this dockable will be set.
For other states the visualizer can have another type, but these types are not obligatory. The visualizer can even be null.
setState in interface Dockablestate - The new state of the dockable. This should be a constant defined by DockableState.visualizer - The object that currently shows the content of the dockable.
Can be null, i.e. when the state of the dockable is DockableState.CLOSED.public java.lang.Object getVisualizer()
DockableDockableState.CLOSED.
getVisualizer in interface Dockablepublic int getState()
Dockable
getState in interface DockableDockableState.public int getPossibleStates()
Gets the possible states of the dockable. This can be a combination of constants defined by DockableState.
A combination is made by the bitwise or-operation on the integer constants.
The default states are DockableState.CLOSED | DockableState.NORMAL | DockableState.MAXIMIZED | DockableState.MINIMIZED.
getPossibleStates in interface Dockablepublic javax.swing.Action[][] getActions()
getActions in interface Dockablepublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Dockabledock property.
addPropertyChangeListener in interface Dockablelistener - The property change listener to be added.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Dockable
removePropertyChangeListener in interface Dockablelistener - The property change listener to be removedpublic void addDockingListener(DockingListener listener)
Dockable
addDockingListener in interface Dockablelistener - A docking listener that will be notified, when this dockable is added, moved, or removed.public void removeDockingListener(DockingListener listener)
Dockable
removeDockingListener in interface Dockablelistener - A docking listener to remove.public void fireDockingWillChange(DockableEvent dockableEvent)
Dockable
fireDockingWillChange in interface DockabledockableEvent - Gives more information about the origin dock, the destination dock,
and the object whose docking state changed.public void fireDockingChanged(DockableEvent dockableEvent)
Dockable
fireDockingChanged in interface DockabledockableEvent - Gives more information about the origin dock, the destination dock,
and the object whose docking state changed.public void setWithHeader(boolean withHeader)
withHeader - True if the dockable will have a header, when it is docked alone, false otherwise.isWithHeader()public void setDockingModes(int dockingModes)
dockingModes - The modes how this dockable can be docked.getDockingModes()public void setIcon(javax.swing.Icon icon)
icon - The icon of the dockable.getIcon()public void setTitle(java.lang.String title)
title - The title of the dockable.getTitle()public void setDescription(java.lang.String description)
description - The description of the dockable.getDescription()public void setPossibleStates(int possibleStates)
possibleStates - The possible states of the dockable.getPossibleStates()public boolean equals(java.lang.Object object)
Dockable with the same ID
as this dockable.
equals in class java.lang.Objectobject -
Dockable with the same ID
as this dockable, false otherwise.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||