Class FormatManager

java.lang.Object
de.saar.chorus.ubench.chartviewer.FormatManager

public class FormatManager extends Object
This is a class providing methods to mark Splits and Subgraphs via a ChartViewer. It manages the colors involved and does the marking itself in a JDomGraph. Further this class provides methods to get a HTML representation of a Split oder a subgraph so as to color the parts of the String according to the marking in the main window.
Author:
Michaela Regneri
  • Constructor Details

    • FormatManager

      public FormatManager()
  • Method Details

    • unmark

      public static void unmark(JDomGraph graph)
      Reset a whole graph's color to the default colors.
      Parameters:
      graph - the graph
    • unmark

      public static void unmark(JDomGraph graph, Map<org.jgraph.graph.CellView,org.jgraph.graph.AttributeMap> backup)
    • markSubgraph

      public static void markSubgraph(Set<String> roots, JDomGraph graph, int subgraphindex, DomGraph dg)
      Mark a subgraph of the given graph according to the index with the next mark-up color.
      Parameters:
      roots - the roots of the fragments to mark
      graph - the graph
      subgraphindex - the index indicating which color index to use
    • markSubgraph

      public static void markSubgraph(Set<String> roots, JDomGraph graph, DomGraph dg)
      Mark a subgraph of the given graph with the default marking color.
      Parameters:
      roots -
      graph -
    • getHTMLforMarkedSubgraph

      public static String getHTMLforMarkedSubgraph(String subgraph)
      Generates a HTML string to represent a subgraph. This "colors" the html string according to the colors that would be used to mark the nodes in the "real" graph.
      Parameters:
      subgraph - the set of nodes to mark
      Returns:
      a HTML representation of the colored nodes
    • getHTMLforMarkedSplit

      public static String getHTMLforMarkedSplit(Split<GraphBasedNonterminal> split, Set<String> roots)
      Generates a HTML string to represent a split. This "colors" the HTML string according to the colors that would be used to mark the split in the "real" graph.
      Parameters:
      split -
      roots -
      Returns:
    • markGraph

      public static void markGraph(Color color, JDomGraph graph)
      Mark the whole graph with a given color.
      Parameters:
      color -
      graph -
    • shadeGraph

      public static void shadeGraph(JDomGraph graph)
      Colors the graph in a light grey.
      Parameters:
      graph -
    • markRootFragment

      public static void markRootFragment(String root, JDomGraph graph, DomGraph dg)
      This colors the root fragment of a split (which always gets a special color).
      Parameters:
      root - the root fragment
      graph - the parent graph
    • refreshGraphLayout

      public static void refreshGraphLayout(JDomGraph graph)
      This relayouts the graph so as to make the color changes visible.
      Parameters:
      graph -