|
||||||||||
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
net.xqhs.graphs.representation.linear.LinearGraphRepresentation
net.xqhs.graphs.representation.graphical.GraphicalGraphRepresentation
public class GraphicalGraphRepresentation
Graphical representation for a Graph
that relies on LinearGraphRepresentation
to create a tree of
paths and then displays the tree of paths.
It relies on GCanvas
and the Gel
framework for the graphical display.
Currently not supporting links in the same path very well.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.xqhs.util.config.Config |
---|
net.xqhs.util.config.Config.ConfigLockedException |
Field Summary | |
---|---|
(package private) java.awt.geom.Point2D |
bottomright
Bottom right corner of the representation, in the canvas. |
(package private) net.xqhs.graphical.GCanvas |
canvas
The canvas in which the graph will be displayed. |
(package private) java.awt.geom.Point2D |
topleft
Top left corner of the representation, in the canvas. |
Fields inherited from class net.xqhs.graphs.representation.linear.LinearGraphRepresentation |
---|
isBackwards, paths, sortedNodes |
Fields inherited from class net.xqhs.graphs.representation.GraphRepresentationImplementation |
---|
parentRepresentation, theGraph, theRepresentation |
Fields inherited from class net.xqhs.util.logging.Unit |
---|
DEFAULT_LEVEL, DEFAULT_UNIT_NAME |
Constructor Summary | |
---|---|
GraphicalGraphRepresentation(Graph theGraph)
Creates a new representation, based on the specified graph. |
Method Summary | |
---|---|
net.xqhs.graphical.GCanvas |
displayRepresentation()
Depending on the nature of the representation, this method returns a way to visualize the representation. |
protected void |
doLayout()
|
protected void |
doLayout(GraphicalRepresentationElement repr,
java.awt.Point cPos,
float wFactor,
float hFactor,
GraphicalRepresentationElement container)
|
GraphicalRepresentationElement |
getRepresentation()
Gets the root element of the representation. |
GraphicalGraphRepresentation |
makeDefaults()
Sets a new GCanvas as a canvas for the representation, and sets the representation to be represented in a
200 units square centered in the origin of the canvas. |
protected java.awt.Point |
measureLayout(GraphicalRepresentationElement repr)
|
protected void |
processGraph()
Calculates the graph paths and creates the layout. |
protected GraphicalRepresentationElement |
representChildren(PathElement el,
java.util.Set<PathElement> blackNodes)
|
protected void |
representOthers(java.util.List<PathElement> others,
java.util.Set<PathElement> blackNodes,
GraphicalRepresentationElement.EdgeType edgeType,
PathElement parent,
GraphicalRepresentationElement parentRepr)
|
GraphicalGraphRepresentation |
setBottomRight(java.awt.geom.Point2D bottomRight)
Sets the size of the representation, by means of the bottom right corner. |
GraphicalGraphRepresentation |
setCanvas(net.xqhs.graphical.GCanvas representationCanvas)
Configures the representation to use the specified canvas. |
protected java.lang.String |
setDefaultName(java.lang.String name)
This can be overridden by other representations to produce the correct suffix. |
GraphicalGraphRepresentation |
setOrigin(java.awt.geom.Point2D origin)
Sets the origin of the rectangle for this representation, on the GCanvas. |
Methods inherited from class net.xqhs.graphs.representation.linear.LinearGraphRepresentation |
---|
buildPaths, isBackwards, setBackwards, setBackwards |
Methods inherited from class net.xqhs.graphs.representation.GraphRepresentationImplementation |
---|
getRootRepresentation, setParentRepresentation, setUnitName, update |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
net.xqhs.graphical.GCanvas canvas
java.awt.geom.Point2D topleft
java.awt.geom.Point2D bottomright
Constructor Detail |
---|
public GraphicalGraphRepresentation(Graph theGraph)
theGraph
- - the Graph
instance to be represented.Method Detail |
---|
public GraphicalGraphRepresentation makeDefaults()
GCanvas
as a canvas for the representation, and sets the representation to be represented in a
200 units square centered in the origin of the canvas.
makeDefaults
in interface net.xqhs.util.config.Configurable
makeDefaults
in class net.xqhs.util.config.Config
public GraphicalGraphRepresentation setCanvas(net.xqhs.graphical.GCanvas representationCanvas)
representationCanvas
- - the GCanvas
instance. If the argument is null
, the call will be ignored.
public GraphicalGraphRepresentation setOrigin(java.awt.geom.Point2D origin)
origin
- - the origin (top left corner - the minimum x and y in the representation).
public GraphicalGraphRepresentation setBottomRight(java.awt.geom.Point2D bottomRight)
bottomRight
- - the bottom right corner - the maximum x and y in the representation).
protected java.lang.String setDefaultName(java.lang.String name)
GraphRepresentationImplementation
setDefaultName
in class LinearGraphRepresentation
name
- : the name of the graph's unit.
protected void processGraph()
processGraph
in class LinearGraphRepresentation
protected GraphicalRepresentationElement representChildren(PathElement el, java.util.Set<PathElement> blackNodes)
protected void representOthers(java.util.List<PathElement> others, java.util.Set<PathElement> blackNodes, GraphicalRepresentationElement.EdgeType edgeType, PathElement parent, GraphicalRepresentationElement parentRepr)
protected void doLayout()
protected void doLayout(GraphicalRepresentationElement repr, java.awt.Point cPos, float wFactor, float hFactor, GraphicalRepresentationElement container)
protected java.awt.Point measureLayout(GraphicalRepresentationElement repr)
public GraphicalRepresentationElement getRepresentation()
GraphRepresentation
getRepresentation
in interface GraphRepresentation
getRepresentation
in class GraphRepresentationImplementation
RepresentationElement
instance.public net.xqhs.graphical.GCanvas displayRepresentation()
GraphRepresentation
String
.
displayRepresentation
in interface GraphRepresentation
displayRepresentation
in class GraphRepresentationImplementation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |