net.refractions.udig.ui
Class CRSChooser

java.lang.Object
  extended by net.refractions.udig.ui.CRSChooser

public class CRSChooser
extends java.lang.Object

Creates a Control for choosing a Coordinate Reference System.

Since:
0.6.0
Author:
jeichar

Constructor Summary
CRSChooser()
           
CRSChooser(Controller parentPage)
           
 
Method Summary
 void clearSearch()
           
 Control createControl(Composite parent)
          Creates the CRS PreferencePage root control with no CRS selected
 Control createControl(Composite parent, CoordinateReferenceSystem crs)
          Creates the CRS PreferencePage root control with a CRS already selected
protected  CoordinateReferenceSystem createCRS(java.lang.String code)
          creates a CRS from a code when the appropriate CRSAuthorityFactory is unknown
protected  void fillCodesList()
          populates the codes list with a filtered list of CRS names
protected  java.util.Set<java.lang.String> filterCRSNames(java.lang.String[] filter)
          filters all CRS Names from all available CRS authorities
 CoordinateReferenceSystem getCRS()
          returns the selected CRS
 void gotoCRS(CoordinateReferenceSystem crs)
          Takes in a CRS, finds it in the list and highlights it
protected  boolean matchesFilter(java.lang.String input, java.lang.String[] filter)
          checks if all keywords in filter array are in input
 void setController(Controller controller)
           
 void setFocus()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRSChooser

public CRSChooser(Controller parentPage)

CRSChooser

public CRSChooser()
Method Detail

setFocus

public void setFocus()

createControl

public Control createControl(Composite parent,
                             CoordinateReferenceSystem crs)
Creates the CRS PreferencePage root control with a CRS already selected

Parameters:
parent - PreferencePage for this chooser
crs - current CRS for the associated map
Returns:
control for the PreferencePage

clearSearch

public void clearSearch()

gotoCRS

public void gotoCRS(CoordinateReferenceSystem crs)
Takes in a CRS, finds it in the list and highlights it

Parameters:
crs -

createControl

public Control createControl(Composite parent)
Creates the CRS PreferencePage root control with no CRS selected

Parameters:
parent - PreferencePage for this chooser
Returns:
control for the PreferencePage

matchesFilter

protected boolean matchesFilter(java.lang.String input,
                                java.lang.String[] filter)
checks if all keywords in filter array are in input

Parameters:
input - test string
filter - array of keywords
Returns:
true, if all keywords in filter are in the input, false otherwise

filterCRSNames

protected java.util.Set<java.lang.String> filterCRSNames(java.lang.String[] filter)
filters all CRS Names from all available CRS authorities

Parameters:
filter - array of keywords
Returns:
Set of CRS Names which contain all the filter keywords

fillCodesList

protected void fillCodesList()
populates the codes list with a filtered list of CRS names


createCRS

protected CoordinateReferenceSystem createCRS(java.lang.String code)
creates a CRS from a code when the appropriate CRSAuthorityFactory is unknown

Parameters:
code - CRS code
Returns:
CRS object from appropriate authority, or null if the appropriate factory cannot be determined

getCRS

public CoordinateReferenceSystem getCRS()
returns the selected CRS

Returns:
selected CRS

setController

public void setController(Controller controller)