Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## info.bioinfweb.treegraph.document.format
Class FormatUtils

    java.lang.Object
      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 backgound color of the specified document.
`static Color` | `getTextColor(Document document)` Returns the default text color or its inversion depending in the backgound 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 backgound 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 backgound 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD