|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.common.intern.AbstractCDockable
public abstract class AbstractCDockable
An abstract implementation of CDockable
. Contains methods to
work with listeners and with CAction
s.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface bibliothek.gui.dock.common.intern.CDockable |
---|
CDockable.ExtendedMode |
Field Summary |
---|
Fields inherited from interface bibliothek.gui.dock.common.intern.CDockable |
---|
ACTION_KEY_CLOSE, ACTION_KEY_EXTERNALIZE, ACTION_KEY_MAXIMIZE, ACTION_KEY_MINIMIZE, ACTION_KEY_NORMALIZE |
Constructor Summary | |
---|---|
protected |
AbstractCDockable(CommonDockable dockable)
Creates a new dockable |
Method Summary | |
---|---|
void |
addCDockablePropertyListener(CDockablePropertyListener listener)
Adds a property listener to this dockable, the listener will be informed of changes of this dockable. |
void |
addCDockableStateListener(CDockableStateListener listener)
Adds a state listener to this dockable, the listener will be informed of changes of this dockable. |
protected CControlAccess |
control()
Gets access to the controller. |
CAction |
getAction(String key)
Gets an action which is not added to the title by this CDockable
put by another module. |
Dimension |
getAndClearResizeRequest()
Gets the preferred size of this CDockable . |
CLocation |
getBaseLocation()
Gets the location of this dockable. |
protected CloseActionSource |
getClose()
Gets the action source which might show a single action that closes this dockable. |
ColorMap |
getColors()
Gets a mutable map of colors. |
CControlAccess |
getControl()
Gets the control which is responsible for this dockable. |
CDockable.ExtendedMode |
getExtendedMode()
Gets the size and location of this dockable. |
Dimension |
getMinimizedSize()
Gets the size which is used when this dockable is minimzed and on a popup window. |
CStation |
getWorkingArea()
Gets the parent of this dockable, this should be the same as set by the last call of CDockable.setWorkingArea(CStation) . |
protected void |
init(CommonDockable dockable)
Initializes this CDockable. |
CommonDockable |
intern()
Gets the intern representation of this dockable. |
boolean |
isMinimizedHold()
Tells whether this dockable remains visible when minimized and without focus. |
boolean |
isResizeLocked()
Tells whether the size of this dockable should remain the same when its parent changes the size. |
boolean |
isTitleShown()
Tells whether this dockable shows its title or not. |
boolean |
isVisible()
Tells whether this dockable is currently visible or not. |
protected CDockablePropertyListener[] |
propertyListeners()
Gets the list of property listeners. |
void |
putAction(String key,
CAction action)
Exchanges an action of this dockable. |
void |
removeCDockablePropertyListener(CDockablePropertyListener listener)
Removes a property listener from this dockable. |
void |
removeCDockableStateListener(CDockableStateListener listener)
Removes a state listener from this dockable. |
void |
setControl(CControlAccess control)
Sets the CControl which is responsible for this dockable. |
void |
setExtendedMode(CDockable.ExtendedMode extendedMode)
Sets how and where this dockable should be shown. |
void |
setLocation(CLocation location)
Sets the location of this dockable. |
void |
setMinimizedHold(boolean hold)
Sets whether this dockable should remain visible when minimized and without focus. |
void |
setMinimizedSize(Dimension size)
Sets the size of this dockable when this dockable is minimized and on a popup window. |
void |
setResizeLocked(boolean resizeLocked)
Sets whether this dockable likes to remain with the same size all the time. |
void |
setResizeRequest(Dimension size,
boolean process)
Tells this CDockable which size it should have. |
void |
setTitleShown(boolean shown)
Tells this CDockable whether to show or to hide its titles. |
void |
setVisible(boolean visible)
Shows or hides this dockable. |
void |
setWorkingArea(CStation area)
Sets the parent of this dockable. |
protected CDockableStateListener[] |
stateListeners()
Gets the list of state listeners. |
void |
toFront()
Tries to focus this dockable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bibliothek.gui.dock.common.intern.CDockable |
---|
isCloseable, isExternalizable, isMaximizable, isMinimizable, isStackable |
Constructor Detail |
---|
protected AbstractCDockable(CommonDockable dockable)
dockable
- the internal representation of this CDockable
,
can be null
but then init(CommonDockable)
should
be called.Method Detail |
---|
protected void init(CommonDockable dockable)
dockable
- the representation of this CDockable
, not null
protected CloseActionSource getClose()
protected CControlAccess control()
null
public void addCDockableStateListener(CDockableStateListener listener)
CDockable
addCDockableStateListener
in interface CDockable
listener
- the new listenerpublic void addCDockablePropertyListener(CDockablePropertyListener listener)
CDockable
addCDockablePropertyListener
in interface CDockable
listener
- the new listenerpublic void removeCDockableStateListener(CDockableStateListener listener)
CDockable
removeCDockableStateListener
in interface CDockable
listener
- the listener to removepublic void removeCDockablePropertyListener(CDockablePropertyListener listener)
CDockable
removeCDockablePropertyListener
in interface CDockable
listener
- the listener to removeprotected CDockableStateListener[] stateListeners()
protected CDockablePropertyListener[] propertyListeners()
public void setVisible(boolean visible)
CDockable
CControlAccess.show(CDockable)
or
CControlAccess.hide(CDockable)
.
setVisible
in interface CDockable
visible
- the new visibility stateCDockable.isVisible()
public boolean isVisible()
CDockable
JFrame
is not shown, or some DockStation
not
properly added to a parent component, then a visible dockable can
be invisible for the user.CControlAccess.isVisible(CDockable)
.
isVisible
in interface CDockable
true
if this dockable can be accessed by the user
through a graphical user interface.public void toFront()
public void setLocation(CLocation location)
CDockable
setLocation
in interface CDockable
location
- the new location, null
is possible, but
will not move the dockable immediatelypublic CLocation getBaseLocation()
CDockable
CDockable.setLocation(CLocation)
.
getBaseLocation
in interface CDockable
null
public void setExtendedMode(CDockable.ExtendedMode extendedMode)
CDockable
CDockable.isExternalizable()
, CDockable.isMaximizable()
and CDockable.isMinimizable()
will just be ignored.
setExtendedMode
in interface CDockable
extendedMode
- the size and locationpublic CDockable.ExtendedMode getExtendedMode()
CDockable
getExtendedMode
in interface CDockable
null
if this dockable
is not part of an CControl
.public void setWorkingArea(CStation area)
CDockable
CDockable.setLocation(CLocation)
.
setWorkingArea
in interface CDockable
area
- the new parent or null
public CStation getWorkingArea()
CDockable
CDockable.setWorkingArea(CStation)
.
getWorkingArea
in interface CDockable
null
public boolean isResizeLocked()
CDockable
isResizeLocked
in interface CDockable
true
if the size of this dockable should remain
the same during resize events of the parent.public void setResizeRequest(Dimension size, boolean process)
CDockable
which size it should have. The size will
be stored until it is read by getAndClearResizeRequest()
.CControl.handleResizeRequests()
in order to
try to apply the requested size. However, there are no guarantees that
the requested size can be matched, or that the request gets handled at all.CControl
, then the request
will remain unprocessed until this dockable is registered, and someone calls
CControl.handleResizeRequests()
on the new owner.
size
- the new preferred size, can be null
to cancel an
earlier requestprocess
- whether to process all pending requests of all CDockable
registered at the CControl
which is the owner of this
.
Clients can set this parameter to false
and call
CControl.handleResizeRequests()
manually to process all pending
requests.public Dimension getAndClearResizeRequest()
CDockable
CDockable
. The preferred size
will be used to resize this CDockable
when
CControl.handleResizeRequests()
is called. There are no guarantees
that the request can be granted, or will be handled at all.null
is
returned.
getAndClearResizeRequest
in interface CDockable
null
public void setResizeLocked(boolean resizeLocked)
resizeLocked
- true
if the size of this dockable should
be kept as long as possible.public void setMinimizedHold(boolean hold)
CDockable
setMinimizedHold
in interface CDockable
hold
- whether to remain visiblepublic boolean isMinimizedHold()
CDockable
isMinimizedHold
in interface CDockable
true
if this remains visible, false
otherwisepublic void setMinimizedSize(Dimension size)
CDockable
setMinimizedSize
in interface CDockable
size
- the sizepublic Dimension getMinimizedSize()
CDockable
getMinimizedSize
in interface CDockable
public void setTitleShown(boolean shown)
CDockable
whether to show or to hide its titles.
shown
- true
if titles should be shown, false
if they should be hidden.public boolean isTitleShown()
CDockable
DockTheme
s might override this setting.
isTitleShown
in interface CDockable
true
if the title is shown, false
otherwise.public CommonDockable intern()
intern
in interface CDockable
public void setControl(CControlAccess control)
CControl
which is responsible for this dockable.
setControl
in interface CDockable
control
- the new controlpublic void putAction(String key, CAction action)
key
- the key of the actionaction
- the new action, can be null
which might force
back a default action (that depends on the module that uses key
)public CAction getAction(String key)
CDockable
CDockable
put by another module.
getAction
in interface CDockable
key
- the name of the action
null
public ColorMap getColors()
CDockable
getColors
in interface CDockable
public CControlAccess getControl()
getControl
in interface CDockable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |