ilog.cpl.graph.background
Class IlpAbstractMapDataSourceBackground

java.lang.Object
  extended by ilog.cpl.graph.background.IlpAbstractBackground
      extended by ilog.cpl.graph.background.IlpAbstractMapDataSourceBackground
All Implemented Interfaces:
IlpBackground, IlpMapDataSourceBackground, IlvBatchable
Direct Known Subclasses:
IlpImageBackground, IlpMIDMIFBackground, IlpShapeBackground

public abstract class IlpAbstractMapDataSourceBackground
extends IlpAbstractBackground
implements IlpMapDataSourceBackground

This type servers as base type for background implementations that wish to use the IlvMapDataSource facilities, by implementing the common functionality needed for such backgrounds.

Subclasses should overwrite the IlpMapDataSourceBackground.createMapDataSource to return the proper instance that can handle the specific background format.

Since:
JViews 7.5
See Also:
IlpMapDataSourceBackground.createMapDataSource(ilog.cpl.graphic.views.IlpViewsView)

Field Summary
 
Fields inherited from class ilog.cpl.graph.background.IlpAbstractBackground
managerLayers
 
Fields inherited from interface ilog.cpl.graph.background.IlpBackground
LOAD_ON_DEMAND_PROPERTY, THREADED_PROPERTY, URL_PROPERTY, VISIBLE_PROPERTY
 
Constructor Summary
IlpAbstractMapDataSourceBackground()
           
 
Method Summary
 void create(IlvManager manager, int index, IlpViewsView view)
          This method: Obtains the IlvMapDataSource Fills it with the background Updates the IlvManagerLayer references It relies on the IlpMapDataSourceBackground.createMapDataSource.
protected  IlvMapStyle createMapStyle()
          Should create the ilog.views.maps.graphic.style.IlvMapStyle to be used by this background's ilog.views.maps.datasource.IlvMapDataSource.
protected  IlvFeatureRenderer createRenderer(IlpViewsView view, IlvMapFeatureIterator featureIterator)
          Can be overwritten by background implementations that want to provide a custom IlvFeatureRenderer for a background.
protected  void customizeMapStyle(IlvMapStyle mapStyle)
          Should customize the ilog.views.maps.graphic.style.IlvMapStyle to be used by this background's ilog.views.maps.datasource.IlvMapDataSource.
 void dispose(IlvManager manager, IlpViewsView view)
          This method: Clears the area of the IlvManagerLayers used Clears the IlvMapDataSource references from the underlying IlvManager.
 IlvMapDataSource getMapDataSource()
          Implementation of the IlpMapDataSourceBackground.
 IlvMapStyle getMapStyle()
          Returns the IlvMapStyle that is associated with this background's IlvMapDataSource.
 
Methods inherited from class ilog.cpl.graph.background.IlpAbstractBackground
addLayer, addLayers, addPropertyChangeListener, endBatch, getManagerLayer, getManagerLayers, getManagerLayersCount, getProperties, getProperty, getUrl, isLoadOnDemand, isThreaded, isVisible, removeLayer, removeLayers, removePropertyChangeListener, setLoadOnDemand, setProperty, setThreaded, setUrl, setVisible, startBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.cpl.graph.background.IlpMapDataSourceBackground
createMapDataSource
 
Methods inherited from interface ilog.cpl.graph.background.IlpBackground
addPropertyChangeListener, getManagerLayer, getManagerLayers, getManagerLayersCount, getProperty, removePropertyChangeListener, setProperty
 

Constructor Detail

IlpAbstractMapDataSourceBackground

public IlpAbstractMapDataSourceBackground()
Method Detail

create

public void create(IlvManager manager,
                   int index,
                   IlpViewsView view)
            throws IlpBackgroundHandlingException
This method:
  1. Obtains the IlvMapDataSource
  2. Fills it with the background
  3. Updates the IlvManagerLayer references

