public class WMSLayer extends ImageryLayer implements java.awt.image.ImageObserver, Preferences.PreferenceChangedListener, java.io.Externalizable
Modifier and Type | Class and Description |
---|---|
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 |
class |
WMSLayer.ToggleAutoResolutionAction |
private class |
WMSLayer.ZoomToNativeResolution |
ImageryLayer.ApplyOffsetAction, ImageryLayer.OffsetAction
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
Modifier and Type | Field and Description |
---|---|
private AttributionSupport |
attribution |
protected boolean |
autoDownloadEnabled |
protected boolean |
autoResolutionEnabled |
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 |
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 BooleanProperty |
PROP_DEFAULT_AUTOZOOM |
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 double |
resolution |
protected java.lang.String |
resolutionText |
protected static int |
serializeFormatVersion |
protected boolean |
settingsChanged |
private static java.lang.Double[] |
snapLevels |
private boolean |
usesInvalidUrl
set to true if this layer uses an invalid base url
|
dx, dy, icon, info, PROP_FADE_AMOUNT, PROP_FADE_COLOR, PROP_SHARPEN_LEVEL, sharpenLevel
ICON_SIZE, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
Constructor and Description |
---|
WMSLayer()
Constructs a new
WMSLayer . |
WMSLayer(ImageryInfo info) |
Modifier and Type | Method and Description |
---|---|
void |
addRequest(WMSRequest request) |
private void |
cancelGrabberThreads(boolean wait) |
private static void |
changeResolution(WMSLayer layer,
boolean snap)
Updates the given layer’s resolution settings to the current zoom level and
updates existing tiles.
|
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() |
private static double |
getBestZoom()
Finds the most suitable resolution for the current zoom level, but prefers
higher resolutions.
|
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() |
private static void |
updateResolutionSetting(WMSLayer layer,
boolean snap)
Updates the given layer’s resolution settings to the current zoom level.
|
void |
visitBoundingBox(BoundingXYVisitor v) |
void |
writeExternal(java.io.ObjectOutput out) |
private boolean |
zoomIsTooBig() |
create, displace, drawErrorTile, getDx, getDy, getFadeColor, getFadeColorWithAlpha, getIcon, getInfoComponent, getOffsetMenuItem, getOffsetMenuItem, getPPD, isMergable, mergeFrom, sharpenImage
addPropertyChangeListener, checkSaveConditions, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, isBackgroundLayer, isInfoResizable, isVisible, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisible
private static final ObjectFactory OBJECT_FACTORY
private static final java.lang.Double[] snapLevels
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 static final BooleanProperty PROP_DEFAULT_AUTOZOOM
public int messageNum
protected double resolution
protected java.lang.String resolutionText
protected int imageSize
protected int dax
protected int day
protected int daStep
protected int minZoom
protected GeorefImage[][] images
protected static final int serializeFormatVersion
protected boolean autoDownloadEnabled
protected boolean autoResolutionEnabled
protected boolean settingsChanged
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<java.lang.Thread> grabberThreads
private boolean canceled
private boolean usesInvalidUrl
private boolean isInvalidUrlConfirmed
public WMSLayer()
WMSLayer
.public WMSLayer(ImageryInfo info)
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 final 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 static double getBestZoom()
private static void updateResolutionSetting(WMSLayer layer, boolean snap)
layer
- snap
- Set to true if the resolution should snap to certain values instead of
matching the current zoom level perfectlyprivate static void changeResolution(WMSLayer layer, boolean snap)
layer
- snap
- Set to true if the resolution should snap to certain values instead of
matching the current zoom level perfectlyprivate void cancelGrabberThreads(boolean wait)
private void startGrabberThreads()
public boolean isChanged()
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
public java.io.File createAndOpenSaveFileChooser()
Layer
createAndOpenSaveFileChooser
in class Layer
File
SaveActionBase.createAndOpenSaveFileChooser(java.lang.String, org.openstreetmap.josm.actions.ExtensionFileFilter)