com.tensegrity.composite
Interface CompositeLine

All Superinterfaces:
Attributable, AttributableOnSet, BaseComposite, BaseInteractable, InteractableLine
All Known Subinterfaces:
VisualEdgeComposite

public interface CompositeLine
extends BaseComposite, InteractableLine

A CompositeLine is a specialization of the BaseComposite interface. Therefore, it is recommended that you read the documentation of the BaseComposite interface first to acquire a basic understanding of this interface's inherited responsibility.

The CompositeLine interface is used whenever a line is drawn or two composites are connected with a link. This connecting edge is made up of a CompositeLine - a Composite that holds a line and behaves differently than normal composites.

The CompositeLine interface supplements the BaseComposite behavior by managing a set of Coordinate objects that are used by a parent CoordinateSystem.

Class Diagram CompositeLine

To deal with the coordinates of a CompositeLine, you may use the following methods:

A CompositeLine object fires events for every change that can happen to it. In order to be notified about these events, you have to programmatically register an object that implements the CompositeLineListener interface. For more information about this interface, please take a closer look at the documentation for CompositeLineListener and CompositeLineEvent.

Some of the events generated by a CompositeLine are vetoable, which means that the processing of an event can be programmatically stopped. In order to veto an event, you have to register a VetoableCompositeLineListener. For more information about this interface, please take a closer look at the documentation for VetoableCompositeLineListener.

For more information about the event mechanism in the tensegrity frameworks, please see interface EventListenerTag and class EventMultiplexer.

The methods a CompositeLine provides to support the event mechanism are:

Version:
$Id: CompositeLine.java,v 1.59 2005/06/16 16:13:43 AndreasEbbert Exp $
Author:
MichaelKegel

Field Summary
static int EVENT_MASK_CHANGE
          Constant that tells about the different events or groups of events and can be used with BaseComposite.enableEvents(int) to turn them on and BaseComposite.disableEvents(int) to turn them off.
static int EVENT_MASK_MANIPULATE
          Constant that tells about the different events or groups of events and can be used with BaseComposite.enableEvents(int) to turn them on and BaseComposite.disableEvents(int) to turn them off.
static int EVENT_MASK_MOVE
          Constant that tells about the different events or groups of events and can be used with BaseComposite.enableEvents(int) to turn them on and BaseComposite.disableEvents(int) to turn them off.
static int LABEL_POSITION_CENTER
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_CENTER_END
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_CENTER_START
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_FREE
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_HEAD
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_HEAD_END
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_HEAD_START
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_TAIL
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_TAIL_END
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_TAIL_START
          Deprecated. use SIGN_XXX position constants instead
static int LABEL_POSITION_UNKNOWN
          Deprecated. use SIGN_XXX position constants instead
static int SIGN_ANCHOR_BEGIN
           
static int SIGN_ANCHOR_CENTER
           
static int SIGN_ANCHOR_END
           
static int SIGN_ANCHOR_FREE
           
static int SIGN_PLACEMENT_CENTER
           
static int SIGN_PLACEMENT_FREE
           
static int SIGN_PLACEMENT_HEAD
           
static int SIGN_PLACEMENT_TAIL
           
static int TYPE_CURVED
          Constant to specify the type of the CompositeLine.
static int TYPE_DYNAMIC
          Constant to specify the type of the CompositeLine.
static int TYPE_ORTHOGONAL
          Constant to specify the type of the CompositeLine.
static int TYPE_STRAIGHT
          Constant to specify the type of the CompositeLine.
 
Fields inherited from interface com.tensegrity.composite.BaseComposite
DELEGATE_INFOVALUE, EVENT_MASK_MOUSE, EVENT_MASK_SELECT, GENERAL_INFOVALUE, NON_INFOVALUE
 
Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet
TREE_SUBSET_POSTFIX
 
