M - the kind of areas this mode handlespublic class MaximizedMode<M extends MaximizedModeArea> extends AbstractLocationMode<M>
Dockables are maximized if they take up the whole space a frame
or a screen offers.AbstractLocationMode.DockableHandle| Modifier and Type | Field and Description |
|---|---|
static String |
ICON_IDENTIFIER
the key used for the
IconManager to read the Icon for the "maximize"-action |
static Path |
IDENTIFIER
unique identifier for this mode
|
| Modifier | Constructor and Description |
|---|---|
protected |
MaximizedMode()
Empty default constructor.
|
|
MaximizedMode(CControl control)
Creates a new mode
|
|
MaximizedMode(DockController controller)
Creates a new mode.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyDone(LocationModeEvent event) |
protected void |
applyStarting(LocationModeEvent event) |
Location |
current(Dockable dockable)
Provides history information about the current state of
dockable
in respect to this mode. |
void |
ensureNotHidden(Dockable dockable)
Ensures that no
Dockable that has this mode hides dockable. |
ExtendedMode |
getExtendedMode()
Gets the unique identifier of this mode.
|
MaximizedModeArea |
getMaximizeArea(Dockable dockable)
Searches the first
MaximizedModeArea which is a parent
of dockable. |
MaximizedModeArea |
getMaximizeArea(Dockable dockable,
Location history)
Gets the area to which
dockable should be maximized. |
MaximizedModeArea |
getMaximizeArea(DockStation station)
Searches the one
MaximizedModeArea whose station is
station. |
Dockable |
getMaximizingElement(Dockable dockable)
Gets the element which must be maximized when the user requests that
dockable is maximized. |
Dockable |
getMaximizingElement(Dockable old,
Dockable dockable)
Gets the element which would be maximized if
old is currently
maximized, and dockable is or will not be maximized. |
MaximizedModeArea |
getNextMaximizeArea(DockStation station)
Searches the
MaximizedModeArea which either represents
station or its nearest parent. |
ModeSettingFactory<Location> |
getSettingFactory()
Gets a factory for creating new
ModeSettings. |
Path |
getUniqueIdentifier()
Gets a unique identifier, only this
Mode must have this
identifier. |
LocationMode |
getUnmaximizedMode(Dockable dockable)
Assuming
dockable is a maximized element, tells which
mode would be the preferred mode for unmaximization. |
boolean |
isCurrentMode(Dockable dockable)
If this method is not able to clearly find out whether
dockable
has this mode, it returns false. |
boolean |
isDefaultMode(Dockable dockable)
Checks whether this mode is a default mode of
dockable. |
boolean |
isRepresenting(DockStation station)
Tells whether this mode knows
station and represents the mode
children of station are in. |
void |
maximize(MaximizedModeArea area,
Dockable dockable,
AffectedSet set)
Ensures that
dockable is maximized. |
boolean |
maximize(MaximizedModeArea area,
Dockable dockable,
Location history,
AffectedSet set)
Ensures that
dockable is maximized. |
protected boolean |
process(Dockable dockable,
KeyEvent event)
Invoked whenever a key is pressed, released or typed.
|
void |
readSetting(ModeSetting<Location> setting)
Sets the properties of this mode.
|
boolean |
runApply(Dockable dockable,
Location history,
AffectedSet set)
Called by
AbstractLocationMode.apply(Dockable, Location, AffectedSet) after the LocationModeListeners
are informed. |
void |
setManager(LocationModeManager<?> manager)
Sets the manager which is using this mode.
|
boolean |
switchMode(Dockable dockable)
Tries to switch the current mode of
dockable to or from
the maximized mode. |
void |
unmaximize(Dockable dockable,
AffectedSet set)
Ensures that
dockable is not maximized. |
void |
unmaximize(DockStation station,
AffectedSet affected)
Ensures that either the
MaximizedModeArea station or its
nearest parent does not show a maximized element. |
void |
unmaximize(MaximizedModeArea area,
AffectedSet affected)
Ensures that
area has no maximized child. |
void |
writeSetting(ModeSetting<Location> setting)
Gets the current properties of this mode in an independent way.
|
add, addLocationModeListener, apply, aside, createHandle, get, get, get, get, getActionsFor, getController, getDefaultArea, getManager, getRepresentation, getRepresentationIds, isModeAvailable, isModeHidden, iterator, listeners, remove, removeLocationModeListener, setActionProvider, setController, setDefaultArea, setShouldAutoFocus, shouldAutoFocusclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static final Path IDENTIFIER
public static final String ICON_IDENTIFIER
IconManager to read the Icon for the "maximize"-actionprotected MaximizedMode()
AbstractLocationMode.setActionProvider(LocationModeActionProvider) to complete
initialization of this mode.public MaximizedMode(CControl control)
control - the control in whose realm this mode will workpublic MaximizedMode(DockController controller)
controller - the owner of this modepublic void setManager(LocationModeManager<?> manager)
LocationModesetManager in interface LocationModesetManager in class AbstractLocationMode<M extends MaximizedModeArea>manager - the manager or nullpublic Path getUniqueIdentifier()
ModeMode must have this
identifier. Identifiers with the first segment being "dock" are
reserved for this framework, clients may choose any other identifiers.null, should contain at least
one segment.public ExtendedMode getExtendedMode()
LocationModepublic boolean runApply(Dockable dockable, Location history, AffectedSet set)
AbstractLocationModeAbstractLocationMode.apply(Dockable, Location, AffectedSet) after the LocationModeListeners
are informed. Applies this mode to dockable.runApply in class AbstractLocationMode<M extends MaximizedModeArea>dockable - the element whose mode becomes thishistory - history information that was returned by this mode when calling
Mode.current(Dockable) the last time.set - this method has to store all Dockables which might have changed their
mode in the set.true if dockable was moved, false if the method failed
to set the location of dockable for any reasonpublic Location current(Dockable dockable)
Modedockable
in respect to this mode.dockable - the elementMode.apply(Dockable, Object, AffectedSet)public boolean isCurrentMode(Dockable dockable)
LocationModedockable
has this mode, it returns false. The LocationModeManager
will ask again with the parent station of dockable.dockable - some dockable, not nulldockable is in this modepublic boolean isDefaultMode(Dockable dockable)
Modedockable. A
default mode is a mode that is chosen per default, if no other mode
is selected. There should be only one default-mode per Dockable.dockable - some dockable, not nullpublic boolean isRepresenting(DockStation station)
LocationModestation and represents the mode
children of station are in.isRepresenting in interface LocationModeisRepresenting in class AbstractLocationMode<M extends MaximizedModeArea>station - the station which is to be testedstationpublic LocationMode getUnmaximizedMode(Dockable dockable)
dockable is a maximized element, tells which
mode would be the preferred mode for unmaximization.dockable - some childnullpublic void maximize(MaximizedModeArea area, Dockable dockable, AffectedSet set)
dockable is maximized.area - the future parent of dockable, can be nulldockable - the element that should be made maximizedset - a set of Dockables which will be filled by the
elements that change their mode because of this methodpublic boolean maximize(MaximizedModeArea area, Dockable dockable, Location history, AffectedSet set)
dockable is maximized.area - the future parent of dockable, can be nulldockable - the element that should be made maximizedhistory - the expected location of dockable after this method has finished, can be null.
No guarantees are given that the final location matches history.set - a set of Dockables which will be filled by the
elements that change their mode because of this methodpublic void unmaximize(Dockable dockable, AffectedSet set)
dockable is not maximized. Does nothing if the parent
MaximizedModeArea of dockable has not maximized dockable
or if the LocationModeManager does not know dockable.dockable - the element that might be maximized currentlyset - a set of Dockables which will be filled by the
elements that change their mode because of this methodpublic MaximizedModeArea getNextMaximizeArea(DockStation station)
MaximizedModeArea which either represents
station or its nearest parent.station - some stationnullpublic void unmaximize(DockStation station, AffectedSet affected)
MaximizedModeArea station or its
nearest parent does not show a maximized element.station - an area or a child of an areaaffected - elements whose mode changes will be added to this setpublic void unmaximize(MaximizedModeArea area, AffectedSet affected)
area has no maximized child.area - some areaaffected - the element whose mode might changepublic void ensureNotHidden(Dockable dockable)
LocationModeDockable that has this mode hides dockable.
Note that dockable may or may not be in this mode.dockable - the element which must not be hiddenpublic MaximizedModeArea getMaximizeArea(Dockable dockable, Location history)
dockable should be maximized. This can be
getMaximizeArea(Dockable), or some other station.dockable - the element that is maximizedhistory - the history of the last place where dockable was maximized, might be nulldockablepublic MaximizedModeArea getMaximizeArea(Dockable dockable)
MaximizedModeArea which is a parent
of dockable. This method will never return
dockable itself.dockable - the element whose maximize area is searchednullpublic MaximizedModeArea getMaximizeArea(DockStation station)
MaximizedModeArea whose station is
station.station - the station whose area is searchednull if not foundpublic Dockable getMaximizingElement(Dockable dockable)
dockable is maximized.dockable - some element, not nulldockable
itself, not nullpublic Dockable getMaximizingElement(Dockable old, Dockable dockable)
old is currently
maximized, and dockable is or will not be maximized.old - some elementdockable - some element, might be olddockable is
no longer maximized, can be nullprotected void applyStarting(LocationModeEvent event)
protected void applyDone(LocationModeEvent event)
public ModeSettingFactory<Location> getSettingFactory()
ModeModeSettings.nullpublic void writeSetting(ModeSetting<Location> setting)
Modesetting - a ModeSetting with the same id as this Mode. This setting
was created by a ModeSettingFactory with the same id as this Mode.public void readSetting(ModeSetting<Location> setting)
ModeModeSetting that has been created by the current
ModeSettingFactorysetting - the new set of properties, not nullprotected boolean process(Dockable dockable, KeyEvent event)
dockable - the element to which the event belongsevent - the eventtrue if the event has been processed, false
if the event was not used up.public boolean switchMode(Dockable dockable)
dockable to or from
the maximized mode.dockable - the element whose mode is to be changedCopyright © 2018. All rights reserved.