|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
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:
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.
| Attribute | Type | Description |
|---|---|---|
| style | Constant |
The style constant defines whether the line is continuous or has
a pattern.
The following styles are currently supported:
|
| color | Color | Defines the color of the line. |
| weight | Integer | 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.
| Attribute | Type | Description |
|---|---|---|
| style | Constant |
The style constant defines how to fill an area.
The following styles are currently supported:
|
| background | Color | Defines the background color. |
| foreground | Color | Defines the foreground color. |
| gradienttype | Constant |
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:
|
| patterntype | Constant |
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:
|
| texturekey | String |
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'!
|
| texturekeyreferenceclass | String | 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) |
| transparency | Integer | 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.
| Attribute | Type | Description |
|---|---|---|
| family | String | Define the type of font that should be used. |
| color | Color | Defines the color of the text. |
| size | Integer | Defines the size of the text. |
| italic | Boolean | Defines whether the text should be in italic or not. |
| underline | Boolean | Defines whether the text be underlined or not. |
| strikethrough | Boolean | Defines 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 |
|---|---|---|
| type | Constant |
The style constant defines whether the line is continuous or has
a pattern.
The following styles are currently supported:
|
| size | Integer | Defines 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.
<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.
| 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 |
public static final int GENERAL_ITEM
StyleItem.
public static final int LINE_ITEM
StyleItem.
public static final int RECT_ITEM
StyleItem.
public static final int ELLIPSE_ITEM
StyleItem.
public static final int POLYGON_ITEM
StyleItem.
public static final int LABEL_ITEM
StyleItem.
public static final int ELEMENT_ITEM
StyleItem.
public static final int TABLE_ITEM
StyleItem.
public static final int ITEM_TYPE_MAX
| Method Detail |
public int getType()
StyleItem. Have a look at the
constants of this class for possible values for type.
StyleItem.public java.lang.String getName()
StyleItem.
StyleItem.public AttributeSet getAttributes()
AttributeSet that holds the various attributes of
this StyleItem. If no attributes are assigned to the
StyleItem the return value is null.
AttributeSet holding the various attributes of
this StyleItem or null.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||