Class JParameterListWizard

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

    public class JParameterListWizard
    extends JWizard
    Wizard prompting the user to enter or review connection parameters.

    Example of use (from the GeoTools example project):

    
     List<Parameter<?>> list = new ArrayList<Parameter<?>>();
     list.add(new Parameter<File>("image", File.class, "Image",
     "GeoTiff or World+Image to display as basemap",
     new KVP( Parameter.EXT, "tif", Parameter.EXT, "jpg")));
     list.add(new Parameter<File>("shape", File.class, "Shapefile",
     "Shapefile contents to display", new KVP(Parameter.EXT, "shp")));
    
     JParameterListWizard wizard = new JParameterListWizard("Image Lab",
     "Fill in the following layers", list);
     int finish = wizard.showModalDialog();
    
     if (finish != JWizard.FINISH) {
     System.exit(0);
     }
     File imageFile = (File) wizard.getConnectionParameters().get("image");
     File shapeFile = (File) wizard.getConnectionParameters().get("shape");
     
    See Also:
    Serialized Form
    • Field Detail

      • connectionParameters

        protected Map<String,​Object> connectionParameters
        Connection parameters; shared with pages for editing
    • Constructor Detail

      • JParameterListWizard

        public JParameterListWizard​(String title,
                                    String description,
                                    List<Parameter<?>> contents,
                                    Map<String,​Object> connectionParams)
        Constructor.
        Parameters:
        title - title for the dialog
        description - brief description to be displayed on the page
        contents - a List of Parameter objects defining the data being requested
        connectionParams - an optional Map of initial parameter values
      • JParameterListWizard

        public JParameterListWizard​(String title,
                                    String description,
                                    List<Parameter<?>> contents)
        Constructor.
        Parameters:
        title - title for the dialog
        description - brief description to be displayed on the page
        contents - a List of Parameter objects defining the data being requested
    • Method Detail

      • getConnectionParameters

        public Map<String,​Object> getConnectionParameters()
        Retrieve the connection parameters entered
        Returns:
        the Map of connection parameters
      • getFile

        public File getFile()
        Helper method that returns the "url" element of the connection parameters as a File, if present. Equivalent to:
        
             URL url = (URL) myWizard.getConnectionParameters().get("url");
             File file = URLs.urlToFile(url);
         
        Returns:
        url parameter as a File, or null if not applicable