public class

SaveFramegrabsAction

extends ActionAdapter
java.lang.Object
   ↳ javax.swing.AbstractAction
     ↳ org.mbari.awt.event.ActionAdapter
       ↳ vars.query.ui.actions.SaveFramegrabsAction

Class Overview

Use as:

 // Create an array of URLS representing images that you want to save
 URLS[] urls = new URL[]{new URL"http://someserver/somepath/image1.jpg"),
      new URL("http://someserver/somepath/image2.png")};

 // Initialize the action and set the parameters (URLs, and directory to save images to)
 SaveFramegrabsAction action = new SaveFramegrabsAction();
 action.setUrls(urls);
 action.setSaveLocation("/Users/bob/someimages")
 action.doAction();

 

Summary

Constants
String ACTION_NAME
[Expand]
Inherited Constants
From interface javax.swing.Action
[Expand]
Inherited Fields
From class javax.swing.AbstractAction
Public Constructors
SaveFramegrabsAction()
Public Methods
static void copy(URL src, File dst)
Copies the contents of a URL to a local file.
void doAction()
static boolean doesImageExist(URL url)
Checks to see if the images is available at the url
void setProgressMonitor(ProgressMonitor progressMonitor)
void setSaveLocation(File saveLocation)
void setUrls(URL[] urls)
Set the URL of to be downloaded.
[Expand]
Inherited Methods
From class org.mbari.awt.event.ActionAdapter
From class javax.swing.AbstractAction
From class java.lang.Object
From interface java.awt.event.ActionListener
From interface javax.swing.Action
From interface org.mbari.awt.event.IAction

Constants

public static final String ACTION_NAME

Constant Value: "Download Images"

Public Constructors

public SaveFramegrabsAction ()

Public Methods

public static void copy (URL src, File dst)

Copies the contents of a URL to a local file.

Parameters
src The URL that we want to retrieve
dst The destination to where we want to save the url. All intermediate directories will be created as needed.
Throws
IOException

public void doAction ()

public static boolean doesImageExist (URL url)

Checks to see if the images is available at the url

Parameters
url The url of the image
Returns
  • true if the image can be downloaded. false otherwise.

public void setProgressMonitor (ProgressMonitor progressMonitor)

public void setSaveLocation (File saveLocation)

public void setUrls (URL[] urls)

Set the URL of to be downloaded.

Parameters
urls A collection of URL objects. Each URL should correspond to a framegrab that is to be downloaded.