Class ReferencingFunctions

Object
WeakBase
CalcAddins
ReferencingFunctions
All Implemented Interfaces:
XLocalizable, XService­Info, XService­Name, XType­Provider, XInterface, XWeak, XReferencing

public class ReferencingFunctions extends CalcAddins implements XReferencing
Implements the XReferencing methods to make available to Apache OpenOffice.
Since:
0.8
  • Field Summary

    Fields inherited from class CalcAddins

    context
    Modifier and Type
    Field
    Description
    protected final XComponent­Context
    Indirectly provides access to the service manager.

    Fields inherited from class com.sun.star.lib.uno.helper.WeakBase

    _map­Types

    Fields inherited from interface com.sun.star.lang.XLocalizable

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.lang.XServiceInfo

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.lang.XServiceName

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.lang.XTypeProvider

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.uno.XWeak

    UNOTYPEINFO
  • Constructor Summary

    Constructors
    Constructor
    Description
    Referencing­Functions(XComponent­Context context)
    Constructs an implementation of XReferencing interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    String[][]
    format­Angle(double[][] value, Object pattern, Object locale)
    Converts an angle to text according to a given format.
    double
    get­Accuracy(String source­CRS, String target­CRS, Object area­Of­Interest)
    Returns the accuracy of a transformation between two coordinate reference systems.
    get­Axis(String code­Or­Path, int dimension)
    Returns the axis name and units for the specified dimension in a coordinate reference system or coordinate system.
    Returns the domain of validity from an authority code.
    double[][]
    get­Geographic­Area(String code­Or­Path)
    Returns the domain of validity as a geographic bounding box for an identified object.
    Provides the implementation name of the service.
    get­Name(String code­Or­Path)
    Returns the identified object name from an authority code.
    get­Scope(String code­Or­Path)
    Returns the identified object scope from an authority code.
    The service name that can be used to create such an object by a factory.
    double[][]
    parse­Angle(String[][] text, Object pattern, Object locale)
    Converts text in degrees-minutes-seconds to an angle in decimal degrees.
    double[][]
    transform­Envelope(String source­CRS, String target­CRS, double[][] envelope)
    Transforms an envelope from the specified source CRS to the specified target CRS.
    double[][]
    transform­Points(String source­CRS, String target­CRS, double[][] points)
    Transforms coordinates from the specified source CRS to the specified target CRS.

    Methods inherited from class CalcAddins

    get­Java­Locale, get­Locale, get­Localized­Message, get­Logger, get­Supported­Service­Names, set­Locale, supports­Service
    Modifier and Type
    Method
    Description
    protected final Locale
    Returns the locale as an object from the Java standard SDK.
    final Locale
    Returns the current locale used by this instance.
    protected final String
    Returns the localized message from the specified exception.
    protected final Logger
    Returns the logger to use for logging warnings.
    final String[]
    Provides the supported service names of the implementation, including also indirect service names.
    final void
    set­Locale(Locale locale)
    Sets the locale to be used by this object.
    final boolean
    Tests whether the specified service is supported, i.e. implemented by the implementation.

    Methods inherited from class com.sun.star.lib.uno.helper.WeakBase

    finalize, get­Implementation­Id, get­Types, query­Adapter
  • Constructor Details

    • ReferencingFunctions

      public ReferencingFunctions(XComponentContext context)
      Constructs an implementation of XReferencing interface.
      Parameters:
      context - the value to assign to the Calc­Addins​.context field.
  • Method Details

    • getServiceName

      public String getServiceName()
      The service name that can be used to create such an object by a factory.
      Specified by:
      get­Service­Name in interface XService­Name
      Specified by:
      get­Service­Name in class Calc­Addins
      Returns:
      unique name of the service.
    • getImplementationName

      public String getImplementationName()
      Provides the implementation name of the service.
      Specified by:
      get­Implementation­Name in interface XService­Info
      Returns:
      unique name of the implementation.
    • getName

      public String getName(String codeOrPath)
      Returns the identified object name from an authority code.
      Specified by:
      get­Name in interface XReferencing
      Parameters:
      code­Or­Path - the code allocated by an authority, or the path to a file.
      Returns:
      the object name.
    • getScope

      public String getScope(String codeOrPath)
      Returns the identified object scope from an authority code.
      Specified by:
      get­Scope in interface XReferencing
      Parameters:
      code­Or­Path - the code allocated by an authority, or the path to a file.
      Returns:
      the object scope.
    • getDomainOfValidity

      public String getDomainOfValidity(String codeOrPath)
      Returns the domain of validity from an authority code.
      Specified by:
      get­Domain­Of­Validity in interface XReferencing
      Parameters:
      code­Or­Path - the code allocated by an authority, or the path to a file.
      Returns:
      the domain of validity.
    • getGeographicArea

      public double[][] getGeographicArea(String codeOrPath)
      Returns the domain of validity 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 corner, and the second row contains the latitude and longitude of bottom right corner. Units are degrees.
      Specified by:
      get­Geographic­Area in interface XReferencing
      Parameters:
      code­Or­Path - the code allocated by an authority, or the path to a file.
      Returns:
      the object bounding box.
    • getAxis

      public String getAxis(String codeOrPath, int dimension)
      Returns the axis name and units for the specified dimension in a coordinate reference system or coordinate system. This method returns a short axis name as used in Well Known Text (WKT) format, for example Latitude instead of Geodetic latitude.
      Specified by:
      get­Axis in interface XReferencing
      Parameters:
      code­Or­Path - the code allocated by an authority, or the path to a file.
      dimension - the dimension (1, 2, …).
      Returns:
      the name of the requested axis.
    • getAccuracy

      public double getAccuracy(String sourceCRS, String targetCRS, Object areaOfInterest) throws IllegalArgumentException
      Returns the accuracy of a transformation between two coordinate reference systems.
      Specified by:
      get­Accuracy in interface XReferencing
      Parameters:
      source­CRS - the authority code for the source coordinate reference system.
      target­CRS - the authority code for the target coordinate reference system.
      area­Of­Interest - an optional bounding box of source coordinates to transform.
      Returns:
      the operation accuracy.
      Throws:
      Illegal­Argument­Exception - if points is not a double[][] value or void.
    • transformPoints

      public double[][] transformPoints(String sourceCRS, String targetCRS, double[][] points)
      Transforms coordinates from the specified source CRS to the specified target CRS.
      Specified by:
      transform­Points in interface XReferencing
      Parameters:
      source­CRS - the authority code for the source coordinate reference system.
      target­CRS - the authority code for the target coordinate reference system.
      points - the coordinates to transform.
      Returns:
      the transformed coordinates.
    • transformEnvelope

      public double[][] transformEnvelope(String sourceCRS, String targetCRS, double[][] envelope)
      Transforms an envelope from the specified source CRS to the specified target CRS.
      Specified by:
      transform­Envelope in interface XReferencing
      Parameters:
      source­CRS - the authority code for the source coordinate reference system.
      target­CRS - the authority code for the target coordinate reference system.
      envelope - points inside the envelope to transform.
      Returns:
      the transformed envelope.
    • parseAngle

      public double[][] parseAngle(String[][] text, Object pattern, Object locale) throws IllegalArgumentException
      Converts text in degrees-minutes-seconds to an angle in decimal degrees. See Angle­Format for pattern description.
      Specified by:
      parse­Angle in interface XReferencing
      Parameters:
      text - the text to be converted to an angle.
      pattern - an optional text that describes the format (example: "D°MM.m'").
      locale - the convention to use (e.g. decimal separator symbol).
      Returns:
      the angle parsed as a number.
      Throws:
      Illegal­Argument­Exception - if pattern is not a string value or void.
    • formatAngle

      public String[][] formatAngle(double[][] value, Object pattern, Object locale) throws IllegalArgumentException
      Converts an angle to text according to a given format. This method uses the pattern described by Angle­Format with the following extension:
      • If the pattern ends with E or W, then the angle is formatted as a longitude.
      • If the pattern ends with N or S, then the angle is formatted as a latitude.
      Specified by:
      format­Angle in interface XReferencing
      Parameters:
      value - the angle value (in decimal degrees) to be converted.
      pattern - an optional text that describes the format (example: "D°MM.m'").
      locale - the convention to use (e.g. decimal separator symbol).
      Returns:
      the angle formatted as a string.
      Throws:
      Illegal­Argument­Exception - if pattern is not a string value or void.