Module _curveknob :: Class Layer
[hide private]
[frames] | no frames]

Class Layer

object --+    
         |    
   Element --+
             |
            Layer

A layer, used to group other elements in the paint tree.

Layers can contain shapes, strokes and other layers. They can be transformed, which has the effect of transforming all contained objects by the same amount (in addition to any individual transforms on the contained objects).

Layers are represented as a sequence of Element objects. You can find out how many items the layer contains using the len() function, as for any python sequence. Likewise you can access the contained elements using python's array-style syntax (e.g. layer[0] will return the first element inside the layer, layer[-1] will return the last element, etc.).

Instance Methods [hide private]
 
__delattr__(...)
x.__delattr__('name') <==> del x.name
 
__getattribute__(...)
x.__getattribute__('name') <==> x.name
 
__getitem__(x, y)
x[y]
 
__len__(x)
len(x)
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
None
append(self, element)
Add a new element inside this layer.
AnimAttributes
getAttributes(self)
Gets the collection of attributes for this stroke.
bool
getFlag(self, flag)
Check whether a particular flag is set or not.
AnimCTransform
getTransform(self)
Gets the transform for this shape.
None
insert(self, index, element)
Insert a new element inside this layer at the given index.
None
remove(self, index)
Remove the element at the given index from this layer.
None
removeAll(self)
Remove all elements from this layer.
None
setFlag(self, flag, value)
Set a particular flag.
None
setTransform(self, transform)
Replace the existing transform for this shape with a new one.

Inherited from Element: clone, getVisible, serialise, setVisible

Inherited from object: __format__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Element: locked, name

Inherited from object: __class__

Method Details [hide private]

__delattr__(...)

 

x.__delattr__('name') <==> del x.name

Overrides: object.__delattr__

__getattribute__(...)

 

x.__getattribute__('name') <==> x.name

Overrides: object.__getattribute__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__setattr__(...)

 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__

append(self, element)

 

Add a new element inside this layer. The element must be an instance of either the Shape, Stroke or Layer classes. Note that an element cannot be in more than one place in the tree, so if you try to add an element that is already in the tree somewhere else, it'll be removed from its old location first.

Returns: None

getFlag(self, flag)

 

Check whether a particular flag is set or not. The flag parameter should be one of the constants from the FlagType class. The return value will be True if the flag is set, False if it isn't.

Returns: bool

insert(self, index, element)

 

Insert a new element inside this layer at the given index. The element must be an instance of either the Shape, Stroke or Layer classes. Note that an element cannot be in more than one place in the tree, so if you try to add an element that is already in the tree somewhere else, it'll be removed from its old location first.

Returns: None

remove(self, index)

 

Remove the element at the given index from this layer. If the index is out of bounds, an IndexError will be raised.

Returns: None

setFlag(self, flag, value)

 

Set a particular flag. The flag parameter specifies which flag to set and should be one of the constants from the FlagType class. The value parameter is a boolean value; True will set the flag, False will clear it.

Returns: None

setTransform(self, transform)

 

Replace the existing transform for this shape with a new one. The transform parameter must be an instance of the AnimTransform class.

Returns: None