ptolemy.vergil.actor
Class LinkController.LinkRenderer

java.lang.Object
  extended by 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
LinkController.LinkRenderer()
           
 
Method Summary
 Connector render(java.lang.Object edge, Site tailSite, Site headSite)
          Render a visual representation of the given edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkController.LinkRenderer

public LinkController.LinkRenderer()
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 named "color" of the edge 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 named "color" and is a 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 interface EdgeRenderer
Parameters:
edge - The edge.
tailSite - The tail site.
headSite - The head site.
Returns:
The Connector that represents the edge.