Method Summary
 void addCompositeLineListener(CompositeLineListener listener)
          Adds the given CompositeLineListener to the CompositeLines internal structure, such that the listener is informed about every event that occurs.
 void addCoordinate(Coordinate coordinate)
          Adds the Coordinate given by coordinate to the end of the CompositeLines actual coordinates.
 void addVetoableCompositeLineListener(VetoableCompositeLineListener listener)
          Adds the given VetoableCompositeLineListener to the CompositeLines internal structure, such that the listener is informed about every event that occurs.
 void applyState(CompositeLineState state)
          Applies the CompositeLineState given by state to the CompositeLine.
 CompositeLine deepCopy()
          Deep copies a CompositeLine.
 Coordinate getCoordinateAt(int index)
          Returns the Coordinate at the index given by index from the CompositeLines current coordinates.
 int getCoordinateCount()
          Returns the current number of Coordinates the CompositeLine consist of.
 Coordinate[] getCoordinates()
          Returns an array of the current Coordinates the CompositeLine consist of.
 Coordinate getEndingLocation()
          Returns the ending Coordinate of the CompositeLine.
 java.lang.String getLabel()
          Deprecated. use .setSignVisible() and .adjustGeometry() instead [NOTICE: method will be removed in the near future]
 Coordinate getLabelLocation()
          Deprecated. use .getSign().getLocation() instead [NOTICE: method will be removed in the near future]
 int getLabelPositioning()
          Deprecated. use .getSignPosition() or .getSignLinePosition() instead [NOTICE: method will be removed in the near future]
 Size getLabelSize()
          Deprecated. use .getSign().getSize() instead [NOTICE: method will be removed in the near future]
 MarkerFormat getMarkerBegin()
          Returns the MarkerFormat that is currently used to draw a marker at the beginning coordinate of the CompositeLine.
 MarkerFormat getMarkerEnd()
          Returns the MarkerFormat that is currently used to draw a marker at the ending coordinate of the CompositeLine.
 Coordinate[] getReferenceCoordinates()
          Returns an array of Coordinates that represents the reference coordinates the CompositeLine currently provides.
 int[] getSegmentTypes()
          Returns an int-array that represent the segment types the CompositeLine currently provides.
 Composite getSign()
           
 int getSignAnchor()
           
 int getSignPlacement()
           
 Coordinate getStartingLocation()
          Returns the starting Coordinate of the CompositeLine.
 CompositeLineState getState()
          Returns a CompositeLineState instance that can be used to reset the state of the CompositeLine to the state that is stored into the CompositeLineState.
 StrokeFormat getStroke()
          Returns the StrokeFormat that is currently used to draw the CompositeLine.
 int getType()
          Returns the type of the line.
 void insertCoordinate(int index, Coordinate coordinate)
          Inserts the Coordinate given by coordinate at the index given by index.
 void insertCoordinate(int index, Coordinate coordinate, Coordinate[] refCoordinate)
          Inserts the Coordinate given by coordinate at the index given by index.
 boolean isEachPointInteractionAllowed()
          Returns a boolean that indicates whether it is allowed for the user to interact at each point of the CompositeLine or not.
 boolean isSignVisible()
          Returns a boolean that indicates whether the current sign of the CompositeLine is visible or not.
 void layoutLabel(Coordinate location)
          Deprecated. use .getSign().setLocation() [NOTICE: method will be removed in the near future]
 void removeCompositeLineListener(CompositeLineListener listener)
          Removes the given CompositeLineListener from the CompositeLines internal structure, such that the listener is no longer informed about occurring events.
 void removeCoordinate(int index)
          Removes the Coordinate at the index given by index from the CompositeLines coordinates.
 void removeCoordinates(int index1, int index2)
          Removes all Coordinates between the two indices given by index1 and index2 from the CompositeLines actual Coordinates.
 void removeVetoableCompositeLineListener(VetoableCompositeLineListener listener)
          Removes the given VetoableCompositeLineListener from the CompositeLines internal structure, such that the listener is no longer informed about occurring events.
 void setCoordinateAt(int index, Coordinate coordinate)
          Sets the Coordinate given by coordinate at the index given by index of the Composites current coordinates.
 void setCoordinates(Coordinate[] coordinates)
          Sets the Coordinates given by coordinates as the CompositeLines coordinates.
 void setEachPointInteractionAllowed(boolean allowEachPointInteraction)
          Sets the state of the each-point-interaction flag to the value given by allowEachPointInteraction.
 void setEndingLocation(Coordinate coordinate)
          Sets the Coordinate given by Coordinate as the new ending coordinate of the CompositeLine.
 void setLabel(java.lang.String text)
          Deprecated. use .setSignVisible() and .adjustGeometry() instead [NOTICE: method will be removed in the near future]
 void setLabel(Transform2D xform_context, ScaleValues scalevalues, java.lang.String text)
          Deprecated. use .setSignVisible() and .adjustGeometry() instead [NOTICE: method will be removed in the near future]
 void setLabelPositioning(int positioning)
          Deprecated. use .setSignAnchor() and/or .setSignPlacement() instead [NOTICE: method will be removed in the near future]
 void setLabelVisible(Transform2D xform_context, ScaleValues scalevalues, boolean visible)
          Deprecated. use .setSignVisible() and .adjustGeometry() instead [NOTICE: method will be removed in the near future]
 void setMarkerBegin(MarkerFormat marker)
          Sets the MarkerFormat given by marker as the new MarkerFormat> used to draw a marker at the beginning coordinate of the CompositeLine.
 void setMarkerEnd(MarkerFormat marker)
          Sets the MarkerFormat given by marker as the new MarkerFormat> used to draw a marker at the ending coordinate of the CompositeLine.
 void setReferenceCoordinates(Coordinate[] coordinatesRef)
          Sets the reference Coordinates given by coordinates as the CompositeLines reference coordinates.
 void setSegmentTypes(int[] segmentTypesNew)
          Sets the segment types for the PolygonLine to the values given by segmentTypesNew.
 void setSign(Composite sign)
           
 void setSignAnchor(int anchor)
           
 void setSignPlacement(int placement)
           
 void setSignVisible(boolean visible)
          Sets the visibility state of the CompositeLine's sign to the value given by visible.
 void setStartingLocation(Coordinate coordinate)
          Sets the Coordinate given by coordinate as the new starting coordinate of the CompositeLine.
 void setStroke(StrokeFormat stroke)
          Sets the StrokeFormat given by stroke as the new StrokeFormat used to draw the CompositeLine.
 void setType(int type)
          Sets the type of the line.
 void translatePoints(int indexStart, int indexEnd, int offsetX, int offsetY)
          Translates the given range of points by the values of offsetX and offsetY.
 