It relies on the IlpMapDataSourceBackground.createMapDataSource.

Specified by:
create in interface IlpBackground
Overrides:
create in class IlpAbstractBackground
Parameters:
manager - the manager where the graphics should be added to
index - the IlvManagerLayer index in the manager from which this background should start inserting the graphics.
view - the associated IlpViewsView
Throws:
IlpBackgroundHandlingException - in case there is a problem handling this operation.
See Also:
IlpAbstractBackground.create(ilog.views.IlvManager, int, ilog.cpl.graphic.views.IlpViewsView)

dispose

public void dispose(IlvManager manager,
                    IlpViewsView view)
             throws IlpBackgroundHandlingException
This method:
  1. Clears the area of the IlvManagerLayers used
  2. Clears the IlvMapDataSource references from the underlying IlvManager.
  3. Empties the local references to the IlvManagerLayers

Specified by:
dispose in interface IlpBackground
Overrides:
dispose in class IlpAbstractBackground
Parameters:
manager - the manager where the graphics are being displayed.
view - the associated IlpViewsView
Throws:
IlpBackgroundHandlingException - in case there is a problem handling this operation.
See Also:
IlpAbstractBackground.dispose(ilog.views.IlvManager, ilog.cpl.graphic.views.IlpViewsView)

getMapDataSource

public IlvMapDataSource getMapDataSource()
Implementation of the IlpMapDataSourceBackground.

Specified by:
getMapDataSource in interface IlpMapDataSourceBackground
Returns:
the IlvMapDataSource being used by this background
See Also:
IlpMapDataSourceBackground.getMapDataSource()

getMapStyle

public IlvMapStyle getMapStyle()
Returns the IlvMapStyle that is associated with this background's IlvMapDataSource.

Returns:
the IlvMapStyle that is associated with this background's IlvMapDataSource. Or null if the underlying IlvMapDataSource has not been initialized.

createRenderer

protected IlvFeatureRenderer createRenderer(IlpViewsView view,
                                            IlvMapFeatureIterator featureIterator)
Can be overwritten by background implementations that want to provide a custom IlvFeatureRenderer for a background.

By default it uses the IlvFeatureRenderer from the IlvMapFeatureIterator.

Parameters:
view - the associated IlpViewsView
featureIterator - the feature iterator being used
Returns:
the feature renderer to use

createMapStyle

protected IlvMapStyle createMapStyle()
                              throws IlpBackgroundHandlingException
Should create the ilog.views.maps.graphic.style.IlvMapStyle to be used by this background's ilog.views.maps.datasource.IlvMapDataSource.

Subclasses overriding this method can assume that the getMapDataSource() will return a non null object as the ilog.views.maps.datasource.IlvMapDataSource associated with this background will already be available by the time this method is invoked.

By default it re-uses the IlvMapStyle that is associated with this background's IlvMapDataSource if any.

Returns:
the ilog.views.maps.graphic.style.IlvMapStyle to be used by this background's ilog.views.maps.datasource.IlvMapDataSource.
Throws:
IlpBackgroundHandlingException - if a problem occurs.

customizeMapStyle

protected void customizeMapStyle(IlvMapStyle mapStyle)
                          throws IlpBackgroundHandlingException
Should customize the ilog.views.maps.graphic.style.IlvMapStyle to be used by this background's ilog.views.maps.datasource.IlvMapDataSource.

Subclasses overriding this method can assume that the getMapDataSource() will return a non null object as the ilog.views.maps.datasource.IlvMapDataSource associated with this background will already be available by the time this method is invoked.

Applies the default TGO map style values.

Note: if a null map style is returned by the createMapStyle(), this method will not be called.

Parameters:
mapStyle - the ilog.views.maps.graphic.style.IlvMapStyle to be used by this background's ilog.views.maps.datasource.IlvMapDataSource.
Throws:
IlpBackgroundHandlingException - if a problem occurs.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.