|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.layer.Layer
org.openstreetmap.josm.gui.layer.ImageryLayer
org.openstreetmap.josm.gui.layer.WMSLayer
public class WMSLayer
This is a layer that grabs the current screen from an WMS server. The data fetched this way is tiled and managed to the disc to reduce server load.
Nested Class Summary | |
---|---|
class |
WMSLayer.BookmarkWmsAction
This action will add a WMS layer menu entry with the current WMS layer URL and name extended by the current resolution. |
static class |
WMSLayer.ChangeResolutionAction
|
class |
WMSLayer.DownloadAction
|
static class |
WMSLayer.PrecacheTask
|
class |
WMSLayer.ReloadErrorTilesAction
|
private class |
WMSLayer.StartStopAction
|
class |
WMSLayer.ToggleAlphaAction
|
private class |
WMSLayer.ZoomToNativeResolution
|
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer |
---|
ImageryLayer.ApplyOffsetAction, ImageryLayer.OffsetAction, ImageryLayer.OffsetServerThread |
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.Layer |
---|
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction |
Field Summary | |
---|---|
private AttributionSupport |
attribution
|
protected boolean |
autoDownloadEnabled
|
private int |
bmaxx
|
private int |
bmaxy
|
private int |
bminx
|
private int |
bminy
|
private int |
bottomEdge
|
WmsCache |
cache
|
private boolean |
canceled
|
protected int |
daStep
|
protected int |
dax
|
protected int |
day
|
private java.util.List<WMSRequest> |
finishedRequests
|
private java.util.List<Grabber> |
grabbers
|
private java.util.List<java.lang.Thread> |
grabberThreads
|
protected GeorefImage[][] |
images
|
protected int |
imageSize
|
protected ImageryInfo |
info
|
private boolean |
isInvalidUrlConfirmed
set to true if the user confirmed to use an potentially invalid WMS base url |
private int |
leftEdge
|
int |
messageNum
|
protected int |
minZoom
|
private static ObjectFactory |
OBJECT_FACTORY
|
private java.util.List<WMSRequest> |
processingRequests
List of request currently being processed by download threads |
static BooleanProperty |
PROP_ALPHA_CHANNEL
|
static IntegerProperty |
PROP_IMAGE_SIZE
|
static BooleanProperty |
PROP_OVERLAP
|
static IntegerProperty |
PROP_OVERLAP_EAST
|
static IntegerProperty |
PROP_OVERLAP_NORTH
|
static IntegerProperty |
PROP_SIMULTANEOUS_CONNECTIONS
|
private java.util.concurrent.locks.Condition |
queueEmpty
|
private java.util.List<WMSRequest> |
requestQueue
|
private java.util.concurrent.locks.Lock |
requestQueueLock
|
protected java.lang.String |
resolution
|
protected int |
serializeFormatVersion
|
protected boolean |
settingsChanged
|
private int |
threadCount
|
private boolean |
usesInvalidUrl
set to true if this layer uses an invalid base url |
private int |
workingThreadCount
|
Fields inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer |
---|
dx, dy, icon, offsetServerSupported, offsetServerThread, offsetServerUsed, PROP_FADE_AMOUNT, PROP_FADE_COLOR, PROP_SHARPEN_LEVEL, sharpenLevel |
Fields inherited from class org.openstreetmap.josm.gui.layer.Layer |
---|
ICON_SIZE, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
WMSLayer()
|
|
WMSLayer(ImageryInfo info)
|
Method Summary | |
---|---|
void |
addRequest(WMSRequest request)
|
private void |
cancelGrabberThreads(boolean wait)
|
java.io.File |
createAndOpenSaveFileChooser()
Creates a new "Save" dialog for this layer and makes it visible. When the user has chosen a file, checks the file extension, and confirms overwrite if needed. |
void |
destroy()
Called, when the layer is removed from the mapview and is going to be destroyed. |
void |
doSetName(java.lang.String name)
|
protected void |
downloadAndPaintVisible(java.awt.Graphics g,
MapView mv,
boolean real)
|
void |
downloadAreaToCache(WMSLayer.PrecacheTask precacheTask,
java.util.List<LatLon> points,
double bufferX,
double bufferY)
|
GeorefImage |
findImage(EastNorth eastNorth)
|
void |
finishRequest(WMSRequest request)
|
private void |
gatherFinishedRequests()
|
int |
getBaseImageHeight()
|
int |
getBaseImageWidth()
|
ProjectionBounds |
getBounds(WMSRequest request)
|
EastNorth |
getEastNorth(int xIndex,
int yIndex)
|
protected Grabber |
getGrabber(boolean localOnly)
|
int |
getImageHeight(int yIndex)
|
int |
getImageSize()
|
int |
getImageWidth(int xIndex)
|
int |
getImageX(int imageIndex)
|
int |
getImageXIndex(double coord)
|
int |
getImageY(int imageIndex)
|
int |
getImageYIndex(double coord)
|
ImageryInfo |
getInfo()
|
javax.swing.Action[] |
getMenuEntries()
Returns list of actions. |
WMSRequest |
getRequest(boolean localOnly)
|
private int |
getRequestPriority(WMSRequest request)
|
java.lang.String |
getToolTipText()
|
boolean |
hasAutoDownload()
|
void |
hookUpMapView()
Initialization code, that depends on Main.map.mapView. |
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
|
void |
initializeImages()
|
boolean |
isChanged()
Check changed status of layer |
boolean |
isOverlapEnabled()
|
boolean |
isProjectionSupported(Projection proj)
allows to check whether a projection is supported or not |
boolean |
isSavable()
Replies the savable state of this layer (i.e if it can be saved through a "File->Save" dialog). |
private int |
modulo(int a,
int b)
|
java.lang.String |
nameSupportedProjections()
Specify user information about projections |
java.awt.image.BufferedImage |
normalizeImage(java.awt.image.BufferedImage img)
|
void |
onPostLoadFromFile()
Initializes the layer after a successful load of data from a file |
void |
paint(java.awt.Graphics2D g,
MapView mv,
Bounds b)
Paint the dataset using the engine set. |
void |
preferenceChanged(Preferences.PreferenceChangeEvent event)
|
void |
readExternal(java.io.ObjectInput in)
|
boolean |
requestIsVisible(WMSRequest request)
|
void |
setOffset(double dx,
double dy)
|
private void |
sortRequests(boolean localOnly)
|
private void |
startGrabberThreads()
|
void |
visitBoundingBox(BoundingXYVisitor v)
|
void |
writeExternal(java.io.ObjectOutput out)
|
private boolean |
zoomIsTooBig()
|
Methods inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer |
---|
create, createoffsetServerThread, displace, drawErrorTile, enableOffsetServer, getDx, getDy, getFadeColor, getFadeColorWithAlpha, getIcon, getInfoComponent, getOffsetMenuItem, getOffsetMenuItem, getPPD, isMergable, mergeFrom, sharpenImage |
Methods inherited from class org.openstreetmap.josm.gui.layer.Layer |
---|
addPropertyChangeListener, checkSaveConditions, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, isBackgroundLayer, isVisible, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final ObjectFactory OBJECT_FACTORY
public static final BooleanProperty PROP_ALPHA_CHANNEL
public static final IntegerProperty PROP_SIMULTANEOUS_CONNECTIONS
public static final BooleanProperty PROP_OVERLAP
public static final IntegerProperty PROP_OVERLAP_EAST
public static final IntegerProperty PROP_OVERLAP_NORTH
public static final IntegerProperty PROP_IMAGE_SIZE
public int messageNum
protected java.lang.String resolution
protected int imageSize
protected int dax
protected int day
protected int daStep
protected int minZoom
protected GeorefImage[][] images
protected final int serializeFormatVersion
protected boolean autoDownloadEnabled
protected boolean settingsChanged
protected ImageryInfo info
public WmsCache cache
private AttributionSupport attribution
private volatile int bminx
private volatile int bminy
private volatile int bmaxx
private volatile int bmaxy
private volatile int leftEdge
private volatile int bottomEdge
private final java.util.List<WMSRequest> requestQueue
private final java.util.List<WMSRequest> finishedRequests
private final java.util.List<WMSRequest> processingRequests
private final java.util.concurrent.locks.Lock requestQueueLock
private final java.util.concurrent.locks.Condition queueEmpty
private final java.util.List<Grabber> grabbers
private final java.util.List<java.lang.Thread> grabberThreads
private int threadCount
private int workingThreadCount
private boolean canceled
private boolean usesInvalidUrl
private boolean isInvalidUrlConfirmed
Constructor Detail |
---|
public WMSLayer()
public WMSLayer(ImageryInfo info)
Method Detail |
---|
public void hookUpMapView()
Layer
hookUpMapView
in class Layer
public void doSetName(java.lang.String name)
public boolean hasAutoDownload()
public void downloadAreaToCache(WMSLayer.PrecacheTask precacheTask, java.util.List<LatLon> points, double bufferX, double bufferY)
public void destroy()
Layer
destroy
in interface Destroyable
destroy
in class ImageryLayer
public void initializeImages()
public ImageryInfo getInfo()
getInfo
in class ImageryLayer
public java.lang.String getToolTipText()
getToolTipText
in class Layer
private int modulo(int a, int b)
private boolean zoomIsTooBig()
public void paint(java.awt.Graphics2D g, MapView mv, Bounds b)
Layer
paint
in interface MapViewPaintable
paint
in class Layer
mv
- The object that can translate GeoPoints to screen coordinates.public void setOffset(double dx, double dy)
setOffset
in class ImageryLayer
public int getImageXIndex(double coord)
public int getImageYIndex(double coord)
public int getImageX(int imageIndex)
public int getImageY(int imageIndex)
public int getImageWidth(int xIndex)
public int getImageHeight(int yIndex)
public int getBaseImageWidth()
public int getBaseImageHeight()
public int getImageSize()
public boolean isOverlapEnabled()
public java.awt.image.BufferedImage normalizeImage(java.awt.image.BufferedImage img)
public EastNorth getEastNorth(int xIndex, int yIndex)
xIndex
- yIndex
-
protected void downloadAndPaintVisible(java.awt.Graphics g, MapView mv, boolean real)
public void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox
in class Layer
public javax.swing.Action[] getMenuEntries()
Layer
getMenuEntries
in class Layer
public GeorefImage findImage(EastNorth eastNorth)
private int getRequestPriority(WMSRequest request)
request
-
private void sortRequests(boolean localOnly)
public WMSRequest getRequest(boolean localOnly)
public void finishRequest(WMSRequest request)
public void addRequest(WMSRequest request)
public boolean requestIsVisible(WMSRequest request)
private void gatherFinishedRequests()
private void cancelGrabberThreads(boolean wait)
private void startGrabberThreads()
public boolean isChanged()
Layer
isChanged
in class Layer
public void preferenceChanged(Preferences.PreferenceChangeEvent event)
preferenceChanged
in interface Preferences.PreferenceChangedListener
protected Grabber getGrabber(boolean localOnly)
public ProjectionBounds getBounds(WMSRequest request)
public boolean isProjectionSupported(Projection proj)
Layer
isProjectionSupported
in class Layer
public java.lang.String nameSupportedProjections()
Layer
nameSupportedProjections
in class Layer
public boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void onPostLoadFromFile()
Layer
onPostLoadFromFile
in class Layer
public boolean isSavable()
Layer
isSavable
in class Layer
public java.io.File createAndOpenSaveFileChooser()
Layer
createAndOpenSaveFileChooser
in class Layer
File
SaveActionBase.createAndOpenSaveFileChooser(java.lang.String, org.openstreetmap.josm.actions.ExtensionFileFilter)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |