Search this API

y.view
Class MultiplexingNodeEditor

java.lang.Object
  extended by y.view.AbstractMouseInputEditor
      extended by y.view.MultiplexingNodeEditor
All Implemented Interfaces:
GenericNodeRealizer.GenericMouseInputEditorProvider, MouseInputEditor

public class MultiplexingNodeEditor
extends AbstractMouseInputEditor
implements GenericNodeRealizer.GenericMouseInputEditorProvider

MouseInputEditor that multiplexes between one or more subordinate editors. Each subordinate editor may take responsibility for handling an editing gesture according to event position and type.

 
Your browser does not support SVG content.

Nested Class Summary
static class MultiplexingNodeEditor.EventReporter
          Editor that plays recorded MouseEvents back to a parent EditMode instance for further processing.
static interface MultiplexingNodeEditor.NodeEditor
          A class implementing this interface can be added to a MultiplexingNodeEditor and implements one behaviour of a node triggered by a mouse gesture.
 
Constructor Summary
MultiplexingNodeEditor()
          Creates a new MultiplexingNodeEditor without any subordinate editors.
 
Method Summary
 void addNodeEditor(MultiplexingNodeEditor.NodeEditor editor)
          Adds the specified editor as a subordinate editor to the MultiplexingNodeEditor instance.
 MouseInputEditor findMouseInputEditor(NodeRealizer context, Graph2DView view, double x, double y, HitInfo hitInfo)
          Used as a callback for the GenericNodeRealizer.findMouseInputEditor(Graph2DView, double, double, HitInfo) method.
 java.util.Collection getNodeEditors()
          Returns a read-only view of the MultiplexingNodeEditor's subordinate editors.
 void mouse2DEventHappened(Mouse2DEvent event)
          Listener-like interface that will be notified of Mouse2DEvents.
 void removeNodeEditor(MultiplexingNodeEditor.NodeEditor editor)
          Removes the specified editor from the MultiplexingNodeEditor's collection of subordinate editors.
 boolean startsEditing(Mouse2DEvent event)
          This method is used by clients to query whether the given event is deemed as a starting gesture.
 void stopEditing()
          Called by clients to stop the editing process cleanly.
 
Methods inherited from class y.view.AbstractMouseInputEditor
addChangeListener, fireStateChanged, isEditing, isEnabled, isInterestedInEvents, removeChangeListener, setEnabled, startEditing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiplexingNodeEditor

public MultiplexingNodeEditor()
Creates a new MultiplexingNodeEditor without any subordinate editors.

Method Detail

addNodeEditor

public void addNodeEditor(MultiplexingNodeEditor.NodeEditor editor)
Adds the specified editor as a subordinate editor to the MultiplexingNodeEditor instance.

Parameters:
editor - the subordinate editor to add.

removeNodeEditor

public void removeNodeEditor(MultiplexingNodeEditor.NodeEditor editor)
Removes the specified editor from the MultiplexingNodeEditor's collection of subordinate editors.

Parameters:
editor - the subordinate editor to remove.

getNodeEditors

public java.util.Collection getNodeEditors()
Returns a read-only view of the MultiplexingNodeEditor's subordinate editors.

Returns:
a read-only view of the MultiplexingNodeEditor's subordinate editors.

findMouseInputEditor

public MouseInputEditor findMouseInputEditor(NodeRealizer context,
                                             Graph2DView view,
                                             double x,
                                             double y,
                                             HitInfo hitInfo)
Description copied from interface: GenericNodeRealizer.GenericMouseInputEditorProvider
Used as a callback for the GenericNodeRealizer.findMouseInputEditor(Graph2DView, double, double, HitInfo) method.

Specified by:
findMouseInputEditor in interface GenericNodeRealizer.GenericMouseInputEditorProvider
See Also:
MouseInputEditor, MouseInputEditorProvider

startsEditing

public boolean startsEditing(Mouse2DEvent event)
Description copied from interface: MouseInputEditor
This method is used by clients to query whether the given event is deemed as a starting gesture.

Specified by:
startsEditing in interface MouseInputEditor
Parameters:
event - the event that happened
Returns:
whether the given gesture can be used to start the editing
See Also:
MouseInputEditor.isInterestedInEvents()

stopEditing

public void stopEditing()
Description copied from interface: MouseInputEditor
Called by clients to stop the editing process cleanly.

Specified by:
stopEditing in interface MouseInputEditor
Overrides:
stopEditing in class AbstractMouseInputEditor

mouse2DEventHappened

public void mouse2DEventHappened(Mouse2DEvent event)
Description copied from interface: MouseInputEditor
Listener-like interface that will be notified of Mouse2DEvents.

Specified by:
mouse2DEventHappened in interface MouseInputEditor
Parameters:
event - the event that happened
See Also:
MouseInputEditor.isInterestedInEvents()

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.