Methods inherited from interface com.tensegrity.composite.BaseComposite
addPrimitive, adjustGeometry, adjustGeometry, applyGeometry, applyStyle, areEventsEnabled, disableEvents, draw, draw, drawComposite, enableEvents, getBaseCompositeContainer, getEventMask, getGeometryName, getInfoValue, getInfoValueIdentifier, getName, getPrimitiveIterator, getShadowColor, getShadowDirection, getStyleName, internalSetGeometryName, internalSetStyleName, isDeletable, isShadowVisible, registerAttributeConstraint, registerEventMediator, registerVetoableEventMediator, removeAllPrimitives, removePrimitive, setBaseCompositeContainer, setDeletable, setEventMask, setInfoValue, setInfoValue, setName, setShadowColor, setShadowDirection, setShadowVisible, unregisterAttributeConstraint
 
Methods inherited from interface com.tensegrity.generic.attribute.AttributableOnSet
addAttributableOnSetListener, areAttributableEventsEnabled, disableAttributableEvents, enableAttributableEvents, getAttributes, getAttributesTree, removeAttributableOnSetListener, setAttributes, setAttributesTree
 
Methods inherited from interface com.tensegrity.generic.attribute.Attributable
getAttribute, getAttributeType, getAttributeValue, setAttribute, setAttributeValue
 
Methods inherited from interface com.tensegrity.graphics.interaction.BaseInteractable
getBoundingBox, getInteractionDescriptor, getMoveItem, hits, internalEnableSelection, internalSelect, internalSetSelected, isMovable, isSelectable, isSelected, mouseClick, mouseDown, mouseEnter, mouseExit, mouseUp, postActing, preActing, select, setMovable, setSelectable, setSelected, startAction, stopAction
 
Methods inherited from interface com.tensegrity.graphics.interaction.InteractableLine
calculateCoordinates, getActionMode, isManipulable, setManipulable
 

Field Detail

LABEL_POSITION_UNKNOWN

public static final int LABEL_POSITION_UNKNOWN
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_FREE

public static final int LABEL_POSITION_FREE
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_HEAD

public static final int LABEL_POSITION_HEAD
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_HEAD_START

public static final int LABEL_POSITION_HEAD_START
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_HEAD_END

