Package saui_pr4 :: Module latticeui :: Class LatticeView :: Class DisplayWord
[hide private]
[frames] | no frames]

Class DisplayWord

source code

object --+
         |
        LatticeView.DisplayWord

One word to be displayed in the lattice view.

In addition to a lattice entry, these objects also keep track of their location and size within the lattice view.

Instance Methods [hide private]
 
__init__(self, context, desc, node, x, y, scale=1.0)
Initialize a DisplayWord.
source code
boolean
contains(self, x, y)
Returns True if point (x,y) is inside this word's bounds.
source code
 
set_scale(self, scale)
Set the scaling factor for this word.
source code
float
get_scale(self)
Return the scaling factor for this word.
source code
float
get_actual_size(self)
Return the actual font size for this word.
source code
 
set_pos(self, x, y)
Set the position for this word.
source code
(int, int, int, int)
get_bounds(self)
Get the ink bounds of this word in the LatticeView coordinate system.
source code
(int, int, int, int)
get_extents(self)
Get the logical extents of this word in the LatticeView coordinate system.
source code
 
draw(self, gc)
Draw this word in a given graphics context.
source code

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

Instance Variables [hide private]
pango.Context context
Pango context for drawing this word
pango.Layout layout
Pango layout for drawing this word
LatticeWord node
Lattice node corresponding to this word
float scale
Scaling factor applied when drawing
int x
Horizontal origin (top-left of logical bounds)
int y
Horizontal origin (top-left of logical bounds)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, context, desc, node, x, y, scale=1.0)
(Constructor)

source code 
Initialize a DisplayWord.
Parameters:
  • context (pango.Context) - Pango context for drawing this word
  • desc (pango.FontDescription) - Pango font description for drawing this word
  • node (LatticeWord) - Lattice node corresponding to this word
  • x (int) - Horizontal origin (top-left of logical bounds)
  • y (int) - Horizontal origin (top-left of logical bounds)
  • scale (float) - Scaling factor applied when drawing
Overrides: object.__init__

contains(self, x, y)

source code 
Returns True if point (x,y) is inside this word's bounds.
Parameters:
  • x (int) - Horizontal position of picking point
  • y (int) - Vertical position of picking point
Returns: boolean
True if point (x,y) is inside this word's bounds

set_scale(self, scale)

source code 
Set the scaling factor for this word.
Parameters:
  • scale (float) - Amount to scale this word in the display.

get_scale(self)

source code 
Return the scaling factor for this word.
Returns: float
Scaling factor for this word.

get_actual_size(self)

source code 
Return the actual font size for this word.
Returns: float
Font size for this word, in pango.SCALE units

set_pos(self, x, y)

source code 
Set the position for this word.
Parameters:
  • x (int) - Horizontal origin (top-left of logical bounds)
  • y (int) - Horizontal origin (top-left of logical bounds)

get_bounds(self)

source code 
Get the ink bounds of this word in the LatticeView coordinate system.
Returns: (int, int, int, int)
the ink bounds of this word in the LatticeView coordinate system.

get_extents(self)

source code 
Get the logical extents of this word in the LatticeView coordinate system.
Returns: (int, int, int, int)
the logical extentsof this word in the LatticeView coordinate system.

draw(self, gc)

source code 
Draw this word in a given graphics context.
Parameters:
  • gc (cairo.Context) - Cairo context (not to be confused with a Pango context) for drawing.