Package pySVG :: Module pysvg :: Class Group
[hide private]
[frames] | no frames]

Class Group

source code

Base class for a container element. Different shapes, paths and text can be put together inside a container sharing the same style.

Instance Methods [hide private]
 
__init__(self, style_dict=None, transform_dict=None)
Initialization.
source code
 
addElement(self, element)
Generic method to add any element to the container
source code
 
getXMLFromStyle(self)
This method converts the information in the style dictionary into svg syntax for the style attribute
source code
 
getXMLFromTransform(self)
This method converts the information in the transform dictionary into svg syntax for the transform attribute
source code
 
getXML(self)
Return a XML representation of the current element.
source code
Class Variables [hide private]
  startXML = "<g "
  endTag = ">\n"
  endXML = "</g>\n"
Method Details [hide private]

__init__(self, style_dict=None, transform_dict=None)
(Constructor)

source code 

Initialization.

Parameters:
  • style_dict (dict) - The style that should be applied to all elements within this container

addElement(self, element)

source code 

Generic method to add any element to the container

Parameters:
  • element (Object that contains a getXML method (circle, line, text, polyline, etc....)) - the element to add to the container

getXMLFromStyle(self)

source code 

This method converts the information in the style dictionary into svg syntax for the style attribute

Returns:
the representation of the current style as an xml string

getXMLFromTransform(self)

source code 

This method converts the information in the transform dictionary into svg syntax for the transform attribute

Returns:
the representation of the current transformations as an xml string

getXML(self)

source code 

Return a XML representation of the current element. This function can be used for debugging purposes. It is also used by getXML in SVG

Returns:
the representation of the current element as an xml string