org.geotools.openoffice
Class Referencing

java.lang.Object
  extended bycom.sun.star.lib.uno.helper.WeakBase
      extended byorg.geotools.openoffice.Formulas
          extended byorg.geotools.openoffice.Referencing
All Implemented Interfaces:
com.sun.star.sheet.XAddIn, com.sun.star.uno.XInterface, com.sun.star.lang.XLocalizable, XReferencing, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XServiceName, com.sun.star.lang.XTypeProvider, com.sun.star.uno.XWeak

public final class Referencing
extends Formulas
implements XReferencing

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

Since:
2.2
Version:
$Id: Referencing.java 17661 2006-01-18 07:55:11Z desruisseaux $
Author:
Martin Desruisseaux, Richard Deplanque

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

Constructor Detail

Referencing

public Referencing()
Constructs a default implementation of interface.

Method Detail

__getServiceFactory

public static com.sun.star.lang.XSingleServiceFactory __getServiceFactory(java.lang.String implementation,
                                                                          com.sun.star.lang.XMultiServiceFactory factories,
                                                                          com.sun.star.registry.XRegistryKey registry)
Returns a factory for creating the service. This method is called by the ; 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(com.sun.star.registry.XRegistryKey registry)
Writes the service information into the given registry key. This method is called by the ; do not rename!

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

getServiceName

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

Specified by:
getServiceName in interface com.sun.star.lang.XServiceName
Specified by:
getServiceName in class Formulas

getSupportedServiceNames

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

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

supportsService

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

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

setLocale

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

Specified by:
setLocale in interface com.sun.star.lang.XLocalizable
Overrides:
setLocale in class Formulas

getValueAngle

public double getValueAngle(com.sun.star.beans.XPropertySet xOptions,
                            java.lang.String text,
                            java.lang.Object pattern)
                     throws com.sun.star.lang.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:
com.sun.star.lang.IllegalArgumentException - if is illegal.

getTextAngle

public java.lang.String getTextAngle(com.sun.star.beans.XPropertySet xOptions,
                                     double value,
                                     java.lang.Object pattern)
                              throws com.sun.star.lang.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:
com.sun.star.lang.IllegalArgumentException - if is illegal.

getTextLongitude

public java.lang.String getTextLongitude(com.sun.star.beans.XPropertySet xOptions,
                                         double value,
                                         java.lang.Object pattern)
                                  throws com.sun.star.lang.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:
com.sun.star.lang.IllegalArgumentException - if is illegal.

getTextLatitude

public java.lang.String getTextLatitude(com.sun.star.beans.XPropertySet xOptions,
                                        double value,
                                        java.lang.Object pattern)
                                 throws com.sun.star.lang.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:
com.sun.star.lang.IllegalArgumentException - if is illegal.

getDescription

public java.lang.String getDescription(com.sun.star.beans.XPropertySet xOptions,
                                       java.lang.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 java.lang.String getScope(com.sun.star.beans.XPropertySet xOptions,
                                 java.lang.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 java.lang.String getValidArea(com.sun.star.beans.XPropertySet xOptions,
                                     java.lang.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(com.sun.star.beans.XPropertySet xOptions,
                                 java.lang.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 java.lang.String getRemarks(com.sun.star.beans.XPropertySet xOptions,
                                   java.lang.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 java.lang.String getAxis(com.sun.star.beans.XPropertySet xOptions,
                                java.lang.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 java.lang.Object getParameter(com.sun.star.beans.XPropertySet xOptions,
                                     java.lang.String authorityCode,
                                     java.lang.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 java.lang.String getWKT(com.sun.star.beans.XPropertySet xOptions,
                               java.lang.String authorityCode,
                               java.lang.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 java.lang.String getTransformWKT(com.sun.star.beans.XPropertySet xOptions,
                                        java.lang.String sourceCRS,
                                        java.lang.String targetCRS,
                                        java.lang.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(com.sun.star.beans.XPropertySet xOptions,
                          java.lang.String sourceCRS,
                          java.lang.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(com.sun.star.beans.XPropertySet xOptions,
                                            double[][] coordinates,
                                            java.lang.String sourceCRS,
                                            java.lang.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(com.sun.star.beans.XPropertySet xOptions,
                                         double[][] source,
                                         double[][] target,
                                         java.lang.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(com.sun.star.beans.XPropertySet xOptions,
                                        double[][] source,
                                        double[][] displacement,
                                        java.lang.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 java.lang.Throwable
Release resources used by this implementation.

Throws:
java.lang.Throwable


Copyright © GeoTools. All Rights Reserved.