Package com.luciad.shape.shape2D
Class TLcdXYArcBand
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.shape2D.ALcd2DEditableShape
com.luciad.shape.shape2D.TLcdXYArcBand
- All Implemented Interfaces:
ILcdArcBand,ILcdBounded,ILcdShape,ILcd2DEditableArcBand,ILcd2DEditableShape,ILcdCache,ILcdCloneable,Serializable,Cloneable
This class provides an implementation of
ILcd2DEditableArcBand in
the cartesian space.
It implements ILcdCache, thus providing a cache
to store expensive calculations, e.g. for painters,
to store model-world transformations. The cache is cleared whenever the shape is modified.
This class is thread-safe for concurrent read-only access of its contents. For read-write access, external locking must be used. Such locking is typically done at the model level.
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.shape.ILcdArcBand
MAX_RADIUS_END_CORNER, MAX_RADIUS_START_CORNER, MIN_RADIUS_END_CORNER, MIN_RADIUS_START_CORNER -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newTLcdXYArcBandwith all coordinates and angles set to 0.TLcdXYArcBand(double aCenterX, double aCenterY, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdXYArcBandwith the given parameters.TLcdXYArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdXYArcBandwith the given parameters.TLcdXYArcBand(ILcd2DEditableArcBand a2DEditableArcBand) Constructs a newTLcdXYArcBandthat is a deep copy of the givenILcd2DEditableArcBand. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the cache.clone()Creates and returns a copy of this object.booleancontains2D(double aX, double aY) Checks whether thisILcdShapecontains the given point in the 2D space.voidcorner2DEditablePointSFCT(int aCorner, ILcd2DEditablePoint a2DEditablePointSFCT) Computes the position of the specified corner of thisILcdArcBand.booleanReturns whether the given object has the same class and the same coordinates and parameters.final doubleReturns the angle over which the arc extends (in degrees).Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.getCachedObject(Object aKey) Looks up and returns the cached Object corresponding to the given key.Returns the center point of thisILcdArcBand.Returns the focus point of thisILcdShape.final doubleReturns the maximum radius of thisILcdArcBand.final doubleReturns the minimum radius of thisILcdArcBand.final doubleReturns the start angle of the arc (in degrees).inthashCode()The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method.voidinsertIntoCache(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.voidmoveCornerPoint2D(int aCorner, double aX, double aY) Moves the specified corner point to a new location.removeCachedObject(Object aKey) Looks up and removes the cached Object corresponding to the given key.voidsetArcAngle(double aArcAngle) Sets the angle over which thisILcd2DEditableArcBandextends (in degrees).voidsetMaxRadius(double aMaxRadius) Sets the radius of the outer arc of the arc band.voidsetMinRadius(double aMinRadius) Sets the radius of the inner arc of the arc band.voidsetStartAngle(double aStartAngle) Sets the start angle of thisILcd2DEditableArcBand(in degrees).toString()voidtranslate2D(double aX, double aY) Translates thisILcd2DEditableShapefrom its current position over the given translation vector in the 2D space.Methods inherited from class com.luciad.shape.shape2D.ALcd2DEditableShape
contains3D, move2D, move2DMethods inherited from class com.luciad.shape.ALcdShape
contains2D, contains3D, fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableShape
move2D, move2DMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D, contains3D
-
Constructor Details
-
TLcdXYArcBand
public TLcdXYArcBand()Constructs a newTLcdXYArcBandwith all coordinates and angles set to 0. -
TLcdXYArcBand
Constructs a newTLcdXYArcBandthat is a deep copy of the givenILcd2DEditableArcBand.- Parameters:
a2DEditableArcBand- theILcd2DEditableArcBandto copy.
-
TLcdXYArcBand
public TLcdXYArcBand(ILcdPoint aCenter, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdXYArcBandwith the given parameters.- Parameters:
aCenter- the center point.aMinRadius- the minimum radius.aMaxRadius- the maximum radius.aStartAngle- the start angle.aArcAngle- the arc angle.- Throws:
IllegalArgumentException- if the minimum or maximum radius passed is less than 0.
-
TLcdXYArcBand
public TLcdXYArcBand(double aCenterX, double aCenterY, double aMinRadius, double aMaxRadius, double aStartAngle, double aArcAngle) Constructs a newTLcdXYArcBandwith the given parameters.- Parameters:
aCenterX- the longitude of the center point.aCenterY- the latitude of the center point.aMinRadius- the minimum radius.aMaxRadius- the maximum radius.aStartAngle- the start angle.aArcAngle- the arc angle.- Throws:
IllegalArgumentException- if the minimum or maximum radius passed is less than 0.
-
-
Method Details
-
getCenter
Description copied from interface:ILcdArcBandReturns the center point of thisILcdArcBand.- Specified by:
getCenterin interfaceILcdArcBand- Returns:
- the center point of this
ILcdArcBand.
-
setMinRadius
public void setMinRadius(double aMinRadius) Sets the radius of the inner arc of the arc band.- Specified by:
setMinRadiusin interfaceILcd2DEditableArcBand- Parameters:
aMinRadius- the radius of the inner arc of the arc band. This value should not be less than 0.- Throws:
IllegalArgumentException- if the radius passed is less than 0.
-
getMinRadius
public final double getMinRadius()Description copied from interface:ILcdArcBandReturns the minimum radius of thisILcdArcBand.- Specified by:
getMinRadiusin interfaceILcdArcBand- Returns:
- the minimum radius of this
ILcdArcBand.
-
setMaxRadius
public void setMaxRadius(double aMaxRadius) Sets the radius of the outer arc of the arc band.- Specified by:
setMaxRadiusin interfaceILcd2DEditableArcBand- Parameters:
aMaxRadius- the radius of the outer arc of the arc band. This value should not be less than 0.- Throws:
IllegalArgumentException- if the radius passed is less than 0.
-
getMaxRadius
public final double getMaxRadius()Description copied from interface:ILcdArcBandReturns the maximum radius of thisILcdArcBand.- Specified by:
getMaxRadiusin interfaceILcdArcBand- Returns:
- the maximum radius of this
ILcdArcBand.
-
getStartAngle
public final double getStartAngle()Description copied from interface:ILcdArcBandReturns the start angle of the arc (in degrees). The angle is measured from 3 o'clock position, positive counter-clockwise.- Specified by:
getStartAnglein interfaceILcdArcBand- Returns:
- the start angle of the arc (in degrees). The angle is measured from 3 o'clock position, positive counter-clockwise.
-
setStartAngle
public void setStartAngle(double aStartAngle) Description copied from interface:ILcd2DEditableArcBandSets the start angle of thisILcd2DEditableArcBand(in degrees). The angle is measured from 3 o'clock position, positive counter-clockwise.- Specified by:
setStartAnglein interfaceILcd2DEditableArcBand- Parameters:
aStartAngle- the new start angle.
-
getArcAngle
public final double getArcAngle()Description copied from interface:ILcdArcBandReturns the angle over which the arc extends (in degrees). The angle is positive counter-clockwise.- Specified by:
getArcAnglein interfaceILcdArcBand- Returns:
- the angle over which the arc extends (in degrees). The angle is positive counter-clockwise.
-
setArcAngle
public void setArcAngle(double aArcAngle) Description copied from interface:ILcd2DEditableArcBandSets the angle over which thisILcd2DEditableArcBandextends (in degrees). The angle is positive counter-clockwise.- Specified by:
setArcAnglein interfaceILcd2DEditableArcBand- Parameters:
aArcAngle- the new arc angle.
-
corner2DEditablePointSFCT
Description copied from interface:ILcdArcBandComputes the position of the specified corner of thisILcdArcBand.- Specified by:
corner2DEditablePointSFCTin interfaceILcdArcBand- Parameters:
aCorner- the corner:ILcdArcBand.MIN_RADIUS_START_CORNER,ILcdArcBand.MAX_RADIUS_START_CORNER,ILcdArcBand.MIN_RADIUS_END_CORNER, orILcdArcBand.MAX_RADIUS_END_CORNER.a2DEditablePointSFCT- anILcd2DEditablePointinto which the result is written as a side-effect.
-
moveCornerPoint2D
public void moveCornerPoint2D(int aCorner, double aX, double aY) Description copied from interface:ILcd2DEditableArcBandMoves the specified corner point to a new location. The shape of the arc band changes accordingly.- Specified by:
moveCornerPoint2Din interfaceILcd2DEditableArcBand- Parameters:
aCorner- a constant indicating which corner is to be moved:ILcdArcBand.MIN_RADIUS_START_CORNER,ILcdArcBand.MAX_RADIUS_START_CORNER,ILcdArcBand.MIN_RADIUS_END_CORNER, orILcdArcBand.MAX_RADIUS_END_CORNER.aX- the new x coordinate of the point.aY- the new y coordinate of the point.
-
getFocusPoint
Description copied from interface:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the focus point of this
ILcdShape.
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
contains2D
public boolean contains2D(double aX, double aY) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 2D space. Only the first two dimensions of theILcdShapeare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
translate2D
public void translate2D(double aX, double aY) Description copied from interface:ILcd2DEditableShapeTranslates thisILcd2DEditableShapefrom its current position over the given translation vector in the 2D space. Only the first two dimensions of theILcdShapeare considered. The third dimension is left unchanged.- Specified by:
translate2Din interfaceILcd2DEditableShape- Parameters:
aX- the x coordinate of the translation vector.aY- the y coordinate of the translation vector.
-
insertIntoCache
Description copied from interface:ILcdCacheInserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCachein interfaceILcdCache- Parameters:
aKey- the key Object that will be used to identify the Object. The key must therefore be a unique identifier, typically the caller itself:insertIntoCache(this, ...).aObject- the Object to be cached.
-
getCachedObject
Description copied from interface:ILcdCacheLooks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObjectin interfaceILcdCache- Parameters:
aKey- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there is no Object corresponding to the given key.
-
removeCachedObject
Description copied from interface:ILcdCacheLooks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObjectin interfaceILcdCache- Parameters:
aKey- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there was no Object corresponding to the given key.
-
clearCache
public void clearCache()Description copied from interface:ILcdCacheClears the cache.- Specified by:
clearCachein interfaceILcdCache
-
clone
Creates and returns a copy of this object. The contained center point is cloned. The cache is not copied or cloned at all.- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classALcdShape- See Also:
-
equals
Returns whether the given object has the same class and the same coordinates and parameters. -
hashCode
public int hashCode()Description copied from class:ALcdShapeThe hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method. Extensions should refine this implementation, based on their properties. -
toString
-