public class IlvMapLoader extends Object
IlvMapLoader
class can be used to load map
files into an IlvManager
more easily.
For instance, the
load(String fileName)
method is
able to determine the format of a map
file and to instantiate the appropriate map reader to load it.
Similarly, the
load(IlvMapFeatureIterator iterator)
method
can take any IlvMapFeatureIterator
and load its content into a manager.load(java.lang.String)
,
IlvMapFeatureIterator
,
IlvFeatureRenderer
,
IlvMapFeature
,
IlvManager
,
IlvManagerView
Constructor and Description |
---|
IlvMapLoader(IlvManager manager)
Initializes an
IlvMapLoader that will load map files into
the specified manager. |
Modifier and Type | Method and Description |
---|---|
IlvCoordinateSystem |
getDefaultCoordinateSystem()
Returns the default Coordinate System used by readers that
are not georeferenced.
|
static Locale |
getFileLocale()
Returns the locale used to call
String.toLowerCase(Locale) when comparing file extensions. |
IlvManagerLayer |
getInsertionLayer()
Returns the layer to which the graphic objects will be added.
|
boolean |
isAttachingAttributes()
Returns
true if the attributes associated with the
map features are attached to the graphic objects. |
int |
load(IlvMapFeatureIterator featureIterator)
Loads the map features using the specified map reader.
|
int |
load(IlvMapFeatureIterator featureIterator,
IlvFeatureRenderer renderer)
Loads the map features using the specified map reader and translates
them into graphic objects using the specified map renderer.
|
int |
load(String fileName)
Loads the map file specified as argument.
|
IlvMapFeatureIterator |
makeFeatureIterator(String fileName)
Tries to instantiate a map reader to read the data from the specified
file.
|
void |
setAttachingAttributes(boolean attachAttributes)
Specifies whether the loader must attach a copy of the attributes of the
features read by the map reader to the graphic objects.
|
void |
setDefaultCoordinateSystem(IlvCoordinateSystem cs)
Sets the default Coordinate System to be used by readers that
are not georeferenced.
|
void |
setInsertionLayer(IlvManagerLayer insertionLayer)
Specifies the layer to which the graphic objects will be added.
|
static void |
setLocale(Locale locale)
Changes the locale used to call
String.toLowerCase(Locale) when comparing file extensions. |
public IlvMapLoader(IlvManager manager)
IlvMapLoader
that will load map files into
the specified manager. If an IlvProjectionProperty
is attached to the manager, and if the objects are read from
a georeferenced map file (from which it is possible to know
the projection used), the graphic objects will be automatically
projected using the manager's projection.manager
- The manager to which the graphic objects will be added.IlvProjectionProperty
public int load(String fileName) throws IOException
fileName
- The name of the file to be loaded.IlvMapFormatException
- If the file format cannot be determined.IOException
- If an error occurs while reading the file.public int load(IlvMapFeatureIterator featureIterator) throws IOException
featureIterator
- The map reader.IOException
- If an error occurs while reading the data.public int load(IlvMapFeatureIterator featureIterator, IlvFeatureRenderer renderer) throws IOException
featureIterator
- The map reader.renderer
- The map renderer.IOException
- If an error occurs while reading the data.public IlvMapFeatureIterator makeFeatureIterator(String fileName) throws IOException
load
method. Subclassing the IlvMapLoader
and overloading this method is a way to add support to user-defined
map readers for the load(java.lang.String)
method.fileName
- The name of the map file.null
if the map format could not be determined.IOException
- If an error occurs while opening the reader.public final IlvManagerLayer getInsertionLayer()
public void setInsertionLayer(IlvManagerLayer insertionLayer)
insertionLayer
- The layer to which the objects will be added.public void setAttachingAttributes(boolean attachAttributes)
attachAttributes
- If true
, a copy of the
attributes is attached to the graphic objects.IlvMapFeature.getAttributes()
public boolean isAttachingAttributes()
true
if the attributes associated with the
map features are attached to the graphic objects.public void setDefaultCoordinateSystem(IlvCoordinateSystem cs)
cs
- The default Coordinate System.public IlvCoordinateSystem getDefaultCoordinateSystem()
public static Locale getFileLocale()
String.toLowerCase(Locale)
when comparing file extensions.IlvLocaleUtil.getCurrentLocale()
public static void setLocale(Locale locale)
String.toLowerCase(Locale)
when comparing file extensions.locale
- The new locale.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.