com.tensegrity.composite.geometry
Interface GeometryItem

All Known Subinterfaces:
NodeGeometryItem
All Known Implementing Classes:
DefaultGeometryItem

public interface GeometryItem

A GeometryItem defines a basic, atomic geometric shape, such as a line, rectangle, ellipse, polygon or label. These items are created in a geometry.xml or similarly named file and customized with attribute parameters. These attributes define specific visual aspects of the geometry item and vary depending on the item's basic type. New types may be introduced by applications.

Once a GeometryItem has been defined, it can be referenced by any number of composites, which group items into new geometry entities of type GeometryDescriptor. This separation of items and composites allows you to easily attain a consistent look and feel for all of your repository elements by centralizing and reusing one or more GeometryItem definitions.

Every GeometryItem consists of a name, a type and a list of optional attributes.

Instances of this class are usually configured in a geometry.xml file that is loaded and parsed by a GeometryPool singleton. A minimal definition of a GeometryItem looks like this:

 <!-- A Minimal Item -->
 <list name="GeometryItem">
   <attribute name="Name" value="GEOMETRY_ITEM_NAME"/>
   <attribute name="Type" value="GEOMETRY_ITEM_TYPE"/>
   [..]
 </list>
 


Rectangle: Specifies a rectangular graphical shape . The following table describes the attributes which may be configured in a geometry.xml file. For each attribute listed, a corresponding setter and getter method is available for runtime Rect2D configuration.

Name Value Type Description
RoundEdges Boolean If set to true, the rectangle will be displayed with rounded edges.
ArcWidth Integer Defines the width of the rounded edges. The 'ArcWidth' must be given in units of the CoordinateSystem the rectangle lies within.
ArcHeight Integer Defines the height of the rounded edges. The 'ArcHeight' must be given in units of the CoordinateSystem the rectangle lies within.


Label: Specifies a textual graphical shape that exposes the following geometrical attributes:

Name Value Type Description
Text String Specifies the text that should be initially displayed.
FontUnit String Constant Specifies the unit that should be used to measure the font. The following constants are currently supported: Point, Object.
LineShortening Boolean Specifies whether the label lines should be shortened, which means that characters extending past the label boundaries are truncated.
SizeAdjustment String Constant Specifies the size adjustment mode of the label. The following constants are currently supported: None, LineCount, LineLength, LineCountAndLength.


Ellipse: Specifies an elliptical graphical shape that has no configurable geometrical attributes.


Polygon: Specifies a polygonal graphical shape that has no configurable geometrical attributes.


Element: Here a GeometryDescriptor may be used as an item as well so that hierarchies can be built up. Note that this type of GeometryItem is translated into a CompositeGroup object at runtime.

Name Value Type Description
ElementName String The name of the referenced GeometryDescriptor.


Port: Specifies a VisualPort for a VisualNode. This GeometryItem is only supported by the Graph API.

Name Value Type Description
DenotationName String Specifies the name of the port.
DenotationIntervalBegin Double Specifies the begin of the interval the port should except incoming and outgoing edges. The value must be given in degrees. Note that this attribute is used by a graph layout.
DenotationIntervalEnd Double Specifies the end of the interval the port should except incoming and outgoing edges. The value must be given in degrees. Note that this attribute is used by a graph layout.


Version:
$Id: GeometryItem.java,v 1.19 2005/06/16 09:47:16 AndreasEbbert Exp $
Author:
MichaelKegel
See Also:
GeometryDescriptor, GeometryDescriptorItem

Field Summary
static int ELEMENT_ITEM
          Different types of a GeometryItem.
static int ELLIPSE_ITEM
          Different types of a GeometryItem.
static int LABEL_ITEM
          Different types of a GeometryItem.
static int LINE_ITEM
          Different types of a GeometryItem.
static int POLYGON_ITEM
          Different types of a GeometryItem.
static int RECT_ITEM
          Different types of a GeometryItem.
static int TABLE_COLUMN_ITEM
          Different types of a GeometryItem.
static int TABLE_ITEM
          Different types of a GeometryItem.
static int TABLE_ROW_ITEM
          Different types of a GeometryItem.
 
Method Summary
 AttributeSet getAttributes()
          Returns an AttributeSet that holds the various attributes of this GeometryItem.
 java.lang.String getName()
          Returns the name of this GeometryItem.
 int getType()
          Returns the type of the GeometryItem.
 

Field Detail

LINE_ITEM

public static final int LINE_ITEM
Different types of a GeometryItem.

See Also:
Constant Field Values

RECT_ITEM

public static final int RECT_ITEM
Different types of a GeometryItem.

See Also:
Constant Field Values

ELLIPSE_ITEM

public static final int ELLIPSE_ITEM
Different types of a GeometryItem.

See Also:
Constant Field Values

POLYGON_ITEM

public static final int POLYGON_ITEM
Different types of a GeometryItem.

See Also:
Constant Field Values

LABEL_ITEM

public static final int LABEL_ITEM
Different types of a GeometryItem.

See Also:
Constant Field Values

ELEMENT_ITEM

public static final int ELEMENT_ITEM
Different types of a GeometryItem.

See Also:
Constant Field Values

TABLE_ITEM

public static final int TABLE_ITEM
Different types of a GeometryItem.

See Also:
Constant Field Values

TABLE_COLUMN_ITEM

public static final int TABLE_COLUMN_ITEM
Different types of a GeometryItem.

See Also:
Constant Field Values

TABLE_ROW_ITEM

public static final int TABLE_ROW_ITEM
Different types of a GeometryItem.

See Also:
Constant Field Values
Method Detail

getType

public int getType()
Returns the type of the GeometryItem. The type of a GeometryItem identifies the item and dependent on the of it

Returns:
an int specifying the type of the GeometryItem.

getName

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

Returns:
the name of this GeometryItem.

getAttributes

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

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


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