GeoAPI 1.0
Build 2004-05-18

org.opengis.go.display.primitive
Interface GraphicCompositeCurve

All Superinterfaces:
Graphic
All Known Subinterfaces:
GraphicRing

public interface GraphicCompositeCurve
extends Graphic

Defines a common abstraction for general implementations of aggregated Graphics.

The abstraction assumes that each of the Graphics are each topologically open and the ordered aggregation is piecewise continuous in the zeroith degree, i.e. piecewise, the endpoint of one Graphic is the same location as the startpoint of the next Graphic in the order.

If the endpoint of the last Graphic in the aggregation is in the same location as the startpoint of the first Graphic, then the GraphicCompositeCurve is closed, and the isClosed() method returns true. Otherwise this method returns false.

The abstraction makes no assumptions as to thread safety. If the implementations of Graphic are to be used in a multi-threaded environment, the implementation will have to address thread safety by synchronizing methods or by invoking all methods from a single thread.

Version:
$Revision: 1.4 $, $Date: 2004/05/12 00:34:45 $
Author:
OpenGIS® consortium

Method Summary
 void addAggregationListener(AggregationListener listener)
          Adds the given AggregationListener to this GraphicCompositeCurve's list of listeners.
 Graphic addSegment(Graphic segment)
          Adds the given segment to this GraphicCompositeCurve.
 void aggregationChanged(AggregationChangeEvent event)
          Calls the aggregationChanged() method of all AggregationListeners in this GraphicCompositeCurve's list of listeners.
 CompositeCurve getCompositeCurve()
          Returns the ISO 19107 CompositeCurve geometry for this Graphic
 Graphic getSegment(int index)
          Retrieves the segment Graphic at the given index.
 int getSegmentCount()
          Returns the number of segments currently assigned to this GraphicCompositeCurve.
 Graphic[] getSegments()
          Returns the segments of this GraphicCompositeCurve.
 Graphic insertSegment(int index, Graphic segment)
          Adds a segment into this composite curve, inserting it before the segment at the given index.
 boolean isClosed()
          Returns whether this composite curve is topologically closed.
 boolean isValid()
          Returns whether the GraphicCompositeCurve is continuous.
 void removeAggregationListener(AggregationListener listener)
          Removes the given AggregationListener from this GraphicCompositeCurve's list of listeners.
 Graphic removeSegment(Graphic segment)
          Removes the given segment from this GraphicCompositeCurve.
 Graphic removeSegment(int index)
          Removes the segment at the given index.
 void removeSegments()
          Removes all of the segments from this GraphicCompositeCurve.
 Graphic replaceSegment(Graphic oldSegment, Graphic newSegment)
          Replaces the oldSegment with the newSegment.
 void setCompositeCurve(CompositeCurve compositeCurve)
          Sets the geometry based on ISO 19107 CompositeCurve geometry for this Graphic.
 void setSegments(Graphic[] segments)
          Sets the segments of this GraphicCompositeCurve to the given set of Graphics.
 
Methods inherited from interface Graphic
addGraphicListener, cloneGraphic, dispose, fireGraphicEvent, getClientProperty, getGraphicStyle, getName, getParent, isPassingEventsToParent, isShowingAnchorHandles, isShowingEditHandles, putClientProperty, refresh, removeGraphicListener, setName, setParent, setPassingEventsToParent, setShowingAnchorHandles, setShowingEditHandles
 

Method Detail

setCompositeCurve

void setCompositeCurve(CompositeCurve compositeCurve)
                       throws GeometryNotSupportedException
Sets the geometry based on ISO 19107 CompositeCurve geometry for this Graphic.

Parameters:
compositeCurve - the CompositeCurve for this Graphic.
Throws:
GeometryNotSupportedException

getCompositeCurve

CompositeCurve getCompositeCurve()
Returns the ISO 19107 CompositeCurve geometry for this Graphic

Returns:
the CompositeCurve representing this GraphicCompositeCurve

isClosed

boolean isClosed()
Returns whether this composite curve is topologically closed. If the endpoint of the last Graphic in the aggregation is in the same location as the startpoint of the first Graphic, then the GraphicCompositeCurve is closed, and the isClosed() method returns true. Otherwise this method returns false.

Returns:
true if the composite curve is closed.

setSegments

void setSegments(Graphic[] segments)
Sets the segments of this GraphicCompositeCurve to the given set of Graphics. If there are already segments assigned, then those segments will be removed and their parent will be set to null.

Parameters:
segments - the new segments of the GraphicCompositeCurve.

replaceSegment

Graphic replaceSegment(Graphic oldSegment,
                       Graphic newSegment)
Replaces the oldSegment with the newSegment.

Parameters:
oldSegment - the segment to be replaced.
newSegment - the segment to be added in its place.
Returns:
the newSegment that replaced the oldSegment.

removeSegments

void removeSegments()
Removes all of the segments from this GraphicCompositeCurve.


removeSegment

Graphic removeSegment(Graphic segment)
Removes the given segment from this GraphicCompositeCurve.

Parameters:
segment - the Graphic segment to remove from the composite curve.
Returns:
the removed Graphic, or null if it is not found.

removeSegment

Graphic removeSegment(int index)
Removes the segment at the given index.

Parameters:
index -
Returns:
Returns the segment just removed.

isValid

boolean isValid()
Returns whether the GraphicCompositeCurve is continuous. If all Graphics in the aggregation are each topologically open and the ordered aggregation is piecewise continuous in degree zero, then the GraphicCompositeCurve is valid, and this method returns true. Otherwise this method returns false.

Returns:
true if the GraphicCompositeCurve is continuous.

insertSegment

Graphic insertSegment(int index,
                      Graphic segment)
Adds a segment into this composite curve, inserting it before the segment at the given index. The existing segment at the given index and all those with a larger index have their index increased by one.

Parameters:
index - Index where the new segment will be added.
segment - New segment Graphic to add.
Returns:
Returns the segment just added.

getSegments

Graphic[] getSegments()
Returns the segments of this GraphicCompositeCurve. If no segments are assigned, the method returns an empty array.

Returns:
the segment Graphics of the GraphicCompositeCurve.

getSegmentCount

int getSegmentCount()
Returns the number of segments currently assigned to this GraphicCompositeCurve.

Returns:
the number of segments currently assigned.

getSegment

Graphic getSegment(int index)
Retrieves the segment Graphic at the given index.

Parameters:
index - the index of the segment of interest.
Returns:
the segment at the index.

addSegment

Graphic addSegment(Graphic segment)
Adds the given segment to this GraphicCompositeCurve.

Parameters:
segment - Graphic segment to add to the composite curve.
Returns:
the added Graphic.

addAggregationListener

void addAggregationListener(AggregationListener listener)
Adds the given AggregationListener to this GraphicCompositeCurve's list of listeners. The listeners will be notified if this GraphicCompositeCurve adds or removes any elements.

Parameters:
listener - the AggregationListener to be added.

removeAggregationListener

void removeAggregationListener(AggregationListener listener)
Removes the given AggregationListener from this GraphicCompositeCurve's list of listeners.

Parameters:
listener - the AggregationListener to be removed.

aggregationChanged

void aggregationChanged(AggregationChangeEvent event)
Calls the aggregationChanged() method of all AggregationListeners in this GraphicCompositeCurve's list of listeners. This method is called when any elements are added, removed, or reorderd in this GraphicCompositeCurve.

Parameters:
event - the AggregationChangedEvent to give to the listeners.

GeoAPI 1.0
Build 2004-05-18

Symbols, terms and definitions
Copyright OpenGIS® Consortium