ilog.cpl.equipment
Class IlpEquipmentAdapter

java.lang.Object
  extended by ilog.cpl.datasource.IlpAbstractAdapter
      extended by ilog.cpl.datasource.IlpAbstractHierarchyAdapter
          extended by ilog.cpl.graph.IlpAbstractNodeAdapter
              extended by ilog.cpl.equipment.IlpEquipmentAdapter
All Implemented Interfaces:
IlpStylable, DataSourceListener, IlpStylableAdapter, IlpRepresentationObjectMapper, IlvStylable, EventListener

public class IlpEquipmentAdapter
extends IlpAbstractNodeAdapter
implements IlpStylableAdapter

This class adapts a data source to an equipment.

This adapter gets IlpObjects from a data source and creates corresponding equipment nodes and equipment links in an equipment model.

This class is stylable using cascading style sheets. The CSS customization is done using files that are loaded in method setStyleSheets(java.lang.String[]).

The following extract illustrates the adapter customization for the equipment component:

 Equipment {
   adapter: true;
 }
 
 Adapter {
   origins[0]: id0;
   origins[1]: id1;
   showOrigin: true;
   filter: @+myFilter;
   ...
 }
 
 Subobject#myFilter {
   class: ...;
 }
 

Please refer to the properties defined by this adapter class for information about how each property can be customized using cascading style sheets.

Since:
JTGO 3.0

Field Summary
 
Fields inherited from class ilog.cpl.graph.IlpAbstractNodeAdapter
FILTER_BREADTH_FIRST_THRESHOLD
 
Fields inherited from interface ilog.cpl.css.IlpStylable
UPDATE_ALL_MASK, UPDATE_COMPONENT_MASK, UPDATE_NONE_MASK, UPDATE_OBJECTS_MASK
 
Fields inherited from interface ilog.views.util.styling.IlvStylable
APPLIED_RULE_MASK, BAD_CLASS_MASK, BAD_PROP_MASK, BAD_PROP_WITH_STACK_MASK, CREATED_MASK, DECL_MASK, DECL_VALUE_MASK, FAILED_CONVERSIONS_MASK, TIME_REPORT_MASK, WARNING_PROP_MASK
 
Constructor Summary
IlpEquipmentAdapter()
          Default constructor.
IlpEquipmentAdapter(IlpContext context)
          Constructor with a given context.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Registers a property change listener.
protected  IlpBusinessObjectCustomization applyObjectCustomization(IlpObject ilpObject)
          Returns the object that contains all the customization properties of the given business object.
protected  void clearRepresentationObjects()
          Removes all objects created by this adapter
protected  IlpRepresentationLink createLink(IlpObject ilpObject, IlpRepresentationNode fromNode, IlpRepresentationNode toNode)
          Creates a representation link object from a given business object.
protected  IlpRepresentationNode createNode(IlpObject ilpObject)
          Creates a representation node object from a given business object.
protected  void doApplyConfiguration(Map properties)
          Applies the new configuration.
 void endChangingEquipmentModel()
          Deprecated. Use IlpAbstractDataSource.endBatch() instead.
protected  ilog.cpl.datasource.css.internal.IlpStylableAdapterSupport getCSSDelegate()
          Returns the context information needed to provide support to cascading style sheets.
 IlpEquipmentNode getEquipmentNode(IlpObject ilpObject)
          Returns the equipment node representing the IlpObject.
 IlpEquipmentNode getEquipmentNode(Object identifier)
          Returns the equipment node that represents the IlpObject that is identified by identifier.
 IlpEquipmentLinkFactory getLinkFactory()
          Returns the equipment link factory.
 IlpMutableEquipmentModel getModel()
          Returns the equipment model.
 IlpMutableStyleSheet getMutableStyleSheet()
          Returns a mutable style sheet that can be used to change the adapter configuration dynamically.
 IlpEquipmentNodeFactory getNodeFactory()
          Returns the equipment node factory.
 int getStyleSheetDebugMask()
          Returns the current debug level.
 String[] getStyleSheets()
          Returns the cascading style sheets.
 String getStyleSheets(int index)
          Returns one of the cascading style sheets.
