yEd::PropertyBasedObject - common methods for property based yEd Objects (e.g. Nodes,Edges,Labels)
This module is just a collection of commonly used subroutines for handling property access.
All properties can be accessed by using the property name as a funktion. Without any parameters they will act as a getter and as a setter if a value is provided. An exception will be thrown if the value is invalid. All properties will have very similar default values to yEd.
For a list of available properties for each Object have a look at the documentation for
yEd::Node
yEd::Edge
yEd::Label
and its subclasses.
$node->x(3.5); $node->fillColor('#cccccc'); # which is equivalent to: $node->setProperties('x' => 3.5, 'fillColor' => '#cccccc'); my $text = $label->text();
Takes arguments of the form 'property1 => value, property2 => value2, ...' and sets the provided properties accordingly for the element in whichs context this funktion is called.
Properties not provided will be left unchanged.
$node->setProperties('fillColor' => '#ffffff', 'borderColor' => 'none'));
Returns a hash of the properties and their current values for the element in whichs context this funktion is called.
my %properties = $node->getProperties();
Takes arguments of the form 'property1 => value, property2 => value2, ...'.
Returns true if the element in whichs context this funktion is called has all provided properties set to the provided values.
Returns false otherwise or if an invalid property is provided.
if ($node->hasProperties('fillColor' => '#ffffff', 'borderColor' => 'none')) { ...
yEd::Document for further informations about the whole package
yEd::Node for information about Node elements
yEd::Edge for information about Edge elements
yEd::Label for information about Label elements
To install yEd::Document, copy and paste the appropriate command in to your terminal.
cpanm
cpanm yEd::Document
CPAN shell
perl -MCPAN -e shell install yEd::Document
For more information on module installation, please visit the detailed CPAN module installation guide.