public class IlvFileTileURLFactory extends Object implements IlvTileURLFactory
IlvTileURLFactory
that build file URL from
a Rectangle2D
.
The produced file name is in the form :
x_y_width_height.jpg
Modifier and Type | Field and Description |
---|---|
static String |
JPEG_EXT
The extension for JPEG files
|
static String |
PNG_EXT
The extension for PNG files.
|
Constructor and Description |
---|
IlvFileTileURLFactory(File base)
Constructs a
IlvFileTileURLFactory by specifying a base directory name. |
Modifier and Type | Method and Description |
---|---|
File |
getBaseDir()
Returns the base directory of this factory.
|
int |
getImageFormat()
Returns the compression format used to write the image tiles.
|
NumberFormat |
getNumberFormat()
Retrieves the format used to format digit parts of the filename.
|
int |
getPrecision()
Retrieves the number of digits used when building file names.
|
boolean |
isURL(URL url)
Tells if the URL pass as argument is an URL recognized
by this URL factory.
|
URL |
makeURL(Object o)
Creates an URL from an
Rectangle2D . |
void |
setImageFormat(int format)
Sets the compression format used to write the image tiles.
|
void |
setNumberFormat(NumberFormat numberFormat)
Sets the format used to format digit parts of the filename.
|
void |
setPrecision(int precision)
Sets the number of digits used when building file names.
|
public static final String JPEG_EXT
public static final String PNG_EXT
public IlvFileTileURLFactory(File base)
IlvFileTileURLFactory
by specifying a base directory name.base
- The base directory name.public void setImageFormat(int format)
format
- the image format.public int getImageFormat()
public URL makeURL(Object o)
Rectangle2D
.
The rectangle is used to build a file name, which
will be the name of the file containing the cached tile.makeURL
in interface IlvTileURLFactory
o
- The Rectangle2D
which is the bounding box of
used to build the file URL.URL
build from the rectangle.public void setNumberFormat(NumberFormat numberFormat)
numberFormat
- the format used to format digit parts of the filename.public NumberFormat getNumberFormat()
null
if no format has been specified.public File getBaseDir()
public boolean isURL(URL url)
isURL
in interface IlvTileURLFactory
url
- The URL to check.true
if the URL is recognized, false
otherwise.public int getPrecision()
public void setPrecision(int precision)
precision
- The number of digit.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.