java.lang.Object
de.grogra.graph.GraphBase
de.grogra.graph.GraphFilter
de.grogra.graph.AttributeOverwritingFilter
- All Implemented Interfaces:
AttributeChangeListener,ChangeBoundaryListener,EdgeChangeListener,Graph,Lockable
- Direct Known Subclasses:
HighlightFilter,TopologyGraph
This graph filter may be used as superclass for graph filters
which overwrite attribute values of their source graphs.
It implements the attribute-related methods such that the attributes
of the filtered graph are the attributes of the source graph plus
the additionally defined attributes (which may be overwritten
attributes of the source graph). The additional attributes have to be
declared by overriding the methods
initNodeAccessors(AccessorMap)
and initEdgeAccessors(AccessorMap).- Author:
- Ole Kniemeyer
-
Nested Class Summary
Nested classes/interfaces inherited from class de.grogra.graph.GraphFilter
GraphFilter.AccessorBridge, GraphFilter.StateNested classes/interfaces inherited from interface de.grogra.util.Lockable
Lockable.DeadLockException -
Field Summary
Fields inherited from class de.grogra.graph.GraphFilter
sourceFields inherited from interface de.grogra.graph.ChangeBoundaryListener
ATTRIBUTE_PRIORITY, TOPOLOGY_PRIORITY, UPDATE_PRIORITYFields inherited from interface de.grogra.graph.Graph
BRANCH_EDGE, CONTAINMENT_EDGE, CONTAINMENT_END_EDGE, EDGENODE_IN_EDGE, EDGENODE_OUT_EDGE, ELLIPSE_SYMBOL, IGNORED_EDGE, INSTANTIATION_EDGE, MAIN_GRAPH, MARK_EDGE, MIN_NORMAL_BIT_INDEX, MIN_UNUSED_EDGE, MIN_UNUSED_EDGE_BIT, NOTIFIES_EDGE, PERSISTENT, PERSISTENT_DELETED, RECTANGLE_SYMBOL, REFINEMENT_EDGE, RHOMBUS_SYMBOL, ROUND_RECTANGLE_SYMBOL, SPECIAL_EDGE_MASK, SPECIAL_EDGE_OF_SOURCE_BIT, STD_EDGE_5, STD_EDGE_6, SUCCESSOR_EDGE, TRANSIENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetAccessor(Object object, boolean asNode, Attribute attribute) Returns an attribute accessor for the given attribute on the given object.getAttributes(Object object, boolean asNode) Returns the set of attributes which are available for the given object.protected booleangetBoolean(Object object, GraphFilter.AccessorBridge accessor, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge.protected bytegetByte(Object object, GraphFilter.AccessorBridge accessor, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge.protected chargetChar(Object object, GraphFilter.AccessorBridge accessor, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge.protected doublegetDouble(Object object, GraphFilter.AccessorBridge accessor, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge.protected floatgetFloat(Object object, GraphFilter.AccessorBridge accessor, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge.protected intgetInt(Object object, GraphFilter.AccessorBridge accessor, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge.protected longgetLong(Object object, GraphFilter.AccessorBridge accessor, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge.protected ObjectgetObject(Object object, GraphFilter.AccessorBridge accessor, Object placeIn, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge.protected shortgetShort(Object object, GraphFilter.AccessorBridge accessor, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge.protected voidprotected voidinitEdgeAccessors(AccessorMap accessors) Additional (possibly overwritten) attributes for edges have to be declared in subclasses by overriding this method.protected voidinitNodeAccessors(AccessorMap accessors) Additional (possibly overwritten) attributes for nodes have to be declared in subclasses by overriding this method.protected booleansetBoolean(Object object, GraphFilter.AccessorBridge accessor, boolean value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge.protected bytesetByte(Object object, GraphFilter.AccessorBridge accessor, byte value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge.protected charsetChar(Object object, GraphFilter.AccessorBridge accessor, char value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge.protected doublesetDouble(Object object, GraphFilter.AccessorBridge accessor, double value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge.protected floatsetFloat(Object object, GraphFilter.AccessorBridge accessor, float value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge.protected intsetInt(Object object, GraphFilter.AccessorBridge accessor, int value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge.protected longsetLong(Object object, GraphFilter.AccessorBridge accessor, long value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge.protected ObjectsetObject(Object object, GraphFilter.AccessorBridge accessor, Object value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge.protected shortsetShort(Object object, GraphFilter.AccessorBridge accessor, short value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge.Methods inherited from class de.grogra.graph.GraphFilter
accept, attributeChanged, beginChange, createBooleanMap, createMainState, createObjectMap, createState, edgeChanged, endChange, getColor, getDependent, getDependentOfSource, getDescription, getEdgeBits, getFirstEdge, getId, getInstantiator, getLifeCycleState, getName, getNextEdge, getNodeForId, getObjectForName, getParentAttribute, getPriority, getRoot, getRootKeys, getSourceNode, getSourceState, getSpecialEdgeDescriptors, getStamp, getSymbol, getTargetNode, getTreePattern, isWritableMethods inherited from class de.grogra.graph.GraphBase
addAttributeChangeListener, addAttributeChangeListener, addChangeBoundaryListener, addEdgeChangeListener, addEdgeChangeListener, execute, execute, executeForcedly, executeForcedly, getMainState, getMaxWaitingTime, getQueueLength, getStateMap, init, isLocked, removeAttributeChangeListener, removeAttributeChangeListener, removeChangeBoundaryListener, removeEdgeChangeListener, removeEdgeChangeListener
-
Constructor Details
-
AttributeOverwritingFilter
-
-
Method Details
-
initAttributeOverwritingFilter
protected void initAttributeOverwritingFilter() -
initNodeAccessors
Additional (possibly overwritten) attributes for nodes have to be declared in subclasses by overriding this method. For each overwritten attribute, a suitable accessor has to be added toaccessors. Instances ofGraphFilter.AccessorBridgemay be used for this purpose.- Parameters:
accessors- set of node accessors
-
initEdgeAccessors
Additional (possibly overwritten) attributes for edges have to be declared in subclasses by overriding this method. For each overwritten attribute, a suitable accessor has to be added toaccessors. Instances ofGraphFilter.AccessorBridgemay be used for this purpose.- Parameters:
accessors- set of node accessors
-
accept
-
getAttributes
Description copied from interface:GraphReturns the set of attributes which are available for the given object.- Specified by:
getAttributesin interfaceGraph- Overrides:
getAttributesin classGraphFilter- Parameters:
object- the objectasNode-trueifobjectis a node,falseifobjectis an edge- Returns:
- the object's attributes
-
getAccessor
Description copied from interface:GraphReturns an attribute accessor for the given attribute on the given object.- Specified by:
getAccessorin interfaceGraph- Overrides:
getAccessorin classGraphFilter- Parameters:
object- the objectasNode-trueifobjectis a node,falseifobjectis an edgeattribute- the attribute- Returns:
- an accessor for the object's attribute value
-
getBoolean
This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge. The default implementation returns the value ofaccessor's attribute in the source graph.- Overrides:
getBooleanin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodgs- current graph state- Returns:
- value of the accessor's attribute for the object
-
setBoolean
protected boolean setBoolean(Object object, GraphFilter.AccessorBridge accessor, boolean value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge. The default implementation sets the value ofaccessor's attribute in the source graph.- Overrides:
setBooleanin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodvalue- the new value for the attributegs- current graph state- Returns:
- actual new value of the attribute
-
getByte
This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge. The default implementation returns the value ofaccessor's attribute in the source graph.- Overrides:
getBytein classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodgs- current graph state- Returns:
- value of the accessor's attribute for the object
-
setByte
protected byte setByte(Object object, GraphFilter.AccessorBridge accessor, byte value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge. The default implementation sets the value ofaccessor's attribute in the source graph.- Overrides:
setBytein classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodvalue- the new value for the attributegs- current graph state- Returns:
- actual new value of the attribute
-
getShort
This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge. The default implementation returns the value ofaccessor's attribute in the source graph.- Overrides:
getShortin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodgs- current graph state- Returns:
- value of the accessor's attribute for the object
-
setShort
protected short setShort(Object object, GraphFilter.AccessorBridge accessor, short value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge. The default implementation sets the value ofaccessor's attribute in the source graph.- Overrides:
setShortin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodvalue- the new value for the attributegs- current graph state- Returns:
- actual new value of the attribute
-
getChar
This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge. The default implementation returns the value ofaccessor's attribute in the source graph.- Overrides:
getCharin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodgs- current graph state- Returns:
- value of the accessor's attribute for the object
-
setChar
protected char setChar(Object object, GraphFilter.AccessorBridge accessor, char value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge. The default implementation sets the value ofaccessor's attribute in the source graph.- Overrides:
setCharin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodvalue- the new value for the attributegs- current graph state- Returns:
- actual new value of the attribute
-
getInt
This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge. The default implementation returns the value ofaccessor's attribute in the source graph.- Overrides:
getIntin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodgs- current graph state- Returns:
- value of the accessor's attribute for the object
-
setInt
This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge. The default implementation sets the value ofaccessor's attribute in the source graph.- Overrides:
setIntin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodvalue- the new value for the attributegs- current graph state- Returns:
- actual new value of the attribute
-
getLong
This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge. The default implementation returns the value ofaccessor's attribute in the source graph.- Overrides:
getLongin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodgs- current graph state- Returns:
- value of the accessor's attribute for the object
-
setLong
protected long setLong(Object object, GraphFilter.AccessorBridge accessor, long value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge. The default implementation sets the value ofaccessor's attribute in the source graph.- Overrides:
setLongin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodvalue- the new value for the attributegs- current graph state- Returns:
- actual new value of the attribute
-
getFloat
This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge. The default implementation returns the value ofaccessor's attribute in the source graph.- Overrides:
getFloatin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodgs- current graph state- Returns:
- value of the accessor's attribute for the object
-
setFloat
protected float setFloat(Object object, GraphFilter.AccessorBridge accessor, float value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge. The default implementation sets the value ofaccessor's attribute in the source graph.- Overrides:
setFloatin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodvalue- the new value for the attributegs- current graph state- Returns:
- actual new value of the attribute
-
getDouble
This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge. The default implementation returns the value ofaccessor's attribute in the source graph.- Overrides:
getDoublein classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodgs- current graph state- Returns:
- value of the accessor's attribute for the object
-
setDouble
protected double setDouble(Object object, GraphFilter.AccessorBridge accessor, double value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge. The default implementation sets the value ofaccessor's attribute in the source graph.- Overrides:
setDoublein classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodvalue- the new value for the attributegs- current graph state- Returns:
- actual new value of the attribute
-
getObject
protected Object getObject(Object object, GraphFilter.AccessorBridge accessor, Object placeIn, GraphState gs) This method has to be implemented by subclasses in order to obtain the value of an additional attribute which is defined by anGraphFilter.AccessorBridge. The default implementation returns the value ofaccessor's attribute in the source graph.- Overrides:
getObjectin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodplaceIn- an instance for the result may be provided by the callergs- current graph state- Returns:
- value of the accessor's attribute for the object
-
setObject
protected Object setObject(Object object, GraphFilter.AccessorBridge accessor, Object value, GraphState gs) This method has to be implemented by subclasses in order to set value of an additional writable attribute which is defined by anGraphFilter.AccessorBridge. The default implementation sets the value ofaccessor's attribute in the source graph.- Overrides:
setObjectin classGraphFilter- Parameters:
object- the objectaccessor- the accessor bridge which invokes this methodvalue- the new value for the attributegs- current graph state- Returns:
- actual new value of the attribute
-