public static final int LABEL_POSITION_HEAD_END
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_TAIL

public static final int LABEL_POSITION_TAIL
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_TAIL_START

public static final int LABEL_POSITION_TAIL_START
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_TAIL_END

public static final int LABEL_POSITION_TAIL_END
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_CENTER

public static final int LABEL_POSITION_CENTER
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_CENTER_START

public static final int LABEL_POSITION_CENTER_START
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

LABEL_POSITION_CENTER_END

public static final int LABEL_POSITION_CENTER_END
Deprecated. use SIGN_XXX position constants instead

Constant that specifies the label position.

See Also:
Constant Field Values

SIGN_PLACEMENT_FREE

public static final int SIGN_PLACEMENT_FREE
See Also:
Constant Field Values

SIGN_PLACEMENT_HEAD

public static final int SIGN_PLACEMENT_HEAD
See Also:
Constant Field Values

SIGN_PLACEMENT_CENTER

public static final int SIGN_PLACEMENT_CENTER
See Also:
Constant Field Values

SIGN_PLACEMENT_TAIL

public static final int SIGN_PLACEMENT_TAIL
See Also:
Constant Field Values

SIGN_ANCHOR_FREE

public static final int SIGN_ANCHOR_FREE
See Also:
Constant Field Values

SIGN_ANCHOR_BEGIN

public static final int SIGN_ANCHOR_BEGIN
See Also:
Constant Field Values

SIGN_ANCHOR_CENTER

public static final int SIGN_ANCHOR_CENTER
See Also:
Constant Field Values

SIGN_ANCHOR_END

public static final int SIGN_ANCHOR_END
See Also:
Constant Field Values

TYPE_DYNAMIC

public static final int TYPE_DYNAMIC
Constant to specify the type of the CompositeLine.

See Also:
Constant Field Values

TYPE_STRAIGHT

public static final int TYPE_STRAIGHT
Constant to specify the type of the CompositeLine.

See Also:
Constant Field Values

TYPE_ORTHOGONAL

public static final int TYPE_ORTHOGONAL
Constant to specify the type of the CompositeLine.

See Also:
Constant Field Values

TYPE_CURVED

public static final int TYPE_CURVED
Constant to specify the type of the CompositeLine.

See Also:
Constant Field Values

EVENT_MASK_CHANGE

public static final int EVENT_MASK_CHANGE
Constant that tells about the different events or groups of events and can be used with BaseComposite.enableEvents(int) to turn them on and BaseComposite.disableEvents(int) to turn them off.

See Also:
Constant Field Values

EVENT_MASK_MANIPULATE

public static final int EVENT_MASK_MANIPULATE
Constant that tells about the different events or groups of events and can be used with BaseComposite.enableEvents(int) to turn them on and BaseComposite.disableEvents(int) to turn them off.

See Also:
Constant Field Values

EVENT_MASK_MOVE

public static final int EVENT_MASK_MOVE
Constant that tells about the different events or groups of events and can be used with BaseComposite.enableEvents(int) to turn them on and BaseComposite.disableEvents(int) to turn them off.

See Also:
Constant Field Values
Method Detail

getType

public int getType()
Returns the type of the line.

Returns:
the type of the line.

setType

public void setType(int type)
Sets the type of the line. Valid values are TYPE_DYNAMIC, TYPE_STRAIGHT, TYPE_ORTHOGONAL and TYPE_POLYLINE.

Parameters:
type - the type to set.

isEachPointInteractionAllowed

public boolean isEachPointInteractionAllowed()
Returns a boolean that indicates whether it is allowed for the user to interact at each point of the CompositeLine or not. In case that it is not allowed he can manipulate the CompositeLine only at the starting and ending location. In this case selection markers are also shown only for the starting and ending location.

Returns:
boolean flag that indicates whether the user has the permission to manipulate each point of the CompositeLine

setEachPointInteractionAllowed

public void setEachPointInteractionAllowed(boolean allowEachPointInteraction)
Sets the state of the each-point-interaction flag to the value given by allowEachPointInteraction.

Parameters:
allowEachPointInteraction - the new value for the each-point-interaction flag

getStroke

public StrokeFormat getStroke()
Returns the StrokeFormat that is currently used to draw the CompositeLine.

