|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.composite.coordinate.CoordinateSystemUtilities
This class provides some general functionalities needed to work with
CoordinateSystems.
| Field Summary | |
static java.lang.String |
COORDINATESYSTEM
String constant for the CoordinateSystem. |
static java.lang.String |
DELIM
Delimiter which splits the values in method getDoubles. |
static int |
MAXIMUM_X
constant that tells about the index of a coordiante system value within an array |
static int |
MAXIMUM_Y
constant that tells about the index of a coordiante system value within an array |
static int |
MINIMUM_X
constant that tells about the index of a coordiante system value within an array |
static int |
MINIMUM_Y
constant that tells about the index of a coordiante system value within an array |
static java.lang.String |
SCALEX
String constant for the ScaleX field. |
static java.lang.String |
SCALEY
String constant for the ScaleY field. |
| Method Summary | |
static double[] |
convertCoordinateSystemValues(CoordinateSystem sourceSystem,
CoordinateSystem targetSystem,
double[] values)
Converts the values given by values from a source coordinate
system given by sourceSystem to a target coordinate system
given by targetSystem. |
static double[] |
convertCoordinateSystemValues(double sourceSystemMinX,
double sourceSystemMaxX,
double sourceSystemMinY,
double sourceSystemMaxY,
double targetSystemMinX,
double targetSystemMaxX,
double targetSystemMinY,
double targetSystemMaxY,
double[] values)
Converts the values given by values from a source coordinate
system given by sourceSystem to a target coordinate system
given by targetSystem. |
static MutableCoordinateSystem |
convertToMutableCoordinateSystem(CoordinateSystem coordSystem)
Returns an equivalent mutable version of the given immutable CoordinateSystem. |
static CoordinateSystem |
copy(CoordinateSystem coordSystem)
Returns a copy of the CoordinateSystem instance given by
coordSystem. |
static CoordinateSystem |
createCoordinateSystem(AttributeList list,
java.lang.String name)
Method createCoordinateSystem creates a CoordinateSystem from the given list of double values. |
static CoordinateSystem |
createCoordinateSystem(int xMin,
int xMax,
int yMin,
int yMax)
Creates a CoordinateSystem with the given
minimum and maximum vlues. |
static java.lang.String |
getCanonicalDescription(AttributeList list)
Method createCoordinateSystem creates a canonical description from the given list of double values. |
static java.lang.String |
getCanonicalDescription(AttributeList list,
java.lang.String name)
Method createCoordinateSystem creates a canonical description from the given list of double values. |
static java.lang.String |
getCanonicalDescription(java.lang.String scaleX,
java.lang.String scaleY)
Returns the canonical description of a CoordinateSystem. |
static double[] |
getDoubles(java.lang.String values)
Method getDoubles extracts all the double values from a given string and returns it as array of doubles. |
static Attribute |
toAttribute(CoordinateSystem coordSystem)
Returns an Attribute representing the given
CoordinateSystem. |
static Attribute |
toAttribute(CoordinateSystem coordSystem,
java.lang.String name)
Method toAttribute converts an instance of CoordinateSystem
to an Attribute.
|
static java.lang.String |
toString(double[] arr)
Converts an array of doubles to a comma separated list of string representable's. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int MINIMUM_X
public static final int MAXIMUM_X
public static final int MINIMUM_Y
public static final int MAXIMUM_Y
public static final java.lang.String SCALEX
public static final java.lang.String SCALEY
public static final java.lang.String COORDINATESYSTEM
public static final java.lang.String DELIM
getDoubles.
| Method Detail |
public static final CoordinateSystem copy(CoordinateSystem coordSystem)
CoordinateSystem instance given by
coordSystem.
coordSystem - the CoordinateSystem instance to copy
CoordinateSystempublic static final MutableCoordinateSystem convertToMutableCoordinateSystem(CoordinateSystem coordSystem)
CoordinateSystem.
coordSystem - the CoordinateSystem to convert to a
mutable version.
CoordinateSystem.
public static final double[] convertCoordinateSystemValues(CoordinateSystem sourceSystem,
CoordinateSystem targetSystem,
double[] values)
values from a source coordinate
system given by sourceSystem to a target coordinate system
given by targetSystem. The indices of the values in the
array are defined by MINIMUM_X, MAXIMUM_X,
MINIMUM_Y and MAXIMUM_Y.
sourceSystem - the source coordinate systemtargetSystem - the target coordinate systemvalues - the values to convert
public static final double[] convertCoordinateSystemValues(double sourceSystemMinX,
double sourceSystemMaxX,
double sourceSystemMinY,
double sourceSystemMaxY,
double targetSystemMinX,
double targetSystemMaxX,
double targetSystemMinY,
double targetSystemMaxY,
double[] values)
values from a source coordinate
system given by sourceSystem to a target coordinate system
given by targetSystem. The indices of the values in the
array are defined by MINIMUM_X, MAXIMUM_X,
MINIMUM_Y and MAXIMUM_Y.
sourceSystemMinX - the minimum x value of the source coordinate systemsourceSystemMaxX - the maximum x value of the source coordinate systemsourceSystemMinY - the minimum y value of the source coordinate systemsourceSystemMaxY - the maximum y value of the source coordinate systemtargetSystemMinX - the minimum x value of the target coordinate systemtargetSystemMaxX - the maximum x value of the target coordinate systemtargetSystemMinY - the minimum y value of the target coordinate systemtargetSystemMaxY - the maximum y value of the target coordinate systemvalues - the values to convert
public static final java.lang.String getCanonicalDescription(java.lang.String scaleX,
java.lang.String scaleY)
CoordinateSystem.
scaleX - the canonical description of the Scale for
the x axisscaleY - the canonical description of a Scale for
the y axis
CoordinateSystem
public static final Attribute toAttribute(CoordinateSystem coordSystem,
java.lang.String name)
throws IllegalAttributeException,
ConstraintViolationException,
IllegalValueException,
IllegalNameException
CoordinateSystem
to an Attribute.
Attribute(COORDINATESYSTEM, elements)
AttributeList(elements)
Attribute(ScaleX, "scaleMinimumX, scaleMaximumX")
Attribute(ScaleY, "scaleMinimumY, scaleMaximumY")
coordSystem - the instance to convert to an attribute.name - a name for the returned Attribute.
CoordinateSystem as an Attribute.
IllegalAttributeException
ConstraintViolationException
IllegalValueException
IllegalNameException
public static final Attribute toAttribute(CoordinateSystem coordSystem)
throws IllegalAttributeException,
ConstraintViolationException,
IllegalValueException,
IllegalNameException
Attribute representing the given
CoordinateSystem. The String defined in the
constant COORDINATESYSTEM will be used as the name of this
Attribute.
coordSystem - the CoordinateSystem to convert to an
Attribute.
Attribute representing the given
CoordinateSystem.
IllegalAttributeException
ConstraintViolationException
IllegalValueException
IllegalNameException
public static final CoordinateSystem createCoordinateSystem(AttributeList list,
java.lang.String name)
throws BuildException
list - AttributeList with the 4 necessary attributes.name - the name of the Attribute holding the
coordinate-information.
CoordinateSystem
BuildException
public static final java.lang.String getCanonicalDescription(AttributeList list,
java.lang.String name)
throws BuildException
list - AttributeList containing the list with the 4 necessary attributes.name - the name of the Attribute holding the list
BuildException
public static final java.lang.String getCanonicalDescription(AttributeList list)
throws BuildException
list - AttributeList with the 4 necessary attributes.
coordinate-information.
BuildException
public static CoordinateSystem createCoordinateSystem(int xMin,
int xMax,
int yMin,
int yMax)
throws CoordinateSystemParseException
CoordinateSystem with the given
minimum and maximum vlues.
xMin - minimum x-coordinate.xMax - maximum x-coordinate.yMin - minimum y-coordinate.yMax - maximum y-coordinate.
CoordinateSystem.
CoordinateSystemParseExceptionpublic static final java.lang.String toString(double[] arr)
arr - the array of doubles
public static final double[] getDoubles(java.lang.String values)
values - a String containing one or more double values separated
by a comma.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||