All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.gov.nasa.worldwind.event.BulkRetrievalEvent Maven / Gradle / Ivy

Go to download

World Wind is a collection of components that interactively display 3D geographic information within Java applications or applets.

There is a newer version: 2.0.0-986
Show newest version
/*
 * Copyright (C) 2012 United States Government as represented by the Administrator of the
 * National Aeronautics and Space Administration.
 * All Rights Reserved.
 */

package gov.nasa.worldwind.event;

import gov.nasa.worldwind.retrieve.BulkRetrievable;

/**
 * Notifies of bulk retrieval events.
 *
 * @author tag
 * @version $Id: BulkRetrievalEvent.java 1171 2013-02-11 21:45:02Z dcollins $
 * @see gov.nasa.worldwind.retrieve.BulkRetrievable
 */
public class BulkRetrievalEvent extends WWEvent
{
    /** Constant indicating retrieval failure. */
    public static String RETRIEVAL_FAILED = "gov.nasa.worldwind.retrieve.BulkRetrievable.RetrievalFailed";

    /** Constant indicating retrieval success. */
    public static String RETRIEVAL_SUCCEEDED = "gov.nasa.worldwind.retrieve.BulkRetrievable.RetrievalSucceeded";

    protected String eventType;
    protected String item;

    /**
     * Creates a new event.
     *
     * @param source    the event source, typically either a tiled image layer, elevation model or placename layer.
     * @param eventType indicates success or failure. One of {@link #RETRIEVAL_SUCCEEDED} or {@link #RETRIEVAL_FAILED}.
     * @param item      the cache location of the item whose retrieval succeeded or failed.
     *
     * @see gov.nasa.worldwind.retrieve.BulkRetrievable
     */
    public BulkRetrievalEvent(BulkRetrievable source, String eventType, String item)
    {
        super(source);

        this.eventType = eventType;
        this.item = item;
    }

    /**
     * Returns the event source.
     *
     * @return the event source, typically either a tiled image layer, elevation model or placename layer.
     *
     * @see gov.nasa.worldwind.retrieve.BulkRetrievable
     */
    public BulkRetrievable getSource()
    {
        return super.getSource() instanceof BulkRetrievable ? (BulkRetrievable) super.getSource() : null;
    }

    /**
     * Returns the event type, one of {@link #RETRIEVAL_SUCCEEDED} or {@link #RETRIEVAL_FAILED}.
     *
     * @return the event type.
     */
    public String getEventType()
    {
        return eventType;
    }

    /**
     * Returns the filestore location of the item whose retrieval succeeded or failed.
     *
     * @return the filestore location of the item.
     */
    public String getItem()
    {
        return item;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy