com.tensegrity.composite.geometry
Interface GeometryDescriptor

All Known Implementing Classes:
DefaultGeometryDescriptor

public interface GeometryDescriptor

A GeometryDescriptor represents a grouping of one or more basic items of type GeometryItem. Each aggregated item is represented as a uniquely named GeometryDescriptorItem.

Each GeometryDescriptor definition consists of a name, a type, a CoordinateSystem and, of course, a list of atomic parts of type GeometryDescriptorItem. The Type attribute can be one of the following string enumerations: Composite, CompositeLine or CompositeGroup.

A basic definition of a GeometryDescriptor looks like this:

 <!-- a minimal geometry descriptor -->
 <list name="GeometryDescriptor">
   <attribute name="Name" value="GEOMETRY_DESCRIPTOR_NAME"/>
   <attribute name="Type" value="GEOMETRY_DESCRITPOR_TYPE"/>
   <list name="CoordinateSystem">
     <attribute name="ScaleX" value="MINIMUM_VALUE, MAXIMUM_VALUE" />
     <attribute name="ScaleY" value="MINIMUM_VALUE, MAXIMUM_VALUE" />
   </list>
   <!-- optional attributes of the geometry descriptor -->
   <set name="Attributes">
     <attribute name="ATTRIBUTENAME" 
 			type="ATTRIBUTETYPE" 
 			value="ATTRIBUTEVALUE" />
 
     [...]
 
   </set>
   <list name="DescriptorItems">
     <list name="DescriptorItem">
 
     [...]
 
     </list>
   </list>
 </list>
 


The following lists show the GeometryDescriptor types that are currently supported and their attributes, if available:

CompositeLine: Definition of a CompositeLine:

Name Value Type Description
Type Constant Specifies the line type. The following types are currently supported:
  • dynamic
  • straight
  • orthogonal
  • LineCountAndLength
isLabelVisible Boolean Specifies whether the label is visible or not.
LabelPositioning Constant Specifies the label positioning. The following positioning types are currently supported:
  • Free
  • Head
  • HeadStart
  • HeadEnd
  • Tail
  • TailStart
  • TailEnd
  • Center
  • CenterStart
  • CenterEnd


Composite: Definition of a Composite.

Name Value Type Description
MinimumSize Size The minimum size of the Composite.


CompositeGroup: Definition of a CompositeGroup.

Attribute Name Value Type Description
HorizontalBorderToContent Integer The horizontal distance between the border and the elements inside the CompositeGroup.
VerticalBorderToContent Integer The vertical distance between the border and the elements inside the CompositeGroup.
Foldable Boolean Specifies whether the CompositeGroup should be foldable or not.
FoldedSize Size The size of the CompositeGroup when folded.
FoldStateButtonSize Size The size of the button the CompositeGroup is folded with.


The coordinate system specifies the inner measurement for the object and is defined by a list within the GeometryDescriptor. An example of such a list is below:

 <list name="CoordinateSystem">
  <attribute name="ScaleX" value="MINIMUM_VALUE, MAXIMUM_VALUE" />
  <attribute name="ScaleY" value="MINIMUM_VALUE, MAXIMUM_VALUE" />
  [...]
 
As you can see above, the definition is divided into two attributes that define the extensions of the coordinate system in the X and Y directions. Note that the coordinate system; must start at the origin. A well-defined coordinate system looks as follows:
 <list name="CoordinateSystem">
  <attribute name="ScaleX" value="0, 500" />
  <attribute name="ScaleY" value="0, 500" />
  [...]
 

Version:
$Id: GeometryDescriptor.java,v 1.26 2005/06/17 09:44:56 AndreasEbbert Exp $
Author:
MichaelKegel
See Also:
GeometryDescriptorItem

Field Summary
static int COMPOSITE_DESCRIPTOR
          Constants that define the type of a GeometryDescriptor.
static int COMPOSITEGROUP_DESCRIPTOR
          Constants that define the type of a GeometryDescriptor.
static int COMPOSITELABEL_DESCRIPTOR
          Constants that define the type of a GeometryDescriptor.
static int COMPOSITELINE_DESCRIPTOR
          Constants that define the type of a GeometryDescriptor.
static int COMPOSITESWIMLANE_DESCRIPTOR
          Constants that define the type of a GeometryDescriptor.
static int COMPOSITETABLE_COLUMN_DESCRIPTOR
          Constants that define the type of a GeometryDescriptor.