protected  boolean hasConfigurationChanged(Map properties)
          Checks if the new configuration has changed compared with the current configuration.
 boolean hasStyleSheets()
          Returns if cascading style sheets have been configured for this adapter instance.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Unregisters a property change listener.
protected  IlpRepresentationObject removeRepresentation(Object id)
          Removes the representation object that corresponds to the given identifier.
 void setLinkFactory(IlpEquipmentLinkFactory linkFactory)
          Sets the equipment link factory.
 void setModel(IlpMutableEquipmentModel model)
          Sets the equipment model.
 void setNodeFactory(IlpEquipmentNodeFactory nodeFactory)
          Sets the equipment node factory.
 void setStyleSheetDebugMask(int mask)
          Sets the debug level while parsing the cascading style sheets.
 void setStyleSheets(int index, String css)
          Changes one of the cascading style sheets.
 void setStyleSheets(int index, String css, int updateMask)
          Changes one of the cascading style sheets.
 void setStyleSheets(String[] css)
          Sets the cascading style sheets.
 void setStyleSheets(String[] css, int updateMask)
          Sets the cascading style sheets.
 void startChangingEquipmentModel()
          Deprecated. Use IlpAbstractDataSource.startBatch() instead.
 
Methods inherited from class ilog.cpl.graph.IlpAbstractNodeAdapter
clearTemporaryRepresentationObjects, createRepresentationObject, customizeAllObjects, customizeObject, fillModel, getDefaultExpansionType, getExpansionType, getPendingLinksCount, getPositionAttribute, getPositionAttribute, getRepresentationModel, getRepresentationNode, getRepresentationNode, hasModel, hasTemporaryRepresentationObject, initializeExcludedClasses, isPendingLink, loadChildren, objectAttributeChanged, objectsAdded, objectsRemoved, objectStructureChanged, refilterObjects, releaseChildren, removeTemporaryRepresentationObject, setPositionAttribute, setRepresentationModel, storeTemporaryRepresentationObject
 
Methods inherited from class ilog.cpl.datasource.IlpAbstractHierarchyAdapter
createExpansionStrategy, getAcceptedClasses, getExpansionStrategyFactory, getOrigins, getPossibleRoots, getRoots, initializeAcceptedClasses, isEmptyOrigins, isOrigin, isShowingOrigin, replaceAcceptedClasses, resetOrigins, setAcceptedClasses, setExpansionStrategyFactory, setExpansionType, setOrigins, testObject, testRootObject
 
Methods inherited from class ilog.cpl.datasource.IlpAbstractAdapter
addAdapterListener, addPropertyChangeListener, addRepresentation, applyConfiguration, batchEnded, batchStarted, beginRepresentation, clearIdToRepresentationObjectMap, endBatch, firePropertyChange, fireRepresentationObjectsAdded, fireRepresentationObjectsRemoved, getContext, getDataSource, getExcludedClasses, getFilter, getRepresentationObject, getRepresentationObject, getRepresentationObjects, getSyncStrategy, hasRepresentationObject, hasRepresentationObjects, initializeRepresentationObjects, isRepresenting, refilter, removeAdapterListener, removePropertyChangeListener, replaceExcludedClasses, setBatchable, setDataSource, setExcludedClasses, setFilter, startBatch, stopRepresentation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpEquipmentAdapter

public IlpEquipmentAdapter()
Default constructor. This constructor initializes the equipment node factory with an IlpDefaultEquipmentNodeFactory instance; the equipment link factory with an IlpDefaultEquipmentLinkFactory and the expansion strategy factory with an instance of IlpDefaultNodeExpansionStrategyFactory.

See Also:
IlpDefaultEquipmentNodeFactory, IlpDefaultEquipmentLinkFactory, IlpDefaultNodeExpansionStrategyFactory

IlpEquipmentAdapter

public IlpEquipmentAdapter(IlpContext context)
Constructor with a given context. This constructor initializes the equipment node factory with an IlpDefaultEquipmentNodeFactory instance; the equipment link factory with an IlpDefaultEquipmentLinkFactory and the expansion strategy factory with an instance of IlpDefaultNodeExpansionStrategyFactory.

