Package reflectometry :: Package model1d :: Package profileview :: Module baseInteractor :: Class BaseInteractor

Class BaseInteractor

source code


Abstract base class for someone who use interactor

Share some functions between the interface interactor and various layer interactors.

Individual interactors need the following functions:

save(ev) - save the current state for later restore restore() - restore the old state move(x,y,ev) - move the interactor to position x,y moveend(ev) - end the drag event update() - draw the interactors

The following are provided by the base class:

connect_markers(markers) - register callbacks for all markers clear_markers() - remove all items in self.markers onHilite(ev) - enter/leave event processing onLeave(ev) - enter/leave event processing onClick(ev) - mouse click: calls save() onRelease(ev) - mouse click ends: calls moveend() onDrag(ev) - mouse move: calls move() or restore() onKey(ev) - keyboard move: calls move() or restore()

Interactor attributes:

base - model we are operating on axes - axes holding the interactor color - color of the interactor in non-active state markers - list of handles for the interactor
Instance Methods
 
__init__(self, base, axes, color='black') source code
 
clear_markers(self)
Clear old markers and interfaces.
source code
 
save(self, ev) source code
 
restore(self, ev) source code
 
move(self, x, y, ev) source code
 
moveend(self, ev) source code
 
updateValue(self, event) source code
 
setValue(self, event) source code
 
Artist2Name(self, event) source code
 
BestDepthLayerNum(self, x) source code
 
connect_markers(self, markers)
Connect markers to callbacks
source code
 
onHilite(self, event)
Hilite the artist reporting the event, indicating that it is ready to receive a click.
source code
 
onLeave(self, event)
Restore the artist to the original colour when the cursor leaves.
source code
 
onClick(self, event)
Prepare to move the artist.
source code
 
onRelease(self, event)
Release the mouse
source code
 
onDrag(self, event)
Move the artist.
source code
 
onKey(self, event)
Respond to keyboard events.
source code
 
dpixel(self, x, y, nudge=False)
Return the step size in data coordinates for a small step in screen coordinates.
source code
Method Details

onClick(self, event)

source code 
Prepare to move the artist. Calls save() to preserve the state for later restore().

onDrag(self, event)

source code 
Move the artist. Calls move() to update the state, or restore() if the mouse leaves the window.

onKey(self, event)

source code 

Respond to keyboard events. Arrow keys move the widget. Escape restores it to the position before the last click.

Calls move() to update the state. Calls restore() on escape.

dpixel(self, x, y, nudge=False)

source code 
Return the step size in data coordinates for a small step in screen coordinates. If nudge is False (default) the step size is one pixel. If nudge is True, the step size is 0.2 pixels.