public abstract class IltFacesGraphInteractorActionListener extends Object implements javax.faces.event.ActionListener
IltFacesGraphInteractorActionListener
provides an abstract
implementation for action event listeners of the
IltFacesGraphInteractor
faces component. It decodes
the client interactions into mouse events that are dispatched to the
manager view.
The client interactions consist of a mouse button press, button drag, and button release. These events are mapped into the following events:
MouseEvent.MOUSE_PRESSED
MouseEvent.MOUSE_DRAGGED
MouseEvent.MOUSE_RELEASED
The following three mouse buttons are supported:
MouseEvent.BUTTON1
MouseEvent.BUTTON2
MouseEvent.BUTTON3
Pressing one button at a time only is supported.
Note: Although BUTTON2
is supported by
this class, it is never used. The client side interactor does not submit
requests when this button is pressed.
Any of the following key modifiers are also supported:
MouseEvent.SHIFT_DOWN_MASK
MouseEvent.CTRL_DOWN_MASK
MouseEvent.ALT_DOWN_MASK
MouseEvent.META_DOWN_MASK
More than one key modifier at a time can be handled.
Note: double-click is not supported.
The following example shows how to declare this listener as the
actionListener
of IltFacesGraphInteractor
faces
component:
<jvtf:selectInteractor id="select" actionEvent="#{myBean.processAction}" />
Where myBean
is a subclass of
IltFacesGraphInteractorActionListener
.
Subclasses should implement getViewInteractor
.
This method returns the view interactor that will process the mouse events.
Other methods, such as the ones that create the mouse events, or that
dispatch them, can also be overridden as required.
Modifier | Constructor and Description |
---|---|
protected |
IltFacesGraphInteractorActionListener()
Creates a new
IltFacesGraphInteractorActionListener instance. |
Modifier and Type | Method and Description |
---|---|
protected MouseEvent |
createMouseDragged(IlvManagerView view,
int button,
int modifiers,
int releasePtX,
int releasePtY)
This method creates the
MouseEvent.MOUSE_DRAGGED mouse
event that will be dispatched to the manager view. |
protected MouseEvent |
createMousePressed(IlvManagerView view,
int button,
int modifiers,
int clickPtX,
int clickPtY)
This method creates the
MouseEvent.MOUSE_PRESSED mouse
event that will be dispatched to the manager view. |
protected MouseEvent |
createMouseReleased(IlvManagerView view,
int button,
int modifiers,
int releasePtX,
int releasePtY)
This method creates the
MouseEvent.MOUSE_RELEASED mouse
event that will be dispatched to the manager view. |
protected void |
dispatchMouseEvent(IlvManagerView view,
MouseEvent event)
This method is called by the
processAction method to
dispatch the given MouseEvent event to the manager view. |
protected abstract IlpViewInteractor |
getViewInteractor(String actionName)
This method returns the view interactor that should process the mouse
events in a view.
|
void |
processAction(javax.faces.event.ActionEvent event)
Called when the listener is invoked by the component.
|
protected IltFacesGraphInteractorActionListener()
IltFacesGraphInteractorActionListener
instance.protected abstract IlpViewInteractor getViewInteractor(String actionName)
actionName
- The action name being processed. It is possible
to set different interactions depending on the
given action name.null
is returned.protected MouseEvent createMousePressed(IlvManagerView view, int button, int modifiers, int clickPtX, int clickPtY)
MouseEvent.MOUSE_PRESSED
mouse
event that will be dispatched to the manager view. It is called
internally by the processAction
method.view
- The manager view that will process the mouse event.button
- The mouse button pressed, that is, BUTTON1
,
BUTTON2
, or BUTTON3
.modifiers
- The key modifiers pressed. This can be one of the
following:
SHIFT_DOWN_MASK
CTRL_DOWN_MASK
ALT_DOWN_MASK
META_DOWN_MASK
clickPtX
- The X
coordinate of the point clicked.clickPtY
- The Y
coordinate of the point clicked.MouseEvent.MOUSE_PRESSED
event.protected MouseEvent createMouseDragged(IlvManagerView view, int button, int modifiers, int releasePtX, int releasePtY)
MouseEvent.MOUSE_DRAGGED
mouse
event that will be dispatched to the manager view. It is internally
called by the processAction
method.view
- The manager view that will process the mouse event.button
- The mouse button pressed (BUTTON1
or
BUTTON2
or BUTTON3
).modifiers
- The key modifiers pressed (any of
SHIFT_DOWN_MASK
,
CTRL_DOWN_MASK
,
ALT_DOWN_MASK
or
META_DOWN_MASK
).releasePtX
- The X
coordinate of the released point.releasePtY
- The Y
coordinate of the released point.MouseEvent.MOUSE_DRAGGED
event.protected MouseEvent createMouseReleased(IlvManagerView view, int button, int modifiers, int releasePtX, int releasePtY)
MouseEvent.MOUSE_RELEASED
mouse
event that will be dispatched to the manager view. It is internally
called by the processAction
method.view
- The manager view that will process the mouse event.button
- The mouse button pressed (BUTTON1
or
BUTTON2
or BUTTON3
).modifiers
- The key modifiers pressed (any of
SHIFT_DOWN_MASK
,
CTRL_DOWN_MASK
,
ALT_DOWN_MASK
or
META_DOWN_MASK
).releasePtX
- The X
coordinate of the released point.releasePtY
- The Y
coordinate of the released point.MouseEvent.MOUSE_RELEASED
event.protected void dispatchMouseEvent(IlvManagerView view, MouseEvent event)
This method is called by the processAction
method to
dispatch the given MouseEvent
event to the manager view.
It is called three times in the following order:
MouseEvent.MOUSE_PRESSED
MouseEvent.MOUSE_DRAGGED
MouseEvent.MOUSE_RELEASED
view
- The manager view where the event is dispatched to.event
- The mouse event to be dispatched.public void processAction(javax.faces.event.ActionEvent event)
Called when the listener is invoked by the component. It is responsible for decoding the client interactions into mouse events and dispatching these events to the manager view.
Subclasses must define the getViewInteractor
method.
This method returns the interactor that processes mouse events.
processAction
in interface javax.faces.event.ActionListener
event
- The action event containing information about the
IltFacesGraphInteractor
faces component.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.