ilog.cpl.graph.background
package where all background classes reside.
IlpBackground
implementation is usually associated with a specific background
format. JViews TGO
provides implementations of this interface that cover the most
used background formats. See the table below for a complete
list:
Background
format |
Background
class |
Background
file extension |
---|---|---|
Scalable
Vector Graphics |
IlpSVGBackground
|
SVG
|
GZIP
Scalable Vector Graphics |
IlpSVGZBackground
|
SVGZ
|
Raster
Images |
IlpImageBackground
|
GIF,
PNG, JPEG and JPG |
Tiled
Raster Images |
IlpImageTileBackground
|
GIF,
PNG, JPEG and JPG |
ESRI
Shape |
IlpShapeBackground
|
SHP,
DBF, SHX and IDX |
MID/MIF
|
IlpMIDMIFBackground
|
MIF
and MID |
JViews
Vector Graphics |
IlpIVLFrameworkBackground
|
IVL
and ILV |
JViews
Vector Graphics |
IlpIVLMapBackground
|
IVL
with Map Themes |
IlpBackground
interface defines two key methods:
create
and
dispose
. The method
create
produces the representation of the background itself; the
method
dispose
disposes of the constructs that compose the representation of
the background.
IlpBackground
is made up of instances of
IlvGraphic
objects that are part of the Rogue Wave JViews Framework. These
graphics typically reside on one or more instances of IlvManagerLayer which compose the actual
background representation. An
IlpBackground
implementation is responsible for appropriately processing the
data in a given background format, creating
IlvGraphic
instances that appropriately represent the background data and
populating one or several
IlvManagerLayer
instances with these
IlvGraphic
instances. Each
IlvManagerLayer
instances is accessible through the
IlpBackground.getManagerLayer
method.
IlpBackground
that should be used when introducing new
IlpBackground
types. It implements the IlvBatchable interface in order to
minimize the performance side effects of property changes in a
given background instance. For more information on how to use
this interface, see the
IlvBatchable
and
IlpAbstractBackground
API.
IlpBackground
are managed by an implementation of the IlpBackgroundSupport interface. JViews TGO provides a
predefined implementation that is used by default, namely the IlpDefaultBackgroundSupport.
IlpBackgroundSupport
is in charge of providing all background-related functionality
that graphic components like
IlpNetwork
and
IlpEquipment
may need. For example, it allows you to add, remove, move and
reload backgrounds as well as access the added backgrounds and
their constructs.
IlpBackgroundSupport
is also the entity that handles the lifecycle of
IlpBackground
instances. It determines when the graphical representation of
IlpBackground
instances is created or disposed of. The following diagram
illustrates the possible states and interactions involved when
switching between them:
IlpBackground
API is triggered by the
IlpBackgroundSupport
:
IlpBackground
method |
Invoked
|
---|---|
create
|
|
dispose
|
|
IlpBackgroundSupport.moveBackground
to remove, then add again a given
IlpBackground
at the appropriate index in order to move a background. For
information on the default implementation of this method, see
IlpDefaultBackgroundSupport.moveBackground
.
IlpBackground
interface by defining two additional methods that are necessary
to establish the integration with JViews TGO:
IlpMapDataSourceBackground.createMapDataSource
to create the
IlvMapDataSource
that will handle the background file and
IlpMapDataSourceBackground.getMapDataSource
to provide access to the
IlvMapDataSource
of the background.
IlpMapDataSourceBackground
.
IlpMapDataSourceBackground
interface that allows the integration of new IlvMapDataSource implementations to take
place with minor effort. This class is called IlpAbstractMapDataSourceBackground.
IlvMapDataSource
-based backgrounds within JViews
TGO. It leaves as abstract the
IlpMapDataSourceBackground.createMapDataSource
which must be implemented by the concrete type. It introduces a
new method,
IlpAbstractMapDataSourceBackground.createRenderer
, which returns an IlvFeatureRenderer that can be used to
install a custom feature renderer to be used during the
creation of the
IlvGraphic
instances for the provided
IlvMapDataSource
.
getMapStyle()
, which provides access to the IlvMapStyle used by the underlying
IlvMapDataSource
.
IlvMapDataSource
API.
IlpAbstractIVLBackground
instance through the
IlpAbstractIVLBackground.addManagerLayer
and
IlpAbstractIVLBackground.removeManagerLayer
, respectively.
IlvManagerLayer
instances are treated just like another layer that was
originated from the source IVL file, meaning that the
background properties are propagated to these layers. Thus, the
properties of the
IlpBackground
(like
visibility
) are applied to the added layers as the state of the
IlpAbstractIVLBackground
changes.
IlpAbstractIVLBackground
implementations.
IlpAbstractIVLBackground
: IlpIVLFrameworkBackground and IlpIVLMapBackground.
IlpIVLFrameworkBackground
should be used to read standard IVL files that contain only JViews Framework content. For more
information, see
IlpIVLFrameworkBackground
in the Java™ API Reference
Documentation.
IlpIVLMapBackground
should be used to read IVL files that contain JViews Maps content. For
more information, see
IlpIVLMapBackground
in the Java API Reference
Documentation.
IlpBackgroundSupport
interface to manage backgrounds programmatically. You can add,
remove, reload and access backgrounds. See How to add a background to the network
component for a sample on how to add a background to the
network component.
IlpBackground
instance has a set of predefined properties that can be
retrieved or set at runtime through the methods
IlpBackground.getProperty
or
IlpBackground.setProperty
. Each
IlpBackground
implementation defines the properties that are available to
customize its behavior and representation. See the
IlpBackground
interface for general background properties.
IlpBackground
implementation:
Name
|
Type
|
Default
|
Sample
|
Supported
backgrounds |
Description
|
---|---|---|---|---|---|
url
|
String
|
null
|
url:”sf-bayarea.png”;
|
ALL
|
Defines
the URL of the file that contains the background. This is
a read-only property. |
visible
|
boolean
|
true
|
visible: ”true”
|
ALL
|
Determines
whether the background is visible or not. |
loadOnDemand
|
boolean
|
false
|
loadOnDemand: “false”
|
-Shape
(shp)
-Image (gif, png and jpg) |
Determines
whether the background uses load-on-demand or not. |
threaded
|
boolean
|
false
|
threaded: ”true”
|
-Image
(gif, png and jpg)
-Image Tile (gif, png and jpg) |
Determines
whether the internal processing of the background uses a
multithreaded approach to improve performance. |
tileHeight
|
integer
|
300
|
tileHeight: “100”
|
Image
(gif, png and jpg) |
Determines the height, in pixels, of the tile to be
created. This property is taken into account only when the
loadOnDemand
property is set to
true
.
|
tileWidth
|
integer
|
300
|
tileWidth: “100”
|
Image
(gif, png and jpg) |
Determines the width, in pixels, of the tile to be
created. This property is taken into account only when the
loadOnDemand
property is set to
true
.
|
mapThemed
|
boolean
|
true
|
mapThemed: ”true”
|
JViews
Vector Graphics (ivl) |
Determines
whether the provided IVL file contains Map Themes. |
IlpIVLMapBackground
).
Backgrounds { background[0]: @+background0; } Subobject#background0 { class: "ilog.cpl.graph.background.css.IlpBackgroundCSSConfiguration"; url: "background/backgroundWithMapTheme.ivl"; mapThemed : true; }
IlpNetwork
or
IlpEquipment
.
europe.jpg
background has the lowest priority of all and will be drawn
below all other backgrounds. Whereas
paris-subway.svg
will be drawn on top of all backgrounds (highest priority).
Load
a CSS file that contains a background configuration |
|
Save
the current background configuration |
|
Add
a background to the current configuration |
|
Remove
the selected background from the current configuration |
|
Provide
more information on the selected background |
|
Move
the selected background up |
|
Move
the selected background down |
getBackgroundExtensions
method. You can also specify the default directory where it
looks for backgrounds, by using the
setDefaultDirectory
method. Lastly, you can show or hide both the Add Background
and the Remove Background buttons at runtime by using the
showAddBackgroundButton
and
showRemoveBackgroundButton
property accessors of
IlpBackgroundPanel
.
IlpBackgroundPanel
Java API for additional information.
IlvManagerLayer
index i, because some backgrounds span over more than one
layer.
IlpBackground
implementations allow you to configure the policy used to
handle the management of the resources needed to represent its
format.
IlvRasterMappedBuffer
Java API.
Area |
Description
|
---|---|
Map
Themes - Multiple backgrounds |
Loading
a background that contains a map theme may overwrite some or
all of the map theme settings of a previously loaded
background. The recommended approach will be to:
1. Load all the backgrounds of interest in the JViews Maps Map
Builder.
2. Customize the map theme of all
these backgrounds.
3. Save the map theme as a whole (as
opposed to individually).
4. Load the global map theme as a
standard IVL background. |
IlpMapDataSourceBackground
|
Access to the
IlvCoordinateSystem
of an
IlvMapDataSource
from an
IlpMapDataSourceBackground
is read-only.
If you set the coordinate system of the
IlvMapDataSource
for a given
IlpMapDataSourceBackground
through the method
IlvMapDataSource.setCoordinateSystem()
, it will not take effect because the
IlvMapDataSource
is recreated during a background reload.
If you need to customize the map data source with a custom
IlvCoordinateSystem
, the recommended approach is to overwrite the
IlpAbstractMapDataSource.createDataSource
method to return an
IlvMapDataSource
that already has the
IlvCoordinateSystem
of interest set on it.
|
IlpAbstractIVLBackground
|
When you add
IlvManagerLayer
instances manually to an
IlpAbstractIVLBackground
, these instances will not be
restored during a background reload. If reload support is
required, it is recommended to create an additional
IlpAbstractIVLBackground
that points to an IVL file containing the additional
graphics, or to add again the additional
IlvManagerLayer
instances after the background has been reloaded.
|
URL url = context.getURLAccessService().getFileLocation("world.mif"); networkComponent.addBackgroundURL(url);
IlpNetwok network = …; URL backgroundURL = context.getURLAccessService().getFileLocation("backgrounds/ world.png");
<?xml version="1.0" encoding="UTF-8"?> <background xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ilog/cpl/schema/background.xsd" type="ImageTile"> <property name="pattern">jpp%c%r.jpg</property> <property name="tileWidth">400</property> <property name="tileHeight"400</property> </background>
IlpAbstractIVLBackground
, which gives you direct access to the underlying
IlvManager
that hosts the network (or equipment) component. If this
approach does not satisfy your needs, you can (although this is
not advised):
IlpNetwork
or (
IlpEquipment
) underlying
IlvManager
by calling
network.getView().getManagerView().getManager()
IlvManagerLayer
instances is inserted in this
IlvManager
(so that your background does not corrupt any of the
existing
IlvManagerLayer
instances).
IlvManagerLayer
instances by calling
IlvManager.addLayer(0)
IlvManager.read
to read the IVL file.
IlpGeographicPositionConverter
.
IlvCoordinateSystem
associated with a given background.
IlpMapDataSourceBackground
, you can access its
IlvMapDataSource
and from there you can find the
IlvCoordinateSystem
.
IlpMapDataSourceBackground
, the information is typically configured manually by
setting it explicitly on the underlying
IlvManager
or indirectly through a Map Theme (in an IVL file). Either
way, you can access the
IlvCoordinateSystem
through the call
IlvCoordinateSystemProperty.getCoordinateSystem()
.
IlvMathTransform
, you can use an
IlvCoordinateTransformation
.
IlvCoordinateSystem
provide different types of settings. For example, an
IlvProjectedCoordinateSystem
provides access to a possibly needed
IlvProjection
. So assuming that the background map has an
IlvProjectedCoordinateSystem
, to find out the
IlvProjection
used by it, you can do the following:
IlpMapDatasourceBackground background = …; IlvCoordinateSystem coordinateSystem = background.getMapDataSource().getCoordinateSystem(); if(coordinateSystem instanceof IlvProjectedCoordinateSystem) { IlvProjectedCoordinateSystem projectedCoordinateSystem = (IlvProjectedCoordinateSystem)coordinateSystem; IlvProjection projection = projectedCoordinateSystem.getProjection() … }