org.openpermis.editor.policy.gui
Class ClickForwarder

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by org.openpermis.editor.policy.gui.ClickForwarder
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, EventListener

public class ClickForwarder
extends MouseAdapter

Mouse listener that triggers an action on a double click.

Since:
0.1.0

Field Summary
static String COMMAND
          Default command used to trigger the action.
 
Constructor Summary
ClickForwarder(int clickCount, Action action)
          Creates a new double click listener.
ClickForwarder(int clickCount, Action action, String command)
          Creates a new double click listener.
 
Method Summary
 void mouseClicked(MouseEvent e)
           
static ClickForwarder registerClick(JComponent component, int clickCount, Action action)
          Convenience method to add a single click action to a component.
static ClickForwarder registerDoubleClick(JComponent component, Action action)
          Convenience method to add a double click action to a component.
static ClickForwarder registerSingleClick(JComponent component, Action action)
          Convenience method to add a double click action to a component.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMAND

public static final String COMMAND
Default command used to trigger the action.

Constant Field Value:
"click"
Since:
0.1.0
Constructor Detail

ClickForwarder

public ClickForwarder(int clickCount,
                      Action action)
Creates a new double click listener.

Notes:
Uses COMMAND as command.
Parameters:
clickCount - the number of clicks required to trigger the action.
action - the action to execute.
Since:
0.1.0

ClickForwarder

public ClickForwarder(int clickCount,
                      Action action,
                      String command)
Creates a new double click listener.

Parameters:
clickCount - the number of clicks required to trigger the action.
action - the action to execute.
command - the command to issue.
Since:
0.1.0
Method Detail

registerDoubleClick

public static ClickForwarder registerDoubleClick(JComponent component,
                                                 Action action)
Convenience method to add a double click action to a component.

Parameters:
component - the component to register the action at.
action - the action to register.
Returns:
the action created.
Since:
0.1.0
0.9.0 Renamed to indicate that a double click listener is registered.

registerSingleClick

public static ClickForwarder registerSingleClick(JComponent component,
                                                 Action action)
Convenience method to add a double click action to a component.

Parameters:
component - the component to register the action at.
action - the action to register.
Returns:
the action created.
Since:
0.9.0

registerClick

public static ClickForwarder registerClick(JComponent component,
                                           int clickCount,
                                           Action action)
Convenience method to add a single click action to a component.

Parameters:
component - the component to register the action at.
clickCount - the number of clicks required to trigger the action.
action - the action to register.
Returns:
the action created.
Since:
0.9.0

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener
Overrides:
mouseClicked in class MouseAdapter
Since:
0.1.0
0.9.0 Added support for multiple clicks and check enabledness of action.


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG