Layer Class Reference

Inheritance diagram for Layer:

Inheritance graph

Public Member Functions

def __contains__(self, obj)[Inherited from _GraphicsContainer]
def __init__(self)
def add(self, drawable)
def addHandler(self, handler)[Inherited from _EventTrigger]
def adjustReference(self, dx, dy)[Inherited from Drawable]
def clear(self)[Inherited from _GraphicsContainer]
def clone(self)[Inherited from Drawable]
def flip(self, angle=0)[Inherited from Drawable]
def getContents(self)[Inherited from _GraphicsContainer]
def getDepth(self)[Inherited from Drawable]
def getReferencePoint(self)[Inherited from Drawable]
def move(self, dx, dy)[Inherited from Drawable]
def moveTo(self, x, y)[Inherited from Drawable]
def remove(self, drawable)
def removeHandler(self, handler)[Inherited from _EventTrigger]
def rotate(self, angle)[Inherited from Drawable]
def scale(self, factor)[Inherited from Drawable]
def setDepth(self, depth)[Inherited from Drawable]
def shear(self, shear, angle=0)[Inherited from Drawable]
def stretch(self, xFactor, yFactor, angle=0)[Inherited from Drawable]
def wait(self)[Inherited from _EventTrigger]

Detailed Description

A composite that represents a group of shapes as a single drawable object.

Objects are placed onto the layer relative to the coordinate
system of the layer itself.  The layer can then be placed onto a
canvas (or even onto another layer).

Member Function Documentation

def __contains__ (   self,
) [inherited]

Return True if obj is currently in the container; False otherwise.

def __init__ (   self  ) 

Construct a new Layer instance.

The layer is initially empty.

The reference point of that layer is initially the origin in
its own coordinate system, (0,0).

def add (   self,

Add the Drawable object to the layer.

def addHandler (   self,
) [inherited]

Register an EventHandler instance with this object.

def adjustReference (   self,
) [inherited]

Move the local reference point relative to its current position.

Note that the object is not moved at all.

def clear (   self  )  [inherited]

Remove all objects from the container.

def clone (   self  )  [inherited]

Return a duplicate of the drawable object.

Note that the duplicate is not automatically added to any
canvases or layers, even if original is currently so.

def flip (   self,
  angle = 0 
) [inherited]

Flip the object reflected about its current reference point.

By default the flip is a left-to-right flip with a vertical axis of symmetry.

angle     a clockwise rotation of the axis of symmetry away from vertical

def getContents (   self  )  [inherited]

Return the contents of the container, sorted by depth.

def getDepth (   self  )  [inherited]

Return the depth of the object.

def getReferencePoint (   self  )  [inherited]

Return a copy of the current reference point.

Note that mutating that copy has no effect on the Drawable object.

def move (   self,
) [inherited]

Move the object dx units along X-axis and dy units along Y-axis.

For the default coordinate system, positive dx is rightward and
negative is leftward; positive dy is downard and negative is upward.

def moveTo (   self,
) [inherited]

Move the object to align its reference point with (x,y)

def remove (   self,

Remove the Drawable object from the layer.

A ValueError is raised if the drawable is not currently in the layer.

def removeHandler (   self,
) [inherited]

Unregister an EventHandler instance from this object.

def rotate (   self,
) [inherited]

Rotate the object around its current reference point.

angle  number of degrees of clockwise rotation

Reimplemented in Text.

def scale (   self,
) [inherited]

Scale the object relative to its current reference point.

factor      scale is multiplied by this number (must be positive)

Reimplemented in Text.

def setDepth (   self,
) [inherited]

Set the depth of the object.

Objects with a higher depth will be rendered behind those with lower depths.

def shear (   self,
  angle = 0 
) [inherited]

Shear the object relative to its current reference point.

By default, points with the same y-coordinate as the reference point are left
unchanged.  A point d units above the reference point is shifted d * shear
units to the right.  The optional angle parameter rotates the axis
that the shearing occurs along.

angle      clockwise angle for shear

def stretch (   self,
  angle = 0 
) [inherited]

Stretch the shape in mutltiple direction.

By default the x-axis is scaled by a factor of xFactor and the
y-axis is scaled by a factor of yFactor.  The optional
parameter rotates the directions that the streching is performed

def wait (   self  )  [inherited]

Wait for an event to occur.

When an event occurs, an Event instance is returned
with information about what has happened.

The documentation for this class was generated from the following file:
Generated on Fri Dec 21 18:19:30 2007 by  doxygen 1.5.3