public class WMSLayer extends ImageryLayer implements ImageObserver, Preferences.PreferenceChangedListener, 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 List<WMSRequest> |
finishedRequests |
private List<Grabber> |
grabbers |
private List<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 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 Condition |
queueEmpty |
private List<WMSRequest> |
requestQueue |
private Lock |
requestQueueLock |
protected double |
resolution |
protected String |
resolutionText |
protected static int |
serializeFormatVersion |
protected boolean |
settingsChanged |
private static 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
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
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.
|
File |
createAndOpenSaveFileChooser()
Creates a new "Save" dialog for this layer and makes it visible.
|
void |
destroy()
Called, when the layer is removed from the mapview and is going to be
destroyed.
|
void |
doSetName(String name) |
protected void |
downloadAndPaintVisible(Graphics g,
MapView mv,
boolean real) |
void |
downloadAreaToCache(WMSLayer.PrecacheTask precacheTask,
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() |
Action[] |
getMenuEntries()
Returns list of actions.
|
WMSRequest |
getRequest(boolean localOnly) |
private int |
getRequestPriority(WMSRequest request) |
String |
getToolTipText() |
boolean |
hasAutoDownload() |
void |
hookUpMapView()
Initialization code, that depends on Main.map.mapView.
|
boolean |
imageUpdate(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) |
String |
nameSupportedProjections()
Specify user information about projections
|
BufferedImage |
normalizeImage(BufferedImage img) |
void |
onPostLoadFromFile()
Initializes the layer after a successful load of data from a file
|
void |
paint(Graphics2D g,
MapView mv,
Bounds b)
Paint the dataset using the engine set.
|
void |
preferenceChanged(Preferences.PreferenceChangeEvent event) |
void |
readExternal(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(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, isVisible, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisible
private static final ObjectFactory OBJECT_FACTORY
private static final 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 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 List<WMSRequest> requestQueue
private final List<WMSRequest> finishedRequests
private final List<WMSRequest> processingRequests
private final Lock requestQueueLock
private final Condition queueEmpty
private final List<Thread> grabberThreads
private boolean canceled
private boolean usesInvalidUrl
private boolean isInvalidUrlConfirmed
public WMSLayer()
public WMSLayer(ImageryInfo info)
public void hookUpMapView()
Layer
hookUpMapView
in class Layer
public boolean hasAutoDownload()
public void downloadAreaToCache(WMSLayer.PrecacheTask precacheTask, 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 String getToolTipText()
getToolTipText
in class Layer
private int modulo(int a, int b)
private boolean zoomIsTooBig()
public void paint(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 BufferedImage normalizeImage(BufferedImage img)
public EastNorth getEastNorth(int xIndex, int yIndex)
xIndex
- yIndex
- protected void downloadAndPaintVisible(Graphics g, MapView mv, boolean real)
public void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox
in class Layer
public 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 String nameSupportedProjections()
Layer
nameSupportedProjections
in class Layer
public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
imageUpdate
in interface ImageObserver
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void onPostLoadFromFile()
Layer
onPostLoadFromFile
in class Layer
public boolean isSavable()
Layer
public File createAndOpenSaveFileChooser()
Layer
createAndOpenSaveFileChooser
in class Layer
File
SaveActionBase.createAndOpenSaveFileChooser(java.lang.String, org.openstreetmap.josm.actions.ExtensionFileFilter)