Class MappingToolkit


  • public class MappingToolkit
    extends java.lang.Object
    MappingToolkit provides access to standard features of the mapping package by name. It is particularly useful in a GUI environment where the user needs to be able to select from lists of CoordinateSystems, Datums and Ellipsoids
    • Constructor Summary

      Constructors 
      Constructor Description
      MappingToolkit()
      Construct a new MappingToolkit
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(CoordinateSystem c, java.lang.String example)
      Add a CoordinateSystem type to the toolkit
      Datum defaultDatum​(java.lang.String classname)
      Provide the default Datum for the specified CoordinateSystem
      Ellipsoid defaultEllipsoid​(java.lang.String classname)
      Provide the default Ellipsoid for the named CoordinateSystem class
      java.util.Vector<java.lang.String> getCoordinateSystemNames()
      Create an alphabetically ordered list of CoordinateSystem names
      Datum getDatum​(java.lang.String name)
      Get an instance of a specific Datum
      java.util.Vector<Datum> getDatumList()
      get a list of available Datum instances
      Ellipsoid getEllipsoid​(java.lang.String name)
      Get an instance of a specific Ellipsoid
      java.util.Vector<Ellipsoid> getEllipsoidList()
      Get a list of available Ellipsoid instances
      java.lang.String getExample​(java.lang.String classname)
      Get an example of a grid reference for a specified CoordinateSystem
      java.util.Vector<java.lang.String> getProjectionNames()
      Create an alphabetically-ordered list of Projections.
      CoordinateSystem makeCoordinateSystem​(java.lang.String name, java.lang.Object... args)
      Make a CoordinateSystem instance from a grid reference
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MappingToolkit

        public MappingToolkit()
        Construct a new MappingToolkit
    • Method Detail

      • defaultEllipsoid

        public Ellipsoid defaultEllipsoid​(java.lang.String classname)
                                   throws java.lang.IllegalArgumentException
        Provide the default Ellipsoid for the named CoordinateSystem class
        Parameters:
        classname - The name of the CoordinateSystem
        Returns:
        the defaultEllipsoid() for the class
        Throws:
        java.lang.IllegalArgumentException - if the CoordinateSystem cannot be found
      • defaultDatum

        public Datum defaultDatum​(java.lang.String classname)
                           throws java.lang.IllegalArgumentException
        Provide the default Datum for the specified CoordinateSystem
        Parameters:
        classname - A String containing the name of a CoordinateSystem
        Returns:
        the defaultDatum()
        Throws:
        java.lang.IllegalArgumentException - if the CoordinateSystem cannot be found.
      • makeCoordinateSystem

        public CoordinateSystem makeCoordinateSystem​(java.lang.String name,
                                                     java.lang.Object... args)
                                              throws java.lang.NoSuchMethodException,
                                                     GridFormatException,
                                                     java.lang.IllegalAccessException,
                                                     java.lang.IllegalArgumentException,
                                                     java.lang.reflect.InvocationTargetException,
                                                     java.lang.InstantiationException
        Make a CoordinateSystem instance from a grid reference
        Parameters:
        name - - the name of the CoordinateSystem to make
        args - - the argument list for the class's makePoint() method
        Returns:
        A new CoordinateSystem instanceof the specified type
        Throws:
        java.lang.NoSuchMethodException
        GridFormatException
        java.lang.IllegalAccessException
        java.lang.IllegalArgumentException
        java.lang.reflect.InvocationTargetException
        java.lang.InstantiationException
      • getCoordinateSystemNames

        public java.util.Vector<java.lang.String> getCoordinateSystemNames()
        Create an alphabetically ordered list of CoordinateSystem names
        Returns:
        The list of names
      • getProjectionNames

        public java.util.Vector<java.lang.String> getProjectionNames()
        Create an alphabetically-ordered list of Projections. Since Projection is a sub-class of CoordinateSystem this list will be a subset of that provided by getCoordinateSystemNames()
        Returns:
        the list of names
      • getDatumList

        public java.util.Vector<Datum> getDatumList()
        get a list of available Datum instances
        Returns:
        the list
      • getDatum

        public Datum getDatum​(java.lang.String name)
        Get an instance of a specific Datum
        Parameters:
        name - - the name of the Datum
        Returns:
        the requested Datum instance
      • getEllipsoid

        public Ellipsoid getEllipsoid​(java.lang.String name)
        Get an instance of a specific Ellipsoid
        Parameters:
        name - - the name of the Ellipsoid
        Returns:
        the requested Datum instance
      • getExample

        public java.lang.String getExample​(java.lang.String classname)
                                    throws java.lang.IllegalArgumentException
        Get an example of a grid reference for a specified CoordinateSystem
        Parameters:
        classname - - the name of the CoordinateSystem
        Returns:
        a valid grid reference String
        Throws:
        java.lang.IllegalArgumentException - if the CoordinateSystem name cannot be found
      • getEllipsoidList

        public java.util.Vector<Ellipsoid> getEllipsoidList()
        Get a list of available Ellipsoid instances
        Returns:
        the list
      • add

        public void add​(CoordinateSystem c,
                        java.lang.String example)
        Add a CoordinateSystem type to the toolkit
        Parameters:
        c - a CoordinateSystem instance
        example - - a String containing a valid grid reference for this type