|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A GeometryDescriptorItem represents the first level of
GeometryItem (aka "basic item") reuse. This interface
exists because basic items will be referenced by one or more composites.
Moreover, basic items do not specify any coordinate data for the objects
that aggregate and draw them. This makes perfect sense. A composite will
need to position basic items relative to one another. In most cases,
drawing individual items in the context of a composite will not always
begin in the upper left-hand corner of a composite's coordinate system.
To make things perfectly clear, a GeometryDescriptorItem
represents an association between a single GeometryItem
(atomic geometry, basic item) and a single GeometryDescriptor.
A GeometryDescriptorItem element is embedded inside a
<DescriptorItem> tag inside the geometry.xml configuration file.
Each and every GeometryDescriptorItem references a particular
GeometryItem by name and includes additional coordinate data
inside one or more child <attribute> tags.
Every GeometryDescriptorItem, embedded inside a parent
GeometryDescriptor element, consists of its unique name,
the name of the referenced GeometryItem as well the drawing
coordinates within the composite.
A minimal specification for a GeometryDescriptorItem is this:
<!-- a minimal geometry descriptor --> <list name="DescriptorItem"> <attribute name="Name" value="GEOMETRY_DESCRIPTOR_ITEM_NAME"/> <attribute name="GeometryItemName" value="REFERENCED_GEOMETRY_ITEM_NAME"/> <list name="Coordinates"> <attribute name="Coordinate" value="X_COMPONENT, Y_COMPONENT"/> <attribute name="Coordinate" value="X_COMPONENT, Y_COMPONENT"/> [...]
A single coordinate of a GeometryDescriptorItem specifies a single point of
the basic graphical object it represents. Such a coordinate is defined in form of an
attribute whose value represents the coordinate value. The definition looks like this:
<attribute name="Coordinate" value="X_COMPONENT, Y_COMPONENT" />As you can see, the attribute contains two values separated by a comma. The first value part holds the value for X and the second value part holds the value for Y. A well-defined coordinate would therefore look like this:
<attribute name="Coordinate" value="100, 100" />The coordinates of a
GeometryDescriptorItem are given in the units of the
GeometryDescriptor that contains it.
GeometryDescriptor,
GeometryItem| Method Summary | |
AttributeSet |
getAttributes()
Returns an AttributeSet that holds the various attributes of
this GeometryDescriptorItem. |
GeometryItemCoordinates |
getCoordinates()
Returns the coordinates of this descriptor-item. |
AttributeSet |
getHints()
Returns an AttributeSet that holds the geometrical hints
provides by the GeometryDescriptorItem. |
GeometryItem |
getItem()
Returns the GeometryItem belonging to this descriptor. |
java.lang.String |
getItemName()
|
java.lang.String |
getName()
Returns the name of this GeometryDescriptorItem. |
int |
getType()
Returns the type of the GeometryDescriptorItem |
boolean |
hasHints()
Returns a boolean that indicates whether the
GeometryDescriptorItem provides geometrical hints or not. |
| Method Detail |
public int getType()
GeometryDescriptorItem. The type of a
GeometryDescriptorItem identifies the item.
- Returns:
- an
int specifying the type. Possible values are
defined in GeometryItem. - See Also:
GeometryItem
public java.lang.String getName()
GeometryDescriptorItem.
GeometryDescriptorItem.public java.lang.String getItemName()
public GeometryItem getItem()
GeometryItem belonging to this descriptor.
GeometryItem belonging to this descriptor.public GeometryItemCoordinates getCoordinates()
public AttributeSet getAttributes()
AttributeSet that holds the various attributes of
this GeometryDescriptorItem. If no attributes are assigned
to the GeometryDescriptorItem the return value is
null.
AttributeSet holding the various attributes of
this GeometryDescriptorItem or null.public boolean hasHints()
boolean that indicates whether the
GeometryDescriptorItem provides geometrical hints or not.
public AttributeSet getHints()
AttributeSet that holds the geometrical hints
provides by the GeometryDescriptorItem.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||