ucot.ui.gui.dot
Class DotColorTheme

java.lang.Object
  extended by ucot.ui.gui.dot.DotColorTheme

public class DotColorTheme
extends java.lang.Object

This class implements a color theme for dot markup language, which is useful for DotPanel when figuring out color strings. It is easy to change the color theme using the method 'changeToColorTheme' and giving it the identifier of the preferred color theme.

All themes available currently have to be hard coded here because of the way how Dot understands colors.

TODO: Make color themes more dynamic? TODO: Add more color themes.

Author:
tujupien

Field Summary
private static DotColorModel.ColorModel DEFAULT_COLOR
           
private static DotColorModel.ColorModel DEFAULT_HIGHLIGHT
           
private  DotColorModel highlight
           
private  DotColorModel normal
           
 
Constructor Summary
DotColorTheme()
           Default constructor for DotColorTheme class which initially uses the default color theme.
DotColorTheme(DotColorModel.ColorModel color)
           Constructor for DotColorTheme class.
DotColorTheme(DotColorModel.ColorModel color, DotColorModel.ColorModel highlight)
           Constructor for DotColorTheme class.
 
Method Summary
 void changeColor(DotColorModel.ColorModel color)
           Normal color changer.
 void changeColor(java.lang.String color)
           Normal color changer.
 void changeHighlight(DotColorModel.ColorModel highlight)
           Highlight color changer.
 void changeHighlight(java.lang.String highlight)
           Highlight color changer.
 java.awt.Color getBackgroundColorAsJavaObject()
           Method for getting the background color of the graph as a java object.
 java.lang.String getBackgroundColorString()
           Method for getting the background color of the whole graph in dot's syntax.
 java.lang.String getColor()
           Method for acquiring the name of the current color model.
 java.lang.String getColorString(boolean isHighlighted)
           Method for getting the appropriate color string for an entity based on its highlight status.
 java.lang.String getHighlight()
           Method for acquiring the name of the current highlight model.
 java.lang.String getHighlightedColorString()
           Method which formats highlighted item's color attributes into dot's syntax.
 java.lang.String getNormalColorString()
           Method which formats normal item's color attributes into dot's syntax.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

normal

private DotColorModel normal

highlight

private DotColorModel highlight

DEFAULT_HIGHLIGHT

private static final DotColorModel.ColorModel DEFAULT_HIGHLIGHT

DEFAULT_COLOR

private static final DotColorModel.ColorModel DEFAULT_COLOR
Constructor Detail

DotColorTheme

public DotColorTheme(DotColorModel.ColorModel color,
                     DotColorModel.ColorModel highlight)

Constructor for DotColorTheme class.

Parameters:
color - Normal color of the graph.
highlight - Color of the highlighted elements.

DotColorTheme

public DotColorTheme(DotColorModel.ColorModel color)

Constructor for DotColorTheme class.

Parameters:
color - Normal color of the graph.

DotColorTheme

public DotColorTheme()

Default constructor for DotColorTheme class which initially uses the default color theme.

Method Detail

changeColor

public void changeColor(java.lang.String color)

Normal color changer.

Parameters:
color - New normal color.

changeColor

public void changeColor(DotColorModel.ColorModel color)

Normal color changer.

Parameters:
color - New normal color.

changeHighlight

public void changeHighlight(java.lang.String highlight)

Highlight color changer.

Parameters:
highlight - New highlight color.

changeHighlight

public void changeHighlight(DotColorModel.ColorModel highlight)

Highlight color changer.

Parameters:
highlight - New highlight color.

getHighlightedColorString

public java.lang.String getHighlightedColorString()

Method which formats highlighted item's color attributes into dot's syntax.

Returns:
Highlight nodes' or edges' string in dot's syntax.

getBackgroundColorString

public java.lang.String getBackgroundColorString()

Method for getting the background color of the whole graph in dot's syntax.

Returns:
Background color string in dot's syntax.

getNormalColorString

public java.lang.String getNormalColorString()

Method which formats normal item's color attributes into dot's syntax.

Returns:
Normal nodes' or edges' string in dot's syntax.

getColorString

public java.lang.String getColorString(boolean isHighlighted)

Method for getting the appropriate color string for an entity based on its highlight status.

Parameters:
isHighlighted - Defines wether or not the returned color string is supposed to be for an highlighted entity or a normal entity.
Returns:
Returns appropriate color string in dot's syntax.

getColor

public java.lang.String getColor()

Method for acquiring the name of the current color model.

Returns:
Name of the color model.

getHighlight

public java.lang.String getHighlight()

Method for acquiring the name of the current highlight model.

Returns:
Name of the highlight model.

getBackgroundColorAsJavaObject

public java.awt.Color getBackgroundColorAsJavaObject()

Method for getting the background color of the graph as a java object. This helps to figure out the background color of the DotPanel.

Returns:
Graph background color as a Java object.