java.lang.Objectucot.ui.gui.dot.DotColorTheme
public class DotColorTheme
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.
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 |
---|
private DotColorModel normal
private DotColorModel highlight
private static final DotColorModel.ColorModel DEFAULT_HIGHLIGHT
private static final DotColorModel.ColorModel DEFAULT_COLOR
Constructor Detail |
---|
public DotColorTheme(DotColorModel.ColorModel color, DotColorModel.ColorModel highlight)
Constructor for DotColorTheme class.
color
- Normal color of the graph.highlight
- Color of the highlighted elements.public DotColorTheme(DotColorModel.ColorModel color)
Constructor for DotColorTheme class.
color
- Normal color of the graph.public DotColorTheme()
Default constructor for DotColorTheme class which initially uses the default color theme.
Method Detail |
---|
public void changeColor(java.lang.String color)
Normal color changer.
color
- New normal color.public void changeColor(DotColorModel.ColorModel color)
Normal color changer.
color
- New normal color.public void changeHighlight(java.lang.String highlight)
Highlight color changer.
highlight
- New highlight color.public void changeHighlight(DotColorModel.ColorModel highlight)
Highlight color changer.
highlight
- New highlight color.public java.lang.String getHighlightedColorString()
Method which formats highlighted item's color attributes into dot's syntax.
public java.lang.String getBackgroundColorString()
Method for getting the background color of the whole graph in dot's syntax.
public java.lang.String getNormalColorString()
Method which formats normal item's color attributes into dot's syntax.
public java.lang.String getColorString(boolean isHighlighted)
Method for getting the appropriate color string for an entity based on its highlight status.
isHighlighted
- Defines wether or not the returned
color string is supposed to be for an highlighted entity
or a normal entity.
public java.lang.String getColor()
Method for acquiring the name of the current color model.
public java.lang.String getHighlight()
Method for acquiring the name of the current highlight model.
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.