Package muntjac :: Package event :: Module mouse_events :: Class ClickEvent
[hide private]
[frames] | no frames]

Class ClickEvent

source code

      object --+        
               |        
util.EventObject --+    
                   |    
  ui.component.Event --+
                       |
                      ClickEvent

Class for holding information about a mouse click event. A ClickEvent is fired when the user clicks on a Component.

The information available for click events are terminal dependent. Correct values for all event details cannot be guaranteed.


Authors:
Vaadin Ltd., Richard Lincoln

See Also: ClickListener

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, source, mouseEventDetails)
Constructs a new event with the specified source component.
source code
 
getButton(self)
Returns an identifier describing which mouse button the user pushed.
source code
 
getClientX(self)
Returns the mouse position (x coordinate) when the click took place.
source code
 
getClientY(self)
Returns the mouse position (y coordinate) when the click took place.
source code
 
getRelativeX(self)
Returns the relative mouse position (x coordinate) when the click took place.
source code
 
getRelativeY(self)
Returns the relative mouse position (y coordinate) when the click took place.
source code
 
isDoubleClick(self)
Checks if the event is a double click event.
source code
 
isAltKey(self)
Checks if the Alt key was down when the mouse event took place.
source code
 
isCtrlKey(self)
Checks if the Ctrl key was down when the mouse event took place.
source code
 
isMetaKey(self)
Checks if the Meta key was down when the mouse event took place.
source code
 
isShiftKey(self)
Checks if the Shift key was down when the mouse event took place.
source code
 
getButtonName(self)
Returns a human readable string representing which button has been pushed.
source code

Inherited from ui.component.Event: getComponent

Inherited from util.EventObject: getSource

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BUTTON_LEFT = 1
  BUTTON_MIDDLE = 4
  BUTTON_RIGHT = 2
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, source, mouseEventDetails)
(Constructor)

source code 

Constructs a new event with the specified source component.

Parameters:
  • source - the source component of the event
Overrides: object.__init__
(inherited documentation)

getButton(self)

source code 

Returns an identifier describing which mouse button the user pushed. Compare with BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT to find out which button it is.

Returns:
one of BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT.

getClientX(self)

source code 

Returns the mouse position (x coordinate) when the click took place. The position is relative to the browser client area.

Returns:
The mouse cursor x position

getClientY(self)

source code 

Returns the mouse position (y coordinate) when the click took place. The position is relative to the browser client area.

Returns:
The mouse cursor y position

getRelativeX(self)

source code 

Returns the relative mouse position (x coordinate) when the click took place. The position is relative to the clicked component.

Returns:
The mouse cursor x position relative to the clicked layout component or -1 if no x coordinate available

getRelativeY(self)

source code 

Returns the relative mouse position (y coordinate) when the click took place. The position is relative to the clicked component.

Returns:
The mouse cursor y position relative to the clicked layout component or -1 if no y coordinate available

isDoubleClick(self)

source code 

Checks if the event is a double click event.

Returns:
true if the event is a double click event, false otherwise

isAltKey(self)

source code 

Checks if the Alt key was down when the mouse event took place.

Returns:
true if Alt was down when the event occured, false otherwise

isCtrlKey(self)

source code 

Checks if the Ctrl key was down when the mouse event took place.

Returns:
true if Ctrl was pressed when the event occured, false otherwise

isMetaKey(self)

source code 

Checks if the Meta key was down when the mouse event took place.

Returns:
true if Meta was pressed when the event occured, false otherwise

isShiftKey(self)

source code 

Checks if the Shift key was down when the mouse event took place.

Returns:
true if Shift was pressed when the event occured, false otherwise

getButtonName(self)

source code 

Returns a human readable string representing which button has been pushed. This is meant for debug purposes only and the string returned could change. Use getButton to check which button was pressed.

Returns:
A string representation of which button was pushed.