Package uk.co.mccombe.mapping

# Class MappingToolkit

java.lang.Object
uk.co.mccombe.mapping.MappingToolkit

public class MappingToolkit extends 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

Modifier and Type
Method
Description
`void`
`add(CoordinateSystem c, String example)`
Add a CoordinateSystem type to the toolkit
`Datum`
`defaultDatum(String classname)`
Provide the default Datum for the specified CoordinateSystem
`Ellipsoid`
`defaultEllipsoid(String classname)`
Provide the default Ellipsoid for the named CoordinateSystem class
`Vector<String>`
`getCoordinateSystemNames()`
Create an alphabetically ordered list of CoordinateSystem names
`Datum`
`getDatum(String name)`
Get an instance of a specific Datum
`Vector<Datum>`
`getDatumList()`
get a list of available Datum instances
`Ellipsoid`
`getEllipsoid(String name)`
Get an instance of a specific Ellipsoid
`Vector<Ellipsoid>`
`getEllipsoidList()`
Get a list of available Ellipsoid instances
`String`
`getExample(String classname)`
Get an example of a grid reference for a specified CoordinateSystem
`Vector<String>`
`getProjectionNames()`
Create an alphabetically-ordered list of Projections.
`CoordinateSystem`
`makeCoordinateSystem(String name, 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 Details

### MappingToolkit

public MappingToolkit()
Construct a new MappingToolkit

## Method Details

### defaultEllipsoid

public Ellipsoid defaultEllipsoid(String classname) throws IllegalArgumentException
Provide the default Ellipsoid for the named CoordinateSystem class

Parameters:
  `classname` - The name of the CoordinateSystem
Returns:
  the defaultEllipsoid() for the class
Throws:
  `IllegalArgumentException` - if the CoordinateSystem cannot be found

### defaultDatum

public Datum defaultDatum(String classname) throws IllegalArgumentException
Provide the default Datum for the specified CoordinateSystem

Parameters:
  `classname` - A String containing the name of a CoordinateSystem
Returns:
  the defaultDatum()
Throws:
  `IllegalArgumentException` - if the CoordinateSystem cannot be found.

### makeCoordinateSystem

public CoordinateSystem makeCoordinateSystem(String name, Object... args) throws NoSuchMethodException, GridFormatException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, 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:
  `NoSuchMethodException`
  `GridFormatException`
  `IllegalAccessException`
  `IllegalArgumentException`
  `InvocationTargetException`
  `InstantiationException`

### getCoordinateSystemNames

public Vector<String> getCoordinateSystemNames()
Create an alphabetically ordered list of CoordinateSystem names

Returns:
  The list of names

### getProjectionNames

public Vector<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 Vector<Datum> getDatumList()
get a list of available Datum instances

Returns:
  the list

### getDatum

public Datum getDatum(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(String name)
Get an instance of a specific Ellipsoid

Parameters:
  `name` - - the name of the Ellipsoid
Returns:
  the requested Datum instance

### getExample

public String getExample(String classname) throws 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:
  `IllegalArgumentException` - if the CoordinateSystem name cannot be found

### getEllipsoidList

public Vector<Ellipsoid> getEllipsoidList()
Get a list of available Ellipsoid instances

Returns:
  the list

### add

public void add(CoordinateSystem c, 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