public class IlpDefaultBackgroundSupport extends Object implements IlpBackgroundSupport
IlpBackgroundSupport.| Modifier and Type | Field and Description | 
|---|---|
| protected Map | backgroundFactoriesContains a mapping of extensions (xml, png) to instances of 
 IlpBackgroundFactory. | 
| protected PropertyChangeListener | backgroundPropertyListenerListener that handles the property changes in the IlpBackground instances. | 
| protected List | backgroundsA List with IlpBackground instances. | 
| protected List | backgroundURLsA List with URL instances. | 
| protected ilog.cpl.graph.background.internal.IlpBackgroundBatchingSupport | batchingSupportUsed to provide batching of background properties. | 
| protected List | readOnlyBackgroundsA read-only version of the IlpBackground instances List. | 
| protected List | readOnlyBackgroundURLsA read-only version of the URL instances List. | 
| protected IlpViewsView | viewThe view currently attached to this background support. | 
| Constructor and Description | 
|---|
| IlpDefaultBackgroundSupport()Initializes the needed structures. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addBackground(URL backgroundURL)IlpBackgroundSupport implementation. | 
| void | addBackground(URL backgroundURL,
             IlpBackground background)Adds the background specified in the  URLusing the the providedIlpBackgroundas the last background. | 
| void | addBackground(URL backgroundURL,
             IlpBackground background,
             int index)IlpBackgroundSupport implementation. | 
| void | addBackground(URL backgroundURL,
             int index)IlpBackgroundSupport implementation. | 
| void | addBackgroundListener(IlpBackgroundListener listener)IlpBackgroundSupport implementation. | 
| void | addBackgrounds(List backgroundURLs)IlpBackgroundSupport implementation. | 
| IlpBackground | createBackground(URL backgroundURL)It uses the registered  IlpBackgroundFactorys to create 
 theIlpBackgroundinstance. | 
| IlpBackgroundFactory | getBackgroundFactory(String extension)Returns the background factory that is registered for the given extension. | 
| IlpBackground | getBackgroundInstance(URL backgroundURL)IlpBackgroundSupport implementation. | 
| List | getBackgroundInstances()Returns a read-only List of  IlpBackgroundinstances in the same order as 
 they were indexed. | 
| List | getBackgrounds()IlpBackgroundSupport implementation. | 
| protected int | getLargestLayerIndex(List layers)Returns the largest layer index within the given List of 
 IlvManagerLayers. | 
| IlvManager | getManager()Returns the  IlvManagerof the attached view. | 
| protected int | getManagerLayerIndex(IlpBackground background,
                    int backgroundIndex)Returns the IlvManagerLayer index that should be used by provided 
 IlpBackground as its insertion index. | 
| IlvManagerView | getManagerView()Returns the  IlvManagerViewof the attached view. | 
| protected int | getNextAvailableIndex()Returns the index that is after the index of the last IlvManagerLayer that 
 is used to represent a background. | 
| protected int | getSmallestLayerIndex(List layers)Returns the smallest layer index within the given List of 
 IlvManagerLayers. | 
| IlpViewsView | getView()IlpBackgroundSupport implementation. | 
| protected void | handleBackgroundCreation(IlpBackground background,
                        URL backgroundURL,
                        int backgroundIndex,
                        int backgroundManagerLayerIndex)Should handle the creation the internal structures of the 
 IlpBackground. | 
| protected void | handleBackgroundDisposal(IlpBackground background)Should handle the act of disposing the IlpBackground internal structures. | 
| boolean | isVisible(URL backgroundURL)Returns if the background identified by the provided  URLis 
 visible or not. | 
| void | moveBackground(URL backgroundURL,
              int index)IlpBackgroundSupport implementation. | 
| protected void | registerBackgroundFactories()Registers all known background types. | 
| void | registerBackgroundFactory(String extension,
                         IlpBackgroundFactory factory)IlpBackgroundSupport implementation. | 
| void | reloadBackground(URL backgroundURL)IlpBackgroundSupport implementation. | 
| void | reloadBackgrounds()IlpBackgroundSupport implementation. | 
| void | removeBackground(URL backgroundURL)IlpBackgroundSupport implementation. | 
| void | removeBackgroundListener(IlpBackgroundListener listener)IlpBackgroundSupport implementation. | 
| void | removeBackgrounds()IlpBackgroundSupport implementation. | 
| void | setBackgrounds(List backgroundURLs)Replaces the current backgrounds with the ones provided in the List 
  URLinstances. | 
