]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.maps/src/org/simantics/maps/tile/ITileJobQueue.java
Share some projects for Simantics District
[simantics/district.git] / org.simantics.district.maps / src / org / simantics / maps / tile / ITileJobQueue.java
diff --git a/org.simantics.district.maps/src/org/simantics/maps/tile/ITileJobQueue.java b/org.simantics.district.maps/src/org/simantics/maps/tile/ITileJobQueue.java
new file mode 100644 (file)
index 0000000..7a0a375
--- /dev/null
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.maps.tile;
+
+
+/**
+ * Interface for queue'ing a set of map tile requests. The tiles will be
+ * requested from the provider that has been set for the queue.
+ * 
+ * @author Tuukka Lehtonen
+ */
+public interface ITileJobQueue {
+
+    /**
+     * Add a request for the specified tile with the specified listener. The
+     * listener will be notified depending on how the job progresses.
+     * 
+     * @param key the requested tile
+     * @param listener the listener that will be notified of request result
+     */
+    public void addJob(TileKey key, ITileListener listener);
+
+    /**
+     * Used for removing jobs from the job queue by using the specified filter.
+     * Any not-started tile requests for which the filter returns
+     * <code>false</code> will be removed from the queue.
+     * 
+     * @param filter filter that shall return <code>false</code> for tile
+     *        requests to be removed from the queue
+     */
+    public void filterQueries(IFilter<TileKey> filter);
+
+    /**
+     * Sets the tile provider used by this queue to perform tile requests.
+     * 
+     * @param provider the provider to use from now on
+     */
+    public void setTileProvider(ITileProvider provider);
+
+}
\ No newline at end of file