org.geotools.openoffice
Class Referencing

Object
  extended by WeakBase
      extended by Formulas
          extended by Referencing
All Implemented Interfaces:
XLocalizable, XServiceInfo, XServiceName, XTypeProvider, XAddIn, XInterface, XWeak, XReferencing

public final class Referencing
extends Formulas
implements XReferencing

Exports methods from the org.geotools.referencing package as OpenOffice add-ins.

Since:
2.2
Author:
Martin Desruisseaux, Richard Deplanque
Module:

Field Summary
 
Fields inherited from class Formulas
DAY_TO_MILLIS, methods
 
Fields inherited from class WeakBase
_mapImplementationIds, _mapTypes
 
Fields inherited from interface XAddIn
UNOTYPEINFO
 
Fields inherited from interface XServiceName
UNOTYPEINFO
 
Fields inherited from interface XServiceInfo
UNOTYPEINFO
 
Fields inherited from interface XWeak
UNOTYPEINFO
 
Fields inherited from interface XTypeProvider
UNOTYPEINFO
 
Constructor Summary
Referencing()
          Constructs a default implementation of XReferencing interface.
 
Method Summary
static XSingleServiceFactory __getServiceFactory(String implementation, XMultiServiceFactory factories, XRegistryKey registry)
          Returns a factory for creating the service.
static boolean __writeRegistryServiceInfo(XRegistryKey registry)
          Writes the service information into the given registry key.
protected  void finalize()
          Release resources used by this implementation.
 double getAccuracy(XPropertySet xOptions, String sourceCRS, String targetCRS)
          Returns the accuracy of a transformation between two coordinate reference systems.
 String getAxis(XPropertySet xOptions, String authorityCode, int dimension)
          Returns the axis name for the specified dimension in an identified object.
 double[][] getBoundingBox(XPropertySet xOptions, String authorityCode)
          Returns the valid area as a geographic bounding box for an identified object.
 String getDescription(XPropertySet xOptions, String authorityCode)
          Returns the identified object description from an authority code.
 double[][] getOrthodromicDistance(XPropertySet xOptions, double[][] source, double[][] target, Object CRS)
          Computes the orthodromic distance and azimuth between two coordinates.
 double[][] getOrthodromicForward(XPropertySet xOptions, double[][] source, double[][] displacement, Object CRS)
          Computes the coordinates after a displacement of the specified distance.
 Object getParameter(XPropertySet xOptions, String authorityCode, String parameter)
          Returns the value for a coordinate reference system parameter.
 String getRemarks(XPropertySet xOptions, String authorityCode)
          Returns the remarks for an identified object.
 String getScope(XPropertySet xOptions, String authorityCode)
          Returns the scope for an identified object.
 String getServiceName()
          The service name that can be used to create such an object by a factory.
 String[] getSupportedServiceNames()
          Provides the supported service names of the implementation, including also indirect service names.
 String getTextAngle(XPropertySet xOptions, double value, Object pattern)
          Converts an angle to text according to a given format.
 String getTextLatitude(XPropertySet xOptions, double value, Object pattern)
          Converts a latitude to text according to a given format.
 String getTextLongitude(XPropertySet xOptions, double value, Object pattern)
          Converts a longitude to text according to a given format.
 double[][] getTransformedCoordinates(XPropertySet xOptions, double[][] coordinates, String sourceCRS, String targetCRS)
          Transforms coordinates from the specified source CRS to the specified target CRS.
 String getTransformWKT(XPropertySet xOptions, String sourceCRS, String targetCRS, Object authority)
          Returns the Well Know Text (WKT) of a transformation between two coordinate reference systems.
 String getValidArea(XPropertySet xOptions, String authorityCode)
          Returns the valid area as a textual description for an identified object.
 double getValueAngle(XPropertySet xOptions, String text, Object pattern)
          Converts text in degrees-minutes-seconds to an angle in decimal degrees.
 String getWKT(XPropertySet xOptions, String authorityCode, Object authority)
          Returns the Well Know Text (WKT) for an identified object.
 void setLocale(Locale locale)
          Sets the locale to be used by this object.
 boolean supportsService(String name)
          Tests whether the specified service is supported, i.e. implemented by the implementation.
 