Returns:
StrokeFormat the current format of the CompositeLine

setStroke

public void setStroke(StrokeFormat stroke)
Sets the StrokeFormat given by stroke as the new StrokeFormat used to draw the CompositeLine.

Parameters:
stroke - the new StrokeFormat for the CompositeLine

getMarkerBegin

public MarkerFormat getMarkerBegin()
Returns the MarkerFormat that is currently used to draw a marker at the beginning coordinate of the CompositeLine.

Returns:
MarkerFormat the current format for the marker at the beginning coordinate

setMarkerBegin

public void setMarkerBegin(MarkerFormat marker)
Sets the MarkerFormat given by marker as the new MarkerFormat> used to draw a marker at the beginning coordinate of the CompositeLine.

Parameters:
marker - the new MarkerFormat for the marker at the beginning coordinate

getMarkerEnd

public MarkerFormat getMarkerEnd()
Returns the MarkerFormat that is currently used to draw a marker at the ending coordinate of the CompositeLine.

Returns:
MarkerFormat the current format for the marker at the ending coordinate

setMarkerEnd

public void setMarkerEnd(MarkerFormat marker)
Sets the MarkerFormat given by marker as the new MarkerFormat> used to draw a marker at the ending coordinate of the CompositeLine.

Parameters:
marker - the new MarkerFormat for the marker at the ending coordinate

getLabel

public java.lang.String getLabel()
Deprecated. use .setSignVisible() and .adjustGeometry() instead [NOTICE: method will be removed in the near future]

Returns the text of the label in case the sign of the CompositeLine is the default sign.

Returns:
the text of the label or null.

setLabel

public void setLabel(java.lang.String text)
Deprecated. use .setSignVisible() and .adjustGeometry() instead [NOTICE: method will be removed in the near future]

Sets the text of the label in case the sign of the CompositeLine is the default sign.

Parameters:
text - the text to set.

setLabel

public void setLabel(Transform2D xform_context,
                     ScaleValues scalevalues,
                     java.lang.String text)
Deprecated. use .setSignVisible() and .adjustGeometry() instead [NOTICE: method will be removed in the near future]

Sets the text of the label. The text will be displayed under the Tranform2D xform_context and with the given zoom-values.

Parameters:
xform_context - the Tranform2D to use
scalevalues - the scale values for the different directions the CompositeView has been set to
text - the text to set

isSignVisible

public boolean isSignVisible()
Returns a boolean that indicates whether the current sign of the CompositeLine is visible or not.

Returns:
boolean flag that indicates whether the CompositeLine's sign is visible or not.

setSignVisible

public void setSignVisible(boolean visible)
Sets the visibility state of the CompositeLine's sign to the value given by visible.


getSign

public Composite getSign()

setSign

public void setSign(Composite sign)

setLabelVisible

public void setLabelVisible(Transform2D xform_context,
                            ScaleValues scalevalues,
                            boolean visible)
Deprecated. use .setSignVisible() and .adjustGeometry() instead [NOTICE: method will be removed in the near future]

Sets the visibility of the label. Afterwards the transform and zoom of the label is adjusted to fit the given values.

Parameters:
xform_context - the Transform2D to use
scalevalues - the scale values for the different directions the CompositeView has been set to
visible - set to true, if the label should be visible

getLabelPositioning

public int getLabelPositioning()
Deprecated. use .getSignPosition() or .getSignLinePosition() instead [NOTICE: method will be removed in the near future]

Returns the position of the line's label.

Returns:
the position of the line's label.

setLabelPositioning

public void setLabelPositioning(int positioning)
Deprecated. use .setSignAnchor() and/or .setSignPlacement() instead [NOTICE: method will be removed in the near future]

Sets the position of the label. Look at the constants specified in this class for valid values.

Parameters:
positioning - the position to set.

getSignAnchor

public int getSignAnchor()

setSignAnchor

public void setSignAnchor(int anchor)

getSignPlacement

public int getSignPlacement()

setSignPlacement

public void setSignPlacement(int placement)

getLabelLocation

public Coordinate getLabelLocation()
Deprecated. use .getSign().getLocation() instead [NOTICE: method will be removed in the near future]

Returns the location of the label as a Coordinate.

Returns:
the location of the label as a Coordinate.