Parameters:
context - The context.
See Also:
IlpContext, IlpDefaultEquipmentNodeFactory, IlpDefaultEquipmentLinkFactory, IlpDefaultNodeExpansionStrategyFactory
Method Detail

setStyleSheets

public void setStyleSheets(String[] css)
                    throws IlvStylingException
Sets the cascading style sheets. Each element can be a URL, a filename, or directly the style sheet string. The order is by priority (the last CSS takes precedence).

This method uses the context URL Access Service to convert file names into URLs.

Specified by:
setStyleSheets in interface IlvStylable
Parameters:
css - An array of strings containing the URLs or the file names of CSS files (usually with a .css suffix).
Throws:
IlvStylingException
Since:
JTGO 4.0
See Also:
getStyleSheets()

setStyleSheets

public void setStyleSheets(String[] css,
                           int updateMask)
                    throws IlvStylingException
Sets the cascading style sheets.

Each element can be a URL, a filename, or directly the style sheet string. The order is by priority (the last CSS takes precedence).

Specified by:
setStyleSheets in interface IlpStylable
Parameters:
css - An array of strings containing the URLs or the file names of CSS files (usually with a .css suffix).
updateMask - Flag that indicates if the adapter and/or the business object must be updated to use this new configuration. When IlpStylable.UPDATE_COMPONENT_MASK is set, the adapter is reconfigured with the new style sheets. When IlpStylable.UPDATE_OBJECTS_MASK is set, the business objects that are handled by this adapter are reconfigured according to the new style sheets.
Throws:
IlvStylingException
Since:
JTGO 4.0
See Also:
IlpStylable.UPDATE_COMPONENT_MASK, IlpStylable.UPDATE_OBJECTS_MASK, getStyleSheets()

setStyleSheets

public void setStyleSheets(int index,
                           String css)
                    throws IlvStylingException
Changes one of the cascading style sheets. This method is an alternative to setStyleSheets(java.lang.String[]). It lets you change one particular style sheet file, instead of setting the whole style sheet array.

This method uses the context URL Access Service to convert file names into URLs.

Specified by:
setStyleSheets in interface IlvStylable
Parameters:
index - The index of the style sheet to replace.
css - The URL or file name of the new style sheet file.
Throws:
IlvStylingException
Since:
JTGO 4.0
See Also:
setStyleSheets(java.lang.String[]), getStyleSheets(int)

setStyleSheets

public void setStyleSheets(int index,
                           String css,
                           int updateMask)
                    throws IlvStylingException
Changes one of the cascading style sheets.

This method is an alternative to setStyleSheets(java.lang.String[]). It lets you change one particular style sheet file, instead of setting the whole style sheet array. When this method is used, you can indicate if you want to reapply this configuration immediately to the adapter and all the representation objects that are already being managed by it.

Specified by:
setStyleSheets in interface IlpStylable
Parameters:
index - The index of the style sheet to replace.
css - The URL, file name or CSS extract of the new style sheet.
updateMask - Flag that indicates whether the adapter and/or the business objects must be updated to use this new configuration. When IlpStylable.UPDATE_COMPONENT_MASK is set, the adapter is reconfigured with the new style sheets. When IlpStylable.UPDATE_OBJECTS_MASK is set, the business objects that are handled by this adapter are reconfigured according to the new style sheets.
Throws:
IlvStylingException.
IlvStylingException
Since:
JTGO 4.0
See Also:
IlpStylable.UPDATE_COMPONENT_MASK, IlpStylable.UPDATE_OBJECTS_MASK, getStyleSheets(int)

getStyleSheets

public String getStyleSheets(int index)
Returns one of the cascading style sheets.

Specified by:
getStyleSheets in interface IlvStylable
Parameters:
index - The position of the cascading style sheet to return.
Returns:
The URL, file name or CSS extract that has been set on this component in the index-th position.
Since:
JTGO 4.0
See Also:
setStyleSheets(int,String), setStyleSheets(String[])

getStyleSheets

public String[] getStyleSheets()
Returns the cascading style sheets.

Specified by:
getStyleSheets in interface IlvStylable
Returns:
An array containing the values that have been set in this component. Each item in this array can be an URLs, a file name of the style sheets or a piece of CSS directly.
Since:
JTGO 4.0
See Also:
setStyleSheets(String[])

