org.geotoolkit.coverage.sql
Interface CoverageDatabaseController


public interface CoverageDatabaseController

To be implemented by objects that can determine the settings of a NewGridCoverageReference. The setting can be determined either by putting up a GUI to obtain values from a user, or by other means.

Since:
3.12
Version:
3.15
Author:
Martin Desruisseaux (Geomatys)
See Also:
Layer.addCoverageReferences(Collection, CoverageDatabaseController)
Module:
coverage/geotk-coverage-sql (download)    View source code for this class

Method Summary
 void coverageAdding(CoverageDatabaseEvent event, NewGridCoverageReference reference)
          Invoked before a Grid Coverage Reference is added.
 Collection<String> filterImages(List<String> images, boolean multiSelectionAllowed)
          Invoked before coverageAdding when the coverage contains more than one image.
 

Method Detail

coverageAdding

void coverageAdding(CoverageDatabaseEvent event,
                    NewGridCoverageReference reference)
                    throws DatabaseVetoException
Invoked before a Grid Coverage Reference is added. Implementations can modify in-place the field values of the reference argument as below:
public void coverageAdding(CoverageDatabaseEvent event, NewGridCoverageReference reference) {
    if (event.isBefore()) {
        reference.format = "MyPredefinedFormat";
        // etc.
    }
}

Parameters:
event - Reference to the source database.
reference - Information about the coverage reference to be added.
Throws:
DatabaseVetoException - if the recipient vetos against the operation.

filterImages

Collection<String> filterImages(List<String> images,
                                boolean multiSelectionAllowed)
                                throws DatabaseVetoException
Invoked before coverageAdding when the coverage contains more than one image. This method gives an opportunities to select which image to process. When there is no controller, the default Layer.addCoverageReferences(...) behavior is to select the first image.

Parameters:
images - The names of images found in the files. The index of each element in this list is the index of the corresponding image.
multiSelectionAllowed - true if multi-selection is allowed, or false if the user shall select exactly one element.
Returns:
The name of images to insert. For example if only the image at index 0 is wanted, then this method shall return a singleton containing images.get(0).
Throws:
DatabaseVetoException - if the recipient vetos against the operation.
Since:
3.15


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.