net.xqhs.graphs.representation
Class AbstractVisualizableGraphComponent

java.lang.Object
  extended by net.xqhs.graphs.representation.AbstractVisualizableGraphComponent
All Implemented Interfaces:
VisualizableGraphComponent
Direct Known Subclasses:
SimpleEdge, SimpleNode

public abstract class AbstractVisualizableGraphComponent
extends java.lang.Object
implements VisualizableGraphComponent

THis class implements the basic representing element management required by the VisualizableGraphComponent interface. It does so by maintaining a Set of RepresentationElement instances.

Author:
Andrei Olaru

Field Summary
protected  java.util.Set<RepresentationElement> representations
          The set of elements representing this component.
 
Constructor Summary
AbstractVisualizableGraphComponent()
           
 
Method Summary
 void addRepresentation(RepresentationElement repr)
          Adds a new representation for this component (as a RepresentationElement) to the list of active representations.
 RepresentationElement getFirstRepresentationForRoot(GraphRepresentation root)
          Gets the first (and potentially only) element representing this component that is part of the specified (multi-level) representation.
 java.util.Collection<RepresentationElement> getRepresentations()
          Gets a collection of the elements representing this component (in various representations).
 java.util.Collection<RepresentationElement> getRepresentationsForRoot(GraphRepresentation root)
          Gets a collection of elements representing this component, filtered to match only the one(s) that belong to a particular (multi-level) representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

representations

protected java.util.Set<RepresentationElement> representations
The set of elements representing this component.

Constructor Detail

AbstractVisualizableGraphComponent

public AbstractVisualizableGraphComponent()
Method Detail

addRepresentation

public void addRepresentation(RepresentationElement repr)
Description copied from interface: VisualizableGraphComponent
Adds a new representation for this component (as a RepresentationElement) to the list of active representations.

Specified by:
addRepresentation in interface VisualizableGraphComponent
Parameters:
repr - : the element representing this component.

getRepresentations

public java.util.Collection<RepresentationElement> getRepresentations()
Description copied from interface: VisualizableGraphComponent
Gets a collection of the elements representing this component (in various representations).

Specified by:
getRepresentations in interface VisualizableGraphComponent
Returns:
a collection of the representing elements.

getFirstRepresentationForRoot

public RepresentationElement getFirstRepresentationForRoot(GraphRepresentation root)
Description copied from interface: VisualizableGraphComponent
Gets the first (and potentially only) element representing this component that is part of the specified (multi-level) representation.

Specified by:
getFirstRepresentationForRoot in interface VisualizableGraphComponent
Parameters:
root - : the root representation to which the returned element should belong.
Returns:
the required representing element.

getRepresentationsForRoot

public java.util.Collection<RepresentationElement> getRepresentationsForRoot(GraphRepresentation root)
Description copied from interface: VisualizableGraphComponent
Gets a collection of elements representing this component, filtered to match only the one(s) that belong to a particular (multi-level) representation.

Specified by:
getRepresentationsForRoot in interface VisualizableGraphComponent
Parameters:
root - : the root representation to which the returned elements belong.
Returns:
the elements representing this component and belonging to the specified representation.