Methods inherited from class Formulas
getArgumentDescription, getDisplayArgumentName, getDisplayCategoryName, getDisplayFunctionName, getEpoch, getFailure, getFunctionDescription, getImplementationName, getJavaLocale, getLocale, getLocalizedMessage, getLogger, getProgrammaticCategoryName, getProgrammaticFuntionName, reportException, setTimeZone, toDate, toDouble
 
Methods inherited from class WeakBase
getImplementationId, getTypes, queryAdapter
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Referencing

public Referencing()
Constructs a default implementation of XReferencing interface.

Method Detail

__getServiceFactory

public static XSingleServiceFactory __getServiceFactory(String implementation,
                                                        XMultiServiceFactory factories,
                                                        XRegistryKey registry)
Returns a factory for creating the service. This method is called by the com.sun.star.comp.loader.JavaLoader; do not rename!

Parameters:
implementation - The name of the implementation for which a service is desired.
factories - The service manager to be used if needed.
registry - The registry key
Returns:
A factory for creating the component.

__writeRegistryServiceInfo

public static boolean __writeRegistryServiceInfo(XRegistryKey registry)
Writes the service information into the given registry key. This method is called by the com.sun.star.comp.loader.JavaLoader; do not rename!

Parameters:
registry - The registry key.
Returns:
true if the operation succeeded.

getServiceName

public String getServiceName()
The service name that can be used to create such an object by a factory.

Specified by:
getServiceName in interface XServiceName
Specified by:
getServiceName in class Formulas

getSupportedServiceNames

public String[] getSupportedServiceNames()
Provides the supported service names of the implementation, including also indirect service names.

Specified by:
getSupportedServiceNames in interface XServiceInfo
Returns:
Sequence of service names that are supported.

supportsService

public boolean supportsService(String name)
Tests whether the specified service is supported, i.e. implemented by the implementation.

Specified by:
supportsService in interface XServiceInfo
Parameters:
name - Name of service to be tested.
Returns:
true if the service is supported, false otherwise.

setLocale

public void setLocale(Locale locale)
Sets the locale to be used by this object.

Specified by:
setLocale in interface XLocalizable
Overrides:
setLocale in class Formulas

getValueAngle

public double getValueAngle(XPropertySet xOptions,
                            String text,
                            Object pattern)
                     throws IllegalArgumentException
Converts text in degrees-minutes-seconds to an angle in decimal degrees.

Specified by:
getValueAngle in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
text - The text to be converted to an angle.
pattern - The text that describes the format (example: "D°MM.m'").
Throws:
IllegalArgumentException - if pattern is illegal.

getTextAngle

public String getTextAngle(XPropertySet xOptions,
                           double value,
                           Object pattern)
                    throws IllegalArgumentException
Converts an angle to text according to a given format.

Specified by:
getTextAngle in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
value - The angle value (in decimal degrees) to be converted.
pattern - The text that describes the format (example: "D°MM.m'").
Throws:
IllegalArgumentException - if pattern is illegal.

getTextLongitude

public String getTextLongitude(XPropertySet xOptions,
                               double value,
                               Object pattern)
                        throws IllegalArgumentException
Converts a longitude to text according to a given format.

Specified by:
getTextLongitude in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
value - The longitude value (in decimal degrees) to be converted.
pattern - The text that describes the format (example: "D°MM.m'").
Throws:
IllegalArgumentException - if pattern is illegal.

getTextLatitude

public String getTextLatitude(XPropertySet xOptions,
                              double value,
                              Object pattern)
                       throws IllegalArgumentException
Converts a latitude to text according to a given format.

Specified by:
getTextLatitude in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
value - The latitude value (in decimal degrees) to be converted.
pattern - The text that describes the format (example: "D°MM.m'").
Throws:
IllegalArgumentException - if pattern is illegal.

getDescription

public String getDescription(XPropertySet xOptions,
                             String authorityCode)
Returns the identified object description from an authority code.

Specified by:
getDescription in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
authorityCode - The code allocated by the authority.

getScope

