ilog.cpl.graph.background
Class IlpAbstractBackground

java.lang.Object
  extended by ilog.cpl.graph.background.IlpAbstractBackground
All Implemented Interfaces:
IlpBackground, IlvBatchable
Direct Known Subclasses:
IlpAbstractIVLBackground, IlpAbstractMapDataSourceBackground, IlpImageTileBackground, IlpSVGBackground

public abstract class IlpAbstractBackground
extends Object
implements IlpBackground, IlvBatchable

Abstract implementation of IlpBackground that should be directly subclassed when non-IlvMapDataSource backgrounds are to be introduced.

For IlvMapDataSource based backgrounds one should extend the \ IlpAbstractMapDataSourceBackground.

Since:
JViews 7.5

Field Summary
protected  List managerLayers
          The list of IlvManagerLayer instances that compose this IlpBackground.
 
Fields inherited from interface ilog.cpl.graph.background.IlpBackground
LOAD_ON_DEMAND_PROPERTY, THREADED_PROPERTY, URL_PROPERTY, VISIBLE_PROPERTY
 
Constructor Summary
IlpAbstractBackground()
          Initializes the defaults values and internal variables.
 
Method Summary
protected  void addLayer(IlvManagerLayer layer)
          Adds the provided layer to the end of a convenience internal list of IlvManagerLayer instances.
protected  void addLayers(List layers)
          Adds the provided layers to the end of the convenience internal list of IlvManagerLayer instances.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Implementation of IlpBackground.
 void create(IlvManager manager, int index, IlpViewsView view)
          Handles some of the common logistics behind creating a background, namely: Update the visibility of the IlvManagerLayer instances based on the properties of this background.
 void dispose(IlvManager manager, IlpViewsView view)
          Performs the following actions: Ensures that the area covered by the this background's layers are scheduled for a redraw Removes this background's layers from the provided IlvManager Clears the IlvManagerLayer references Subclasses should overwrite this method is further processing needs to be take place.
 void endBatch()
          Implementation of the IlvBatchable.
 IlvManagerLayer getManagerLayer(int index)
          Implementation of IlpBackground.
 List getManagerLayers()
          Implementation of IlpBackground.
 int getManagerLayersCount()
          Implementation of IlpBackground.
 Map getProperties()
          Returns a readonly version of the properties of this background.
 Object getProperty(String property)
          Implementation of IlpBackground.getProperty.
 String getUrl()
          Returns the URL of this background.
 boolean isLoadOnDemand()
          Returns whether or not this background is using Load-On-Demand.
 boolean isThreaded()
          Returns whether or not this background is using multiple threads for its internal processing.
 boolean isVisible()
          Returns whether the background will be visible.
protected  void removeLayer(IlvManagerLayer layer)
          Removes the provided layer from the convenience internal list of IlvManagerLayer instances.
protected  void removeLayers(List layers)
          Removes the provided layers from the convenience internal list of IlvManagerLayer instances.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Implementation of IlpBackground.
 void setLoadOnDemand(boolean loadOnDemand)
          Enables or disables load-on-demand for this background if it supports load-on-demand.
 void setProperty(String property, Object propertyValue)
          Implementation of IlpBackground.setProperty.
 void setThreaded(boolean threaded)
          Sets the property that enables the use of multiple threads for its internal processing.
 void setUrl(String url)
          Sets the URL of this background.
 void setVisible(boolean visible)
          Changes the visibility of this background.
 void startBatch()
          Implementation of IlvBatchable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

managerLayers

protected List managerLayers
The list of IlvManagerLayer instances that compose this IlpBackground. It can be used by subclasses to have read and write access to the list of IlvManagerLayer instances.

Constructor Detail

IlpAbstractBackground

public IlpAbstractBackground()
Initializes the defaults values and internal variables.

Method Detail

create

public void create(IlvManager manager,
                   int index,
                   IlpViewsView view)
            throws IlpBackgroundHandlingException
Handles some of the common logistics behind creating a background, namely:
  1. Update the visibility of the IlvManagerLayer instances based on the properties of this background.

Subclasses should call this method after the graphic representation of the background is generated.

This method uses the IlpBackground#getManagerLayers() to handle the logistics, so subclasses should ensure that the layers are properly set after generation so that the call to this method takes effect.

Specified by:
create in interface IlpBackground
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:
IlpBackground.create(ilog.views.IlvManager, int, ilog.cpl.graphic.views.IlpViewsView)

dispose

public void dispose(IlvManager manager,
                    IlpViewsView view)
             throws IlpBackgroundHandlingException
Performs the following actions:
  1. Ensures that the area covered by the this background's layers are scheduled for a redraw
  2. Removes this background's layers from the provided IlvManager
  3. Clears the IlvManagerLayer references