static int COMPOSITETABLE_DESCRIPTOR
          Constants that define the type of a GeometryDescriptor.
static int COMPOSITETABLE_ROW_DESCRIPTOR
          Constants that define the type of a GeometryDescriptor.
static int COMPOSITEVIEW_DESCRIPTOR
          Constants that define the type of a GeometryDescriptor.
static int DESCRIPTOR_TYPE_MAX
          This constant that tells you about the maximum number of types currently defined.
 
Method Summary
 AttributeSet getAttributes()
          Returns an AttributeSet that holds the various attributes of this GeometryDescriptor.
 CoordinateSystem getCoordinateSystem()
          Returns the CoordinateSystem of the geometry.
 GeometryDescriptorItem getItem(java.lang.String name)
          Returns the GeometryDescriptorItem with the name given by name.
 java.lang.String getName()
          Returns the name of the GeometryDescriptor.
 int getType()
          Returns the type of the GeometryDescriptor.
 java.util.Iterator iteratorItems()
          This method returns an iterator which steps over the GeometryItems provided by this GeometryDescriptor object.
 

Field Detail

COMPOSITE_DESCRIPTOR

public static final int COMPOSITE_DESCRIPTOR
Constants that define the type of a GeometryDescriptor.

See Also:
Constant Field Values

COMPOSITELINE_DESCRIPTOR

public static final int COMPOSITELINE_DESCRIPTOR
Constants that define the type of a GeometryDescriptor.

See Also:
Constant Field Values

COMPOSITEGROUP_DESCRIPTOR

public static final int COMPOSITEGROUP_DESCRIPTOR
Constants that define the type of a GeometryDescriptor.

See Also:
Constant Field Values

COMPOSITETABLE_DESCRIPTOR

public static final int COMPOSITETABLE_DESCRIPTOR
Constants that define the type of a GeometryDescriptor.

See Also:
Constant Field Values

COMPOSITESWIMLANE_DESCRIPTOR

public static final int COMPOSITESWIMLANE_DESCRIPTOR
Constants that define the type of a GeometryDescriptor.

See Also:
Constant Field Values

COMPOSITELABEL_DESCRIPTOR

public static final int COMPOSITELABEL_DESCRIPTOR
Constants that define the type of a GeometryDescriptor.

See Also:
Constant Field Values

COMPOSITETABLE_COLUMN_DESCRIPTOR

public static final int COMPOSITETABLE_COLUMN_DESCRIPTOR
Constants that define the type of a GeometryDescriptor.

See Also:
Constant Field Values

COMPOSITETABLE_ROW_DESCRIPTOR

public static final int COMPOSITETABLE_ROW_DESCRIPTOR
Constants that define the type of a GeometryDescriptor.

See Also:
Constant Field Values

COMPOSITEVIEW_DESCRIPTOR

public static final int COMPOSITEVIEW_DESCRIPTOR
Constants that define the type of a GeometryDescriptor.

See Also:
Constant Field Values

DESCRIPTOR_TYPE_MAX

public static final int DESCRIPTOR_TYPE_MAX
This constant that tells you about the maximum number of types currently defined. This means all available constants are smaller than this value. This is useful to let you iterate over the available types without even knowing how much there are currently defined.

See Also:
Constant Field Values
Method Detail

getType

public int getType()
Returns the type of the GeometryDescriptor. The allowed types are defined through constants defined in this interface.

Returns:
int the type of the GeometryDescriptor

getName

public java.lang.String getName()
Returns the name of the GeometryDescriptor.
NOTICE: Since the name of a GeometryDescriptor is used to store it in the GeometryPool the name must be unique.

Returns:
String the name of the geometry descriptor

getCoordinateSystem

public CoordinateSystem getCoordinateSystem()
Returns the CoordinateSystem of the geometry.

Returns:
CoordinateSystem

getAttributes

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

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

getItem

public GeometryDescriptorItem getItem(java.lang.String name)
Returns the GeometryDescriptorItem with the name given by name. If no GeometryDescriptorItem is available with the given name null is returned.

Parameters:
name - the name of the GeometryDescriptorItem to return
Returns:
GeometryDescriptorItem the GeometryDescriptorItem with the given name or null

iteratorItems

public java.util.Iterator iteratorItems()
This method returns an iterator which steps over the GeometryItems provided by this GeometryDescriptor object.

Returns:
Iterator object for all stored items in this descriptor


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