yEd::Label - Textlabels for Nodes and Edges
This is the base class for Labels. It may not be instanciated, instead use one of the specialized types:
yEd::Label::EdgeLabel Label for Edges, see documentation for additional EdgeLabel properties
yEd::Label::NodeLabel Label for Nodes, see documentation for additional NodeLabel properties
Labels are supported for both, Nodes and Edges. However there are some features which are currently not supported:
Smart Labels: Because they offer few advantages over the other types and are much more complex to implement.
configuration of the Preferred Placement Descriptors: As they seem to only have an effect on Smart Labels (and do only exist for Labels on Edges).
SVG content (icons) for Labels
All other types and features of Labels (yEd Version 3.13) are supported.
For the available types (positioning modells) see the documentation of the specialized Labels.
Other than in yEd itself you may add more than one Label to a single Node or Edge, regardless of its type. In fact some special Nodes in yEd have multiple Labels per default (e.g. tables), so yEd will handle this correctly.
Type: anything
Default: ... must be supplied
The text to be displayed by the Label.
If this is a blessed ref it will try to find a toString or to_string method with the fallback of standard perl stringification.
If this is an array ref each entry will be treated as a line of text.
If this is a hash ref its content will be formated like so:
key1: value key2: val2 another key: val3
Type: bool
Default: true
Whether the Label is visible or not (rather useless).
Type: float
Default: 0
The x position of the Label (ignored in most positioning modells).
The y position of the Label (ignored in most positioning modells).
Type: ufloat
Default: 20
The height of the Label (mostly ignored depending on autoSizePolicy).
Default: 30
The width of the Label (mostly ignored depending on autoSizePolicy).
Type: '#0000fa' (rgb) or '#000000cc' (rgb + transparency) java.awt.Color hex form or 'none'
Default: 'none'
The background color of the Label.
The border color of the Label.
Type: uint
The inset between Label border and text.
Rotation of the whole Label.
Type: descrete values ( center | right | left )
Default: 'center'
The text alignment.
Type: Fontstring
Default: 'Dialog'
The font for the Label text.
As fonts differs on systems and platforms, this is not a descrete values property, be sure to choose a proper value (e.g. look into a yEd created graphml). The default font 'Dialog' seems to be always present.
Default: 12
The font size.
Type: descrete values ( plain | bold | italic | bolditalic )
Default: 'plain'
The font style.
Default: '#000000'
The text color.
Default: false
Whether the text is underlined or not.
Creates a copy of this Label and returns it.
You may optionally specify properties in the form 'property => value, ...' to change these properties for the returned copy.
While the 'text' property will return the set value (which may be a ref), this will return the text form of the property as it will be shown in yEd.
Have a look at the 'text' property description for details.
This is an alternative setter for the inset properties.
It takes one or two parameters, where the first one will set bottom and top (or all insets if there is no second parameter) and the second will set left and right.
As described at yEd::PropertyBasedObject
yEd::Document for further informations about the whole package
yEd::PropertyBasedObject for further basic information about properties and their additional functions
yEd::Label::EdgeLabel for information about specialized Label elements for Edges
yEd::Label::NodeLabel for information about specialized Label elements for Nodes
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.