| void | setView(IlpViewsView view)IlpBackgroundSupport implementation. | 
| void | setVisible(URL backgroundURL,
          boolean visible)Sets if the background identified by the provided  URLis 
 visible or not. | 
protected IlpViewsView view
protected ilog.cpl.graph.background.internal.IlpBackgroundBatchingSupport batchingSupport
protected Map backgroundFactories
protected List backgroundURLs
protected List readOnlyBackgroundURLs
protected List backgrounds
protected List readOnlyBackgrounds
protected PropertyChangeListener backgroundPropertyListener
public IlpDefaultBackgroundSupport()
public void addBackground(URL backgroundURL, int index) throws IlpBackgroundHandlingException
addBackground in interface IlpBackgroundSupportbackgroundURL - the URL of the background to be addedindex - the index where to add the backgroundIlpBackgroundHandlingException - in case a problem occurs when adding 
 background for the provided URL at the given index.IlpBackgroundSupport.addBackground(java.net.URL, int)public void addBackground(URL backgroundURL) throws IlpBackgroundHandlingException
addBackground in interface IlpBackgroundSupportbackgroundURL - the URL of the background to be addedIlpBackgroundHandlingException - in case a problem occurs when adding 
 background for the provided URL.IlpBackgroundSupport.addBackground(java.net.URL)public void addBackground(URL backgroundURL, IlpBackground background, int index) throws IlpBackgroundHandlingException
addBackground in interface IlpBackgroundSupportbackgroundURL - the URL of the background to be addedbackground - the IlpBackground instance to be usedindex - the index where to add the backgroundIlpBackgroundHandlingException - in case a problem occurs when adding 
 background for the provided URL and IlpBackground.IlpBackgroundSupport.addBackground(java.net.URL, ilog.cpl.graph.background.IlpBackground, int)public void addBackgrounds(List backgroundURLs) throws IlpBackgroundHandlingException
addBackgrounds in interface IlpBackgroundSupportbackgroundURLs - a List of URL instancesIlpBackgroundHandlingException - in case a problem occurs when 
 adding all the backgrounds.IlpBackgroundSupport.addBackgrounds(java.util.List)public void removeBackground(URL backgroundURL) throws IlpBackgroundHandlingException
removeBackground in interface IlpBackgroundSupportbackgroundURL - the URL of the background of interestIlpBackgroundHandlingException - in case a problem occurs when 
 removing the IlpBackground associated with the provide 
 URL.IlpBackgroundSupport.removeBackground(java.net.URL)public void reloadBackground(URL backgroundURL) throws IlpBackgroundHandlingException
reloadBackground in interface IlpBackgroundSupportbackgroundURL - the URL that points to a given background.IlpBackgroundHandlingException - in case a problem occurs when 
 reloading the provided URL.IlpBackgroundSupport.reloadBackground(java.net.URL)public List getBackgrounds()
getBackgrounds in interface IlpBackgroundSupportURL instances in the same order as they 
 were indexedIlpBackgroundSupport.getBackgrounds()public void removeBackgrounds()
                       throws IlpBackgroundHandlingException
removeBackgrounds in interface IlpBackgroundSupportIlpBackgroundHandlingException - in case a problem occurs when 
 removing all the backgrounds.IlpBackgroundSupport.removeBackgrounds()public IlpBackgroundFactory getBackgroundFactory(String extension)
getBackgroundFactory in interface IlpBackgroundSupportextension - File extension, for instance, gif or svg.public void registerBackgroundFactory(String extension, IlpBackgroundFactory factory) throws IlpBackgroundHandlingException
registerBackgroundFactory in interface IlpBackgroundSupportextension - the extension that should specified in the form: "gif", "png"...factory - the IlpBackgroundFactory to be used for the given 
 extension or nullIlpBackgroundHandlingException - in case a problem occurs when 
 registering the IlpBackgroundFactory for the given extension.IlpBackgroundSupport.registerBackgroundFactory(java.lang.String, ilog.cpl.graph.background.IlpBackgroundFactory)public void setView(IlpViewsView view) throws IlpBackgroundHandlingException
setView in interface IlpBackgroundSupportview - the IlpViewsView of interest.IlpBackgroundHandlingException - in case a problem occurs when 
 setting IlpViewsView.IlpBackgroundSupport.setView(ilog.cpl.graphic.views.IlpViewsView)public IlpBackground getBackgroundInstance(URL backgroundURL) throws IlpBackgroundHandlingException