getLabelSize

public Size getLabelSize()
Deprecated. use .getSign().getSize() instead [NOTICE: method will be removed in the near future]

Returns the Size of the label.

Returns:
the Size of the label.

layoutLabel

public void layoutLabel(Coordinate location)
Deprecated. use .getSign().setLocation() [NOTICE: method will be removed in the near future]

Lays out the label of this line at the given Coordinate.

Parameters:
location - the Coordinate.

getStartingLocation

public Coordinate getStartingLocation()
Returns the starting Coordinate of the CompositeLine. The ending coordinate is the last Coordinate the CompositeLine consists of (respectively the CompositeLine starts at).

Returns:
Coordinate the ending coordinate

Find more information in the class documentation


setStartingLocation

public void setStartingLocation(Coordinate coordinate)
Sets the Coordinate given by coordinate as the new starting coordinate of the CompositeLine. The starting coordinate is the first Coordinate the CompositeLine consists of respectively the CompositeLine starts.

Parameters:
coordinate - the new starting coordinate of the CompositeLine

Find more information in the class documentation


getEndingLocation

public Coordinate getEndingLocation()
Returns the ending Coordinate of the CompositeLine. The ending coordinate is the last Coordinate the CompositeLine consists of respectively the CompositeLine ends.

Returns:
Coordinate the ending coordinate

setEndingLocation

public void setEndingLocation(Coordinate coordinate)
Sets the Coordinate given by Coordinate as the new ending coordinate of the CompositeLine. The ending coordinate is the last Coordinate of the coordinates the CompositeLine consists of respectively the CompositeLine ends.

Parameters:
coordinate - the new ending coordinate of the CompositeLine

getCoordinates

public Coordinate[] getCoordinates()
Returns an array of the current Coordinates the CompositeLine consist of.

Returns:
Coordinate[] the Coordinates the CompositeLine actually consists of

setCoordinates

public void setCoordinates(Coordinate[] coordinates)
Sets the Coordinates given by coordinates as the CompositeLines coordinates. The old coordinates will be removed.

Parameters:
coordinates - the coordinates to set

setReferenceCoordinates

public void setReferenceCoordinates(Coordinate[] coordinatesRef)
Sets the reference Coordinates given by coordinates as the CompositeLines reference coordinates. The old coordinates will be removed.

Parameters:
coordinatesRef - the reference coordinates to set

getReferenceCoordinates

public Coordinate[] getReferenceCoordinates()
Returns an array of Coordinates that represents the reference coordinates the CompositeLine currently provides.
NOTICE:Changes to the returned array do not change the CompositeLine

Returns:
Coordinate[] array of the reference coordinates the CompositeLine currently provides

getCoordinateCount

public int getCoordinateCount()
Returns the current number of Coordinates the CompositeLine consist of.

Returns:
int the current count of coordinates

Find more information in the class documentation


getCoordinateAt

public Coordinate getCoordinateAt(int index)
Returns the Coordinate at the index given by index from the CompositeLines current coordinates. If the index is less than zero or larger than the actual count of Coordinates an exception will be thrown.

Parameters:
index - the index of the Coordinate to return
Returns:
Coordinate the Coordinate at the given index

Find more information in the class documentation


setCoordinateAt

public void setCoordinateAt(int index,
                            Coordinate coordinate)
Sets the Coordinate given by coordinate at the index given by index of the Composites current coordinates. If the index is less than zero or larger than the actual count of Coordinates an exception will be thrown.

Parameters:
index - where to set the given Coordinate to
coordinate - the Coordinate to set

addCoordinate

public void addCoordinate(Coordinate coordinate)
Adds the Coordinate given by coordinate to the end of the CompositeLines actual coordinates.

Parameters:
coordinate - the Coordinate to add

Find more information in the class documentation


insertCoordinate

public void insertCoordinate(int index,
                             Coordinate coordinate)
Inserts the Coordinate given by coordinate at the index given by index. If the first index is less than zero it is adjusted to zero. If the second index is larger than the actual count of Coordinates it is adjusted to the actual count of Coordinates

Parameters:
index - the index where to insert the Coordinate
coordinate - the Coordinate to insert

Find more information in the class documentation


insertCoordinate

