Class TemplateBasedClassRenderer

  • All Implemented Interfaces:
    AtomicVertexRenderer

    public class TemplateBasedClassRenderer
    extends java.lang.Object
    implements AtomicVertexRenderer
    Renderer of an AtomicVertex with ClassAttributes. The renderer is based on a java.text.MessageFormat template. The variables in the template have the following meaning:
    Variable indexDescription
    0fully-qualified class name
    1class type
    2size of the class file in bytes
    3 true if inner class otherwise false
    4Number of incoming arcs
    5 Number of outgoing arcs to other vertices in the graph
    6Number of outgoing arcs to external vertices
    7Layer index
    8Name of the cycle or empty string
    9Source of class file if known
    Author:
    Franz-Josef Elmer
    • Constructor Summary

      Constructors 
      Constructor Description
      TemplateBasedClassRenderer​(java.lang.String template)
      Creates an instance for the specified template.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String render​(AtomicVertex vertex, StrongComponent cycle, int layerIndex)
      Renderes the specified vertex.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TemplateBasedClassRenderer

        public TemplateBasedClassRenderer​(java.lang.String template)
        Creates an instance for the specified template.
    • Method Detail

      • render

        public java.lang.String render​(AtomicVertex vertex,
                                       StrongComponent cycle,
                                       int layerIndex)
        Renderes the specified vertex. It is assumed that the vertex attributes are of the type ClassAttributes.
        Specified by:
        render in interface AtomicVertexRenderer
        Parameters:
        vertex - Vertex to be rendered.
        cycle - Cycle to which vertex belongs. Will be null if it does not belong to a cycle (i.e. a strong component with more than one element).
        layerIndex - Index of the layer to which vertex belongs.
        Returns:
        the rendered vertex.