de.saar.chorus.ubench.gui.chartviewer
Class FormatManager

Object
  extended by 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 Summary
FormatManager()
           
 
Method Summary
static String getHTMLforMarkedSplit(Split split, Set<String> roots)
          Generates a HTML string to represent a split.
static String getHTMLforMarkedSubgraph(Set<String> subgraph)
          Generates a HTML string to represent a subgraph.
static void markGraph(Color color, JDomGraph graph)
          Mark the whole graph with a given color.
static void markRootFragment(Fragment root, JDomGraph graph)
          This colors the root fragment of a split (which always gets a special color).
static void markSubgraph(Set<String> roots, JDomGraph graph)
          Mark a subgraph of the given graph with the default marking color.
static void markSubgraph(Set<String> roots, JDomGraph graph, int subgraphindex)
          Mark a subgraph of the given graph according to the index with the next mark-up color.
static void refreshGraphLayout(JDomGraph graph)
          This relayouts the graph so as to make the color changes visible.
static void shadeGraph(JDomGraph graph)
          Colors the graph in a light grey.
static void unmark(JDomGraph graph)
          Reset a whole graph's color to the default colors.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatManager

public FormatManager()
Method Detail

unmark

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

Parameters:
graph - the graph

markSubgraph

public static void markSubgraph(Set<String> roots,
                                JDomGraph graph,
                                int subgraphindex)
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)
Mark a subgraph of the given graph with the default marking color.

Parameters:
roots -
graph -

getHTMLforMarkedSubgraph

public static String getHTMLforMarkedSubgraph(Set<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 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(Fragment root,
                                    JDomGraph graph)
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 -