Home / Development / Documentation / 2.0.44 / FormatUtils
TreeGraph 2
 


info.bioinfweb.treegraph.document.format
Class FormatUtils

java.lang.Object
  extended by info.bioinfweb.treegraph.document.format.FormatUtils

public class FormatUtils
extends Object

Provides general format functionalities.

Author:
Ben Stöver

Field Summary
static int MIN_COLOR_DIFFERENCE
          The minimal difference of a foreground color to the background color.
 
Constructor Summary
FormatUtils()
           
 
Method Summary
static Legend createLegend(Node anchor, Legends legends)
          Creates a legend to be inserted in the specified document.
static Node createNode(Document document)
          Creates a node with an afferent branch to be inserted in the specified document.
static Node createNode(Node parent)
          Creates a node with an afferent branch to be inserted in the specified document.
static Color getLineColor(Document document)
          Returns the default line color or its inversion depending in the background color of the specified document.
static Color getTextColor(Document document)
          Returns the default text color or its inversion depending in the background color of the specified document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_COLOR_DIFFERENCE

public static int MIN_COLOR_DIFFERENCE
The minimal difference of a foreground color to the background color.

Constructor Detail

FormatUtils

public FormatUtils()
Method Detail

getLineColor

public static Color getLineColor(Document document)
Returns the default line color or its inversion depending in the background color of the specified document.

Parameters:
document -
Returns:

getTextColor

public static Color getTextColor(Document document)
Returns the default text color or its inversion depending in the background color of the specified document.

Parameters:
document -
Returns:

createNode

public static Node createNode(Node parent)
Creates a node with an afferent branch to be inserted in the specified document. Their formats are determined by the specified parent node.

Parameters:
parent - the future parent node of the returned node
See Also:
createNode(Document)

createNode

public static Node createNode(Document document)
Creates a node with an afferent branch to be inserted in the specified document. This method is useful to create a new root node for an empty document. Otherwise createNode(Node) will probably more useful. Their text- and line-colors are set depending on the document background color.

Parameters:
document - the document the returned node shall be inserted to

createLegend

public static Legend createLegend(Node anchor,
                                  Legends legends)
Creates a legend to be inserted in the specified document. Its formats are determined by the specified anchor node.

Parameters:
parent - the future anchor node of the returned legend
legends - the legends object the the returned legend will be inserted to