public String getScope(XPropertySet xOptions,
                       String authorityCode)
Returns the scope for an identified object.

Specified by:
getScope in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
authorityCode - The code allocated by the authority.

getValidArea

public String getValidArea(XPropertySet xOptions,
                           String authorityCode)
Returns the valid area as a textual description for an identified object.

Specified by:
getValidArea in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
authorityCode - The code allocated by the authority.

getBoundingBox

public double[][] getBoundingBox(XPropertySet xOptions,
                                 String authorityCode)
Returns the valid area as a geographic bounding box for an identified object. This method returns a 2×2 matrix. The first row contains the latitude and longitude of upper left corder, and the second row contains the latitude and longitude or bottom right corner. Units are degrees.

Specified by:
getBoundingBox in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
authorityCode - The code allocated by the authority.

getRemarks

public String getRemarks(XPropertySet xOptions,
                         String authorityCode)
Returns the remarks for an identified object.

Specified by:
getRemarks in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
authorityCode - The code allocated by the authority.

getAxis

public String getAxis(XPropertySet xOptions,
                      String authorityCode,
                      int dimension)
Returns the axis name for the specified dimension in an identified object.

Specified by:
getAxis in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
authorityCode - The code allocated by the authority.
dimension - The dimension (1, 2, ...).

getParameter

public Object getParameter(XPropertySet xOptions,
                           String authorityCode,
                           String parameter)
Returns the value for a coordinate reference system parameter.

Specified by:
getParameter in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
authorityCode - The code allocated by the authority.
parameter - The parameter name (e.g. "False easting").

getWKT

public String getWKT(XPropertySet xOptions,
                     String authorityCode,
                     Object authority)
Returns the Well Know Text (WKT) for an identified object.

Specified by:
getWKT in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
authorityCode - The code allocated by the authority.
authority - The authority name for choice of parameter names. Usually "OGC".

getTransformWKT

public String getTransformWKT(XPropertySet xOptions,
                              String sourceCRS,
                              String targetCRS,
                              Object authority)
Returns the Well Know Text (WKT) of a transformation between two coordinate reference systems.

Specified by:
getTransformWKT in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
sourceCRS - The authority code for the source coordinate reference system.
targetCRS - The authority code for the target coordinate reference system.
authority - The authority name for choice of parameter names. Usually "OGC".

getAccuracy

public double getAccuracy(XPropertySet xOptions,
                          String sourceCRS,
                          String targetCRS)
Returns the accuracy of a transformation between two coordinate reference systems.

Specified by:
getAccuracy in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
sourceCRS - The authority code for the source coordinate reference system.
targetCRS - The authority code for the target coordinate reference system.

getTransformedCoordinates

public double[][] getTransformedCoordinates(XPropertySet xOptions,
                                            double[][] coordinates,
                                            String sourceCRS,
                                            String targetCRS)
Transforms coordinates from the specified source CRS to the specified target CRS.

Specified by:
getTransformedCoordinates in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
coordinates - The coordinates to transform.
sourceCRS - The authority code for the source coordinate reference system.
targetCRS - The authority code for the target coordinate reference system.

getOrthodromicDistance

public double[][] getOrthodromicDistance(XPropertySet xOptions,
                                         double[][] source,
                                         double[][] target,
                                         Object CRS)
Computes the orthodromic distance and azimuth between two coordinates.

Specified by:
getOrthodromicDistance in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
source - The source positions.
target - The target positions.
CRS - Authority code of the coordinate reference system.

getOrthodromicForward

public double[][] getOrthodromicForward(XPropertySet xOptions,
                                        double[][] source,
                                        double[][] displacement,
                                        Object CRS)
Computes the coordinates after a displacement of the specified distance.

Specified by:
getOrthodromicForward in interface XReferencing
Parameters:
xOptions - Provided by OpenOffice.
source - The source positions.
displacement - The distance and azimuth.
CRS - Authority code of the coordinate reference system.

finalize

protected void finalize()
                 throws Throwable
Release resources used by this implementation.

Overrides:
finalize in class WeakBase
Throws:
Throwable


Copyright © 1996-2009 Geotools. All Rights Reserved.