Subclasses should overwrite this method is further processing needs to be take place.

Specified by:
dispose in interface IlpBackground
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:
IlpBackground.dispose(ilog.views.IlvManager, ilog.cpl.graphic.views.IlpViewsView)

getManagerLayers

public List getManagerLayers()
Implementation of IlpBackground.

Specified by:
getManagerLayers in interface IlpBackground
Returns:
a read-only List that contains instances of IlvManagerLayer that compose this background.
See Also:
IlpBackground.getManagerLayers()

getManagerLayersCount

public int getManagerLayersCount()
Implementation of IlpBackground.

Specified by:
getManagerLayersCount in interface IlpBackground
Returns:
the number of IlvManagerLayer instances that are used by this background.
See Also:
IlpBackground.getManagerLayersCount()

getManagerLayer

public IlvManagerLayer getManagerLayer(int index)
                                throws IllegalArgumentException
Implementation of IlpBackground.

Specified by:
getManagerLayer in interface IlpBackground
Parameters:
index - the IlvManagerLayer at the provided index.
Throws:
IllegalArgumentException - if an illegal index is provided.
See Also:
IlpBackground.getManagerLayer(int)

setProperty

public void setProperty(String property,
                        Object propertyValue)
Implementation of IlpBackground.setProperty.

Specified by:
setProperty in interface IlpBackground
Parameters:
property - The property name
propertyValue - The property value
See Also:
IlpBackground.setProperty(java.lang.String, java.lang.Object)

getProperty

public Object getProperty(String property)
Implementation of IlpBackground.getProperty.

Specified by:
getProperty in interface IlpBackground
Parameters:
property - The property
Returns:
The property value
See Also:
IlpBackground.getProperty(java.lang.String)

getProperties

public Map getProperties()
Returns a readonly version of the properties of this background.

Returns:
Returns a readonly version of the background properties.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Implementation of IlpBackground.

Specified by:
addPropertyChangeListener in interface IlpBackground
Parameters:
listener - a PropertyChangeListener that will be notified of property changes.
See Also:
IlpBackground.addPropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Implementation of IlpBackground.

Specified by:
removePropertyChangeListener in interface IlpBackground
Parameters:
listener - a PropertyChangeListener that will be no longer be notified of property changes.
See Also:
IlpBackground.removePropertyChangeListener(java.beans.PropertyChangeListener)

setVisible

public void setVisible(boolean visible)
Changes the visibility of this background.

Parameters:
visible - Indicates if the background will be visible or not.

isVisible

public boolean isVisible()
Returns whether the background will be visible.

Returns:
true if visible or false otherwise

isThreaded

public boolean isThreaded()
Returns whether or not this background is using multiple threads for its internal processing.

By default backgrounds are not threaded.

Returns:
true if it is and false otherwise.

setThreaded

public void setThreaded(boolean threaded)
Sets the property that enables the use of multiple threads for its internal processing.

Parameters:
threaded - if it is, and false otherwise.

isLoadOnDemand

public boolean isLoadOnDemand()
Returns whether or not this background is using Load-On-Demand.

By default backgrounds are not using load-on-demand.

Returns:
true if it is and false otherwise.

setLoadOnDemand

public void setLoadOnDemand(boolean loadOnDemand)
Enables or disables load-on-demand for this background if it supports load-on-demand.

Parameters:
loadOnDemand - true enables, and false disables load-on-demand

getUrl

public String getUrl()
Returns the URL of this background.

Returns:
Returns the url of this background.

setUrl

public void setUrl(String url)
Sets the URL of this background.

Parameters:
url - The url to set.
Internal method or field: do not use!

startBatch

public void startBatch()
Implementation of IlvBatchable.

When called, all property changes are batched.

Specified by:
startBatch in interface IlvBatchable
See Also:
IlvBatchable.startBatch()

endBatch

public void endBatch()
Implementation of the IlvBatchable.

When called, the property change batching is ended and the changes are put into effect.

Specified by:
endBatch in interface IlvBatchable
See Also:
IlvBatchable.endBatch()

addLayers

protected void addLayers(List layers)
Adds the provided layers to the end of the convenience internal list of IlvManagerLayer instances.


removeLayers

protected void removeLayers(List layers)
Removes the provided layers from the convenience internal list of IlvManagerLayer instances.


addLayer

protected void addLayer(IlvManagerLayer layer)
Adds the provided layer to the end of a convenience internal list of IlvManagerLayer instances.


removeLayer

protected void removeLayer(IlvManagerLayer layer)
Removes the provided layer from the convenience internal list of IlvManagerLayer instances.



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