|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhpotsdam.unfolding.mapdisplay.AbstractMapDisplay
public abstract class AbstractMapDisplay
Handles tiles management and display, and map location and screen position conversions.
Use UnfoldingMap
in your application. This is the internal class, and should be used only if you know what
you are doing.
Nested Class Summary | |
---|---|
class |
AbstractMapDisplay.QueueSorter
|
class |
AbstractMapDisplay.ZoomComparator
|
Field Summary | |
---|---|
protected boolean |
allTilesLoaded
Check whether all currently visible tiles have been loaded. |
float |
angle
Rotation of this MapDisplay. |
int |
grid_padding
|
protected float |
height
|
protected java.util.Hashtable<Coordinate,java.lang.Object> |
images
|
float |
innerAngle
|
double |
innerOffsetX
|
double |
innerOffsetY
|
float |
innerScale
|
protected processing.core.PVector |
innerTransformationCenter
|
static org.apache.log4j.Logger |
log
|
protected java.util.List<MarkerManager<Marker>> |
markerManagerList
|
int |
max_images_to_keep
|
int |
max_pending
|
float |
offsetX
Vertical offset of this MapDisplay (in screen coordinates). |
float |
offsetY
Horizontal offset of this MapDisplay (in screen coordinates). |
protected java.util.Hashtable<Coordinate,java.lang.Runnable> |
pending
|
protected AbstractMapProvider |
provider
|
protected java.util.Vector<Coordinate> |
queue
|
protected AbstractMapDisplay.QueueSorter |
queueSorter
|
protected java.util.Vector<java.lang.Object> |
recent_images
|
float |
scale
Scale of this MapDisplay. |
static int |
TILE_HEIGHT
|
static int |
TILE_WIDTH
|
protected processing.core.PVector |
transformationCenter
Center of outer transformations in screen pixel. |
protected float |
width
|
protected AbstractMapDisplay.ZoomComparator |
zoomComparator
|
Constructor Summary | |
---|---|
protected |
AbstractMapDisplay(AbstractMapProvider provider,
float width,
float height)
|
Method Summary | |
---|---|
void |
addMarker(Marker marker)
Adds a marker to the default marker manager. |
void |
addMarkerManager(MarkerManager<Marker> markerManager)
You need to set the map of the given MarkerManager before using. |
void |
addMarkers(java.util.List<Marker> markers)
Adds multiple markers to the default marker manager. |
boolean |
allTilesLoaded()
Check whether all currently visible tiles have been loaded. |
abstract void |
calculateInnerMatrix()
|
abstract void |
calculateMatrix()
Updates the matrix to transform the map with with the current transformation center. |
protected void |
cleanupImageBuffer()
Cleans oldest images if too many images exist, or if memory is too full. |
protected void |
cleanupImageBuffer(boolean force)
|
protected void |
createDefaultMarkerManager(UnfoldingMap map)
|
protected abstract TileLoader |
createTileLoader(Coordinate coord)
|
abstract void |
draw()
|
MarkerManager<Marker> |
getDefaultMarkerManager()
|
float |
getHeight()
|
abstract float[] |
getInnerObject(ScreenPosition screenPosition)
|
abstract float[] |
getInnerObjectFromLocation(Location location)
|
abstract float[] |
getInnerObjectFromObjectPosition(float x,
float y)
|
abstract float[] |
getInnerObjectFromScreenPosition(float x,
float y)
Deprecated. |
abstract processing.core.PGraphics |
getInnerPG()
|
processing.core.PVector |
getInnerTransformationCenter()
|
MarkerManager<Marker> |
getLastMarkerManager()
|
abstract Location |
getLocation(float x,
float y)
|
abstract Location |
getLocation(ScreenPosition screenPosition)
|
abstract Location |
getLocationFromInnerObjectPosition(float x,
float y)
|
abstract Location |
getLocationFromObjectPosition(float x,
float y)
|
abstract Location |
getLocationFromScreenPosition(float x,
float y)
Deprecated. |
AbstractMapProvider |
getMapProvider()
|
MarkerManager<Marker> |
getMarkerManager()
Deprecated. |
MarkerManager<Marker> |
getMarkerManager(int index)
|
java.util.List<MarkerManager<Marker>> |
getMarkerManagerList()
|
processing.core.PGraphics |
getMask()
|
abstract float[] |
getObjectFromInnerObjectPosition(float x,
float y)
|
abstract float[] |
getObjectFromLocation(Location location)
|
abstract float[] |
getObjectFromScreenPosition(float x,
float y)
|
abstract processing.core.PGraphics |
getOuterPG()
|
abstract float[] |
getScreenFromInnerObjectPosition(float x,
float y)
|
abstract float[] |
getScreenFromObjectPosition(float x,
float y)
|
abstract ScreenPosition |
getScreenPosition(Location location)
|
abstract float[] |
getScreenPositionFromLocation(Location location)
Deprecated. |
processing.core.PVector |
getTransformationCenter()
|
protected abstract float[] |
getTransformedPosition(float x,
float y,
boolean inverse)
Calculates offset and rotation for screen canvas position, to be used with the internal transformation matrix. |
float |
getWidth()
|
void |
grabTile(Coordinate coord)
|
void |
processQueue()
|
void |
removeMarkerManager(int i)
|
void |
removeMarkerManager(MarkerManager<Marker> markerManager)
|
void |
resize(float width,
float height)
|
abstract void |
setBackgroundColor(java.lang.Integer color)
Sets background color of map. |
void |
setInnerTransformationCenter(processing.core.PVector innerTransformationCenter)
Set inner transformation center. |
void |
setMapProvider(AbstractMapProvider provider)
|
void |
setProvider(AbstractMapProvider provider)
Set the map provider, dynamically. |
void |
setTransformationCenter(processing.core.PVector transformationCenter)
Set outer transformation center. |
void |
tileLoaded(Coordinate coord,
java.lang.Object image)
|
abstract void |
tilesLoaded()
Will be called if all tiles have been loaded. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TILE_WIDTH
public static final int TILE_HEIGHT
public static org.apache.log4j.Logger log
protected float width
protected float height
public double innerOffsetX
public double innerOffsetY
public float innerScale
public float innerAngle
public float offsetX
public float offsetY
public float angle
public float scale
protected processing.core.PVector transformationCenter
protected processing.core.PVector innerTransformationCenter
protected java.util.List<MarkerManager<Marker>> markerManagerList
public int max_pending
public int max_images_to_keep
public int grid_padding
protected boolean allTilesLoaded
protected AbstractMapProvider provider
protected java.util.Hashtable<Coordinate,java.lang.Runnable> pending
protected java.util.Hashtable<Coordinate,java.lang.Object> images
protected java.util.Vector<Coordinate> queue
protected java.util.Vector<java.lang.Object> recent_images
protected AbstractMapDisplay.ZoomComparator zoomComparator
protected AbstractMapDisplay.QueueSorter queueSorter
Constructor Detail |
---|
protected AbstractMapDisplay(AbstractMapProvider provider, float width, float height)
Method Detail |
---|
public void resize(float width, float height)
public AbstractMapProvider getMapProvider()
public void setMapProvider(AbstractMapProvider provider)
public abstract processing.core.PGraphics getInnerPG()
public abstract processing.core.PGraphics getOuterPG()
public processing.core.PGraphics getMask()
public abstract void draw()
public abstract void setBackgroundColor(java.lang.Integer color)
color
- Color for the background canvas. Can be semi-transparent. If null it is not used.public void addMarkerManager(MarkerManager<Marker> markerManager)
public MarkerManager<Marker> getLastMarkerManager()
public MarkerManager<Marker> getDefaultMarkerManager()
@Deprecated public MarkerManager<Marker> getMarkerManager()
public MarkerManager<Marker> getMarkerManager(int index)
public void addMarker(Marker marker)
MarkerManager.addMarker(Marker)
instead.
marker
- The marker to add.public void addMarkers(java.util.List<Marker> markers)
MarkerManager.addMarkers(List)
instead.
markers
- The markers to add.public float getWidth()
public float getHeight()
public abstract void calculateMatrix()
public abstract void calculateInnerMatrix()
protected abstract float[] getTransformedPosition(float x, float y, boolean inverse)
x
- Cartesian x coordinate.y
- Cartesian y coordinate.inverse
- Indicates back and forward matrix calculation. Inverse is used for point2location, non-inverse for
location2point.
public abstract float[] getObjectFromInnerObjectPosition(float x, float y)
public abstract float[] getInnerObjectFromObjectPosition(float x, float y)
public abstract float[] getScreenFromInnerObjectPosition(float x, float y)
@Deprecated public abstract float[] getInnerObjectFromScreenPosition(float x, float y)
public abstract float[] getInnerObject(ScreenPosition screenPosition)
public abstract float[] getScreenFromObjectPosition(float x, float y)
public abstract float[] getObjectFromScreenPosition(float x, float y)
public abstract Location getLocationFromInnerObjectPosition(float x, float y)
@Deprecated public abstract Location getLocationFromScreenPosition(float x, float y)
public abstract Location getLocation(float x, float y)
public abstract Location getLocation(ScreenPosition screenPosition)
public abstract Location getLocationFromObjectPosition(float x, float y)
public abstract float[] getInnerObjectFromLocation(Location location)
@Deprecated public abstract float[] getScreenPositionFromLocation(Location location)
public abstract ScreenPosition getScreenPosition(Location location)
public abstract float[] getObjectFromLocation(Location location)
public processing.core.PVector getTransformationCenter()
public processing.core.PVector getInnerTransformationCenter()
public void setTransformationCenter(processing.core.PVector transformationCenter)
transformationCenter
- Point in screen coordinates.public void setInnerTransformationCenter(processing.core.PVector innerTransformationCenter)
innerTransformationCenter
- Point in screen coordinates.public void processQueue()
protected abstract TileLoader createTileLoader(Coordinate coord)
public void grabTile(Coordinate coord)
public void tileLoaded(Coordinate coord, java.lang.Object image)
tileLoaded
in interface TileLoaderListener
public boolean allTilesLoaded()
public abstract void tilesLoaded()
protected void cleanupImageBuffer()
protected void cleanupImageBuffer(boolean force)
public void setProvider(AbstractMapProvider provider)
provider
- The provider to use.protected void createDefaultMarkerManager(UnfoldingMap map)
public java.util.List<MarkerManager<Marker>> getMarkerManagerList()
public void removeMarkerManager(MarkerManager<Marker> markerManager)
public void removeMarkerManager(int i)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |