Class MapProjectionChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MapProjectionChooser extends JPanel
The map projection chooser allows the display and selection of map projection parameters.
Since:
3.1.2
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • MapProjectionChooser

      public MapProjectionChooser(MapProjection proj, int[] dims)
      Creates a new map projection chooser.
      Parameters:
      proj - the initial map projection.
      dims - the initial dimensions as [rows, columns].
  • Method Details

    • getSystem

      public int getSystem()
      Gets the currently selected projection system.
    • setSystem

      public void setSystem(int system)
      Sets the projection system.
    • getSpheroid

      public int getSpheroid()
      Gets the currently selected spheroid.
      Returns:
      the index of the currently selected spheroid, or -1 if no spheroid is selected.
    • setSpheroid

      public void setSpheroid(int spheroid)
      Sets the projection spheroid.
      Throws:
      IllegalArgumentException - if the spheroid code is out of range, or invalid for the current projection system.
    • getZone

      public int getZone() throws NumberFormatException
      Gets the currently selected zone.
      Throws:
      NumberFormatException
    • setZone

      public void setZone(int zone)
      Sets the projection zone.
    • getParameters

      public double[] getParameters() throws NumberFormatException
      Gets the current projection parameters.
      Throws:
      NumberFormatException
    • setParameters

      public void setParameters(double[] parameters)
      Sets the projection parameters.
    • getDimensions

      public int[] getDimensions() throws NumberFormatException
      Gets the current dimensions.
      Throws:
      NumberFormatException
    • setDimensions

      public void setDimensions(int[] dims)
      Sets the dimensions.
    • getCenter

      public EarthLocation getCenter() throws NumberFormatException
      Gets the current center earth location.
      Throws:
      NumberFormatException
    • setCenter

      public void setCenter(EarthLocation center)
      Sets the projection center earth location.
    • getPixelDimensions

      public double[] getPixelDimensions() throws NumberFormatException
      Gets the current pixel dimensions.
      Throws:
      NumberFormatException
    • setPixelDimensions

      public void setPixelDimensions(double[] pixelDims)
      Sets the projection pixel dimensions.
    • getMapProjection

      Gets the currently selected map projection.
      Throws:
      NumberFormatException
      NoninvertibleTransformException
    • setMapProjection

      public void setMapProjection(MapProjection proj, int[] dims)
      Sets the projection parameters from the specified projection and dimensions.
      Parameters:
      proj - the map projection.
      dims - the region dimensions.
    • showDialog

      public boolean showDialog(Frame frame, String title)
      Creates a dialog showing the projection chooser panel and OK/Cancel buttons.
      Parameters:
      frame - the parent frame for the dialog.
      title - the dialog window title.
      Returns:
      true if the user pressed OK, false otherwise.