hasStyleSheets

public boolean hasStyleSheets()
Returns if cascading style sheets have been configured for this adapter instance.

Returns:
true if cascading style sheets have been set in this context.
Since:
JTGO 4.0

setStyleSheetDebugMask

public void setStyleSheetDebugMask(int mask)
Sets the debug level while parsing the cascading style sheets. Set this property before calling setStyleSheets(java.lang.String[]) to debug problems during configuration.

Note: This property can be set using a CSS, as illustrated below:

 StyleSheet {
   styleSheetDebugMask: 'BAD_PROP_MASK|BAD_CLASS_MASK';
 }
 

Specified by:
setStyleSheetDebugMask in interface IlvStylable
Parameters:
mask - The debug mask, expressed as an OR combination of the predefined flags.
Since:
JTGO 4.0
See Also:
setStyleSheets(java.lang.String[]), getStyleSheetDebugMask(), IlvStylable.APPLIED_RULE_MASK, IlvStylable.BAD_CLASS_MASK, IlvStylable.BAD_PROP_MASK, IlvStylable.CREATED_MASK, IlvStylable.DECL_MASK, IlvStylable.DECL_VALUE_MASK, IlvStylable.FAILED_CONVERSIONS_MASK, IlvStylable.TIME_REPORT_MASK, IlvStylable.WARNING_PROP_MASK

getStyleSheetDebugMask

public int getStyleSheetDebugMask()
Returns the current debug level.

Specified by:
getStyleSheetDebugMask in interface IlvStylable
Since:
JTGO 4.0
See Also:
setStyleSheetDebugMask(int)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Registers a property change listener.

Specified by:
addPropertyChangeListener in interface IlvStylable
Overrides:
addPropertyChangeListener in class IlpAbstractAdapter
Parameters:
listener - The listener to register.
Since:
JTGO 4.0

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Unregisters a property change listener.

Specified by:
removePropertyChangeListener in interface IlvStylable
Overrides:
removePropertyChangeListener in class IlpAbstractAdapter
Parameters:
listener - The listener to unregister.
Since:
JTGO 4.0

getMutableStyleSheet

public IlpMutableStyleSheet getMutableStyleSheet()
Description copied from interface: IlpStylableAdapter
Returns a mutable style sheet that can be used to change the adapter configuration dynamically.

The mutable style sheet is created and registered in this adapter when this method is called for the first time.

Note: if you replace the existing style sheets, the mutable style sheet will no longer be connected to this adapter. Once this happens, a future call to this method will then create a new mutable style sheet and register it.

Specified by:
getMutableStyleSheet in interface IlpStylableAdapter
Since:
JViews 8.1

getCSSDelegate

protected ilog.cpl.datasource.css.internal.IlpStylableAdapterSupport getCSSDelegate()
Returns the context information needed to provide support to cascading style sheets.

Since:
JTGO 4.0
Internal method or field: do not use!

applyObjectCustomization

protected IlpBusinessObjectCustomization applyObjectCustomization(IlpObject ilpObject)
Returns the object that contains all the customization properties of the given business object.

Overrides:
applyObjectCustomization in class IlpAbstractNodeAdapter
Parameters:
ilpObject - Business object
Returns:
Customization object or null if customization is not available.
Since:
JViews 7.5
Internal method or field: do not use!

hasConfigurationChanged

protected boolean hasConfigurationChanged(Map properties)
Checks if the new configuration has changed compared with the current configuration.

Overrides:
hasConfigurationChanged in class IlpAbstractHierarchyAdapter
Returns:
true if one of the properties being set is different from the current value in the adapter.
Since:
JTGO 4.0
See Also:
IlpAbstractAdapter
Internal method or field: do not use!

doApplyConfiguration

protected void doApplyConfiguration(Map properties)
Applies the new configuration.

This method is used during css configuration.

Overrides:
doApplyConfiguration in class IlpAbstractHierarchyAdapter
Since:
JTGO 4.0
See Also:
IlpAbstractAdapter
Internal method or field: do not use!

createNode

protected IlpRepresentationNode createNode(IlpObject ilpObject)
Creates a representation node object from a given business object.

This method returns a representation object that is not a link.

