org.ceryle.graph
Class GraphStylesheet
java.lang.Object
org.ceryle.graph.GraphStylesheet
- Direct Known Subclasses:
- TMStylesheet
public class GraphStylesheet
- extends Object
GraphStylesheet is a static utility class encapsulating various
graph display properties, particularly color. This modifies colors
in GraphLayoutPanel, GraphNode and GraphEdge.
- Since:
- JDK1.3
- Version:
- $Id: GraphStylesheet.java,v 3.6 2007-06-15 12:09:24 altheim Exp $
- Author:
- Murray Altheim
- See Also:
GraphLayoutPanel
|
Method Summary |
static Color |
getColorProperty(PropertyManager pm,
String propertyName,
String hexDefault)
Reads the Color property name from the properties file
supplied by the PropertyManager pm, decoding the String
hexDefault (which should be a hex value, eg., "#2190ff")
should this for some reason fail. |
static void |
setDefaultColors(PropertyManager pm,
GraphPanel gp)
Sets the colors used by this GraphStylesheet by reading their names
from the property file provided by the PropertyManager pm. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_GC
protected static String m_GC
GraphStylesheet
public GraphStylesheet()
setDefaultColors
public static void setDefaultColors(PropertyManager pm,
GraphPanel gp)
- Sets the colors used by this GraphStylesheet by reading their names
from the property file provided by the PropertyManager pm.
This also permits re-setting of the maximum label length, from the
property "http://purl.org/ceryle/prop/#graph-maxLabelLength".
This extends the method in GraphLayoutPanel by providing colors for
topic map nodes.
getColorProperty
public static Color getColorProperty(PropertyManager pm,
String propertyName,
String hexDefault)
- Reads the Color property name from the properties file
supplied by the PropertyManager pm, decoding the String
hexDefault (which should be a hex value, eg., "#2190ff")
should this for some reason fail.
The property value can be in one of three forms:
- Hex Value: eg., "#2190ff"
- sRGB Value: eg., "33,144,255"
- sRGBA (plus alpha) Value: eg., "33,144,255,120"
sRGB and sRGBA values are comprised of integers between 0 and 255.
The alpha value determines transparency, with 255 being opaque.
The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.