|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.frontend.DefaultLayoutChangeStrategy bibliothek.gui.dock.common.intern.layout.CLayoutChangeStrategy
@FrameworkOnly public class CLayoutChangeStrategy
Strategy that pays attention to MultipleCDockableFactory.match(bibliothek.gui.dock.common.MultipleCDockable, bibliothek.gui.dock.common.MultipleCDockableLayout)
and that fires CVetoClosingEvent
s for MultipleCDockable
s as well.
Nested Class Summary | |
---|---|
protected class |
CLayoutChangeStrategy.CSettingAccess
A DefaultLayoutChangeStrategy.SettingAccess that modifies the roots by calling
replaceMultipleDockables(DockFrontendInternals, CSettingAccess, DockLayoutComposition) . |
Nested classes/interfaces inherited from class bibliothek.gui.dock.frontend.DefaultLayoutChangeStrategy |
---|
DefaultLayoutChangeStrategy.SettingAccess |
Constructor Summary | |
---|---|
CLayoutChangeStrategy(CControl control)
Creates a new strategy. |
Method Summary | |
---|---|
protected DefaultLayoutChangeStrategy.SettingAccess |
createAccess(DockFrontendInternals frontend,
Setting setting)
Creates a wrapper around setting that allows the algorithm of this
LayoutChangeStrategy to access the setting. |
protected PredefinedDockSituation |
createSituation(DockFrontendInternals frontend,
boolean entry,
boolean onSetLayout)
Creates a DockSituation which represents all the knowledge
frontend currently has. |
protected Set<Dockable> |
estimateVisible(DockFrontendInternals frontend,
DockSituation situation,
DockLayoutComposition layout)
Tries to estimate which of the currently visible Dockable s will
still be visible if layout is applied to frontend . |
protected Collection<Dockable> |
getClosingDockables(DockFrontendInternals frontend,
Set<Dockable> visible)
Creates a collection of all the Dockable s that are about to be closed. |
protected DockLayoutComposition |
replaceMultipleDockables(DockFrontendInternals frontend,
CLayoutChangeStrategy.CSettingAccess setting,
DockLayoutComposition composition)
Checks the DockLayout that is associated with composition and may replace
the layout by another layout if a MultipleCDockableFactory finds a match between an existing
item and meta-data about an item. |
protected boolean |
shouldPredefine(Dockable dockable)
Tells whether the element dockable should be added as predefined element to the PredefinedDockSituation
that is created by DefaultLayoutChangeStrategy.createSituation(DockFrontendInternals, boolean, boolean) . |
Methods inherited from class bibliothek.gui.dock.frontend.DefaultLayoutChangeStrategy |
---|
applyInvisibleLayout, applyLayout, approveClosing, createPerspective, createSituation, createTransformer, estimateLocations, getPlaceholderStrategy, listEstimateLocations, listLayouts, setLayout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CLayoutChangeStrategy(CControl control)
control
- the control in whose realm this strategy will be usedMethod Detail |
---|
protected PredefinedDockSituation createSituation(DockFrontendInternals frontend, boolean entry, boolean onSetLayout)
DefaultLayoutChangeStrategy
DockSituation
which represents all the knowledge
frontend
currently has.
createSituation
in class DefaultLayoutChangeStrategy
frontend
- the frontend for which the situation is requiredentry
- true
if the situation is used for a regular setting,
false
if the situation is used as the final setting which will
be loaded the next time the application starts.onSetLayout
- whether this method is called by DefaultLayoutChangeStrategy.setLayout(DockFrontendInternals, Setting, boolean)
or not. If
true
then the situation is used to apply some layout, otherwise it is used to store or read a layout
PredefinedDockSituation
, subclasses
may override and return other situations.protected boolean shouldPredefine(Dockable dockable)
DefaultLayoutChangeStrategy
dockable
should be added as predefined element to the PredefinedDockSituation
that is created by DefaultLayoutChangeStrategy.createSituation(DockFrontendInternals, boolean, boolean)
.
shouldPredefine
in class DefaultLayoutChangeStrategy
dockable
- the element which may need to be predefined
true
if dockable
is to be predefinedprotected Set<Dockable> estimateVisible(DockFrontendInternals frontend, DockSituation situation, DockLayoutComposition layout)
DefaultLayoutChangeStrategy
Dockable
s will
still be visible if layout
is applied to frontend
. The
default implementation assumes that situation
is a PredefinedDockSituation
.
estimateVisible
in class DefaultLayoutChangeStrategy
frontend
- the caller of this methodsituation
- algorithm used to convert layout
layout
- the layout that will be applied
null
protected Collection<Dockable> getClosingDockables(DockFrontendInternals frontend, Set<Dockable> visible)
DefaultLayoutChangeStrategy
Dockable
s that are about to be closed. Subclasses
may override this method, they should at least check all the Dockable
s that are
registered at frontend
. Subclasses may need to override
estimateVisible
as
well to get the correct set of visible
elements.
getClosingDockables
in class DefaultLayoutChangeStrategy
frontend
- the caller of this methodvisible
- the elements that remain visible as told by DefaultLayoutChangeStrategy.estimateVisible(DockFrontendInternals, DockSituation, DockLayoutComposition)
.
null
, may be emptyprotected DockLayoutComposition replaceMultipleDockables(DockFrontendInternals frontend, CLayoutChangeStrategy.CSettingAccess setting, DockLayoutComposition composition)
DockLayout
that is associated with composition
and may replace
the layout by another layout if a MultipleCDockableFactory
finds a match between an existing
item and meta-data about an item.
frontend
- the caller of this methodsetting
- the layout that is about to be appliedcomposition
- the composition to modify, may be null
null
protected DefaultLayoutChangeStrategy.SettingAccess createAccess(DockFrontendInternals frontend, Setting setting)
DefaultLayoutChangeStrategy
setting
that allows the algorithm of this
LayoutChangeStrategy
to access the setting.
createAccess
in class DefaultLayoutChangeStrategy
frontend
- the caller of this methodsetting
- the setting to hide
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |