public abstract class IlpAbstractNodeAdapter extends IlpAbstractHierarchyAdapter
IlpDataSourceLoggers.ilog_cpl_datasource_adapter
Modifier and Type | Field and Description |
---|---|
static int |
FILTER_BREADTH_FIRST_THRESHOLD
This parameter is used by the adapter to identify the algorithm
that should be used when refiltering objects.
|
Constructor and Description |
---|
IlpAbstractNodeAdapter()
Default constructor.
|
IlpAbstractNodeAdapter(IlpContext context)
Constructor for a given context.
|
Modifier and Type | Method and Description |
---|---|
protected IlpBusinessObjectCustomization |
applyObjectCustomization(IlpObject ilpObject)
Applies the current customization to the given object.
|
protected void |
clearRepresentationObjects()
Removes all objects created by this adapter
|
void |
clearTemporaryRepresentationObjects()
Clears all the temporary objects.
|
protected abstract IlpRepresentationLink |
createLink(IlpObject ilpObject,
IlpRepresentationNode fromNode,
IlpRepresentationNode toNode)
Creates a representation link object from a given business object.
|
protected abstract IlpRepresentationNode |
createNode(IlpObject ilpObject)
Creates a representation node object from a given business object.
|
protected IlpRepresentationObject |
createRepresentationObject(IlpObject ilpObject)
Creates a representation object and stores it in the identifier-to-RO map.
|
protected void |
customizeAllObjects()
Apply CSS configuration to all objects.
|
protected void |
customizeObject(IlpObject object)
This method is automatically called by
createExpansionStrategy to guarantee that every new
object (or updated) is customized before being added to this
adapter. |
protected void |
fillModel()
Fills the model with the representation object.
|
protected IlpExpansionType |
getDefaultExpansionType(IlpObject ilpObject)
This internal method returns the default expansion type, which is
IlpExpansionType.NO_EXPANSION . |
IlpExpansionType |
getExpansionType(IlpObject ilpObject)
Retrieves the expansion type of a given business object.
|
int |
getPendingLinksCount()
Returns the number of pending links.
|
IlpAttribute |
getPositionAttribute(IlpClass clazz)
Returns the position attribute of an
IlpClass . |
IlpAttribute |
getPositionAttribute(IlpObject object)
Returns the position attribute for an object.
|
protected IlpMutableGraphModel |
getRepresentationModel()
Returns the network model.
|
IlpRepresentationNode |
getRepresentationNode(IlpObject ilpObject)
Returns the node representing the
IlpObject . |
IlpRepresentationNode |
getRepresentationNode(Object identifier)
Returns the node representing the
IlpObject identified by
identifier . |
boolean |
hasModel()
Returns
true if the adapter is connected to a model. |
boolean |
hasTemporaryRepresentationObject(IlpRepresentationNode node)
Informs whether a representation node is temporary or not.
|
protected void |
initializeExcludedClasses()
Initializes the predefined list of excluded classes.
|
boolean |
isPendingLink(Object id)
Returns if the given identifier corresponds to a pending link.
|
void |
loadChildren(IlpRepresentationObject representation)
Initiates the loading of the child objects of the given object, if they
are not all already present.
|
void |
objectAttributeChanged(DataSourceObjectEvent e)
Called when an object structure has changed.
|
void |
objectsAdded(DataSourceEvent evt)
Called when an object has been added to the data source.
|
void |
objectsRemoved(DataSourceEvent evt)
Called when an object has been removed from the data source.
|
void |
objectStructureChanged(DataSourceObjectEvent evt)
Called when an object structure has changed.
|
protected void |
refilterObjects()
Reapplies the filter to the objects that exist in the attached
data source.
|
void |
releaseChildren(IlpRepresentationObject representation)
Signals that the model and the attached views do not need the
child objects of the given object anymore.
|
protected IlpRepresentationObject |
removeRepresentation(Object id)
Removes the representation object that corresponds to the given
identifier.
|
void |
removeTemporaryRepresentationObject(IlpRepresentationNode node)
Remove a temporary object.
|
void |
setPositionAttribute(IlpClass clazz,
IlpAttribute attribute)
Sets the position attribute used by objects belonging to the given
business object class.
|
protected void |
setRepresentationModel(IlpMutableGraphModel newmodel)
Sets the network model.
|
void |
storeTemporaryRepresentationObject(IlpRepresentationNode node,
IlpMutableRepresentationNode parent,
IlpFilter boFilter)
Stores a temporary object along with a filter to detect
the corresponding business object.
|
createExpansionStrategy, doApplyConfiguration, getAcceptedClasses, getExpansionStrategyFactory, getOrigins, getPossibleRoots, getRoots, hasConfigurationChanged, initializeAcceptedClasses, isEmptyOrigins, isOrigin, isShowingOrigin, replaceAcceptedClasses, resetOrigins, setAcceptedClasses, setExpansionStrategyFactory, setExpansionType, setOrigins, testObject, testRootObject
addAdapterListener, addPropertyChangeListener, 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, removePropertyChangeListener, replaceExcludedClasses, setBatchable, setDataSource, setExcludedClasses, setFilter, startBatch, stopRepresentation
public static int FILTER_BREADTH_FIRST_THRESHOLD
If the threshold is set to -1
, breadth-first is always
applied no matter the number of objects that are currently present in this
datasource.
If the number of objects in the datasource is below the given threshold, the refiltering is applied through a breadth-first algorithm. If the number of objects is above the given threshold, the refiltering is applied by removing and recreating the objects.
public IlpAbstractNodeAdapter()
An adapter built this way will use the IlpChild
and
IlpContainer
interfaces.
public IlpAbstractNodeAdapter(IlpContext context)
An adapter built this way will use the IlpChild
and
IlpContainer
interfaces.
context
- The context used by this adapter.public IlpExpansionType getExpansionType(IlpObject ilpObject)
IlpAbstractHierarchyAdapter
Compatibility Note: In JViews 8.0,
ilog.cpl.model.IlpObject.ExpansionType
has been replaced by IlpExpansionType
.
getExpansionType
in class IlpAbstractHierarchyAdapter
ilpObject
- The business object containing the expansion type.protected IlpExpansionType getDefaultExpansionType(IlpObject ilpObject)
IlpExpansionType.NO_EXPANSION
. This value is overridden by
the value in expansionType
structure (or, the value
set through the API).ilpObject
- The business object.public IlpRepresentationNode getRepresentationNode(IlpObject ilpObject)
IlpObject
.public IlpRepresentationNode getRepresentationNode(Object identifier)
IlpObject
identified by
identifier
.protected abstract IlpRepresentationNode createNode(IlpObject ilpObject)
This method returns a representation object that is not a link.
ilpObject
- The business objectprotected abstract IlpRepresentationLink createLink(IlpObject ilpObject, IlpRepresentationNode fromNode, IlpRepresentationNode toNode)
ilpObject
- The business object.fromNode
- The from endpoint for the link.toNode
- The to endpoint for the link.public boolean isPendingLink(Object id)
id
- Object identifiertrue
if the object is a pending link.public int getPendingLinksCount()
protected void initializeExcludedClasses()
By default, alarm objects (ilog.tgo.model.IltAlarm
) are not
displayed in the graph model.
initializeExcludedClasses
in class IlpAbstractAdapter
protected void refilterObjects()
The default implementation performs a breadth-first search
on the representation nodes. It tests each node that is currently displayed
against the new filter criteria. The worst case performance of the
algorithm is o(n)
, where n
is the number of
objects in the data source.
If the number of objects present in the attached data source is large,
the performance of this algorithm may not be good. In this case, instead of
performing a systematic breadth-first search, you can configure the
threshold
of the breadth-first
algorithm.
refilterObjects
in class IlpAbstractAdapter
FILTER_BREADTH_FIRST_THRESHOLD
public IlpAttribute getPositionAttribute(IlpClass clazz)
IlpClass
.public IlpAttribute getPositionAttribute(IlpObject object)
public void setPositionAttribute(IlpClass clazz, IlpAttribute attribute)
public void storeTemporaryRepresentationObject(IlpRepresentationNode node, IlpMutableRepresentationNode parent, IlpFilter boFilter)
node
- Temporary representation object. It has to implement
IlpRepresentationNode
.parent
- The parent of the temporary representation object.
May be null
.boFilter
- The filter that is applied to the business object to
find out if the temporary representation object is to
be replaced by a "real" one representing the first
IlpObject
that matches the filter.IllegalStateException
- If the adapter does not have a model.public void removeTemporaryRepresentationObject(IlpRepresentationNode node)
node
- The temporary representation object to remove.public void clearTemporaryRepresentationObjects()
public boolean hasTemporaryRepresentationObject(IlpRepresentationNode node)
protected IlpRepresentationObject createRepresentationObject(IlpObject ilpObject)
The resulting object will be instance of
IlpRepresentationNode
.
createRepresentationObject
in class IlpAbstractAdapter
protected void clearRepresentationObjects()
clearRepresentationObjects
in class IlpAbstractAdapter
protected IlpRepresentationObject removeRepresentation(Object id)
IlpAbstractAdapter
removeRepresentation
in class IlpAbstractHierarchyAdapter
id
- Object identifierprotected void fillModel()
fillModel
in class IlpAbstractAdapter
public void loadChildren(IlpRepresentationObject representation)
loadChildren
in class IlpAbstractHierarchyAdapter
representation
- Container representation objectIlpExpansionStrategy.loadChildren(ilog.cpl.model.IlpRepresentationObject)
public void releaseChildren(IlpRepresentationObject representation)
releaseChildren
in class IlpAbstractHierarchyAdapter
representation
- Container representation objectIlpExpansionStrategy.releaseChildren(ilog.cpl.model.IlpRepresentationObject)
protected IlpBusinessObjectCustomization applyObjectCustomization(IlpObject ilpObject)
ilpObject
- Business objectnull
if customization is
not available.protected void customizeObject(IlpObject object)
createExpansionStrategy
to guarantee that every new
object (or updated) is customized before being added to this
adapter.customizeObject
in class IlpAbstractHierarchyAdapter
object
- The object to be customized.protected void customizeAllObjects()
The method will check for changes in the expansion type of each object represented by this adapter. In case of change, the object will be removed and recreated.
customizeAllObjects
in class IlpAbstractHierarchyAdapter
public void objectsAdded(DataSourceEvent evt)
public void objectsRemoved(DataSourceEvent evt)
public void objectAttributeChanged(DataSourceObjectEvent e)
public void objectStructureChanged(DataSourceObjectEvent evt)
protected IlpMutableGraphModel getRepresentationModel()
This is a bound property.
protected void setRepresentationModel(IlpMutableGraphModel newmodel)
This is a bound property.
newmodel
- The model where the adapter will put representation objects.public boolean hasModel()
true
if the adapter is connected to a model.hasModel
in class IlpAbstractAdapter
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.