public class IlpNetworkAdapter extends IlpAbstractNodeAdapter implements IlpStylableAdapter
The adapter gets IlpObjects from a data source
and creates corresponding network nodes and network links in a
network model.
This class can be customized using cascading style sheets. The
CSS customization is done using files that are loaded in the method
setStyleSheets(java.lang.String[]).
The following extract illustrates the customization of the adapter of the network component:
Network {
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.
FILTER_BREADTH_FIRST_THRESHOLDUPDATE_ALL_MASK, UPDATE_COMPONENT_MASK, UPDATE_NONE_MASK, UPDATE_OBJECTS_MASKAPPLIED_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 and Description |
|---|
IlpNetworkAdapter()
Default constructor.
|
IlpNetworkAdapter(IlpContext context)
Constructor with a given context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to property modification.
|
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 |
endChangingNetworkModel()
Deprecated.
Use
IlpAbstractDataSource.endBatch()
instead. |
IlpNetworkLinkFactory |
getLinkFactory()
Returns the network link factory.
|
IlpMutableNetworkModel |
getModel()
Returns the network model.
|
IlpMutableStyleSheet |
getMutableStyleSheet()
Returns a mutable style sheet that can be used to change the adapter
configuration dynamically.
|
IlpNetworkNode |
getNetworkNode(IlpObject ilpObject)
Returns the network node representing the
IlpObject. |
IlpNetworkNode |
getNetworkNode(Object identifier)
Returns the network node representing the
IlpObject
identified by identifier. |
IlpNetworkNodeFactory |
getNodeFactory()
Returns the network 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 to the current
configuration.
|
boolean |
hasStyleSheets()
Returns whether style sheets have been set or not.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener from property modification.
|
protected IlpRepresentationObject |
removeRepresentation(Object id)
Removes the representation object that corresponds to the given
identifier.
|
void |
setLinkFactory(IlpNetworkLinkFactory linkFactory)
Sets the network link factory.
|
void |
setModel(IlpMutableNetworkModel model)
Sets the network model.
|
void |
setNodeFactory(IlpNetworkNodeFactory nodeFactory)
Sets the network node factory.
|
void |
setStyleSheetDebugMask(int mask)
Sets the debug level while parsing the 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 |
startChangingNetworkModel()
Deprecated.
Use
IlpAbstractDataSource.startBatch()
instead. |
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, storeTemporaryRepresentationObjectcreateExpansionStrategy, getAcceptedClasses, getExpansionStrategyFactory, getOrigins, getPossibleRoots, getRoots, initializeAcceptedClasses, isEmptyOrigins, isOrigin, isShowingOrigin, replaceAcceptedClasses, resetOrigins, setAcceptedClasses, setExpansionStrategyFactory, setExpansionType, setOrigins, testObject, testRootObjectaddAdapterListener, 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, stopRepresentationpublic IlpNetworkAdapter()
IlpDefaultNetworkNodeFactory instance; the network
link factory with an IlpDefaultNetworkLinkFactory
and the expansion strategy factory with an instance of
IlpDefaultNodeExpansionStrategyFactory.public IlpNetworkAdapter(IlpContext context)
IlpDefaultNetworkNodeFactory instance; the network
link factory with an IlpDefaultNetworkLinkFactory
and the expansion strategy factory with an instance of
IlpDefaultNodeExpansionStrategyFactory.context - The context.IlpContext,
IlpDefaultNetworkNodeFactory,
IlpDefaultNetworkLinkFactory,
IlpDefaultNodeExpansionStrategyFactorypublic void setStyleSheets(String[] css) throws IlvStylingException
This method uses the context URL Access Service to convert file names into URLs.
setStyleSheets in interface IlvStylablecss - An array of strings containing the URLs or the file names of
CSS files (usually with a .css suffix).IlvStylingExceptiongetStyleSheets()public void setStyleSheets(String[] css, int updateMask) throws IlvStylingException
Each element can be a URL, a filename, or directly the style sheet string. The order is by priority (the last CSS takes precedence).
setStyleSheets in interface IlpStylablecss - 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
objects have to 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 representation objects that are handled by this adapter are
reconfigured according to the new style sheets.IlvStylingExceptionIlpStylable.UPDATE_COMPONENT_MASK,
IlpStylable.UPDATE_OBJECTS_MASK,
getStyleSheets()public void setStyleSheets(int index,
String css)
throws IlvStylingException
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.
setStyleSheets in interface IlvStylableindex - The index of the style sheet to replace.css - The URL or file name of the new style sheet file.IlvStylingExceptionsetStyleSheets(java.lang.String[]),
getStyleSheets(int)public void setStyleSheets(int index,
String css,
int updateMask)
throws IlvStylingException
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 this adapter.
setStyleSheets in interface IlpStylableindex - 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 if 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 representation objects that are handled by this
adapter are reconfigured according to the new style
sheets.IlvStylingException.IlvStylingExceptionIlpStylable.UPDATE_COMPONENT_MASK,
IlpStylable.UPDATE_OBJECTS_MASK,
getStyleSheets(int)public String getStyleSheets(int index)
getStyleSheets in interface IlvStylableindex - The position of the cascading style sheet to return.index-th position.setStyleSheets(int, String),
setStyleSheets(String[])public String[] getStyleSheets()
getStyleSheets in interface IlvStylablesetStyleSheets(String[])public boolean hasStyleSheets()
true if style sheets have been set in this context.public void setStyleSheetDebugMask(int mask)
setStyleSheets(java.lang.String[]) to debug
problems during configuration.
Note: This property can be set using CSS, as illustrated below:
StyleSheet {
styleSheetDebugMask: 'BAD_PROP_MASK|BAD_CLASS_MASK';
}
setStyleSheetDebugMask in interface IlvStylablemask - The debug mask, expressed as an OR combination of the
predefined flags.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_MASKpublic int getStyleSheetDebugMask()
getStyleSheetDebugMask in interface IlvStylablesetStyleSheetDebugMask(int)public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in interface IlvStylableaddPropertyChangeListener in class IlpAbstractAdapterlistener - The listener to add.public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface IlvStylableremovePropertyChangeListener in class IlpAbstractAdapterlistener - The listener to remove.public IlpMutableStyleSheet getMutableStyleSheet()
IlpStylableAdapterThe 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.
getMutableStyleSheet in interface IlpStylableAdapterprotected IlpBusinessObjectCustomization applyObjectCustomization(IlpObject ilpObject)
applyObjectCustomization in class IlpAbstractNodeAdapterilpObject - Business objectnull if customization is
not available.protected boolean hasConfigurationChanged(Map properties)
hasConfigurationChanged in class IlpAbstractHierarchyAdaptertrue if one of the properties being set is different
from the current value in the adapter.IlpAbstractAdapterprotected void doApplyConfiguration(Map properties)
doApplyConfiguration in class IlpAbstractHierarchyAdapterIlpAbstractAdapterprotected IlpRepresentationNode createNode(IlpObject ilpObject)
This method returns a representation object that is not a link.
createNode in class IlpAbstractNodeAdapterilpObject - The business objectprotected IlpRepresentationLink createLink(IlpObject ilpObject, IlpRepresentationNode fromNode, IlpRepresentationNode toNode)
createLink in class IlpAbstractNodeAdapterilpObject - The business object.fromNode - The from endpoint for the link.toNode - The to endpoint for the link.protected void clearRepresentationObjects()
clearRepresentationObjects in class IlpAbstractNodeAdapterprotected IlpRepresentationObject removeRepresentation(Object id)
IlpAbstractAdapterremoveRepresentation in class IlpAbstractNodeAdapterid - Object identifierpublic IlpMutableNetworkModel getModel()
This is a bound property.
public void setModel(IlpMutableNetworkModel model)
This is a bound property.
model - The model in which the adapter places the representation
objects.public IlpNetworkNode getNetworkNode(IlpObject ilpObject)
IlpObject.
All objects in a network model are network nodes, even network links.public IlpNetworkNode getNetworkNode(Object identifier)
IlpObject
identified by identifier.
All objects in a network model are network nodes, even network links.public void setLinkFactory(IlpNetworkLinkFactory linkFactory)
Note: This property can be customized using a CSS, as illustrated below:
Adapter {
linkFactory: @+factoryDef;
}
Subobject#factoryDef {
class: ...;
}
linkFactory - The link representation object factory.public IlpNetworkLinkFactory getLinkFactory()
public void setNodeFactory(IlpNetworkNodeFactory nodeFactory)
Note: This property can be customized using CSS.
Adapter {
nodeFactory: @+factoryDef;
}
Subobject#factoryDef {
class: ...;
}
nodeFactory - The node representation object factory.public IlpNetworkNodeFactory getNodeFactory()
@Deprecated public void startChangingNetworkModel()
IlpAbstractDataSource.startBatch()
instead.
After this call, the model notification events are delayed
until the next call to endChangingNetworkModel.
Contrary to the method IlpMutableNetworkModel,
this method ensures that the startChangingNetworkModel method
of the model is called using the correct synchronization strategy; that is,
in the Swing event thread in a regular application.
Note: The adapter needs a model for this method to work.
endChangingNetworkModel(),
IlpMutableNetworkModel.startChangingNetworkModel()@Deprecated public void endChangingNetworkModel()
IlpAbstractDataSource.endBatch()
instead.startChangingNetworkModel.
Contrary to the method IlpMutableNetworkModel,
this method ensures that the
endChangingNetworkModel method of the model is called using
the correct synchronization strategy; that is, in the Swing event thread
in a regular application.
Note:The adapter needs a model for this method to work.
startChangingNetworkModel(),
IlpMutableNetworkModel.endChangingNetworkModel()© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.