cwi.GraphXML.Elements
Class VisualProperties

java.lang.Object
  extended by cwi.GraphXML.Elements.VisualProperties
All Implemented Interfaces:
java.io.Serializable

public class VisualProperties
extends java.lang.Object
implements java.io.Serializable

One (common) representation for all visual styles. In contrast to the XML specification, all visual style information are collected into one class, for easier management.

Author:
Ivan Herman
See Also:
Serialized Form

Field Summary
static int BACKGROUND
           
static int DUPLICATE
           
static int NONE
           
protected static java.util.HashMap predefinedColour
           
protected static java.util.HashMap predefinedStyle
           
static int RESIZE
           
static int SOLID
           
 
Constructor Summary
VisualProperties(ParserError e)
           
 
Method Summary
 java.awt.Color getFillColor()
          Fill colour value.
 java.lang.Integer getFillStyle()
          Area fill style.
 Picture getImage()
          Image URl.
 java.lang.Integer getImageFillControl()
          Image fill control.
 java.awt.Color[] getLineColors()
          Line Colour values.
 java.lang.Short getLinePattern()
          Line pattern.
 java.lang.Double getLineWidth()
          Width value.
static java.awt.Color getXMLColour(java.lang.String name)
          Colour decoder.
 java.lang.Class implScript()
          Implementation class.
 boolean isEmpty()
          Is there anyting in the class?
 void merge(VisualProperties theOther)
          Merge of the instance with another, lower priority instance.
(package private)  void storeFillColour(java.lang.String name)
           
(package private)  void storeFillStyle(java.lang.String name)
           
(package private)  void storeImage(org.w3c.dom.Node node)
           
(package private)  void storeImageFill(java.lang.String name)
           
(package private)  void storeLineColours(java.lang.String name)
           
(package private)  void storeLineColours(java.lang.String name, java.lang.String name2)
           
(package private)  void storeScript(java.lang.String name)
           
(package private)  void storeStyle(java.lang.String style)
           
(package private)  void storeWidth(java.lang.String wV)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESIZE

public static int RESIZE

DUPLICATE

public static int DUPLICATE

NONE

public static int NONE

SOLID

public static int SOLID

BACKGROUND

public static int BACKGROUND

predefinedColour

protected static java.util.HashMap predefinedColour

predefinedStyle

protected static java.util.HashMap predefinedStyle
Constructor Detail

VisualProperties

public VisualProperties(ParserError e)
Method Detail

getLineColors

public java.awt.Color[] getLineColors()
Line Colour values.

Returns:
an array of either one or two colours, or null if not set.

getLineWidth

public java.lang.Double getLineWidth()
Width value.


getLinePattern

public java.lang.Short getLinePattern()
Line pattern.


getFillColor

public java.awt.Color getFillColor()
Fill colour value.


getFillStyle

public java.lang.Integer getFillStyle()
Area fill style. Value of the object

Returns:
value of the object is SOLID, BACKGROUND, or NONE (or null if not set)

getImage

public Picture getImage()
Image URl.


getImageFillControl

public java.lang.Integer getImageFillControl()
Image fill control.

Returns:
value of the object is RESIZE, CONTROL, or NONE (or null if not set)

implScript

public java.lang.Class implScript()
Implementation class.


merge

public void merge(VisualProperties theOther)
Merge of the instance with another, lower priority instance. This means that a value in the lower priority instance is considered only if the value is not set in this instance.

Parameters:
theOther - the lower priority visual property instance to merge with

isEmpty

public boolean isEmpty()
Is there anyting in the class?


getXMLColour

public static java.awt.Color getXMLColour(java.lang.String name)
Colour decoder. Although this method is primarily used internally, it can also be used as a general utility (for example, if a user extension contains colour values).

Parameters:
name - colour name as defined in the GraphXML specification
Returns:
corresponding Color object (or null)

storeStyle

void storeStyle(java.lang.String style)

storeWidth

void storeWidth(java.lang.String wV)

storeLineColours

void storeLineColours(java.lang.String name)

storeLineColours

void storeLineColours(java.lang.String name,
                      java.lang.String name2)

storeFillStyle

void storeFillStyle(java.lang.String name)

storeFillColour

void storeFillColour(java.lang.String name)

storeImageFill

void storeImageFill(java.lang.String name)

storeImage

void storeImage(org.w3c.dom.Node node)

storeScript

void storeScript(java.lang.String name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object