Package horizons :: Package gui :: Package mousetools :: Module cursortool :: Class CursorTool
[hide private]
[frames] | no frames]

Class CursorTool

source code

              object --+    
                       |    
fife.fife.IMouseListener --+
                           |
                          CursorTool

Basic tool for cursors.

Instance Methods [hide private]
 
__init__(self, session)
__init__(FIFE::IMouseListener self) -> IMouseListener
source code
 
enable(self)
Call this to get events.
source code
 
disable(self)
Call this to not get events.
source code
 
remove(self) source code
 
mousePressed(self, evt)
mousePressed(IMouseListener self, MouseEvent evt)
source code
 
mouseReleased(self, evt)
mouseReleased(IMouseListener self, MouseEvent evt)
source code
 
mouseEntered(self, evt)
mouseEntered(IMouseListener self, MouseEvent evt)
source code
 
mouseExited(self, evt)
mouseExited(IMouseListener self, MouseEvent evt)
source code
 
mouseClicked(self, evt)
mouseClicked(IMouseListener self, MouseEvent evt)
source code
 
mouseWheelMovedUp(self, evt)
mouseWheelMovedUp(IMouseListener self, MouseEvent evt)
source code
 
mouseWheelMovedDown(self, evt)
mouseWheelMovedDown(IMouseListener self, MouseEvent evt)
source code
 
mouseWheelMovedLeft(self, evt) source code
 
mouseWheelMovedRight(self, evt) source code
 
mouseMoved(self, evt)
mouseMoved(IMouseListener self, MouseEvent evt)
source code
 
mouseDragged(self, evt)
mouseDragged(IMouseListener self, MouseEvent evt)
source code
 
_round_map_coords(self, map_x, map_y)
Returns the coordinates of an event at the map.
source code
 
get_world_location(self, evt) source code
 
get_exact_world_location(self, evt)
Returns the coordinates of an event at the map.
source code
 
_get_screenpoint(self, arg)
Python lacks polymorphism.
source code
 
end(self) source code

Inherited from fife.fife.IMouseListener: __disown__, __repr__

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

Class Variables [hide private]
  log = logging.getLogger("gui.mousetools")

Inherited from fife.fife.IMouseListener: __del__, __swig_destroy__, thisown

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, session)
(Constructor)

source code 

__init__(FIFE::IMouseListener self) -> IMouseListener

Overrides: object.__init__
(inherited documentation)

mousePressed(self, evt)

source code 

mousePressed(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mousePressed
(inherited documentation)

mouseReleased(self, evt)

source code 

mouseReleased(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseReleased
(inherited documentation)

mouseEntered(self, evt)

source code 

mouseEntered(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseEntered
(inherited documentation)

mouseExited(self, evt)

source code 

mouseExited(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseExited
(inherited documentation)

mouseClicked(self, evt)

source code 

mouseClicked(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseClicked
(inherited documentation)

mouseWheelMovedUp(self, evt)

source code 

mouseWheelMovedUp(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseWheelMovedUp
(inherited documentation)

mouseWheelMovedDown(self, evt)

source code 

mouseWheelMovedDown(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseWheelMovedDown
(inherited documentation)

mouseMoved(self, evt)

source code 

mouseMoved(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseMoved
(inherited documentation)

mouseDragged(self, evt)

source code 

mouseDragged(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseDragged
(inherited documentation)

_round_map_coords(self, map_x, map_y)

source code 
Returns the coordinates of an event at the map.

Why roundhalfplus?

        a      b     a-b   round(a)-round(b)  roundplus(a)-roundplus(b)

       1.50   0.50   1.00       1.00               1.0
       0.50  -0.49   0.99       1.00               1.0
      -0.49  -1.49   1.00       1.00               1.0
Error: 0.50  -0.50   1.00       2.00               1.0

This error would result in fields at position 0 to be smaller than the others,
because both sides (-0.5 and 0.5) would be wrongly assigned to the other fields.

@return Point with int coordinates

get_exact_world_location(self, evt)

source code 

Returns the coordinates of an event at the map. @return FifePoint with float coordinates or something with getX/getY