M
- the kind of areas this mode handlespublic class MaximizedMode<M extends MaximizedModeArea> extends AbstractLocationMode<M>
Dockable
s are maximized if they take up the whole space a frame
or a screen offers.AbstractLocationMode.DockableHandle
Modifier and Type | Field and Description |
---|---|
static java.lang.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
ModeSetting s. |
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,
java.awt.event.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 LocationModeListener s
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, shouldAutoFocus
public static final Path IDENTIFIER
public static final java.lang.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)
LocationMode
setManager
in interface LocationMode
setManager
in class AbstractLocationMode<M extends MaximizedModeArea>
manager
- the manager or null
public Path getUniqueIdentifier()
Mode
Mode
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()
LocationMode
public boolean runApply(Dockable dockable, Location history, AffectedSet set)
AbstractLocationMode
AbstractLocationMode.apply(Dockable, Location, AffectedSet)
after the LocationModeListener
s
are informed. Applies this mode to dockable
.runApply
in class AbstractLocationMode<M extends MaximizedModeArea>
dockable
- the element whose mode becomes this
history
- history information that was returned by this mode when calling
Mode.current(Dockable)
the last time.set
- this method has to store all Dockable
s 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)
Mode
dockable
in respect to this mode.dockable
- the elementMode.apply(Dockable, Object, AffectedSet)
public boolean isCurrentMode(Dockable dockable)
LocationMode
dockable
has this mode, it returns false
. The LocationModeManager
will ask again with the parent station of dockable
.dockable
- some dockable, not null
dockable
is in this
modepublic boolean isDefaultMode(Dockable dockable)
Mode
dockable
. 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 null
public boolean isRepresenting(DockStation station)
LocationMode
station
and represents the mode
children of station
are in.isRepresenting
in interface LocationMode
isRepresenting
in class AbstractLocationMode<M extends MaximizedModeArea>
station
- the station which is to be testedstation
public LocationMode getUnmaximizedMode(Dockable dockable)
dockable
is a maximized element, tells which
mode would be the preferred mode for unmaximization.dockable
- some childnull
public void maximize(MaximizedModeArea area, Dockable dockable, AffectedSet set)
dockable
is maximized.area
- the future parent of dockable
, can be null
dockable
- the element that should be made maximizedset
- a set of Dockable
s 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 null
dockable
- 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 Dockable
s 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 Dockable
s 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 stationnull
public 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)
LocationMode
Dockable
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 null
dockable
public 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 searchednull
public 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 null
dockable
itself, not null
public 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 old
dockable
is
no longer maximized, can be null
protected void applyStarting(LocationModeEvent event)
protected void applyDone(LocationModeEvent event)
public ModeSettingFactory<Location> getSettingFactory()
Mode
ModeSetting
s.null
public void writeSetting(ModeSetting<Location> setting)
Mode
setting
- 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)
Mode
ModeSetting
that has been created by the current
ModeSettingFactory
setting
- the new set of properties, not null
protected boolean process(Dockable dockable, java.awt.event.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 changed