public void insertCoordinate(int index,
                             Coordinate coordinate,
                             Coordinate[] refCoordinate)
Inserts the Coordinate given by coordinate at the index given by index. If the first index is less than zero it is adjusted to zero. If the second index is larger than the actual count of Coordinates it is adjusted to the actual count of Coordinates

Parameters:
index - the index where to insert the Coordinate
coordinate - the Coordinate to insert
refCoordinate - the reference Coordinates to insert

removeCoordinate

public void removeCoordinate(int index)
Removes the Coordinate at the index given by index from the CompositeLines coordinates. If the index is less than zero or larger than the actual count of Coordinates an exception will be thrown.

Parameters:
index - the index of the Coordinate to remove

Find more information in the class documentation


removeCoordinates

public void removeCoordinates(int index1,
                              int index2)
Removes all Coordinates between the two indices given by index1 and index2 from the CompositeLines actual Coordinates. If the first index is less than zero it is adjusted to zero. If the second index is larger than the actual count of Coordinates it is adjusted to the actual count of Coordinates

Parameters:
index1 - the index of the first Coordinate to remove
index2 - the index of the last Coordinate to remove

translatePoints

public void translatePoints(int indexStart,
                            int indexEnd,
                            int offsetX,
                            int offsetY)
Translates the given range of points by the values of offsetX and offsetY. In addition the corresponding reference coordinates are translated as well.

Parameters:
indexStart - The start index of the range to move
indexEnd - The start index of the range to move
offsetX - The horizontal offset
offsetY - The vertical offset

setSegmentTypes

public void setSegmentTypes(int[] segmentTypesNew)
Sets the segment types for the PolygonLine to the values given by segmentTypesNew. The supported segment types are defined by UtilitiesLine.LINEAR_SEGMENT, UtilitiesLine.CUBIC_BEZIER_SEGMENT or UtilitiesLine.CUBIC_CATMULL_ROM_SEGMENT.

Parameters:
segmentTypesNew - the new segment types for the CompositeLine

getSegmentTypes

public int[] getSegmentTypes()
Returns an int-array that represent the segment types the CompositeLine currently provides. The different segment types that are supported by the CompositeLine are defined by the constants UtilitiesLine.LINEAR_SEGMENT, UtilitiesLine.CUBIC_BEZIER_SEGMENT or UtilitiesLine.CUBIC_CATMULL_ROM_SEGMENT.

Returns:
int[] the current segment types of the CompositeLine

getState

public CompositeLineState getState()
Returns a CompositeLineState instance that can be used to reset the state of the CompositeLine to the state that is stored into the CompositeLineState.

Returns:
CompositeState the current state of the Composite

applyState

public void applyState(CompositeLineState state)
                throws StateNotApplicableException
Applies the CompositeLineState given by state to the CompositeLine. If the given state is not applicable an exception is thrown.

Parameters:
state - the CompositeLineState instance that should be applied to the CompositeLine
Throws:
StateNotApplicableException - if the given CompositeLineState can not be applied.

addCompositeLineListener

public void addCompositeLineListener(CompositeLineListener listener)
Adds the given CompositeLineListener to the CompositeLines internal structure, such that the listener is informed about every event that occurs.

Parameters:
listener - the CompositeLineListener to add

removeCompositeLineListener

public void removeCompositeLineListener(CompositeLineListener listener)
Removes the given CompositeLineListener from the CompositeLines internal structure, such that the listener is no longer informed about occurring events.

Parameters:
listener - the CompositeLineListener to remove

addVetoableCompositeLineListener

public void addVetoableCompositeLineListener(VetoableCompositeLineListener listener)
Adds the given VetoableCompositeLineListener to the CompositeLines internal structure, such that the listener is informed about every event that occurs.

Parameters:
listener - the VetoableCompositeLineListener to add

removeVetoableCompositeLineListener

public void removeVetoableCompositeLineListener(VetoableCompositeLineListener listener)
Removes the given VetoableCompositeLineListener from the CompositeLines internal structure, such that the listener is no longer informed about occurring events.

Parameters:
listener - the VetoableCompositeLineListener to remove

deepCopy

public CompositeLine deepCopy()
Deep copies a CompositeLine. Each implementation is responsible for providing the semantics of a deep copy in this method.

Returns:
CompositeLine the deep copied instance


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