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
    • 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