|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.xqhs.util.config.Config
net.xqhs.util.logging.Unit
net.xqhs.graphs.representation.GraphRepresentationImplementation
public abstract class GraphRepresentationImplementation
Abstract class for all classes that produce a representation (graphical, textual, etc) for a Graph
instance.
It is possible that a GraphRepresentationImplementation
class uses other, "sub-"
GraphRepresentationImplementation
instances for the representation, forming a tree that is defined by its
root representation. In this tree, each representation has a parentRepresentation
. If this
instance is the root of the tree (or it is not part of such a tree), the member is null
.
A GraphRepresentationImplementation
is based on RepresentationElement
instances, each instance
associated with a specific VisualizableGraphComponent
. Representation elements should be updateable,
potentially leading to an update of the whole representation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.xqhs.util.config.Config |
---|
net.xqhs.util.config.Config.ConfigLockedException |
Field Summary | |
---|---|
protected GraphRepresentation |
parentRepresentation
The parent representation in the tree of representations this is part of (if any such tree exists). |
protected Graph |
theGraph
The represented Graph . |
protected RepresentationElement |
theRepresentation
The root representation element of this representation, from which all other elements in this representation can be found. |
Fields inherited from class net.xqhs.util.logging.Unit |
---|
DEFAULT_LEVEL, DEFAULT_UNIT_NAME |
Constructor Summary | |
---|---|
GraphRepresentationImplementation(Graph graph)
This constructor creates the link with the Graph instance that this representation will be bound to
throughout its lifecycle. |
Method Summary | |
---|---|
abstract java.lang.Object |
displayRepresentation()
Depending on the nature of the representation, this method returns a way to visualize the representation. |
abstract RepresentationElement |
getRepresentation()
Gets the root element of the representation. |
GraphRepresentation |
getRootRepresentation()
Gets the root representation of the tree of representation this instance is part of. |
protected void |
processGraph()
Begins processing of the graph in order to create a representation. |
protected java.lang.String |
setDefaultName(java.lang.String name)
This can be overridden by other representations to produce the correct suffix. |
GraphRepresentationImplementation |
setParentRepresentation(GraphRepresentation parent)
Set the parent representation in a multi-level graph representation. |
GraphRepresentationImplementation |
setUnitName(java.lang.String unitName)
|
GraphRepresentation |
update()
Instructs the representation to update, since some elements of the graph may have changed. |
Methods inherited from class net.xqhs.util.logging.Unit |
---|
compose, dbg, doExit, getDefaultUnitName, getUnitName, l, le, lf, li, lock, lockedR, lr, lr, lw, setLink, setLink, setLogDisplay, setLogEnsureNew, setLoggerClass, setLoggerType, setLoggerTypeClass, setLogLevel, setLogReporter, setUnitName |
Methods inherited from class net.xqhs.util.config.Config |
---|
build, ensureLocked, locked, lockedEx, makeDefaults |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Graph theGraph
Graph
.
protected GraphRepresentation parentRepresentation
protected RepresentationElement theRepresentation
Constructor Detail |
---|
public GraphRepresentationImplementation(Graph graph)
Graph
instance that this representation will be bound to
throughout its lifecycle.
graph
- : the represented graph.Method Detail |
---|
protected java.lang.String setDefaultName(java.lang.String name)
name
- : the name of the graph's unit.
public GraphRepresentationImplementation setUnitName(java.lang.String unitName)
setUnitName
in class net.xqhs.util.logging.Unit
public GraphRepresentationImplementation setParentRepresentation(GraphRepresentation parent)
GraphRepresentation
The argument may be null
, to indicate this representation does not belong to a larger one, or is the
root of a larger representation.
setParentRepresentation
in interface GraphRepresentation
parent
- : the parent representation.
public GraphRepresentation getRootRepresentation()
GraphRepresentation
getRootRepresentation
in interface GraphRepresentation
GraphRepresentation
.public GraphRepresentation update()
GraphRepresentation
FIXME: this is inefficient as it will cause the whole representation to update - there is no indication on what part of the graph has changed.
update
in interface GraphRepresentation
protected void processGraph()
It is assumed that all configuration of this instance is completed when this method is called.
It is important for inheriting classes to call super.processGraph()
because this ensures that the
instance is 'locked' (see Unit
).
public abstract RepresentationElement getRepresentation()
GraphRepresentation
getRepresentation
in interface GraphRepresentation
RepresentationElement
instance.public abstract java.lang.Object displayRepresentation()
GraphRepresentation
String
.
displayRepresentation
in interface GraphRepresentation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |