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.State
Nested classes/interfaces inherited from interface de.grogra.util.Lockable
Lockable.DeadLockException
-
Field Summary
Fields inherited from class de.grogra.graph.GraphFilter
source
Fields inherited from interface de.grogra.graph.ChangeBoundaryListener
ATTRIBUTE_PRIORITY, TOPOLOGY_PRIORITY, UPDATE_PRIORITY
Fields 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 TypeMethodDescriptionvoid
getAccessor
(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 boolean
getBoolean
(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 byte
getByte
(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 char
getChar
(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 double
getDouble
(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 float
getFloat
(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 int
getInt
(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 long
getLong
(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 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
.protected short
getShort
(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 void
protected void
initEdgeAccessors
(AccessorMap accessors) Additional (possibly overwritten) attributes for edges have to be declared in subclasses by overriding this method.protected void
initNodeAccessors
(AccessorMap accessors) Additional (possibly overwritten) attributes for nodes have to be declared in subclasses by overriding this method.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
.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
.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
.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
.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
.protected int
setInt
(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 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
.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
.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
.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, isWritable
Methods 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.AccessorBridge
may 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.AccessorBridge
may be used for this purpose.- Parameters:
accessors
- set of node accessors
-
accept
-
getAttributes
Description copied from interface:Graph
Returns the set of attributes which are available for the given object.- Specified by:
getAttributes
in interfaceGraph
- Overrides:
getAttributes
in classGraphFilter
- Parameters:
object
- the objectasNode
-true
ifobject
is a node,false
ifobject
is an edge- Returns:
- the object's attributes
-
getAccessor
Description copied from interface:Graph
Returns an attribute accessor for the given attribute on the given object.- Specified by:
getAccessor
in interfaceGraph
- Overrides:
getAccessor
in classGraphFilter
- Parameters:
object
- the objectasNode
-true
ifobject
is a node,false
ifobject
is 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:
getBoolean
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined 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:
setBoolean
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined for the object
-
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:
getByte
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined 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:
setByte
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined for the object
-
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:
getShort
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined 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:
setShort
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined for the object
-
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:
getChar
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined 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:
setChar
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined for the object
-
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:
getInt
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined 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:
setInt
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined for the object
-
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:
getLong
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined 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:
setLong
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined for the object
-
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:
getFloat
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined 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:
setFloat
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined for the object
-
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:
getDouble
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined 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:
setDouble
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined for the object
-
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:
getObject
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined 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:
setObject
in 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
- Throws:
NoSuchKeyException
- if the attribute is not defined for the object
-