Package hec.map.image

Class ImportImageAction

java.lang.Object
javax.swing.AbstractAction
hec.map.image.ImportImageAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public class ImportImageAction extends AbstractAction
This is the action that starts off the process of importing an image into the map structure. The import allows the user to select many maps images (.bmp, .jpg, .tiff, .gif). If those files have a world file or embedded geo-referenced data the map is imported and a .img is created to hold our map geo-referenced data and that file is loaded into the map. If there is no world file or no geo-referenced data embedded, a UI is displayed to the user to have them enter some basic Geo-Referencing information to start off the process. The image once imported can be resized and dragged into the correct posistion by the user.
See Also:
  • Constructor Details

    • ImportImageAction

      public ImportImageAction()
      Creates a new instance of ImportImageAction
  • Method Details

    • setMapsDirectory

      public void setMapsDirectory(String mapsDirectory)
    • setMapPanel

      public void setMapPanel(MapPanel mapPanel)
    • setParentComponent

      public void setParentComponent(Component parent)
      Sets the parent component used when dialogs are popped up.
    • createFile

      protected File createFile(String path)
    • actionPerformed

      public void actionPerformed(ActionEvent e)
    • getTiffBounds

      public Dimension getTiffBounds(File tiffFile)
    • readSidFileExtents

      public WorldRect readSidFileExtents(File sidFile)
    • readGeoTiffExtents

      public WorldRect readGeoTiffExtents(File tiffFile)
    • addMaps

      protected void addMaps(List<File> maps)
      Takes a list of maps and will put them in the MapPanel. This method works in a standalone fashion. If you need to change the way maps are added to the map panel, then override this method.
    • getInputStream

      public InputStream getInputStream(File f)
    • getBufferedReader

      public BufferedReader getBufferedReader(File f)
    • getBufferedWriter

      public BufferedWriter getBufferedWriter(File f)
    • getImageFiles

      protected File[] getImageFiles()
      This is the method that opens a file selector to allow the user to retrieve a list of files. To override how this this is done, override this method.
    • getFileFilters

      protected List<FileFilter> getFileFilters()
    • writeImageFile

      protected ImageMap writeImageFile(File imgFile, File pictureFile, WorldRect rect, double rotation)
      Sets the information to write the .img file to the data structure
      Parameters:
      imgFile - - this is the file that points to the .img file to write.
      pictureFile - - this is the file the represents the .GIF, .JPG, etc
      rotation - - the amount in Radians to rotate the image. 0 is no rotation.
    • setRootDirctory

      public void setRootDirctory(String string)