Class LinkController.LinkRenderer
- java.lang.Object
-
- ptolemy.vergil.actor.LinkController.LinkRenderer
-
- All Implemented Interfaces:
EdgeRenderer
- Enclosing class:
- LinkController
public static class LinkController.LinkRenderer extends java.lang.Object implements EdgeRenderer
Render a visual representation of a link.
-
-
Constructor Summary
Constructors Constructor Description LinkRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connector
render(java.lang.Object edge, Site tailSite, Site headSite)
Render a visual representation of the given edge.
-
-
-
Method Detail
-
render
public Connector render(java.lang.Object edge, Site tailSite, Site headSite)
Render a visual representation of the given edge.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 inSVGUtilities
, 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.- Specified by:
render
in interfaceEdgeRenderer
- Parameters:
edge
- The edge.tailSite
- The tail site.headSite
- The head site.- Returns:
- The Connector that represents the edge.
-
-