com.tensegrity.composite.style
Interface StyleItem

All Superinterfaces:
CanonicalDescribable
All Known Implementing Classes:
DefaultStyleItem

public interface StyleItem
extends CanonicalDescribable

A StyleItem consists of a name and type description followed by a list of attributes defining the border, fill and/or font. The type of a StyleItem is necessary to distinguish between various styles and their dedicated primitives. Valid types are:

The attributes of a StyleItem are definitions for fill, font and border formats. While the definition for a border is mandatory, fill and font format definitions are optional.


StrokeFormat: A stroke format is used to define the visual appearance of a line.

AttributeTypeDescription
styleConstant The style constant defines whether the line is continuous or has a pattern. The following styles are currently supported:
  • Invisible
  • Continuous
  • Dash
  • Dashdot
  • Dashdotdot
  • Dot
  • Custom
colorColorDefines the color of the line.
weightInteger Defines the thickness of the line. Valid values are integers between 0 and 10 (inclusive).


PaintFormat: A paint format is used to define an area fill.

AttributeTypeDescription
styleConstant The style constant defines how to fill an area. The following styles are currently supported:
  • None
  • Solid
  • Gradient
  • Pattern
  • Texture
backgroundColorDefines the background color.
foregroundColorDefines the foreground color.
gradienttypeConstant The gradienttype constant defines what type of gradient should be used to fill an area. Note that this attribute depends on setting the format 'style' to 'Gradient'. The following gradient types are currently supported:
  • Rightleft
  • Verticalcenter
  • Topbottom
  • Horizontalcenter
  • Up
  • Upcenter
  • Down
  • Downcenter
  • Leftbottom
  • Rightbottom
  • Lefttop
  • Righttop
  • Centersquared
  • Centercircle
  • Lefttopcircle
  • Righttopcircle
patterntypeConstant The patterntype constant defines what type of pattern should be used to fill an area. Note that this attribute depends on setting the format 'style' to 'Pattern'. The following pattern types are currently supported:
  • Solid
  • Grey75
  • Grey50
  • Grey25
  • Grey16
  • Grey8
  • Horizontal
  • Vertical
  • Down
  • Up
  • Checker
  • Semigrey75
  • Lighthorizontal
  • Lightvertical
  • Lightdown
  • Lightup
  • Grid
  • Chrisscross
texturekeyString The texturekey is used internally to markup texture images. This is the key to retrieve the raster from the ImagePool, if it has been loaded before. You can also use this key to load the image into the pool. To do so, this has to be a relative or absolute path to the image file you want to load and has to be parseable to a file or web url. (e.g. '/home/usr/images/tile.gif', 'C:\Documents and Settings\tile.gif', 'http://www.CompanyWebsite.com/logo.png', 'resource/icon/logo.png'). See 'texturekeyreferenceclass'!
texturekeyreferenceclassString This is the reference class used to load the image file from the application resources when using a relative path in the 'texturekey' attribute. e.g. texturekey = "resource/icon/logo.png" texturekeyreferenceclass = "com.tensegrity.graphdesigner.GraphDesigner" (Where 'resource' is a subfolder below the folder 'GraphDesigner' lies in)
transparencyInteger Defines the fill transparency as a percentage, such that 100% specifies a completely transparent fill.
transparent Boolean Defines whether transparency is active or not.


FontFormat: A font format is used to define the appearance of text.

AttributeTypeDescription
familyStringDefine the type of font that should be used.
colorColorDefines the color of the text.
sizeIntegerDefines the size of the text.
italicBooleanDefines whether the text should be in italic or not.
underlineBooleanDefines whether the text be underlined or not.
strikethroughBooleanDefines whether the text be strikethrough or not.


MarkerFormat: A marker format is used to define the arrows at the end of a line.

Attribute Type Description
typeConstant The style constant defines whether the line is continuous or has a pattern. The following styles are currently supported:
  • Invisible
  • Continuous
  • Dash
  • Dashdot
  • Dashdotdot
  • dot
