public static class LinkController.LinkRenderer extends java.lang.Object implements EdgeRenderer
Constructor and Description |
---|
LinkRenderer() |
Modifier and Type | Method and Description |
---|---|
Connector |
render(java.lang.Object edge,
Site tailSite,
Site headSite)
Render a visual representation of the given edge.
|
public Connector render(java.lang.Object edge, Site tailSite, Site headSite)
If a StringAttribute named "_color", or a ColorAttribute is set then use that color to draw the line.
If the attribute is named "_color", then the value of
the attribute is passed to
SVGUtilities.getColor(String)
, which
has accepts the following format: If the first character
is "#" or "0", then the value of the attribute is expected
to be in a format suitable for java.awt.Color.decode().
Otherwise, the value of the attribute is passed to checked
against a list of color names defined in
SVGUtilities
, if the color name is
not found, then the value of the attribute is passed to
java.awt.Color.getColor(String) and if there is no match,
then the color black is used.
If the attribute is an instance of
ColorAttribute
, then the
javax.swing.JColorChooser gui will be offered as a way to
edit the color.
If the StringAttribute "_explanation" of the edge is set then use it to set the tooltip.
If the "_linkBendRadius" preference is read from the
PtolemyPreferences
and used to set
the bend radius. The default bend radius is 20.
render
in interface EdgeRenderer
edge
- The edge.tailSite
- The tail site.headSite
- The head site.