ilog.tgo.faces.graph.dhtml.event
Class IltFacesGraphInteractorActionListener

java.lang.Object
  extended by ilog.tgo.faces.graph.dhtml.event.IltFacesGraphInteractorActionListener
All Implemented Interfaces:
EventListener, ActionListener, FacesListener
Direct Known Subclasses:
IltFacesSelectInteractorListener

public abstract class IltFacesGraphInteractorActionListener
extends Object
implements 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:

The following three mouse buttons are supported:

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:

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.

Since:
JViews 7.5

Constructor Summary
protected IltFacesGraphInteractorActionListener()
          Creates a new IltFacesGraphInteractorActionListener instance.
 
Method Summary
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(ActionEvent event)
          Called when the listener is invoked by the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IltFacesGraphInteractorActionListener

protected IltFacesGraphInteractorActionListener()
Creates a new IltFacesGraphInteractorActionListener instance.

Method Detail

getViewInteractor

protected abstract IlpViewInteractor getViewInteractor(String actionName)
This method returns the view interactor that should process the mouse events in a view. It should be implemented by subclasses.

Parameters:
actionName - The action name being processed. It is possible to set different interactions depending on the given action name.
Returns:
The interactor that should process the mouse events. If no interactor is specified, null is returned.

createMousePressed

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. It is called internally by the processAction method.

Parameters:
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.
Returns:
The corresponding MouseEvent.MOUSE_PRESSED event.
Internal method or field: do not use!

createMouseDragged

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. It is internally called by the processAction method.

Parameters:
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.
Returns:
The corresponding MouseEvent.MOUSE_DRAGGED event.
Internal method or field: do not use!

createMouseReleased

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. It is internally called by the processAction method.

Parameters:
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.
Returns:
The corresponding MouseEvent.MOUSE_RELEASED event.
Internal method or field: do not use!

dispatchMouseEvent

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:

Parameters:
view - The manager view where the event is dispatched to.
event - The mouse event to be dispatched.
Internal method or field: do not use!

processAction

public void processAction(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.

Specified by:
processAction in interface ActionListener
Parameters:
event - The action event containing information about the IltFacesGraphInteractor faces component.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.