public class TableEditorInputMode extends MultiplexingInputMode
This mode can either be used as a stand alone input mode, or as a child mode of
GraphEditorInputMode
. In that case, some child modes of this implementation are disabled:
In addition, the stripe selection
is optionally synchronized with the
GraphSelection
.
Constructor and Description |
---|
TableEditorInputMode()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDeletedItemListener(IEventHandler<ItemEventArgs<IModelItem>> deletedItemEvent)
Adds the given listener for the
DeletedItem event that occurs when an item has been deleted interactively by
this mode. |
void |
addDeletedSelectionListener(IEventHandler<SelectionEventArgs<IStripe>> deletedSelectionEvent)
Adds the given listener for the
DeletedSelection event that occurs just before the deleteSelection()
method has deleted the selection after all selected items have been removed. |
void |
addDeletingSelectionListener(IEventHandler<SelectionEventArgs<IStripe>> deletingSelectionEvent)
Adds the given listener for the
DeletingSelection event that occurs just before the deleteSelection()
method starts its work and will be followed by any number of DeletedItem
events and finalized by a DeletedSelection event. |
Future<ILabel> |
addLabel(ILabelOwner owner)
Adds a new label to the given stripe interactively.
|
void |
addLabelAddedListener(IEventHandler<LabelEventArgs> labelAddedEvent)
Adds the given listener for the
LabelAdded event that occurs when this mode has triggered the addition of an
ILabel , for instance, in response to createLabel(IStripe) . |
void |
addLabelAddingListener(IEventHandler<LabelEditingEventArgs> labelAddingEvent)
Adds the given listener for the
LabelAdding event that occurs when a label is about to be added. |
void |
addLabelEditingListener(IEventHandler<LabelEditingEventArgs> labelEditingEvent)
Adds the given listener for the
LabelEditing event that occurs when a label is about to be edited. |
void |
addLabelTextChangedListener(IEventHandler<ItemEventArgs<ILabel>> labelTextChangedEvent)
Adds the given listener for the
LabelTextChanged event that occurs when this mode has triggered the edit of an
ILabel , for instance, in response to editLabel(ILabel) . |
void |
addLabelTextEditingCanceledListener(IEventHandler<ItemEventArgs<ILabel>> labelTextEditingCanceledEvent)
Adds the given listener for the
LabelTextEditingCanceled event that occurs when the actual label editing process
is canceled. |
void |
addLabelTextEditingStartedListener(IEventHandler<ItemEventArgs<ILabel>> labelTextEditingStartedEvent)
Adds the given listener for the
LabelTextEditingStarted event that occurs when the actual label editing process
is about to start. |
void |
addValidateLabelTextListener(IEventHandler<LabelTextValidatingEventArgs> validateLabelTextEvent)
Adds the given listener for the
ValidateLabelText event that occurs after label editing to validate the label
text for a label that is about to be added or edited. |
protected Object |
childInputModeContextLookup(Class type)
Callback method that will be used by the
child context's ILookup.lookup(Class)
method. |
void |
clearSelection()
Clears the current selection.
|
protected ClickInputMode |
createClickInputMode()
Factory method that creates the
KeyboardInputMode instance. |
protected KeyboardInputMode |
createKeyboardInputMode()
Factory method that creates the
KeyboardInputMode instance. |
Future<ILabel> |
createLabel(IStripe stripe)
Interactively creates a new label for the provided stripe.
|
protected IReparentStripeHandler |
createReparentStripeHandler()
Factory method for the
ReparentStripeHandler property. |
protected ReparentStripeInputMode |
createReparentStripeInputMode()
Factory method that creates the
ReparentStripeInputMode lazily the first time the
property is accessed. |
protected ResizeStripeInputMode |
createResizeStripeInputMode()
Factory method that creates the
ResizeStripeInputMode lazily the first time the
property is accessed. |
protected StripeDropInputMode |
createStripeDropInputMode()
Factory method that creates the
StripeDropInputMode lazily the first time the property
is accessed. |
protected IStripeSelection |
createStripeSelection()
Create a new instance of
IStripeSelection the first time property StripeSelection
is accessed. |
protected TextEditorInputMode |
createTextEditorInputMode()
Factory method for the
TextEditorInputMode property. |
void |
deleteSelection()
This method deletes the currently selected stripes.
|
void |
deleteStripe(IStripe stripe)
Deletes a single stripe.
|
void |
editLabel(ILabel label)
Starts editing of the given label.
|
StripeSubregion |
findStripe(PointD location,
StripeTypes stripeTypes,
StripeSubregionTypes subregionTypes)
Used as a callback to find the items underneath a certain point.
|
StripeSubregion |
findStripe(PointD location,
StripeTypes stripeTypes,
StripeSubregionTypes subregionTypes,
Predicate<StripeSubregion> filter)
Used as a callback to find the items underneath a certain point.
|
IEnumerable<StripeSubregion> |
findStripes(PointD location,
StripeTypes stripeTypes,
StripeSubregionTypes subregionTypes)
Used as a callback to find the items underneath a certain point.
|
IEnumerable<StripeSubregion> |
findStripes(PointD location,
StripeTypes stripeTypes,
StripeSubregionTypes subregionTypes,
Predicate<StripeSubregion> filter)
Used as a callback to find the items underneath a certain point.
|
ClickInputMode |
getClickInputMode()
Gets the
ClickInputMode . |
StripeTypes |
getClickSelectableItems()
Gets a property that determines which types of items should be selectable through
mouse clicks. . |
StripeSubregionTypes |
getClickSelectableRegions()
Gets clicks on which
StripeSubregionTypes (s) should toggle a stripe selection state. |
StripeTypes |
getDeletableItems()
Gets a property that determines which types of items may be deleted using the
deleteSelection() action. |
KeyboardInputMode |
getKeyboardInputMode()
Gets the
KeyboardInputMode . |
StripeTypes |
getLabelEditableItems()
Gets a property that determines which types of items may have their
labels edited . |
IEventRecognizer |
getMultiSelectionRecognizer()
Gets the
IEventRecognizer that will be queried to decide if a click is deemed a multi selection gesture. |
IReparentStripeHandler |
getReparentStripeHandler()
Gets the
ReparentStripeHandler property. |
ReparentStripeInputMode |
getReparentStripeInputMode()
Gets the
ReparentStripeInputMode that is used to change a stripes position in the table hierarchy. |
ResizeStripeInputMode |
getResizeStripeInputMode()
Gets the
ResizeStripeInputMode that is used to change the size of a stripe interactively. |
StripeTypes |
getSelectableItems()
Gets a property that determines which types of items should be selectable at all.
|
StripeDropInputMode |
getStripeDropInputMode()
Gets the
StripeDropInputMode property that is responsible for handling drag and drop
operations of stripes onto the Canvas. |
IStripeSelection |
getStripeSelection()
Returns the
selected stripes . |
TextEditorInputMode |
getTextEditorInputMode()
Gets the
TextEditorInputMode . |
protected void |
initialize()
Performs one-time initialization of this instance.
|
IStripe |
insertChild(IStripe owner,
int index)
Convenience method that inserts a new stripe as child of .
|
IStripe |
insertChild(IStripe owner,
int index,
double size)
Convenience method that inserts a new stripe as child of .
|
void |
install(IInputModeContext context,
ConcurrencyController controller)
Installs this mode into the given context that is provided by the canvas.
|
boolean |
isAddLabelAllowed()
Gets whether the label editor will be automatically invoked if the Shift+F2 key is pressed.
|
boolean |
isAllowMixedSelection()
Whether to allow mixed selections of graph elements and table elements.
|
boolean |
isAutoRemovingEmptyLabelsEnabled()
Gets a value indicating whether this mode should automatically
remove labels from the
table when a label text has been edited and the label text is empty. |
boolean |
isEditLabelAllowed()
Gets whether the label editor will be automatically invoked if the F2 key is pressed.
|
boolean |
isSynchronizingWithGraphSelectionEnabled()
Gets a value indicating whether
StripeSelection should be synchronized with the GraphSelection
if this instance is installed as a child of a GraphEditorInputMode instance. |
protected boolean |
onAddLabel()
Callback that is invoked if the shift+F2 key is pressed and
AddLabelAllowed is set to
true . |
protected void |
onClickInputModeChanged(ClickInputMode oldMode,
ClickInputMode newMode)
Called when the
ClickInputMode property value changes and after initialization of the
field. |
protected void |
onClickInputModeClicked(Object sender,
ClickEventArgs e)
Callback that gets triggered once
ClickInputMode triggers the Clicked
event. |
protected void |
onClickInputModeDoubleClicked(Object sender,
ClickEventArgs e)
Callback that gets triggered once
ClickInputMode triggers the DoubleClicked
event. |
protected void |
onDeletedItem(ItemEventArgs<IModelItem> args)
Raises the
DeletedItem event. |
protected void |
onDeletedSelection(SelectionEventArgs<IStripe> args)
Raises the
DeletedSelection event. |
protected void |
onDeletingSelection(SelectionEventArgs<IStripe> args)
Raises the
DeletingSelection event. |
protected boolean |
onEditLabel()
Callback that is invoked if the F2 key is pressed and
EditLabelAllowed is set to
true . |
protected void |
onKeyboardInputModeChanged(KeyboardInputMode oldMode,
KeyboardInputMode newMode)
Called when the
KeyboardInputMode changed. |
protected void |
onLabelAdded(LabelEventArgs args)
Raises the
LabelAdded event. |
protected void |
onLabelAdding(LabelEditingEventArgs args)
Raises the
LabelAdding event. |
protected void |
onLabelEditing(LabelEditingEventArgs args)
Raises the
LabelEditing event. |
protected void |
onLabelTextChanged(ItemEventArgs<ILabel> args)
Raises the
LabelTextChanged event. |
protected void |
onLabelTextEdited(ILabel label,
String text)
Called when the text of a label has been
edited . |
protected void |
onLabelTextEditingCanceled(LabelEventArgs args)
Raises the
LabelTextEditingCanceled event. |
protected void |
onLabelTextEditingStarted(LabelEventArgs args)
Raises the
LabelTextEditingStarted event. |
protected void |
onReparentStripeHandlerChanged(IReparentStripeHandler oldHandler,
IReparentStripeHandler newHandler)
Called when the
ReparentStripeHandler property value changes and after
initialization of the field. |
protected void |
onReparentStripeInputModeChanged(ReparentStripeInputMode oldHandler,
ReparentStripeInputMode newHandler)
Called when the
ReparentStripeInputMode property value changes and after
initialization of the field. |
protected void |
onResizeStripeInputModeChanged(ResizeStripeInputMode oldMode,
ResizeStripeInputMode newMode)
Called when the
ResizeStripeInputMode property value changes and after
initialization of the field. |
protected void |
onStripeDropInputModeChanged(StripeDropInputMode oldMode,
StripeDropInputMode newMode)
Called when the
StripeDropInputMode property value changes and after initialization of
the field. |
protected void |
onTextEditorInputModeChanged(TextEditorInputMode oldMode,
TextEditorInputMode newMode)
Called when the
TextEditorInputMode property value changes and after initialization of
the field. |
protected void |
onValidateLabelText(LabelTextValidatingEventArgs args)
Raises the
ValidateLabelText event. |
void |
removeDeletedItemListener(IEventHandler<ItemEventArgs<IModelItem>> deletedItemEvent)
Removes the given listener for the
DeletedItem event that occurs when an item has been deleted interactively by
this mode. |
void |
removeDeletedSelectionListener(IEventHandler<SelectionEventArgs<IStripe>> deletedSelectionEvent)
Removes the given listener for the
DeletedSelection event that occurs just before the deleteSelection()
method has deleted the selection after all selected items have been removed. |
void |
removeDeletingSelectionListener(IEventHandler<SelectionEventArgs<IStripe>> deletingSelectionEvent)
Removes the given listener for the
DeletingSelection event that occurs just before the deleteSelection()
method starts its work and will be followed by any number of DeletedItem
events and finalized by a DeletedSelection event. |
void |
removeLabelAddedListener(IEventHandler<LabelEventArgs> labelAddedEvent)
Removes the given listener for the
LabelAdded event that occurs when this mode has triggered the addition of an
ILabel , for instance, in response to createLabel(IStripe) . |
void |
removeLabelAddingListener(IEventHandler<LabelEditingEventArgs> labelAddingEvent)
Removes the given listener for the
LabelAdding event that occurs when a label is about to be added. |
void |
removeLabelEditingListener(IEventHandler<LabelEditingEventArgs> labelEditingEvent)
Removes the given listener for the
LabelEditing event that occurs when a label is about to be edited. |
void |
removeLabelTextChangedListener(IEventHandler<ItemEventArgs<ILabel>> labelTextChangedEvent)
Removes the given listener for the
LabelTextChanged event that occurs when this mode has triggered the edit of
an ILabel , for instance, in response to editLabel(ILabel) . |
void |
removeLabelTextEditingCanceledListener(IEventHandler<ItemEventArgs<ILabel>> labelTextEditingCanceledEvent)
Removes the given listener for the
LabelTextEditingCanceled event that occurs when the actual label editing
process is canceled. |
void |
removeLabelTextEditingStartedListener(IEventHandler<ItemEventArgs<ILabel>> labelTextEditingStartedEvent)
Removes the given listener for the
LabelTextEditingStarted event that occurs when the actual label editing
process is about to start. |
void |
removeValidateLabelTextListener(IEventHandler<LabelTextValidatingEventArgs> validateLabelTextEvent)
Removes the given listener for the
ValidateLabelText event that occurs after label editing to validate the label
text for a label that is about to be added or edited. |
void |
selectAll()
Clears the current selection and selects all stripes in all table instances.
|
void |
setAddLabelAllowed(boolean value)
Sets whether the label editor will be automatically invoked if the Shift+F2 key is pressed.
|
void |
setAllowMixedSelection(boolean value)
Whether to allow mixed selections of graph elements and table elements.
|
void |
setAutoRemovingEmptyLabelsEnabled(boolean value)
Sets a value indicating whether this mode should automatically
remove labels from the
table when a label text has been edited and the label text is empty. |
void |
setClickInputMode(ClickInputMode value)
Sets the
ClickInputMode . |
void |
setClickSelectableItems(StripeTypes value)
Sets a property that determines which types of items should be selectable through
mouse clicks. . |
void |
setClickSelectableRegions(StripeSubregionTypes value)
Sets clicks on which
StripeSubregionTypes (s) should toggle a stripe selection state. |
void |
setDeletableItems(StripeTypes value)
Sets a property that determines which types of items may be deleted using the
deleteSelection() action. |
void |
setEditLabelAllowed(boolean value)
Sets whether the label editor will be automatically invoked if the F2 key is pressed.
|
void |
setKeyboardInputMode(KeyboardInputMode value)
Sets the
KeyboardInputMode . |
void |
setLabelEditableItems(StripeTypes value)
Sets a property that determines which types of items may have their
labels edited . |
void |
setMultiSelectionRecognizer(IEventRecognizer value)
Sets the
IEventRecognizer that will be queried to decide if a click is deemed a multi selection gesture. |
void |
setReparentStripeHandler(IReparentStripeHandler value)
Sets the
ReparentStripeHandler property. |
void |
setReparentStripeInputMode(ReparentStripeInputMode value)
Sets the
ReparentStripeInputMode that is used to change a stripes position in the table hierarchy. |
void |
setResizeStripeInputMode(ResizeStripeInputMode value)
Sets the
ResizeStripeInputMode that is used to change the size of a stripe interactively. |
void |
setSelectableItems(StripeTypes value)
Sets a property that determines which types of items should be selectable at all.
|
void |
setStripeDropInputMode(StripeDropInputMode value)
Sets the
StripeDropInputMode property that is responsible for handling drag and drop
operations of stripes onto the Canvas. |
void |
setSynchronizingWithGraphSelectionEnabled(boolean value)
Sets a value indicating whether
StripeSelection should be synchronized with the GraphSelection
if this instance is installed as a child of a GraphEditorInputMode instance. |
void |
setTextEditorInputMode(TextEditorInputMode value)
Sets the
TextEditorInputMode . |
protected boolean |
shouldAddLabel(IModelItem item)
Predicate that determines whether a label may be added interactively to .
|
protected boolean |
shouldDelete(IStripe stripe)
Callback method that determines whether the given item should be deleted during
deleteSelection() . |
protected boolean |
shouldEditLabel(IModelItem item)
Callback method that determines whether the label or the labels of the provided item should be edited in response to a
command or explicit method call to
editLabel(ILabel) or createLabel(IStripe) . |
protected boolean |
shouldInstallCommand(ICommand command)
Callback method that is used by
onKeyboardInputModeChanged(KeyboardInputMode, KeyboardInputMode) to determine
which of the built-in ICommand s to install. |
void |
uninstall(IInputModeContext context)
Uninstalls this mode from the given context.
|
add, adjustCursor, cancel, createChildInputModeContext, createInputModeEventArgs, getController, getDefaultCursor, getInputModeContext, getMutexOwner, getPriority, getSortedModes, invalidate, isEnabled, isExclusive, onConcurrencyControllerActivated, onConcurrencyControllerDeactivated, remove, setDefaultCursor, setEnabled, setExclusive, setPriority, stop, subModePriorityChanged
public final void addDeletedItemListener(IEventHandler<ItemEventArgs<IModelItem>> deletedItemEvent)
DeletedItem
event that occurs when an item has been deleted interactively by
this mode.deletedItemEvent
- The listener to add.removeDeletedItemListener(IEventHandler)
public final void addDeletedSelectionListener(IEventHandler<SelectionEventArgs<IStripe>> deletedSelectionEvent)
DeletedSelection
event that occurs just before the deleteSelection()
method has deleted the selection after all selected items have been removed.deletedSelectionEvent
- The listener to add.deleteSelection()
,
removeDeletedSelectionListener(IEventHandler)
public final void addDeletingSelectionListener(IEventHandler<SelectionEventArgs<IStripe>> deletingSelectionEvent)
DeletingSelection
event that occurs just before the deleteSelection()
method starts its work and will be followed by any number of DeletedItem
events and finalized by a DeletedSelection
event.deletingSelectionEvent
- The listener to add.deleteSelection()
,
removeDeletingSelectionListener(IEventHandler)
public Future<ILabel> addLabel(ILabelOwner owner)
This will activate the TextEditorInputMode
to let the user interactively enter the
label's text and unless the user cancels label creation the returned Future
will contain the label.
The text that the user enters may be validated
before the label is
actually added.
This method is similar to createLabel(IStripe)
. It differs only when either the LabelAdding
event is handled or the owner
has an IEditLabelHelper
requests editing an
existing label instead of creating a new one. In this case, this method will edit that label instead of adding a new
one.
owner
- The item.null
if the creation was canceled.public final void addLabelAddedListener(IEventHandler<LabelEventArgs> labelAddedEvent)
LabelAdded
event that occurs when this mode has triggered the addition of an
ILabel
, for instance, in response to createLabel(IStripe)
.labelAddedEvent
- The listener to add.removeLabelAddedListener(IEventHandler)
public final void addLabelAddingListener(IEventHandler<LabelEditingEventArgs> labelAddingEvent)
LabelAdding
event that occurs when a label is about to be added.
Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be
forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the
LabelEditingEventArgs
. It is even possible to forbid adding a label, but edit an existing one instead.
labelAddingEvent
- The listener to add.removeLabelAddingListener(IEventHandler)
public final void addLabelEditingListener(IEventHandler<LabelEditingEventArgs> labelEditingEvent)
LabelEditing
event that occurs when a label is about to be edited.
Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, event handlers can also specify that instead of editing a label, a new one should be added.
labelEditingEvent
- The listener to add.removeLabelEditingListener(IEventHandler)
public final void addLabelTextChangedListener(IEventHandler<ItemEventArgs<ILabel>> labelTextChangedEvent)
LabelTextChanged
event that occurs when this mode has triggered the edit of an
ILabel
, for instance, in response to editLabel(ILabel)
.labelTextChangedEvent
- The listener to add.removeLabelTextChangedListener(IEventHandler)
public final void addLabelTextEditingCanceledListener(IEventHandler<ItemEventArgs<ILabel>> labelTextEditingCanceledEvent)
LabelTextEditingCanceled
event that occurs when the actual label editing process
is canceled.
This allows to unconfigure temporary customizations for the actual label editing process.
labelTextEditingCanceledEvent
- The listener to add.onValidateLabelText(LabelTextValidatingEventArgs)
,
removeLabelTextEditingCanceledListener(IEventHandler)
public final void addLabelTextEditingStartedListener(IEventHandler<ItemEventArgs<ILabel>> labelTextEditingStartedEvent)
LabelTextEditingStarted
event that occurs when the actual label editing process
is about to start.
This allows to customize the actual label editing process further.
labelTextEditingStartedEvent
- The listener to add.onValidateLabelText(LabelTextValidatingEventArgs)
,
removeLabelTextEditingStartedListener(IEventHandler)
public final void addValidateLabelTextListener(IEventHandler<LabelTextValidatingEventArgs> validateLabelTextEvent)
ValidateLabelText
event that occurs after label editing to validate the label
text for a label that is about to be added or edited.
Note that the Label
may only a dummy instance, i.e. not bound to a live
stripe instance.
validateLabelTextEvent
- The listener to add.onValidateLabelText(LabelTextValidatingEventArgs)
,
removeValidateLabelTextListener(IEventHandler)
protected Object childInputModeContextLookup(Class type)
MultiplexingInputMode
child context's
ILookup.lookup(Class)
method.childInputModeContextLookup
in class MultiplexingInputMode
type
- The type argument passed to ILookup.lookup(Class)
.null
.MultiplexingInputMode.createChildInputModeContext()
public void clearSelection()
getSelectableItems()
protected ClickInputMode createClickInputMode()
KeyboardInputMode
instance.protected KeyboardInputMode createKeyboardInputMode()
KeyboardInputMode
instance.public Future<ILabel> createLabel(IStripe stripe)
This method will invoke the text editor that will let the user edit the text of the label. If the user commits the label text the label will be added to the label owner.
The text that the user enters may be validated
before the label is
actually added.
This method is similar to addLabel(ILabelOwner)
. It differs only when either the LabelAdding
event is handled or the stripe
has an IEditLabelHelper
requests editing an
existing label instead of creating a new one. In both cases, this method will do nothing and neither adds a new label
nor edits an existing one.
stripe
- The item to create a new label for.null
if the creation was canceled.protected IReparentStripeHandler createReparentStripeHandler()
ReparentStripeHandler
property.
This method will be called upon first access to the ReparentStripeHandler
property.
IReparentStripeHandler
protected ReparentStripeInputMode createReparentStripeInputMode()
ReparentStripeInputMode
lazily the first time the
property is accessed.ReparentStripeInputMode
type, which is initially
enabled
.protected ResizeStripeInputMode createResizeStripeInputMode()
ResizeStripeInputMode
lazily the first time the
property is accessed.ResizeStripeInputMode
type, which is initially
enabled
.protected StripeDropInputMode createStripeDropInputMode()
StripeDropInputMode
lazily the first time the property
is accessed.StripeDropInputMode
type, which is initially
disabled
.protected IStripeSelection createStripeSelection()
IStripeSelection
the first time property StripeSelection
is accessed.
By default, the MixedSelectionAllowed
property is false
.
IStripeSelection
instance.protected TextEditorInputMode createTextEditorInputMode()
TextEditorInputMode
property.
This method will be called upon first access to the TextEditorInputMode
property.
TextEditorInputMode
public void deleteSelection()
If the StripeSelection
is non-empty this implementation triggers the DeletingSelection
event, possibly a number of DeletedItem
events, and a final deleteSelection()
event.
public void deleteStripe(IStripe stripe)
stripe
- The stripe to delete.public void editLabel(ILabel label)
The label must be bound to an IStripe
instance for this call to succeed.
This implementation uses the TextEditorInputMode
to display an editor to edit the
label. The text that the user enters may be validated
before the
label is actually edited.
This method will raise the LabelEditing
event and query the IEditLabelHelper
for the label and its owner, but will ignore the result except for the TextEditorInputModeConfigurator
property on the LabelEditingEventArgs
. Thus editing a label via this method cannot be prevented by event
handlers or IEditLabelHelper
s.
label
- The label to edit.onLabelTextEdited(ILabel, String)
public final StripeSubregion findStripe(PointD location, StripeTypes stripeTypes, StripeSubregionTypes subregionTypes)
location
- The location to test.stripeTypes
- An enumeration value of StripeTypes
to specify the stripe type.subregionTypes
- An enumeration value of StripeSubregionTypes
to further restrict the stripe region.null
.public StripeSubregion findStripe(PointD location, StripeTypes stripeTypes, StripeSubregionTypes subregionTypes, Predicate<StripeSubregion> filter)
location
- The location to test.stripeTypes
- An enumeration value of StripeTypes
to specify the stripe type.subregionTypes
- An enumeration value of StripeSubregionTypes
to further restrict the stripe region.filter
- Additional predicate to further restrict the hit test results.null
.public final IEnumerable<StripeSubregion> findStripes(PointD location, StripeTypes stripeTypes, StripeSubregionTypes subregionTypes)
location
- The location to test.stripeTypes
- An enumeration value of StripeTypes
to specify the stripe type.subregionTypes
- An enumeration value of StripeSubregionTypes
to further restrict the stripe region.public IEnumerable<StripeSubregion> findStripes(PointD location, StripeTypes stripeTypes, StripeSubregionTypes subregionTypes, Predicate<StripeSubregion> filter)
location
- The location to test.stripeTypes
- An enumeration value of StripeTypes
to specify the stripe type.subregionTypes
- An enumeration value of StripeSubregionTypes
to further restrict the stripe region.filter
- Additional predicate to further restrict the hit test results.public final ClickInputMode getClickInputMode()
ClickInputMode
.
If the field has not yet been initialized upon first access, the factory method createClickInputMode()
will be
called. Upon change the onClickInputModeChanged(ClickInputMode, ClickInputMode)
method will be called. If the
parent TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance, this
mode is not used, since all work is delegated to the parent's ClickInputMode
instance. This implies that all modifications made to the property value have no effect as long as the parent mode is
child of a GraphEditorInputMode
instance.
By default this input mode has a priority of 0
.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.TextEditorInputMode
.setClickInputMode(ClickInputMode)
public final StripeTypes getClickSelectableItems()
mouse clicks.
.
The default is StripeTypes.ALL
.
GraphInputMode.setSelected(IModelItem, boolean)
,
setClickSelectableItems(StripeTypes)
public final StripeSubregionTypes getClickSelectableRegions()
StripeSubregionTypes
(s) should toggle a stripe selection state.
This is independent to ClickSelectableItems
. By default, only clicks on a stripe StripeSubregionTypes.HEADER
are handled.
setClickSelectableRegions(StripeSubregionTypes)
public final StripeTypes getDeletableItems()
deleteSelection()
action.
The default is GraphItemTypes.ALL
.
shouldDelete(IStripe)
,
setDeletableItems(StripeTypes)
public final KeyboardInputMode getKeyboardInputMode()
KeyboardInputMode
.
If the field has not yet been initialized upon first access, the factory method createKeyboardInputMode()
will
be called. Upon change the onKeyboardInputModeChanged(KeyboardInputMode, KeyboardInputMode)
method will be
called. If the parent TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance, this mode is not used, since all work is delegated to the parent's KeyboardInputMode
instance. This implies that all modifications made to the property value have no effect as long as the parent mode is
child of a GraphEditorInputMode
instance.
By default this input mode has a priority of 0
.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.KeyboardInputMode
.setKeyboardInputMode(KeyboardInputMode)
public final StripeTypes getLabelEditableItems()
labels edited
.
The default is StripeTypes.ALL
which allows for editing the labels of all ILabelOwner
s, and existing
ILabel
s.
shouldEditLabel(IModelItem)
,
setLabelEditableItems(StripeTypes)
public final IEventRecognizer getMultiSelectionRecognizer()
IEventRecognizer
that will be queried to decide if a click is deemed a multi selection gesture.
The default is IEventRecognizer.SHORTCUT_PRESSED
. If the TableEditorInputMode
instance is installed as child
mode of a GraphEditorInputMode
instance, the value of MultiSelectionRecognizer
is used instead.
setMultiSelectionRecognizer(IEventRecognizer)
public final IReparentStripeHandler getReparentStripeHandler()
ReparentStripeHandler
property.
This handler will be delegated to by an implementation of the IReparentStripeHandler
interface that this class
puts into the childInputModeContextLookup(Class)
. If the field has not yet been initialized upon first access,
the factory method createReparentStripeHandler()
will be called. Upon change the onReparentStripeHandlerChanged(IReparentStripeHandler, IReparentStripeHandler)
method will be called.
ReparentStripeHandler
,
setReparentStripeHandler(IReparentStripeHandler)
public final ReparentStripeInputMode getReparentStripeInputMode()
ReparentStripeInputMode
that is used to change a stripes position in the table hierarchy.
The mode by default is enabled
with a priority of 0
. If the field has not yet
been initialized upon first access, the factory method createReparentStripeInputMode()
will be called. Upon
change the onReparentStripeInputModeChanged(ReparentStripeInputMode, ReparentStripeInputMode)
method will be
called.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.setReparentStripeInputMode(ReparentStripeInputMode)
public final ResizeStripeInputMode getResizeStripeInputMode()
ResizeStripeInputMode
that is used to change the size of a stripe interactively.
The mode by default is enabled
with a priority of 0
. If the field has
not yet been initialized upon first access, the factory method createResizeStripeInputMode()
will be called.
Upon change the onResizeStripeInputModeChanged(ResizeStripeInputMode, ResizeStripeInputMode)
method will be
called.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.setResizeStripeInputMode(ResizeStripeInputMode)
public final StripeTypes getSelectableItems()
The default is StripeTypes.ALL
.
GraphInputMode.setSelected(IModelItem, boolean)
,
setSelectableItems(StripeTypes)
public final StripeDropInputMode getStripeDropInputMode()
StripeDropInputMode
property that is responsible for handling drag and drop
operations of stripes onto the Canvas.
The mode by default is disabled
and needs to be enabled
to work, first. If the field has not yet been initialized upon first access, the factory method createStripeDropInputMode()
will be called. Upon change the onStripeDropInputModeChanged(StripeDropInputMode, StripeDropInputMode)
method
will be called.
By default this input mode has a priority of 70
.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.setStripeDropInputMode(StripeDropInputMode)
public final IStripeSelection getStripeSelection()
selected stripes
.public final TextEditorInputMode getTextEditorInputMode()
TextEditorInputMode
.
If the field has not yet been initialized upon first access, the factory method createTextEditorInputMode()
will be called. Upon change the onTextEditorInputModeChanged(TextEditorInputMode, TextEditorInputMode)
method
will be called. If the parent TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance, this mode is not used, since all work is delegated to the parent's TextEditorInputMode
instance. This implies that all modifications made to the property value have no effect as long as the parent mode is
child of a GraphEditorInputMode
instance.
By default this input mode has a priority of 100
.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.TextEditorInputMode
.setTextEditorInputMode(TextEditorInputMode)
protected void initialize()
MultiplexingInputMode
This method should not be invoked by subclasses. This will be done automatically upon first installation
of this mode.
This code will be executed only once per instance. The Canvas
property and InputModeContext
property will be null
when this code is executed. This method should not be used to install this mode into a
specific canvas. Subclasses should always call base.Initialize()
first.
initialize
in class MultiplexingInputMode
MultiplexingInputMode.install(IInputModeContext, ConcurrencyController)
public final IStripe insertChild(IStripe owner, int index)
owner
This method automatically resizes the table node and moves all content in neighboring stripes accordingly. The stripe is
created with an initial size
and otherwise the default settings of the table where owner
belongs to. If
size
is entered as 0
, the owners default size is used.
owner
- The parent of the new stripe.index
- The index where to insert the new stripe.public IStripe insertChild(IStripe owner, int index, double size)
owner
This method automatically resizes the table node and moves all content in neighboring stripes accordingly. The stripe is
created with an initial size
and otherwise the default settings of the table where owner
belongs to. If
size
is entered as 0
, the owners default size is used.
owner
- The parent of the new stripe.index
- The index where to insert the new stripe.size
- The initial size of the stripepublic void install(IInputModeContext context, ConcurrencyController controller)
IInputMode
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.
When this instance gets uninstalled
from the context the same context instance
will be passed to it.
Implementations may hold a reference to the context
instance and use it while they are being installed.
install
in interface IInputMode
install
in class MultiplexingInputMode
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 ConcurrencyController
for this mode.IInputMode.uninstall(IInputModeContext)
public final boolean isAddLabelAllowed()
If the TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance,
adding a label is only allowed if both the value of this property and the value of AddLabelAllowed
are true
. If label adding is allowed, true
pressing Shift+F2 will start the label editor. By default
this feature is enabled.
createLabel(IStripe)
,
setAddLabelAllowed(boolean)
public final boolean isAllowMixedSelection()
Default is true
. Changing this property only has an effetc if SynchronizingWithGraphSelectionEnabled
is enabled.
setAllowMixedSelection(boolean)
public final boolean isAutoRemovingEmptyLabelsEnabled()
remove labels
from the
table when a label text has been edited and the label text is empty.
If the TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance, auto
removal is only enabled allowed if both the value of this property and the value of AutoRemovingEmptyLabelsEnabled
are true
.
true
if empty labels should be removed after text editing; otherwise, false
.setAutoRemovingEmptyLabelsEnabled(boolean)
public final boolean isEditLabelAllowed()
If the TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance,
editing a label is only allowed if both the value of this property and the value of EditLabelAllowed
are
true
. If label editing is allowed, pressing F2 will start the label editor. By default this feature is
enabled.
editLabel(ILabel)
,
setEditLabelAllowed(boolean)
public final boolean isSynchronizingWithGraphSelectionEnabled()
StripeSelection
should be synchronized with the GraphSelection
if this instance is installed as a child of a GraphEditorInputMode
instance.
This feature needs to be disabled temporarily if the Selection
is changed.
By default, this feature is enabled.
setSynchronizingWithGraphSelectionEnabled(boolean)
protected boolean onAddLabel()
AddLabelAllowed
is set to
true
.
This method determines the label owner to add to and delegates to createLabel(IStripe)
.
protected void onClickInputModeChanged(ClickInputMode oldMode, ClickInputMode newMode)
ClickInputMode
property value changes and after initialization of the
field.oldMode
- the old value, which may be null
the first timenewMode
- the new valueprotected void onClickInputModeClicked(Object sender, ClickEventArgs e)
ClickInputMode
triggers the Clicked
event.protected void onClickInputModeDoubleClicked(Object sender, ClickEventArgs e)
ClickInputMode
triggers the DoubleClicked
event.protected final void onDeletedItem(ItemEventArgs<IModelItem> args)
DeletedItem
event.args
- The instance containing the event data.protected void onDeletedSelection(SelectionEventArgs<IStripe> args)
DeletedSelection
event.args
- The SelectionEventArgs
instance containing the event data.protected void onDeletingSelection(SelectionEventArgs<IStripe> args)
DeletingSelection
event.args
- The SelectionEventArgs
instance containing the event data.protected boolean onEditLabel()
EditLabelAllowed
is set to
true
.
This method determines the label to edit and delegates to either editLabel(ILabel)
or createLabel(IStripe)
if no label could be found.
protected void onKeyboardInputModeChanged(KeyboardInputMode oldMode, KeyboardInputMode newMode)
KeyboardInputMode
changed.oldMode
- The old KeyboardInputMode
.newMode
- The new KeyboardInputMode
.protected void onLabelAdded(LabelEventArgs args)
LabelAdded
event.args
- The ItemEventArgs
instance that contains the ILabel
that has been added.protected void onLabelAdding(LabelEditingEventArgs args)
LabelAdding
event.
Invoking the event handlers stops once one event marks the args
as handled.
args
- The event arguments.protected void onLabelEditing(LabelEditingEventArgs args)
LabelEditing
event.
Invoking the event handlers stops once one event marks the args
as handled.
args
- The event arguments.protected void onLabelTextChanged(ItemEventArgs<ILabel> args)
LabelTextChanged
event.args
- The ItemEventArgs
instance that contains the ILabel
that has changed the text.protected void onLabelTextEdited(ILabel label, String text)
edited
.
This method validates the label text
and if successful sets the
label text.
label
- The label that was edited.text
- The new text.protected void onLabelTextEditingCanceled(LabelEventArgs args)
LabelTextEditingCanceled
event.args
- The LabelEventArgs
instance containing the event data.protected void onLabelTextEditingStarted(LabelEventArgs args)
LabelTextEditingStarted
event.args
- The LabelEventArgs
instance containing the event data.protected void onReparentStripeHandlerChanged(IReparentStripeHandler oldHandler, IReparentStripeHandler newHandler)
ReparentStripeHandler
property value changes and after
initialization of the field.oldHandler
- the old value, which may be null
the first timenewHandler
- the new valueprotected void onReparentStripeInputModeChanged(ReparentStripeInputMode oldHandler, ReparentStripeInputMode newHandler)
ReparentStripeInputMode
property value changes and after
initialization of the field.oldHandler
- the old value, which may be null
the first timenewHandler
- the new valueprotected void onResizeStripeInputModeChanged(ResizeStripeInputMode oldMode, ResizeStripeInputMode newMode)
ResizeStripeInputMode
property value changes and after
initialization of the field.oldMode
- the old value, which may be null
the first timenewMode
- the new valueprotected void onStripeDropInputModeChanged(StripeDropInputMode oldMode, StripeDropInputMode newMode)
StripeDropInputMode
property value changes and after initialization of
the field.oldMode
- the old value, which may be null
the first timenewMode
- the new valueprotected void onTextEditorInputModeChanged(TextEditorInputMode oldMode, TextEditorInputMode newMode)
TextEditorInputMode
property value changes and after initialization of
the field.oldMode
- the old value, which may be null
the first timenewMode
- the new valueprotected void onValidateLabelText(LabelTextValidatingEventArgs args)
ValidateLabelText
event.args
- The LabelTextValidatingEventArgs
instance containing the event data.public final void removeDeletedItemListener(IEventHandler<ItemEventArgs<IModelItem>> deletedItemEvent)
DeletedItem
event that occurs when an item has been deleted interactively by
this mode.deletedItemEvent
- The listener to remove.addDeletedItemListener(IEventHandler)
public final void removeDeletedSelectionListener(IEventHandler<SelectionEventArgs<IStripe>> deletedSelectionEvent)
DeletedSelection
event that occurs just before the deleteSelection()
method has deleted the selection after all selected items have been removed.deletedSelectionEvent
- The listener to remove.deleteSelection()
,
addDeletedSelectionListener(IEventHandler)
public final void removeDeletingSelectionListener(IEventHandler<SelectionEventArgs<IStripe>> deletingSelectionEvent)
DeletingSelection
event that occurs just before the deleteSelection()
method starts its work and will be followed by any number of DeletedItem
events and finalized by a DeletedSelection
event.deletingSelectionEvent
- The listener to remove.deleteSelection()
,
addDeletingSelectionListener(IEventHandler)
public final void removeLabelAddedListener(IEventHandler<LabelEventArgs> labelAddedEvent)
LabelAdded
event that occurs when this mode has triggered the addition of an
ILabel
, for instance, in response to createLabel(IStripe)
.labelAddedEvent
- The listener to remove.addLabelAddedListener(IEventHandler)
public final void removeLabelAddingListener(IEventHandler<LabelEditingEventArgs> labelAddingEvent)
LabelAdding
event that occurs when a label is about to be added.
Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be
forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the
LabelEditingEventArgs
. It is even possible to forbid adding a label, but edit an existing one instead.
labelAddingEvent
- The listener to remove.addLabelAddingListener(IEventHandler)
public final void removeLabelEditingListener(IEventHandler<LabelEditingEventArgs> labelEditingEvent)
LabelEditing
event that occurs when a label is about to be edited.
Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, event handlers can also specify that instead of editing a label, a new one should be added.
labelEditingEvent
- The listener to remove.addLabelEditingListener(IEventHandler)
public final void removeLabelTextChangedListener(IEventHandler<ItemEventArgs<ILabel>> labelTextChangedEvent)
LabelTextChanged
event that occurs when this mode has triggered the edit of
an ILabel
, for instance, in response to editLabel(ILabel)
.labelTextChangedEvent
- The listener to remove.addLabelTextChangedListener(IEventHandler)
public final void removeLabelTextEditingCanceledListener(IEventHandler<ItemEventArgs<ILabel>> labelTextEditingCanceledEvent)
LabelTextEditingCanceled
event that occurs when the actual label editing
process is canceled.
This allows to unconfigure temporary customizations for the actual label editing process.
labelTextEditingCanceledEvent
- The listener to remove.onValidateLabelText(LabelTextValidatingEventArgs)
,
addLabelTextEditingCanceledListener(IEventHandler)
public final void removeLabelTextEditingStartedListener(IEventHandler<ItemEventArgs<ILabel>> labelTextEditingStartedEvent)
LabelTextEditingStarted
event that occurs when the actual label editing
process is about to start.
This allows to customize the actual label editing process further.
labelTextEditingStartedEvent
- The listener to remove.onValidateLabelText(LabelTextValidatingEventArgs)
,
addLabelTextEditingStartedListener(IEventHandler)
public final void removeValidateLabelTextListener(IEventHandler<LabelTextValidatingEventArgs> validateLabelTextEvent)
ValidateLabelText
event that occurs after label editing to validate the label
text for a label that is about to be added or edited.
Note that the Label
may only a dummy instance, i.e. not bound to a live
stripe instance.
validateLabelTextEvent
- The listener to remove.onValidateLabelText(LabelTextValidatingEventArgs)
,
addValidateLabelTextListener(IEventHandler)
public void selectAll()
By default, this method will be called in response to a Ctrl-A on Windows and Linux and Command+A on Mac OS key press recognized by
KeyboardInputMode
.
ICommand.SELECT_ALL
,
getSelectableItems()
public final void setAddLabelAllowed(boolean value)
If the TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance,
adding a label is only allowed if both the value of this property and the value of AddLabelAllowed
are true
. If label adding is allowed, true
pressing Shift+F2 will start the label editor. By default
this feature is enabled.
value
- The AddLabelAllowed to set.createLabel(IStripe)
,
isAddLabelAllowed()
public final void setAllowMixedSelection(boolean value)
Default is true
. Changing this property only has an effetc if SynchronizingWithGraphSelectionEnabled
is enabled.
value
- The AllowMixedSelection to set.isAllowMixedSelection()
public final void setAutoRemovingEmptyLabelsEnabled(boolean value)
remove labels
from the
table when a label text has been edited and the label text is empty.
If the TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance, auto
removal is only enabled allowed if both the value of this property and the value of AutoRemovingEmptyLabelsEnabled
are true
.
value
- true
if empty labels should be removed after text editing; otherwise, false
.isAutoRemovingEmptyLabelsEnabled()
public final void setClickInputMode(ClickInputMode value)
ClickInputMode
.
If the field has not yet been initialized upon first access, the factory method createClickInputMode()
will be
called. Upon change the onClickInputModeChanged(ClickInputMode, ClickInputMode)
method will be called. If the
parent TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance, this
mode is not used, since all work is delegated to the parent's ClickInputMode
instance. This implies that all modifications made to the property value have no effect as long as the parent mode is
child of a GraphEditorInputMode
instance.
By default this input mode has a priority of 0
.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.value
- The TextEditorInputMode
.getClickInputMode()
public final void setClickSelectableItems(StripeTypes value)
mouse clicks.
.
The default is StripeTypes.ALL
.
value
- The ClickSelectableItems to set.GraphInputMode.setSelected(IModelItem, boolean)
,
getClickSelectableItems()
public final void setClickSelectableRegions(StripeSubregionTypes value)
StripeSubregionTypes
(s) should toggle a stripe selection state.
This is independent to ClickSelectableItems
. By default, only clicks on a stripe StripeSubregionTypes.HEADER
are handled.
value
- The ClickSelectableRegions to set.getClickSelectableRegions()
public final void setDeletableItems(StripeTypes value)
deleteSelection()
action.
The default is GraphItemTypes.ALL
.
value
- The DeletableItems to set.shouldDelete(IStripe)
,
getDeletableItems()
public final void setEditLabelAllowed(boolean value)
If the TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance,
editing a label is only allowed if both the value of this property and the value of EditLabelAllowed
are
true
. If label editing is allowed, pressing F2 will start the label editor. By default this feature is
enabled.
value
- The EditLabelAllowed to set.editLabel(ILabel)
,
isEditLabelAllowed()
public final void setKeyboardInputMode(KeyboardInputMode value)
KeyboardInputMode
.
If the field has not yet been initialized upon first access, the factory method createKeyboardInputMode()
will
be called. Upon change the onKeyboardInputModeChanged(KeyboardInputMode, KeyboardInputMode)
method will be
called. If the parent TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance, this mode is not used, since all work is delegated to the parent's KeyboardInputMode
instance. This implies that all modifications made to the property value have no effect as long as the parent mode is
child of a GraphEditorInputMode
instance.
By default this input mode has a priority of 0
.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.value
- The KeyboardInputMode
.getKeyboardInputMode()
public final void setLabelEditableItems(StripeTypes value)
labels edited
.
The default is StripeTypes.ALL
which allows for editing the labels of all ILabelOwner
s, and existing
ILabel
s.
value
- The LabelEditableItems to set.shouldEditLabel(IModelItem)
,
getLabelEditableItems()
public final void setMultiSelectionRecognizer(IEventRecognizer value)
IEventRecognizer
that will be queried to decide if a click is deemed a multi selection gesture.
The default is IEventRecognizer.SHORTCUT_PRESSED
. If the TableEditorInputMode
instance is installed as child
mode of a GraphEditorInputMode
instance, the value of MultiSelectionRecognizer
is used instead.
value
- The MultiSelectionRecognizer to set.getMultiSelectionRecognizer()
public final void setReparentStripeHandler(IReparentStripeHandler value)
ReparentStripeHandler
property.
This handler will be delegated to by an implementation of the IReparentStripeHandler
interface that this class
puts into the childInputModeContextLookup(Class)
. If the field has not yet been initialized upon first access,
the factory method createReparentStripeHandler()
will be called. Upon change the onReparentStripeHandlerChanged(IReparentStripeHandler, IReparentStripeHandler)
method will be called.
value
- The ReparentStripeHandler to set.ReparentStripeHandler
,
getReparentStripeHandler()
public final void setReparentStripeInputMode(ReparentStripeInputMode value)
ReparentStripeInputMode
that is used to change a stripes position in the table hierarchy.
The mode by default is enabled
with a priority of 0
. If the field has not yet
been initialized upon first access, the factory method createReparentStripeInputMode()
will be called. Upon
change the onReparentStripeInputModeChanged(ReparentStripeInputMode, ReparentStripeInputMode)
method will be
called.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.value
- The ReparentStripeInputMode to set.getReparentStripeInputMode()
public final void setResizeStripeInputMode(ResizeStripeInputMode value)
ResizeStripeInputMode
that is used to change the size of a stripe interactively.
The mode by default is enabled
with a priority of 0
. If the field has
not yet been initialized upon first access, the factory method createResizeStripeInputMode()
will be called.
Upon change the onResizeStripeInputModeChanged(ResizeStripeInputMode, ResizeStripeInputMode)
method will be
called.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.value
- The ResizeStripeInputMode to set.getResizeStripeInputMode()
public final void setSelectableItems(StripeTypes value)
The default is StripeTypes.ALL
.
value
- The SelectableItems to set.GraphInputMode.setSelected(IModelItem, boolean)
,
getSelectableItems()
public final void setStripeDropInputMode(StripeDropInputMode value)
StripeDropInputMode
property that is responsible for handling drag and drop
operations of stripes onto the Canvas.
The mode by default is disabled
and needs to be enabled
to work, first. If the field has not yet been initialized upon first access, the factory method createStripeDropInputMode()
will be called. Upon change the onStripeDropInputModeChanged(StripeDropInputMode, StripeDropInputMode)
method
will be called.
By default this input mode has a priority of 70
.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.value
- The StripeDropInputMode to set.getStripeDropInputMode()
public final void setSynchronizingWithGraphSelectionEnabled(boolean value)
StripeSelection
should be synchronized with the GraphSelection
if this instance is installed as a child of a GraphEditorInputMode
instance.
This feature needs to be disabled temporarily if the Selection
is changed.
By default, this feature is enabled.
value
- The SynchronizingWithGraphSelectionEnabled to set.isSynchronizingWithGraphSelectionEnabled()
public final void setTextEditorInputMode(TextEditorInputMode value)
TextEditorInputMode
.
If the field has not yet been initialized upon first access, the factory method createTextEditorInputMode()
will be called. Upon change the onTextEditorInputModeChanged(TextEditorInputMode, TextEditorInputMode)
method
will be called. If the parent TableEditorInputMode
instance is installed as child mode of a GraphEditorInputMode
instance, this mode is not used, since all work is delegated to the parent's TextEditorInputMode
instance. This implies that all modifications made to the property value have no effect as long as the parent mode is
child of a GraphEditorInputMode
instance.
By default this input mode has a priority of 100
.
UnsupportedOperationException
- If an attempt is made to change the instance while this mode is
installed
. To
exchange a mode, first IInputMode.uninstall(IInputModeContext)
, then reinstall
to ensure that all data is initialized correctly.value
- The TextEditorInputMode
.getTextEditorInputMode()
protected boolean shouldAddLabel(IModelItem item)
item
This is overridden if the item has a IEditLabelHelper
that returns false
for its IEditLabelHelper.onLabelAdding(LabelEditingEventArgs)
method.
item
- The item to querytrue
iff a label may be addedprotected boolean shouldDelete(IStripe stripe)
deleteSelection()
.
This implementation deletes an item if it is of one of the DeletableItems
type and if it is
not the last stripe of a given type in the table (e.g. the only row or the only column).
stripe
- The item.protected boolean shouldEditLabel(IModelItem item)
editLabel(ILabel)
or createLabel(IStripe)
.item
- The item.protected boolean shouldInstallCommand(ICommand command)
onKeyboardInputModeChanged(KeyboardInputMode, KeyboardInputMode)
to determine
which of the built-in ICommand
s to install.
This implementation unconditionally returns true
, subclasses may override this method to adjust the behavior.
command
- The command to install.public void uninstall(IInputModeContext context)
IInputMode
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.
uninstall
in interface IInputMode
uninstall
in class MultiplexingInputMode
context
- The context to deregister from. This is the same instance that had been passed to IInputMode.install(IInputModeContext, ConcurrencyController)
during installation.