sizeIntegerDefines the color of the line.
border(attribute)set Defines the border of the arrow and follows the rules for the definition of a StrokeFormat mentioned above.
fill(attribute)set Defines the fill of the arrow and follows the rules for the definition of a PaintFormat mentioned above.


Color Definition: Some of the formats listed above require a color definition within their attributes. There are several ways to do this.

For instance, the definition of a color can look like:
 <attribute name="color" type="Color" value="lightcyan"/>
 <attribute name="color" type="Color" value="#FFAAFF"/>
 <attribute name="color" type="Color" value="12, 145, 23"/>]]>
 


Default Values: To simplify the definitions of format attributes, users only have to specify those attributes which differ from the default settings, which exist for each Format.

The default definition for a Border is: weight: 1, color: black and style: continuous.

The default definition for Font is: size: 8, weight: normal, family: dialog, color: black, italic/underline/strikethrough: false

The default definition for Fill is: style: solid, background: white, foreground: black, gradienttype: rightleft, pattern: solid, transparency: 50, transparent: false.


Version:
$Id: StyleItem.java,v 1.24 2005/09/02 12:46:48 BurkhardWick Exp $
Author:
MichaelKegel

Field Summary
static int ELEMENT_ITEM
          Constant specifying the type of this StyleItem.
static int ELLIPSE_ITEM
          Constant specifying the type of this StyleItem.
static int GENERAL_ITEM
          Constant specifying the type of this StyleItem.
static int ITEM_TYPE_MAX
          Defines the highest possible integer constant used for the descriptor constants.
static int LABEL_ITEM
          Constant specifying the type of this StyleItem.
static int LINE_ITEM
          Constant specifying the type of this StyleItem.
static int POLYGON_ITEM
          Constant specifying the type of this StyleItem.
static int RECT_ITEM
          Constant specifying the type of this StyleItem.
static int TABLE_ITEM
          Constant specifying the type of this StyleItem.
 
Fields inherited from interface com.tensegrity.generic.util.CanonicalDescribable
DELIMITER
 
Method Summary
 AttributeSet getAttributes()
          Returns an AttributeSet that holds the various attributes of this StyleItem.
 java.lang.String getName()
          Returns the name of this StyleItem.
 int getType()
          Returns the type of this StyleItem.
 
Methods inherited from interface com.tensegrity.generic.util.CanonicalDescribable
getCanonicalDescription
 

Field Detail

GENERAL_ITEM

public static final int GENERAL_ITEM
Constant specifying the type of this StyleItem.

See Also:
Constant Field Values

LINE_ITEM

public static final int LINE_ITEM
Constant specifying the type of this StyleItem.

See Also:
Constant Field Values

RECT_ITEM

public static final int RECT_ITEM
Constant specifying the type of this StyleItem.

See Also:
Constant Field Values

ELLIPSE_ITEM

public static final int ELLIPSE_ITEM
Constant specifying the type of this StyleItem.

See Also:
Constant Field Values

POLYGON_ITEM

public static final int POLYGON_ITEM
Constant specifying the type of this StyleItem.

See Also:
Constant Field Values

LABEL_ITEM

public static final int LABEL_ITEM
Constant specifying the type of this StyleItem.

See Also:
Constant Field Values

ELEMENT_ITEM

public static final int ELEMENT_ITEM
Constant specifying the type of this StyleItem.

See Also:
Constant Field Values

TABLE_ITEM

public static final int TABLE_ITEM
Constant specifying the type of this StyleItem.

See Also:
Constant Field Values

ITEM_TYPE_MAX

public static final int ITEM_TYPE_MAX
Defines the highest possible integer constant used for the descriptor constants.

See Also:
Constant Field Values
Method Detail

getType

public int getType()
Returns the type of this StyleItem. Have a look at the constants of this class for possible values for type.

Returns:
the type of this StyleItem.

getName

public java.lang.String getName()
Returns the name of this StyleItem.

Returns:
Returns the name of this StyleItem.

getAttributes

public AttributeSet getAttributes()
Returns an AttributeSet that holds the various attributes of this StyleItem. If no attributes are assigned to the StyleItem the return value is null.

Returns:
an AttributeSet holding the various attributes of this StyleItem or null.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.