Class JCRSChooser


  • public class JCRSChooser
    extends Object
    This class has a single static method that shows a dialog to prompt the user to choose a coordinate reference system.

    Example of use:

    
     CoordinateReferenceSystem crs = JCRSChooser.showDialog();
     if (crs != null) {
         // use the CRS...
     }
     
    Since:
    2.6
    Author:
    Michael Bedward
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String DEFAULT_AUTHORITY
      Default authority name (EPSG).
      static String DEFAULT_TITLE
      Default dialog title
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CoordinateReferenceSystem showDialog()
      Displays a dialog with a list of coordinate reference systems in the EPSG database.
      static CoordinateReferenceSystem showDialog​(String title)
      Displays a dialog with a list of coordinate reference systems in the EPSG database.
      static CoordinateReferenceSystem showDialog​(String title, String initialCode)
      Displays a dialog with a list of coordinate reference systems in the EPSG database and with the specified initial code highlighted.
      static CoordinateReferenceSystem showDialog​(String title, String initialCode, String authority)
      Displays a dialog with a list of coordinate reference systems provided by the given authority (e.g.
      • Methods inherited from class Object

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

      • DEFAULT_AUTHORITY

        public static final String DEFAULT_AUTHORITY
        Default authority name (EPSG).
        See Also:
        Constant Field Values
      • DEFAULT_TITLE

        public static final String DEFAULT_TITLE
        Default dialog title
        See Also:
        Constant Field Values
    • Method Detail

      • showDialog

        public static CoordinateReferenceSystem showDialog()
        Displays a dialog with a list of coordinate reference systems in the EPSG database.

        This method can be called safely from any thread.

        Returns:
        a CoordinateReferenceSystem object or null if the user cancelled the dialog
      • showDialog

        public static CoordinateReferenceSystem showDialog​(String title)
        Displays a dialog with a list of coordinate reference systems in the EPSG database.

        This method can be called safely from any thread.

        Parameters:
        title - optional non-default title
        Returns:
        a CoordinateReferenceSystem object or null if the user cancelled the dialog
      • showDialog

        public static CoordinateReferenceSystem showDialog​(String title,
                                                           String initialCode)
        Displays a dialog with a list of coordinate reference systems in the EPSG database and with the specified initial code highlighted.

        This method can be called safely from any thread.

        Parameters:
        title - optional non-default title
        initialCode - optional initial EPSG code
        Returns:
        a CoordinateReferenceSystem object or null if the user cancelled the dialog
      • showDialog

        public static CoordinateReferenceSystem showDialog​(String title,
                                                           String initialCode,
                                                           String authority)
        Displays a dialog with a list of coordinate reference systems provided by the given authority (e.g. "EPSG"), and with the specified initial code highlighted.

        This method can be called safely from any thread.

        Parameters:
        title - optional non-default title
        initialCode - an optional initial code in appropriate form for the authority
        authority - optional non-default authority (defaults to "EPSG")
        Returns:
        a CoordinateReferenceSystem object or null if the user cancelled the dialog