It throws an IllegalArgumentException if the URL provided is not known.
getBackgroundInstance in interface IlpBackgroundSupportbackgroundURL - the URL of the background of interestIlpBackgroundHandlingException - in case a problem occurs when 
 obtaining the IlpBackground instance for the provide 
 URL.public void reloadBackgrounds()
                       throws IlpBackgroundHandlingException
reloadBackgrounds in interface IlpBackgroundSupportIlpBackgroundHandlingException - in case a problem occurs when 
 reloading all the backgrounds.IlpBackgroundSupport.reloadBackgrounds()public void moveBackground(URL backgroundURL, int index) throws IlpBackgroundHandlingException
Indices larger than the current background size will be adjusted to reflect the last position in backgrounds list.
This method does not remove nor re-add the background in question. Instead it 
 re-arrange the IlvManagerLayers appropriately.
moveBackground in interface IlpBackgroundSupportbackgroundURL - the URL of the background of interest.index - the index where the background should now be located.IlpBackgroundHandlingException - in case a problem occurs when moving 
 the background.IlpBackgroundSupport.moveBackground(java.net.URL, int)public IlpViewsView getView()
getView in interface IlpBackgroundSupportIlpViewsView that this background support is 
 associated with.IlpBackgroundSupport.getView()public void addBackgroundListener(IlpBackgroundListener listener)
addBackgroundListener in interface IlpBackgroundSupportlistener - IlpBackgroundListener to be notified of changes.IlpBackgroundSupport.addBackgroundListener(ilog.cpl.graph.background.event.IlpBackgroundListener)public void removeBackgroundListener(IlpBackgroundListener listener)
removeBackgroundListener in interface IlpBackgroundSupportlistener - IlpBackgroundListener to be removed.IlpBackgroundSupport.removeBackgroundListener(ilog.cpl.graph.background.event.IlpBackgroundListener)public void addBackground(URL backgroundURL, IlpBackground background) throws IlpBackgroundHandlingException
URL using the the provided
 IlpBackground as the last background.public void setBackgrounds(List backgroundURLs) throws IlpBackgroundHandlingException
URL instances.backgroundURLs - a List of URLsIlpBackgroundHandlingExceptionpublic List getBackgroundInstances()
IlpBackground instances in the same order as 
 they were indexed.IlpBackground instances in the same order as they 
 were indexed.public IlpBackground createBackground(URL backgroundURL) throws IlpBackgroundHandlingException
IlpBackgroundFactorys to create 
 the IlpBackground instance.
 
 Note that the created IlpBackground is not attached 
 to this IlpBackgroundSupport.
backgroundURL - the URL of interest.IlpBackground that represents the 
 provided URL.IlpBackgroundHandlingException - if a problem occurs.public boolean isVisible(URL backgroundURL) throws IlpBackgroundHandlingException
URL is 
 visible or not.backgroundURL - the URL of interestIlpBackgroundHandlingExceptionpublic void setVisible(URL backgroundURL, boolean visible) throws IlpBackgroundHandlingException
URL is 
 visible or not.backgroundURL - the URL of interestvisible - true if visible and false otherwiseIlpBackgroundHandlingExceptionprotected int getManagerLayerIndex(IlpBackground background, int backgroundIndex) throws IlpBackgroundHandlingException
The provided index is the index of the background within this background support.
IlpBackgroundHandlingExceptionprotected int getNextAvailableIndex()
protected int getLargestLayerIndex(List layers)
protected int getSmallestLayerIndex(List layers)
public IlvManager getManager()
IlvManager of the attached view.public IlvManagerView getManagerView()
IlvManagerView of the attached view.protected void registerBackgroundFactories()
                                    throws IlpBackgroundHandlingException
IlpBackgroundHandlingExceptionprotected void handleBackgroundDisposal(IlpBackground background) throws IlpBackgroundHandlingException
Handles:
background - the IlpBackground to be handled.IlpBackgroundHandlingExceptionprotected void handleBackgroundCreation(IlpBackground background, URL backgroundURL, int backgroundIndex, int backgroundManagerLayerIndex) throws IlpBackgroundHandlingException
Handles:
background - the IlpBackground to be handled.backgroundURL - the URL to be handled.backgroundIndex - the index of this background within its peers.backgroundManagerLayerIndex - the IlvManagerLayer index where to insert the given background.IlpBackgroundHandlingException© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.