Specified by:
createNode in class IlpAbstractNodeAdapter
Parameters:
ilpObject - The business object
Returns:
The representation node corresponding to the given business object.
Since:
JTGO 4.0
Internal method or field: do not use!

createLink

protected IlpRepresentationLink createLink(IlpObject ilpObject,
                                           IlpRepresentationNode fromNode,
                                           IlpRepresentationNode toNode)
Creates a representation link object from a given business object.

Specified by:
createLink in class IlpAbstractNodeAdapter
Parameters:
ilpObject - The business object.
fromNode - The from endpoint for the link.
toNode - The to endpoint for the link.
Returns:
The representation link corresponding to the given business object.
Since:
JTGO 4.0
Internal method or field: do not use!

clearRepresentationObjects

protected void clearRepresentationObjects()
Removes all objects created by this adapter

Overrides:
clearRepresentationObjects in class IlpAbstractNodeAdapter

removeRepresentation

protected IlpRepresentationObject removeRepresentation(Object id)
Description copied from class: IlpAbstractAdapter
Removes the representation object that corresponds to the given identifier.

Overrides:
removeRepresentation in class IlpAbstractNodeAdapter
Parameters:
id - Object identifier

getModel

public IlpMutableEquipmentModel getModel()
Returns the equipment model.

This is a bound property.

Returns:
The model in which the adapter puts the representation objects.

setModel

public void setModel(IlpMutableEquipmentModel model)
Sets the equipment model.

This is a bound property.

Parameters:
model - The model in which the adapter puts the representation objects.

getEquipmentNode

public IlpEquipmentNode getEquipmentNode(IlpObject ilpObject)
Returns the equipment node representing the IlpObject. All objects in an equipment model are equipment nodes, even equipment links.


getEquipmentNode

public IlpEquipmentNode getEquipmentNode(Object identifier)
Returns the equipment node that represents the IlpObject that is identified by identifier. All objects in an equipment model are equipment nodes, even equipment links.


setLinkFactory

public void setLinkFactory(IlpEquipmentLinkFactory linkFactory)
Sets the equipment link factory.

Note: This property can be customized using CSS, as illustrated below:

 Adapter {
   linkFactory: @+factoryDef;
 }
 Subobject#factoryDef {
   class: ...;
 }
 

Parameters:
linkFactory - The link representation object factory.

getLinkFactory

public IlpEquipmentLinkFactory getLinkFactory()
Returns the equipment link factory.


setNodeFactory

public void setNodeFactory(IlpEquipmentNodeFactory nodeFactory)
Sets the equipment node factory.

Note: This property can be customized using a CSS.

 Adapter {
   nodeFactory: @+factoryDef;
 }
 Subobject#factoryDef {
   class: ...;
 }
 

Parameters:
nodeFactory - The node representation object factory.

getNodeFactory

public IlpEquipmentNodeFactory getNodeFactory()
Returns the equipment node factory.


startChangingEquipmentModel

public void startChangingEquipmentModel()
Deprecated. Use IlpAbstractDataSource.startBatch() instead.

Tells the model temporarily not to send events.

After this call, the model notification events are delayed until the next call to endChangingEquipmentModel.

This method ensures that the startChangingEquipmentModel method of the model is called using the proper synchronization strategy; that is, in the Swing event thread in a regular application.

Note that this method does nothing if the adapter does not have a model.

See Also:
endChangingEquipmentModel(), IlpMutableEquipmentModel.startChangingEquipmentModel()
Deprecated Since:
JTGO 4.0

endChangingEquipmentModel

public void endChangingEquipmentModel()
Deprecated. Use IlpAbstractDataSource.endBatch() instead.

Tells the model that a temporary inhibition of events is terminated and sends the events buffered since the last call to startChangingEquipmentModel.

Contrary to the method IlpMutableEquipmentModel, this method ensures that the endChangingEquipmentModel method of the model is called using the proper synchronization strategy; that is, in the Swing event thread in a regular application.

Note that this method does nothing if the adapter does not have a model.

See Also:
startChangingEquipmentModel(), IlpMutableEquipmentModel.endChangingEquipmentModel()
Deprecated Since:
JTGO 4.0


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