Oxygen XML Editor 11.2 Author API

ro.sync.ecss.extensions.api
Class AuthorMouseEvent

java.lang.Object
  extended by ro.sync.ecss.extensions.api.AuthorInputEvent
      extended by ro.sync.ecss.extensions.api.AuthorMouseEvent

public class AuthorMouseEvent
extends AuthorInputEvent

Mouse event received by the AuthorMouseListener.


Field Summary
 int button
          Indicates which, if any, of the mouse buttons has changed its state.
static int BUTTON1
          Indicates mouse button #1.
static int BUTTON2
          Indicates mouse button #2.
static int BUTTON3
          Indicates mouse button #3.
 int clickCount
          Click count.
static int NOBUTTON
          Indicates no mouse button.
 boolean popupTrigger
          true if this event is a pop-up trigger.
 int state
          One of the constants STATE_PRESSED, STATE_RELEASED, STATE_CLICKED, STATE_MOVED or STATE_DRAGGED.
static int STATE_CLICKED
          Mouse clicked event type.
static int STATE_DRAGGED
          Mouse dragged event type.
static int STATE_MOVED
          Mouse moved event type.
static int STATE_PRESSED
          Mouse pressed event type.
static int STATE_RELEASED
          Mouse released event type.
 int X
          The mouse event's x coordinate.
 int Y
          The mouse event's y coordinate.
 
Fields inherited from class ro.sync.ecss.extensions.api.AuthorInputEvent
ALT_GRAPH_PRESSED, ALT_PRESSED, consumed, CTRL_PRESSED, META_PRESSED, modifiers, SHIFT_PRESSED
 
Constructor Summary
AuthorMouseEvent(int x, int y, boolean isPopupTrigger, int state, int modifiers, int clickCount)
          Constructor for the author mouse event.
AuthorMouseEvent(int x, int y, boolean isPopupTrigger, int state, int modifiers, int clickCount, int button)
          Constructor for the author mouse event.
 
Method Summary
 int getButton()
          Returns which, if any, of the mouse buttons has changed state.
 int getClickCount()
          Returns the number of mouse clicks associated with this event.
 int getState()
          Returns the state.
protected  String getStateDescription(int state)
           
 int getX()
          Returns the horizontal x position of the event relative to the source component.
 int getY()
          Returns the vertical y position of the event relative to the source component.
 boolean isPopupTrigger()
          Returns whether or not this mouse event is the popup menu trigger event for the platform.
 String toString()
           
 
Methods inherited from class ro.sync.ecss.extensions.api.AuthorInputEvent
consume, getModifiers, isAltGraphPressed, isAltPressed, isConsumed, isCtrlPressed, isMetaPressed, isShiftPressed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_PRESSED

public static final int STATE_PRESSED
Mouse pressed event type. The value is 1.

See Also:
Constant Field Values

STATE_RELEASED

public static final int STATE_RELEASED
Mouse released event type. The value is 2.

See Also:
Constant Field Values

STATE_CLICKED

public static final int STATE_CLICKED
Mouse clicked event type. The value is 3.

See Also:
Constant Field Values

STATE_MOVED

public static final int STATE_MOVED
Mouse moved event type. The value is 4.

See Also:
Constant Field Values

STATE_DRAGGED

public static final int STATE_DRAGGED
Mouse dragged event type. The value is 5.

See Also:
Constant Field Values

BUTTON1

public static final int BUTTON1
Indicates mouse button #1. The value is 1.

See Also:
Constant Field Values

BUTTON2

public static final int BUTTON2
Indicates mouse button #2. The value is 2.

See Also:
Constant Field Values

BUTTON3

public static final int BUTTON3
Indicates mouse button #3. The value is 3.

See Also:
Constant Field Values

NOBUTTON

public static final int NOBUTTON
Indicates no mouse button. The value is 0.

See Also:
Constant Field Values

X

public final int X
The mouse event's x coordinate. The x value is relative to the author page.


Y

public final int Y
The mouse event's y coordinate. The y value is relative to the author page.


popupTrigger

public final boolean popupTrigger
true if this event is a pop-up trigger.


clickCount

public final int clickCount
Click count.


button

public final int button
Indicates which, if any, of the mouse buttons has changed its state. The only legal values are the following constants: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3.


state

public final int state
One of the constants STATE_PRESSED, STATE_RELEASED, STATE_CLICKED, STATE_MOVED or STATE_DRAGGED.

Constructor Detail

AuthorMouseEvent

public AuthorMouseEvent(int x,
                        int y,
                        boolean isPopupTrigger,
                        int state,
                        int modifiers,
                        int clickCount)
Constructor for the author mouse event.

Parameters:
x - The x coordinate of the mouse event.
y - The y coordinate of the mouse event.
isPopupTrigger - true if it is pop-up trigger.
state - One of the constants STATE_PRESSED, STATE_RELEASED, STATE_CLICKED, STATE_MOVED or STATE_DRAGGED.
modifiers - Marks if CTRL, SHIFT, ALT, ALT GR, META were pressed.
clickCount - Click count.

AuthorMouseEvent

public AuthorMouseEvent(int x,
                        int y,
                        boolean isPopupTrigger,
                        int state,
                        int modifiers,
                        int clickCount,
                        int button)
Constructor for the author mouse event.

Parameters:
x - The x coordinate of the mouse event.
y - The y coordinate of the mouse event.
isPopupTrigger - true if it is pop-up trigger.
state - One of the constants STATE_PRESSED, STATE_RELEASED, STATE_CLICKED, STATE_MOVED or STATE_DRAGGED.
modifiers - Marks if CTRL, SHIFT, ALT, ALT GR, META were pressed.
clickCount - Click count.
button - One of the constants BUTTON1, BUTTON2, BUTTON3, NOBUTTON.
Method Detail

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getStateDescription

protected String getStateDescription(int state)
Returns:
String representation for mouse state.

getClickCount

public int getClickCount()
Returns the number of mouse clicks associated with this event.

Returns:
integer value for the number of clicks

getButton

public int getButton()
Returns which, if any, of the mouse buttons has changed state.

Returns:
one of the following constants: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3.

isPopupTrigger

public boolean isPopupTrigger()
Returns whether or not this mouse event is the popup menu trigger event for the platform.

Note: Popup menus are triggered differently on different systems. Therefore, isPopupTrigger should be checked in both mousePressed and mouseReleased for proper cross-platform functionality.

Returns:
boolean, true if this event is the popup menu trigger for this platform

getX

public int getX()
Returns the horizontal x position of the event relative to the source component.

Returns:
x an integer indicating horizontal position relative to the component

getY

public int getY()
Returns the vertical y position of the event relative to the source component.

Returns:
y an integer indicating vertical position relative to the component

getState

public int getState()
Returns the state.

Returns:
one of the following constants: STATE_PRESSED, STATE_RELEASED, STATE_CLICKED STATE_DRAGGED or STATE_MOVED.

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.