Search in sources :

Example 1 with ModelEvent

use of org.geotoolkit.storage.event.ModelEvent in project geotoolkit by Geomatys.

the class MockTiledGridCoverageResource method removeTileMatrixSet.

@Override
public void removeTileMatrixSet(String identifier) throws DataStoreException {
    ArgumentChecks.ensureNonNull("identifier", identifier);
    final Iterator<TileMatrixSet> it = tileMatrixSets.iterator();
    while (it.hasNext()) {
        final TileMatrixSet tms = it.next();
        if (identifier.equalsIgnoreCase(tms.getIdentifier())) {
            tileMatrixSets.remove(tms);
            localEvents.add(new MockEvent(EventType.TILE_MATRIX_SET_REMOVED, tms));
            listeners.fire(new ModelEvent(this), StoreEvent.class);
            return;
        }
    }
    throw new DataStoreException("Identifier " + identifier + " not found in models.");
}
Also used : TileMatrixSet(org.geotoolkit.storage.multires.TileMatrixSet) AbstractTileMatrixSet(org.geotoolkit.storage.multires.AbstractTileMatrixSet) DataStoreException(org.apache.sis.storage.DataStoreException) ModelEvent(org.geotoolkit.storage.event.ModelEvent)

Example 2 with ModelEvent

use of org.geotoolkit.storage.event.ModelEvent in project geotoolkit by Geomatys.

the class AggregatedCoverageResource method eraseCaches.

private void eraseCaches() {
    cachedGridGeometry = null;
    for (VirtualBand vb : bands) {
        vb.cachedSampleDimension = null;
    }
    tree = null;
    listeners.fire(new ModelEvent(this), ModelEvent.class);
    listeners.fire(new ContentEvent(this), ContentEvent.class);
    photographic = false;
    homogeneous = false;
}
Also used : ContentEvent(org.geotoolkit.storage.event.ContentEvent) ModelEvent(org.geotoolkit.storage.event.ModelEvent)

Example 3 with ModelEvent

use of org.geotoolkit.storage.event.ModelEvent in project geotoolkit by Geomatys.

the class InMemoryTiledGridCoverageResource method createTileMatrixSet.

/**
 * {@inheritDoc }.
 */
@Override
public TileMatrixSet createTileMatrixSet(TileMatrixSet template) throws DataStoreException {
    final TileMatrixSet p = (TileMatrixSet) template;
    final InMemoryTileMatrixSet py = new InMemoryTileMatrixSet(UUID.randomUUID().toString(), p.getCoordinateReferenceSystem());
    py.setBuildPhase(true);
    TileMatrices.copyStructure(p, py);
    py.setBuildPhase(false);
    tileMatrixSets.add(py);
    listeners.fire(new ModelEvent(this), StoreEvent.class);
    return py;
}
Also used : TileMatrixSet(org.geotoolkit.storage.multires.TileMatrixSet) AbstractTileMatrixSet(org.geotoolkit.storage.multires.AbstractTileMatrixSet) ModelEvent(org.geotoolkit.storage.event.ModelEvent)

Example 4 with ModelEvent

use of org.geotoolkit.storage.event.ModelEvent in project geotoolkit by Geomatys.

the class InMemoryTiledGridCoverageResource method removeTileMatrixSet.

@Override
public void removeTileMatrixSet(String identifier) throws DataStoreException {
    ArgumentChecks.ensureNonNull("identifier", identifier);
    final Iterator<TileMatrixSet> it = tileMatrixSets.iterator();
    while (it.hasNext()) {
        final TileMatrixSet tms = it.next();
        if (identifier.equalsIgnoreCase(tms.getIdentifier())) {
            tileMatrixSets.remove(tms);
            listeners.fire(new ModelEvent(this), StoreEvent.class);
            return;
        }
    }
    throw new DataStoreException("Identifier " + identifier + " not found in models.");
}
Also used : TileMatrixSet(org.geotoolkit.storage.multires.TileMatrixSet) AbstractTileMatrixSet(org.geotoolkit.storage.multires.AbstractTileMatrixSet) DataStoreException(org.apache.sis.storage.DataStoreException) ModelEvent(org.geotoolkit.storage.event.ModelEvent)

Example 5 with ModelEvent

use of org.geotoolkit.storage.event.ModelEvent in project geotoolkit by Geomatys.

the class MockTiledGridCoverageResource method createTileMatrixSet.

/**
 * {@inheritDoc }.
 */
@Override
public TileMatrixSet createTileMatrixSet(TileMatrixSet template) throws DataStoreException {
    final InMemoryTileMatrixSet py = new InMemoryTileMatrixSet(UUID.randomUUID().toString(), template.getCoordinateReferenceSystem());
    py.setBuildPhase(true);
    localEvents.add(new MockEvent(EventType.TILE_MATRIX_SET_CREATED, py));
    TileMatrices.copyStructure(template, py);
    py.setBuildPhase(false);
    tileMatrixSets.add(py);
    listeners.fire(new ModelEvent(this), StoreEvent.class);
    return py;
}
Also used : ModelEvent(org.geotoolkit.storage.event.ModelEvent)

Aggregations

ModelEvent (org.geotoolkit.storage.event.ModelEvent)6 AbstractTileMatrixSet (org.geotoolkit.storage.multires.AbstractTileMatrixSet)3 TileMatrixSet (org.geotoolkit.storage.multires.TileMatrixSet)3 DataStoreException (org.apache.sis.storage.DataStoreException)2 ContentEvent (org.geotoolkit.storage.event.ContentEvent)1