public class NavigationInputMode extends Object implements IInputMode
IInputMode
that can navigate
an IGraph
displayed in a
GraphControl
.
This mode is Exclusive
by default.
Constructor and Description |
---|
NavigationInputMode()
Initializes a new instance of the
NavigationInputMode class. |
Modifier and Type | Method and Description |
---|---|
void |
addGroupCollapsedListener(IEventHandler<ItemEventArgs<INode>> groupCollapsedEvent)
Adds the given listener for the
GroupCollapsed event that occurs whenever a group has been
Collapsed . |
void |
addGroupCollapsingListener(IEventHandler<ItemEventArgs<INode>> groupCollapsingEvent)
Adds the given listener for the
GroupCollapsing event that occurs before a group will be
Collapsed . |
void |
addGroupEnteredListener(IEventHandler<ItemEventArgs<INode>> groupEnteredEvent)
Adds the given listener for the
GroupEntered event that occurs whenever a group has been
Entered . |
void |
addGroupEnteringListener(IEventHandler<ItemEventArgs<INode>> groupEnteringEvent)
Adds the given listener for the
GroupEntering event that occurs before a group will be
Entered . |
void |
addGroupExitedListener(IEventHandler<ItemEventArgs<INode>> groupExitedEvent)
Adds the given listener for the
GroupExited event that occurs whenever a group has been
Exited . |
void |
addGroupExitingListener(IEventHandler<ItemEventArgs<INode>> groupExitingEvent)
Adds the given listener for the
GroupExiting event that occurs before a group will be
Exited . |
void |
addGroupExpandedListener(IEventHandler<ItemEventArgs<INode>> groupExpandedEvent)
Adds the given listener for the
GroupExpanded event that occurs whenever a group has been
Expanded . |
void |
addGroupExpandingListener(IEventHandler<ItemEventArgs<INode>> groupExpandingEvent)
Adds the given listener for the
GroupExpanding event that occurs before a group will be
Expanded . |
protected void |
adjustContentRect()
Callback that adjusts the
ContentRect to encompass all elements. |
protected void |
adjustGroupNodeLocation(boolean collapse,
INode groupNode)
Adjust the group node location according to the value of
AutoGroupNodeAlignmentPolicy . |
void |
cancel()
Called by the client to unconditionally cancel all editing.
|
void |
clearSelection()
Clears the selection in the
GraphControl . |
void |
collapseGroup(INode groupNode)
Collapses the given group node to hide the contents of the group node from this
IFoldingView . |
void |
collapseSelection()
Performs
collapseGroup(INode) for all SelectedNodes . |
void |
enterGroup(INode node)
This method allows for entering a group node so that the currently displayed
IFoldingView 's LocalRoot
will be reset to the provided node. |
void |
enterSelectedGroup()
Performs
enterGroup(INode) for the first valid SelectedNodes . |
void |
exitGroup()
|
void |
expandGroup(INode groupNode)
Expands the given group node to show the contents of the collapsed group node in this
IFoldingView . |
void |
expandSelection()
Performs
expandGroup(INode) for all SelectedNodes . |
void |
extendSelectionTo(MoveFocusDirection direction)
Moves the focus into the given direction, extending the selection to the new element.
|
NodeAlignmentPolicy |
getAutoGroupNodeAlignmentPolicy()
Gets the the location that should be kept fixed if toggling a group node state.
|
Collection<ICommand> |
getAvailableCommands()
Gets the list of commands that are available in this instance.
|
protected ConcurrencyController |
getController()
Returns the installed
Controller . |
IGraph |
getGraph()
Gets the graph this mode operates on.
|
GraphControl |
getGraphControl()
Gets the
GraphControl this mode acts on. |
IGraphSelection |
getGraphSelection()
Gets the
IGraphSelection this mode operates on. |
IInputModeContext |
getInputModeContext()
Returns the context instance this mode is currently installed in or
null if this instance is not installed. |
GraphItemTypes |
getNavigableItems()
Gets the item types that can be navigated to by this mode.
|
int |
getPriority()
The priority of this input mode.
|
GraphItemTypes |
getSelectableItems()
Gets the types of the items that should be selectable by this instance.
|
void |
install(IInputModeContext context,
ConcurrencyController controller)
Installs this mode into the given context that is provided by the canvas.
|
boolean |
isCollapseGroupAllowed()
Gets a value that determines whether it is allowed to collapse group nodes via the
ICommand.COLLAPSE_GROUP . |
boolean |
isEnabled()
Gets the enabled state of this input mode.
|
boolean |
isEnterGroupAllowed()
Gets a value that determines whether it is allowed to
enter group nodes via the
ICommand.ENTER_GROUP . |
boolean |
isExclusive()
Gets a value indicating whether this mode will be the only one running when it has the mutex.
|
boolean |
isExitGroupAllowed()
Gets a value that determines whether it is allowed to
exit the current group node via the
ICommand.EXIT_GROUP . |
boolean |
isExpandGroupAllowed()
Gets a value that determines whether it is allowed to
expand group nodes via the
ICommand.EXPAND_GROUP . |
boolean |
isFittingContentAfterGroupActionsEnabled()
Gets a value that determines whether
CanvasControl.fitContent() or the ICommand.FIT_CONTENT should be
triggered after a group navigation action. |
boolean |
isUsingCurrentItemForCommandsEnabled()
Gets a value indicating whether to use the
CurrentItem as a fallback for the
commands if no item is provided in the parameter and the current selection is empty. |
void |
moveFocusTo(MoveFocusDirection direction)
Moves the focus into the given direction, not changing the current selection.
|
void |
moveTo(MoveFocusDirection direction)
Moves the focus into the given direction, setting the selection to the new element.
|
protected void |
onCanceled()
Called after
cancel() has been called. |
protected void |
onConcurrencyControllerActivated()
|
protected void |
onConcurrencyControllerDeactivated()
|
protected void |
onGroupCollapsed(ItemEventArgs<INode> argument)
Raises the
GroupCollapsed event. |
protected void |
onGroupCollapsing(ItemEventArgs<INode> argument)
Raises the
GroupCollapsing event. |
protected void |
onGroupEntered(ItemEventArgs<INode> argument)
Raises the
GroupEntered event. |
protected void |
onGroupEntering(ItemEventArgs<INode> argument)
Raises the
GroupEntering event. |
protected void |
onGroupExited(ItemEventArgs<INode> argument)
Raises the
GroupExited event. |
protected void |
onGroupExiting(ItemEventArgs<INode> argument)
Raises the
GroupExiting event. |
protected void |
onGroupExpanded(ItemEventArgs<INode> argument)
Raises the
GroupExpanded event. |
protected void |
onGroupExpanding(ItemEventArgs<INode> argument)
Raises the
GroupExpanding event. |
protected void |
onStopped()
Called after
stop() has been called. |
void |
removeGroupCollapsedListener(IEventHandler<ItemEventArgs<INode>> groupCollapsedEvent)
Removes the given listener for the
GroupCollapsed event that occurs whenever a group has been
Collapsed . |
void |
removeGroupCollapsingListener(IEventHandler<ItemEventArgs<INode>> groupCollapsingEvent)
Removes the given listener for the
GroupCollapsing event that occurs before a group will be
Collapsed . |
void |
removeGroupEnteredListener(IEventHandler<ItemEventArgs<INode>> groupEnteredEvent)
Removes the given listener for the
GroupEntered event that occurs whenever a group has been
Entered . |
void |
removeGroupEnteringListener(IEventHandler<ItemEventArgs<INode>> groupEnteringEvent)
Removes the given listener for the
GroupEntering event that occurs before a group will be
Entered . |
void |
removeGroupExitedListener(IEventHandler<ItemEventArgs<INode>> groupExitedEvent)
Removes the given listener for the
GroupExited event that occurs whenever a group has been
Exited . |
void |
removeGroupExitingListener(IEventHandler<ItemEventArgs<INode>> groupExitingEvent)
Removes the given listener for the
GroupExiting event that occurs before a group will be
Exited . |
void |
removeGroupExpandedListener(IEventHandler<ItemEventArgs<INode>> groupExpandedEvent)
Removes the given listener for the
GroupExpanded event that occurs whenever a group has been
Expanded . |
void |
removeGroupExpandingListener(IEventHandler<ItemEventArgs<INode>> groupExpandingEvent)
Removes the given listener for the
GroupExpanding event that occurs before a group will be
Expanded . |
void |
selectCurrentItem()
Selects the
CurrentItem current item. |
protected void |
selectItem(GraphControl graphControl,
IModelItem item,
boolean extendSelection)
Callback that selects the given item.
|
void |
setAutoGroupNodeAlignmentPolicy(NodeAlignmentPolicy value)
Sets the the location that should be kept fixed if toggling a group node state.
|
void |
setCollapseGroupAllowed(boolean value)
Sets a value that determines whether it is allowed to collapse group nodes via the
ICommand.COLLAPSE_GROUP . |
protected boolean |
setCurrentItem(GraphControl graphControl,
IModelItem item)
Callback that actually sets the current item property.
|
void |
setCurrentItem(IModelItem item)
Sets the "current" item to the given one.
|
void |
setEnabled(boolean value)
Sets the enabled state of this input mode.
|
void |
setEnterGroupAllowed(boolean value)
Sets a value that determines whether it is allowed to
enter group nodes via the
ICommand.ENTER_GROUP . |
void |
setExclusive(boolean value)
Sets a value indicating whether this mode will be the only one running when it has the mutex.
|
void |
setExitGroupAllowed(boolean value)
Sets a value that determines whether it is allowed to
exit the current group node via the
ICommand.EXIT_GROUP . |
void |
setExpandGroupAllowed(boolean value)
Sets a value that determines whether it is allowed to
expand group nodes via the
ICommand.EXPAND_GROUP . |
void |
setFittingContentAfterGroupActionsEnabled(boolean value)
Sets a value that determines whether
CanvasControl.fitContent() or the ICommand.FIT_CONTENT should be
triggered after a group navigation action. |
void |
setGraphControl(GraphControl value)
Sets the
GraphControl this mode acts on. |
protected void |
setGraphControlCore(GraphControl graphControl)
Sets the
GraphControl to use for the various actions. |
void |
setNavigableItems(GraphItemTypes value)
Sets the item types that can be navigated to by this mode.
|
void |
setPriority(int value)
The priority of this input mode.
|
void |
setSelectableItems(GraphItemTypes value)
Sets the types of the items that should be selectable by this instance.
|
void |
setUsingCurrentItemForCommandsEnabled(boolean value)
Sets a value indicating whether to use the
CurrentItem as a fallback for the
commands if no item is provided in the parameter and the current selection is empty. |
protected boolean |
shouldCollapseGroup(INode groupNode)
Predicate method that decides whether it is allowed to
collapse the given group node. |
protected boolean |
shouldEnterGroup(INode node)
Predicate method that decides whether it is allowed to
enter the specific group node. |
protected boolean |
shouldExitGroup()
Predicate method that decides whether it is allowed to
exit the current group node. |
protected boolean |
shouldExpandGroup(INode node)
Predicate method that decides whether it is allowed to
expand the given group node. |
protected boolean |
shouldNavigateTo(IModelItem item)
Callback predicate method that determines whether a given model item should be navigated to.
|
protected boolean |
shouldSelect(IModelItem item)
Callback predicate method that determines whether a given model item should be selected.
|
protected boolean |
shouldToggleExpansionState(INode node)
Predicate method that decides whether it is allowed to
toggle the collapsed state
of the given group node. |
boolean |
stop()
Overridden to only return
true if this instance does not currently
have the input mutex . |
void |
toggleExpansionState(INode groupNode)
Toggles the
expanded/collapsed state for the given group node in the
IFoldingView . |
void |
uninstall(IInputModeContext context)
Uninstalls this mode from the given context.
|
public NavigationInputMode()
NavigationInputMode
class.public final void addGroupCollapsedListener(IEventHandler<ItemEventArgs<INode>> groupCollapsedEvent)
GroupCollapsed
event that occurs whenever a group has been
Collapsed
.groupCollapsedEvent
- The listener to add.removeGroupCollapsedListener(IEventHandler)
public final void addGroupCollapsingListener(IEventHandler<ItemEventArgs<INode>> groupCollapsingEvent)
GroupCollapsing
event that occurs before a group will be
Collapsed
.groupCollapsingEvent
- The listener to add.removeGroupCollapsingListener(IEventHandler)
public final void addGroupEnteredListener(IEventHandler<ItemEventArgs<INode>> groupEnteredEvent)
GroupEntered
event that occurs whenever a group has been
Entered
.groupEnteredEvent
- The listener to add.removeGroupEnteredListener(IEventHandler)
public final void addGroupEnteringListener(IEventHandler<ItemEventArgs<INode>> groupEnteringEvent)
GroupEntering
event that occurs before a group will be
Entered
.groupEnteringEvent
- The listener to add.removeGroupEnteringListener(IEventHandler)
public final void addGroupExitedListener(IEventHandler<ItemEventArgs<INode>> groupExitedEvent)
GroupExited
event that occurs whenever a group has been
Exited
.groupExitedEvent
- The listener to add.removeGroupExitedListener(IEventHandler)
public final void addGroupExitingListener(IEventHandler<ItemEventArgs<INode>> groupExitingEvent)
GroupExiting
event that occurs before a group will be
Exited
.groupExitingEvent
- The listener to add.removeGroupExitingListener(IEventHandler)
public final void addGroupExpandedListener(IEventHandler<ItemEventArgs<INode>> groupExpandedEvent)
GroupExpanded
event that occurs whenever a group has been
Expanded
.groupExpandedEvent
- The listener to add.removeGroupExpandedListener(IEventHandler)
public final void addGroupExpandingListener(IEventHandler<ItemEventArgs<INode>> groupExpandingEvent)
GroupExpanding
event that occurs before a group will be
Expanded
.groupExpandingEvent
- The listener to add.removeGroupExpandingListener(IEventHandler)
protected void adjustContentRect()
ContentRect
to encompass all elements.
This implementation will try to delegate to GraphEditorInputMode.adjustContentRect()
if it can find the GraphEditorInputMode
in the InputModeContext
, otherwise the ICommand.FIT_GRAPH_BOUNDS
is executed.
protected void adjustGroupNodeLocation(boolean collapse, INode groupNode)
AutoGroupNodeAlignmentPolicy
.collapse
- true
iff the node has just been collapsed.groupNode
- The node that has changed its state.public void cancel()
IInputMode
This will be called prior to the uninstalling of this instance.
In order to stop an active input mode manually, client code should use the following idiom:
cancel
in interface IInputMode
public void clearSelection()
GraphControl
.public void collapseGroup(INode groupNode)
Collapses
the given group node to hide the contents of the group node from this
IFoldingView
.groupNode
- The group node to collapse.FoldingManager
,
isCollapseGroupAllowed()
public void collapseSelection()
collapseGroup(INode)
for all SelectedNodes
.public void enterGroup(INode node)
IFoldingView
's LocalRoot
will be reset to the provided node.
It is possible to both use a local group node that is part of the currently displayed Graph
as the node
argument, as well as an item that belongs to the MasterGraph
to allow for switching to group nodes which are currently not being displayed in this view.
node
- The node that needs to be either part of the current graph, or part of the
MasterGraph
.shouldEnterGroup(INode)
,
isEnterGroupAllowed()
,
FoldingManager
public void enterSelectedGroup()
enterGroup(INode)
for the first valid SelectedNodes
.public void exitGroup()
LocalRoot
of the currently displayed view
and
shows the contents of the parent container.
This method will also clear the selection
and select
the exited group node.
FoldingManager
,
isExitGroupAllowed()
,
shouldExitGroup()
public void expandGroup(INode groupNode)
Expands
the given group node to show the contents of the collapsed group node in this
IFoldingView
.groupNode
- The group node to expandFoldingManager
,
isExpandGroupAllowed()
public void expandSelection()
expandGroup(INode)
for all SelectedNodes
.public void extendSelectionTo(MoveFocusDirection direction)
direction
- The direction to move the focus and extend the selection.public final NodeAlignmentPolicy getAutoGroupNodeAlignmentPolicy()
Default value is NodeAlignmentPolicy.NONE
expandGroup(INode)
,
collapseGroup(INode)
,
setAutoGroupNodeAlignmentPolicy(NodeAlignmentPolicy)
public final Collection<ICommand> getAvailableCommands()
By default, all supported commands are available
Removing commands from this collection also removes the command bindings registered by this instance.
Add supported commands to make them available in this instance.
Supported commands are
ICommand.MOVE_LEFT
ICommand.MOVE_RIGHT
ICommand.MOVE_UP
ICommand.MOVE_DOWN
ICommand.MOVE_TO_PAGE_UP
ICommand.MOVE_TO_PAGE_DOWN
ICommand.MOVE_FOCUS_BACK
ICommand.MOVE_FOCUS_FORWARD
ICommand.MOVE_FOCUS_UP
ICommand.MOVE_FOCUS_DOWN
ICommand.MOVE_FOCUS_PAGE_UP
ICommand.MOVE_FOCUS_PAGE_DOWN
ICommand.EXTEND_SELECTION_LEFT
ICommand.EXTEND_SELECTION_RIGHT
ICommand.EXTEND_SELECTION_UP
ICommand.EXTEND_SELECTION_DOWN
ICommand.SELECT_TO_PAGE_UP
ICommand.SELECT_TO_PAGE_DOWN
protected final ConcurrencyController getController()
Controller
.public final IGraph getGraph()
public final GraphControl getGraphControl()
GraphControl
this mode acts on.GraphControl
.setGraphControl(GraphControl)
public final IGraphSelection getGraphSelection()
IGraphSelection
this mode operates on.public final IInputModeContext getInputModeContext()
IInputMode
null
if this instance is not installed.
Note that this instance should not be passed down to subordinate modes or instances. Instead a corresponding context
that has this instance set as the ParentInputMode
should be used.
getInputModeContext
in interface IInputMode
public final GraphItemTypes getNavigableItems()
shouldNavigateTo(IModelItem)
,
setNavigableItems(GraphItemTypes)
public final int getPriority()
IInputMode
The priority will influence the order in which the modes will be installed
into the canvas control. The lower the priority value, the earlier it will be installed. If two modes are installed
using the same priority value, the first one will be installed earlier.
getPriority
in interface IInputMode
public final GraphItemTypes getSelectableItems()
The selectable items. The default value is GraphItemTypes.NODE
.
setSelectableItems(GraphItemTypes)
public void install(IInputModeContext context, ConcurrencyController controller)
In general a mode can only be installed into a single canvas at all times.
This method is called to initialize this instance. Subclasses should override this method to register the corresponding event handler delegates for the various input events they need to register with.
Overriding implementations should call the base implementation, first.
install
in interface IInputMode
context
- The context that this instance shall be installed into. The same instance will be passed to this instance during
IInputMode.uninstall(IInputModeContext)
. A reference to the context may be kept and queried during the time
the mode is installed.controller
- The Controller
for this mode.IInputMode.uninstall(IInputModeContext)
public final boolean isCollapseGroupAllowed()
ICommand.COLLAPSE_GROUP
.
The default value is true
.
collapseGroup(INode)
,
shouldCollapseGroup(INode)
,
FoldingManager
,
setCollapseGroupAllowed(boolean)
public boolean isEnabled()
Clients can use this property to disable or reenable this instance. This will set the Enabled
property of the installed Controller
so a disabled instance should never try to acquire the
input mutex.
setEnabled(boolean)
public final boolean isEnterGroupAllowed()
enter group nodes
via the
ICommand.ENTER_GROUP
.
The default value is true
.
shouldEnterGroup(INode)
,
FoldingManager
,
setEnterGroupAllowed(boolean)
public final boolean isExclusive()
The value of this property will be delegated to the Exclusive
property of
the Controller
.
If this mode is marked as exclusive and has the mutex, all other modes added
to the same MultiplexingInputMode
will be deactivated. Otherwise it will always run
concurrently with all other modes.
setExclusive(boolean)
public final boolean isExitGroupAllowed()
exit the current group node
via the
ICommand.EXIT_GROUP
.
The default value is true
.
shouldExitGroup()
,
FoldingManager
,
setExitGroupAllowed(boolean)
public final boolean isExpandGroupAllowed()
expand group nodes
via the
ICommand.EXPAND_GROUP
.
The default value is true
.
shouldExpandGroup(INode)
,
FoldingManager
,
setExpandGroupAllowed(boolean)
public final boolean isFittingContentAfterGroupActionsEnabled()
CanvasControl.fitContent()
or the ICommand.FIT_CONTENT
should be
triggered after a group navigation action.
The default value is true
.
setFittingContentAfterGroupActionsEnabled(boolean)
public final boolean isUsingCurrentItemForCommandsEnabled()
CurrentItem
as a fallback for the
commands if no item is provided in the parameter and the current selection is empty.
This applies to the following commands:
true
if the current item should be used as a fallback; false
otherwise, which is the default.setUsingCurrentItemForCommandsEnabled(boolean)
public void moveFocusTo(MoveFocusDirection direction)
direction
- The direction to move the focus.public void moveTo(MoveFocusDirection direction)
direction
- The direction to move the focus and selection.protected void onCanceled()
cancel()
has been called.
Can be overridden in subclasses to perform additional actions after the mode has been canceled.
This implementation does nothing.
protected void onConcurrencyControllerActivated()
Active
property of the installed ConcurrencyController
has been set to true
.
Can be overridden in subclasses to perform additional actions after the mode has been activated.
Overriding implementations should call the base implementation.
protected void onConcurrencyControllerDeactivated()
Active
property of the installed ConcurrencyController
has been set to false
.
Can be overridden in subclasses to perform additional actions after the mode has been deactivated.
Overriding implementations should call the base implementation.
protected void onGroupCollapsed(ItemEventArgs<INode> argument)
GroupCollapsed
event.argument
- The ItemEventArgs
instance containing the event data.protected void onGroupCollapsing(ItemEventArgs<INode> argument)
GroupCollapsing
event.argument
- The ItemEventArgs
instance containing the event data.protected void onGroupEntered(ItemEventArgs<INode> argument)
GroupEntered
event.argument
- The ItemEventArgs
instance containing the event data.protected void onGroupEntering(ItemEventArgs<INode> argument)
GroupEntering
event.argument
- The ItemEventArgs
instance containing the event data.protected void onGroupExited(ItemEventArgs<INode> argument)
GroupExited
event.argument
- The ItemEventArgs
instance containing the event data.protected void onGroupExiting(ItemEventArgs<INode> argument)
GroupExiting
event.argument
- The ItemEventArgs
instance containing the event data.protected void onGroupExpanded(ItemEventArgs<INode> argument)
GroupExpanded
event.argument
- The ItemEventArgs
instance containing the event data.protected void onGroupExpanding(ItemEventArgs<INode> argument)
GroupExpanding
event.argument
- The ItemEventArgs
instance containing the event data.protected void onStopped()
stop()
has been called.
Can be overridden in subclasses to perform additional actions after the mode has been stopped.
This implementation does nothing.
public final void removeGroupCollapsedListener(IEventHandler<ItemEventArgs<INode>> groupCollapsedEvent)
GroupCollapsed
event that occurs whenever a group has been
Collapsed
.groupCollapsedEvent
- The listener to remove.addGroupCollapsedListener(IEventHandler)
public final void removeGroupCollapsingListener(IEventHandler<ItemEventArgs<INode>> groupCollapsingEvent)
GroupCollapsing
event that occurs before a group will be
Collapsed
.groupCollapsingEvent
- The listener to remove.addGroupCollapsingListener(IEventHandler)
public final void removeGroupEnteredListener(IEventHandler<ItemEventArgs<INode>> groupEnteredEvent)
GroupEntered
event that occurs whenever a group has been
Entered
.groupEnteredEvent
- The listener to remove.addGroupEnteredListener(IEventHandler)
public final void removeGroupEnteringListener(IEventHandler<ItemEventArgs<INode>> groupEnteringEvent)
GroupEntering
event that occurs before a group will be
Entered
.groupEnteringEvent
- The listener to remove.addGroupEnteringListener(IEventHandler)
public final void removeGroupExitedListener(IEventHandler<ItemEventArgs<INode>> groupExitedEvent)
GroupExited
event that occurs whenever a group has been
Exited
.groupExitedEvent
- The listener to remove.addGroupExitedListener(IEventHandler)
public final void removeGroupExitingListener(IEventHandler<ItemEventArgs<INode>> groupExitingEvent)
GroupExiting
event that occurs before a group will be
Exited
.groupExitingEvent
- The listener to remove.addGroupExitingListener(IEventHandler)
public final void removeGroupExpandedListener(IEventHandler<ItemEventArgs<INode>> groupExpandedEvent)
GroupExpanded
event that occurs whenever a group has been
Expanded
.groupExpandedEvent
- The listener to remove.addGroupExpandedListener(IEventHandler)
public final void removeGroupExpandingListener(IEventHandler<ItemEventArgs<INode>> groupExpandingEvent)
GroupExpanding
event that occurs before a group will be
Expanded
.groupExpandingEvent
- The listener to remove.addGroupExpandingListener(IEventHandler)
public void selectCurrentItem()
CurrentItem
current item.
This method delegates to selectItem(GraphControl, IModelItem, boolean)
.
protected void selectItem(GraphControl graphControl, IModelItem item, boolean extendSelection)
graphControl
- The GraphControl
.item
- The item to select.extendSelection
- if set to true
the current selection is extended otherwise it is cleared beforehand.clearSelection()
public final void setAutoGroupNodeAlignmentPolicy(NodeAlignmentPolicy value)
Default value is NodeAlignmentPolicy.NONE
value
- The AutoGroupNodeAlignmentPolicy to set.expandGroup(INode)
,
collapseGroup(INode)
,
getAutoGroupNodeAlignmentPolicy()
public final void setCollapseGroupAllowed(boolean value)
ICommand.COLLAPSE_GROUP
.
The default value is true
.
value
- The CollapseGroupAllowed to set.collapseGroup(INode)
,
shouldCollapseGroup(INode)
,
FoldingManager
,
isCollapseGroupAllowed()
protected boolean setCurrentItem(GraphControl graphControl, IModelItem item)
graphControl
- The GraphControl
to set the current item of.item
- The item to set.public void setCurrentItem(IModelItem item)
item
- The item to set as the current item.setCurrentItem(GraphControl, IModelItem)
public void setEnabled(boolean value)
Clients can use this property to disable or reenable this instance. This will set the Enabled
property of the installed Controller
so a disabled instance should never try to acquire the
input mutex.
value
- The Enabled to set.isEnabled()
public final void setEnterGroupAllowed(boolean value)
enter group nodes
via the
ICommand.ENTER_GROUP
.
The default value is true
.
value
- The EnterGroupAllowed to set.shouldEnterGroup(INode)
,
FoldingManager
,
isEnterGroupAllowed()
public final void setExclusive(boolean value)
The value of this property will be delegated to the Exclusive
property of
the Controller
.
If this mode is marked as exclusive and has the mutex, all other modes added
to the same MultiplexingInputMode
will be deactivated. Otherwise it will always run
concurrently with all other modes.
value
- The Exclusive to set.isExclusive()
public final void setExitGroupAllowed(boolean value)
exit the current group node
via the
ICommand.EXIT_GROUP
.
The default value is true
.
value
- The ExitGroupAllowed to set.shouldExitGroup()
,
FoldingManager
,
isExitGroupAllowed()
public final void setExpandGroupAllowed(boolean value)
expand group nodes
via the
ICommand.EXPAND_GROUP
.
The default value is true
.
value
- The ExpandGroupAllowed to set.shouldExpandGroup(INode)
,
FoldingManager
,
isExpandGroupAllowed()
public final void setFittingContentAfterGroupActionsEnabled(boolean value)
CanvasControl.fitContent()
or the ICommand.FIT_CONTENT
should be
triggered after a group navigation action.
The default value is true
.
value
- The FittingContentAfterGroupActionsEnabled to set.isFittingContentAfterGroupActionsEnabled()
public final void setGraphControl(GraphControl value)
GraphControl
this mode acts on.value
- The GraphControl
.getGraphControl()
protected void setGraphControlCore(GraphControl graphControl)
GraphControl
to use for the various actions.
This will register or unregister the CommandBinding
s for the control. This method is called in response to install(IInputModeContext, ConcurrencyController)
and uninstall(IInputModeContext)
.
graphControl
- The control to use or null
.public final void setNavigableItems(GraphItemTypes value)
value
- The navigable items.shouldNavigateTo(IModelItem)
,
getNavigableItems()
public final void setPriority(int value)
The priority will influence the order in which the modes will be installed
into the canvas control. The lower the priority value, the earlier it will be installed. If two modes are installed
using the same priority value, the first one will be installed earlier.
value
- The Priority to set.getPriority()
public final void setSelectableItems(GraphItemTypes value)
The selectable items. The default value is GraphItemTypes.NODE
.
value
- The SelectableItems to set.getSelectableItems()
public final void setUsingCurrentItemForCommandsEnabled(boolean value)
CurrentItem
as a fallback for the
commands if no item is provided in the parameter and the current selection is empty.
This applies to the following commands:
value
- true
if the current item should be used as a fallback; false
otherwise, which is the default.isUsingCurrentItemForCommandsEnabled()
protected boolean shouldCollapseGroup(INode groupNode)
collapse
the given group node.
This implementation returns the value of CollapseGroupAllowed
.
protected boolean shouldEnterGroup(INode node)
enter
the specific group node.
This implementation yields the value of EnterGroupAllowed
.
node
- The group node to enter.protected boolean shouldExitGroup()
exit
the current group node.
This implementation yields the value of ExitGroupAllowed
.
protected boolean shouldExpandGroup(INode node)
expand
the given group node.
This implementation yields the value of ExpandGroupAllowed
.
protected boolean shouldNavigateTo(IModelItem item)
This implementation uses the NavigableItems
property to determine whether the item
can be navigated to.
item
- The model item.protected boolean shouldSelect(IModelItem item)
This implementation uses the SelectableItems
property to determine whether the item
should be selected.
item
- The model item.protected boolean shouldToggleExpansionState(INode node)
toggle
the collapsed state
of the given group node.
This implementation uses shouldExpandGroup(INode)
and shouldCollapseGroup(INode)
respectively.
public boolean stop()
true
if this instance does not currently
have the input mutex
.stop
in interface IInputMode
true
iff this instance does not own the mutex
.IInputMode.cancel()
public void toggleExpansionState(INode groupNode)
expanded/collapsed
state for the given group node in the
IFoldingView
.groupNode
- The group node to toggle the state for.FoldingManager
public void uninstall(IInputModeContext context)
This code should clean up all changes made to the canvas in the IInputMode.install(IInputModeContext, ConcurrencyController)
method. After a mode has been uninstalled it can be installed again into the same or another canvas.
Overriding implementations should call the base implementation after their own code.
uninstall
in interface IInputMode
context
- The context to deregister from. This is the same instance that had been passed to IInputMode.install(IInputModeContext, ConcurrencyController)
during installation.