public class IlvMapServletSupport extends IlvDiagrammerServletSupport
IlvMapServletSupport
is an extension of the basic
IlvDiagrammerServletSupport
class that manages JViews Maps
thin-client parameters. This class also provides the default tile manager.ImageMapAreaGeneratorProperty
Constructor and Description |
---|
IlvMapServletSupport(jakarta.servlet.ServletContext context)
Creates a new
IlvMapServletSupport instance. |
Modifier and Type | Method and Description |
---|---|
protected BufferedImage |
generateImage(jakarta.servlet.http.HttpServletRequest request,
IlvRect bbox,
int width,
int height,
String[] requestedLayers,
Color bgColor,
boolean transparent)
Generates the image.
|
protected Map<Object,Object> |
getAdditionalCapabilities(jakarta.servlet.http.HttpServletRequest request)
Allows you to add more capabilities to the capability request.
|
protected File |
getCacheRootDirectory(String project)
Returns the directory used to store generated background tiles for this
project.
|
IlvManagerLayer[] |
getDynamicLayers(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
Returns an array of
IlvManagerLayer instances that are known to be dynamic. |
IlvManagerLayer[] |
getLayers(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
Returns only the nonempty layers.
|
double |
getMaxZoomLevel(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
Returns the maximum zoom level authorized by the servlet.
|
protected IlvTileManager |
getTileManager(jakarta.servlet.http.HttpServletRequest request)
Retrieves the tile manager.
|
double[] |
getZoomLevels(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
Returns the zoom levels that a client of this servlet should use to take
advantage of the tiling and caching mechanisms.
|
protected boolean |
isOverviewLayer(jakarta.servlet.http.HttpServletRequest request,
IlvManagerLayer layer)
Returns
true if the specified layer returned by
getLayers should be displayed in an overview window. |
protected void |
prepareManagerView(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
This method is overridden to set the reference zoom of the view and to
add support for
IlvJComponentGraphic objects. |
void |
setMaxZoomLevel(double maxZoomLevel)
Sets a new maximum zoom level
|
void |
setProject(jakarta.servlet.http.HttpServletRequest request,
String project)
Loads a Diagrammer project file.
|
createSelectionSupport, getDefaultProject, getDiagrammer, handleRequest, initSDMView, setDefaultProject
findFile, getDataURL, getDefaultStyleSheet, getDefaultXmlFile, getImageMapAreaGenerator, getImageMapAreaGenerator, getLock, getManagerView, getSDMView, getValue, installImageMapAreaGenerator, installImageMapAreaGenerator, isMultiSession, setDataURL, setDefaultStyleSheet, setDefaultXmlFile, setMultiSession, setStyleSheet, setValue, setXmlFile
additionalCapabilities, additionalCapabilities, addServerActionListener, addServerActionListener, beforeDraw, createPopupMenuSupport, encodeImage, generateImageWhenSessionExpired, getAntialiasing, getContentLengthEnable, getContext, getDefaultImageMapHREF, getExpirationDate, getGraphicObjectComparator, getHitmapSupport, getImageMapAreaGenerator, getInternalLock, getJPEGQuality, getKey, getManagerBBox, getManagerLayerComparator, getMinZoomLevel, getPopupMenuSupport, getSelectionSupport, isPopupEnabled, isSelectionEnabled, isVerbose, removeServerActionListener, removeServerActionListener, setAntialiasing, setContentLengthEnable, setImageResponseCachePolicy, setJPEGQuality, setPopupEnabled, setSelectionEnabled, setVerbose, shouldGenerateImageMap, useTileManager
doGetScriptMessage, getParameterValidationListener, getScriptMessageSupport, setParameterValidationListener
public IlvMapServletSupport(jakarta.servlet.ServletContext context)
IlvMapServletSupport
instance.context
- The servlet context.protected boolean isOverviewLayer(jakarta.servlet.http.HttpServletRequest request, IlvManagerLayer layer)
true
if the specified layer returned by
getLayers
should be displayed in an overview window.
The default implementation always return true
.
The base method in IlvManagerServletSupport
has
been overridden so that the Layers visible in the overview are the ones
associated with an IlvMapLayer
instance whose
IlvMapStyle.VISIBLE_IN_OVERVIEW
style attribute is set to
true
. Labeling layers are not visible in the overview.
isOverviewLayer
in class IlvManagerServletSupport
request
- The current HTTP request.layer
- A manager layer.IlvManagerServletSupport.getLayers(HttpServletRequest, IlvManagerView)
public IlvManagerLayer[] getDynamicLayers(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view)
IlvManagerLayer
instances that are known to be dynamic.
This implementation returns the layers that have an index greater or equal
to the value returned by IlvManagerView.getTripleBufferedLayerCount()
.
Layers that have an associated IlvMapLayer
instance and a
style that specifies the IlvMapStyle.THIN_CLIENT_BACKGROUND
property to false
are also considered to be dynamic layers.
getDynamicLayers
in class IlvManagerServletSupport
request
- The current HttpServletRequest
.view
- The IlvManagerView
returned by getManagerView()
.IlvManagerView.getTripleBufferedLayerCount()
public IlvManagerLayer[] getLayers(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view)
This method has been overridden so that only Layers that are "visible in tree" will be returned.
getLayers
in class IlvSDMServletSupport
request
- The current HTTP request.view
- The manager view.public double getMaxZoomLevel(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view)
This method has been overridden so you can specify the zoom level.
getMaxZoomLevel
in class IlvManagerServletSupport
request
- The current HTTP request.view
- The manager view returned by getManagerView
.public double[] getZoomLevels(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view)
null
.
This method has been overridden so you can read the scales specified in a
map file. If no scale has been specified, null
is returned.
getZoomLevels
in class IlvManagerServletSupport
request
- The current HTTP request.view
- The view returned by getManagerView()
.null
if no zoom level is
provided.public void setMaxZoomLevel(double maxZoomLevel)
maxZoomLevel
- The new maximum zoom level.public void setProject(jakarta.servlet.http.HttpServletRequest request, String project)
setProject
in class IlvDiagrammerServletSupport
request
- The request being processed.project
- The URL of the project file.protected BufferedImage generateImage(jakarta.servlet.http.HttpServletRequest request, IlvRect bbox, int width, int height, String[] requestedLayers, Color bgColor, boolean transparent) throws jakarta.servlet.ServletException
This method has been overridden so an additional "quality" parameter can be specified for JPEG rendering.
generateImage
in class IlvManagerServletSupport
request
- The current HTTP request.bbox
- The area of the manager to draw.width
- The width of the image.height
- The height of the image.requestedLayers
- An array of layer names to draw.bgColor
- The background color of the imagetransparent
- Indicates if the image should be transparent.jakarta.servlet.ServletException
protected void prepareManagerView(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view) throws jakarta.servlet.ServletException
IlvJComponentGraphic
objects. This method has been overridden to do the following:
prepareManagerView
in class IlvSDMServletSupport
request
- The current HTTP request.view
- The manager view.jakarta.servlet.ServletException
protected Map<Object,Object> getAdditionalCapabilities(jakarta.servlet.http.HttpServletRequest request)
Map
should contain pairs of propertyName
and propertyValue
for each additional capability.
This method has been overridden to store the session id in the servlet properties.
getAdditionalCapabilities
in class IlvManagerServletSupport
request
- The current HTTP request.null
if none).protected File getCacheRootDirectory(String project)
project
- The path for the project cache.javax.servlet.context.tempdir
in the servlet context.
If this configuration parameter does not exists, it will create a
directory using the java.io.tmpdir
system variable.protected IlvTileManager getTileManager(jakarta.servlet.http.HttpServletRequest request)
null
.
Subclasses must override this method to provide a tile manager.
This method has been overridden to create a default tile manager when a project is loaded.
getTileManager
in class IlvManagerServletSupport
request
- The current HTTP request.IlvTileManager
or null
if no tile
manager was found.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.