public class GraphVisualizer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GraphVisualizer.AddMode
Represents whether added objects are created, deleted or neither.
|
static class |
GraphVisualizer.RuleVisi
Class used to return rule visualizations.
|
class |
GraphVisualizer.VisualSynchronizer
GraphEditSynchronizer implementation which uses the style properties of
this GraphVisualizer.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
arityStyleName |
static java.lang.String |
connectionStyleName |
static java.lang.String |
createdArityStyleName |
static java.lang.String |
createdConnectionStyleName |
static java.lang.String |
createdEdgeStyleName |
static java.lang.String |
createdHyperedgeStyleName |
static java.lang.String |
createdLabelStyleName |
static java.lang.String |
createdNodeStyleName |
static java.lang.String |
deletedArityStyleName |
static java.lang.String |
deletedConnectionStyleName |
static java.lang.String |
deletedEdgeStyleName |
static java.lang.String |
deletedHyperedgeStyleName |
static java.lang.String |
deletedLabelStyleName |
static java.lang.String |
deletedNodeStyleName |
static java.lang.String |
edgeStyleName |
static java.lang.String |
hyperedgeStyleName |
static java.lang.String |
labelStyleName |
static java.lang.String |
morphismStyleName |
static java.lang.String |
nodeStyleName |
static java.lang.String |
stateStyleName |
static java.lang.String |
transitionStyleName |
Constructor and Description |
---|
GraphVisualizer()
Creates a new GraphVisualizer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addDefaultStyles(de.uni_due.inf.ti.visigraph.StyleMap styleMap)
Adds default styles to the style names of this GraphVisualizer.
|
java.awt.geom.Rectangle2D |
getBounds()
Returns the bounds of the generated graphs.
|
java.awt.geom.Rectangle2D |
getBounds(java.awt.geom.Rectangle2D result)
Returns the bounds of the generated graphs.
|
GraphVisualizer.VisualSynchronizer |
getSynchronizer()
Returns a GraphEditSynchronizer for Graph instances which uses the
style properties of this visualizer.
|
boolean |
hasEdgeLabels()
Determines whether graph visualizations have edge labels.
|
boolean |
hasHyperStyle()
Returns whether this GraphVisualizer will always generate hypergraph
representations.
|
boolean |
hasNodeLabels()
Determines whether graph visualizations have node labels.
|
void |
setBounds(double x,
double y,
double width,
double height)
Sets the bounds of the generated graphs.
|
void |
setBounds(java.awt.geom.Rectangle2D rect)
Sets the bounds of the generated graphs to a rectangle.
|
void |
setEdgeLabels(boolean edgeLabels)
Sets whether graph visualizations have edge labels.
|
void |
setHyperStyle(boolean h)
Sets whether this GraphVisualizer will always generated hypergraph
representations.
|
void |
setNodeLabels(boolean nodeLabels)
Sets whether graph visualizations have node labels.
|
de.uni_due.inf.ti.visigraph.VxGraph |
visualizeFlatMorphism(Morphism morph)
Creates a VxGraph which visualizes a rule, where the rule is displayed
as a single graph with different style for deleted and created parts.
|
de.uni_due.inf.ti.visigraph.VxGraph |
visualizeGraph(Graph graph)
Creates a VxGraph which visualizes a graph.
|
GraphVisualizer.RuleVisi |
visualizeMorphism(Morphism morph)
Creates a VxGraph which visualizes a rule.
|
de.uni_due.inf.ti.visigraph.VxGraph |
visualizeSystem(ExplicitTransitionSystem system)
Visualizes a transition system.
|
public static java.lang.String nodeStyleName
public static java.lang.String createdNodeStyleName
public static java.lang.String deletedNodeStyleName
public static java.lang.String hyperedgeStyleName
public static java.lang.String createdHyperedgeStyleName
public static java.lang.String deletedHyperedgeStyleName
public static java.lang.String edgeStyleName
public static java.lang.String createdEdgeStyleName
public static java.lang.String deletedEdgeStyleName
public static java.lang.String labelStyleName
public static java.lang.String createdLabelStyleName
public static java.lang.String deletedLabelStyleName
public static java.lang.String connectionStyleName
public static java.lang.String createdConnectionStyleName
public static java.lang.String deletedConnectionStyleName
public static java.lang.String arityStyleName
public static java.lang.String createdArityStyleName
public static java.lang.String deletedArityStyleName
public static java.lang.String morphismStyleName
public static java.lang.String stateStyleName
public static java.lang.String transitionStyleName
public void addDefaultStyles(de.uni_due.inf.ti.visigraph.StyleMap styleMap)
styleMap
- style map to add default style topublic void setBounds(double x, double y, double width, double height)
x
- x-coordinate of the top-left corner of the bounding rectangley
- y-coordinate of the top-left corner of the bounding rectanglewidth
- width of the bounding rectangleheight
- height of the bounding rectanglepublic void setBounds(java.awt.geom.Rectangle2D rect)
rect
- the new bounding rectanglepublic java.awt.geom.Rectangle2D getBounds(java.awt.geom.Rectangle2D result)
Rectangle2D
object holding the bounds is created and
returned.result
- buffer to hold the return valuepublic java.awt.geom.Rectangle2D getBounds()
result
- buffer to hold the return valuepublic void setHyperStyle(boolean h)
true
, the GraphVisualizer will generate
hypergraph representations of graphs which contain only binary edges.h
- whether this GraphVisualizer will always generate hypergraph
representationspublic boolean hasHyperStyle()
setHyperStyle(boolean)
public void setNodeLabels(boolean nodeLabels)
The default value is true
.
nodeLabels
- whether or not nodes will have their id numbers as labelshasNodeLabels()
public boolean hasNodeLabels()
setNodeLabels(boolean)
public void setEdgeLabels(boolean edgeLabels)
true
, edges in graph visualization created with this
GraphVisualizer afterwards will have labels. Since edge labels are
semantically significant in the graphs modelled by Graph
objects, setting this property to false
is mainly useful if it
is known that only one label can occur in a graph.
The default value of this property is true
.
edgeLabels
- whether or not edges will have labelshasEdgeLabels()
public boolean hasEdgeLabels()
setEdgeLabels(boolean)
public de.uni_due.inf.ti.visigraph.VxGraph visualizeGraph(Graph graph)
If either getHyperStyle() == true
, or this graph contains
non-binary edges, the graph is visualized using a hypergraph
representation; otherwise an ordinary graph representation is used.
The nodes and hyperedges of the graphical representation are put on arbitrary positions, whereas all edges will be straight lines from the source to the target node. In most cases, it will be necessary to layout the resulting graphical representation, either manually or with one of the graph layout algorithm provided with the VisiGraph library.
The result visualization uses the following style names:
graph
- the graph of which a visualization is generatedjava.lang.NullPointerException
- if graph
is null
public GraphVisualizer.RuleVisi visualizeMorphism(Morphism morph)
leftGroup
and rightGroup
groups, respectively.
If either getHyperStyle() == true
, this rule contains
non-binary edges, or the correspondence morphism maps at least one edge
of the left-hand side to one edge in the right-hand side, the graph is
visualized using a hypergraph representation; otherwise an ordinary
graph representation is used.
The nodes and hyperedges of the graphical representation are put on random positions, whereas all edges will be straight lines from the source to the target node. In most cases, it will be necessary to layout the resulting graphical representation, either manually or with one of the graph layout algorithm provided with the VisiGraph library.
The resulting visualization uses the following style names:
morph
- the morphism of which a visualization is generatedjava.lang.NullPointerException
- if morph
is null
public de.uni_due.inf.ti.visigraph.VxGraph visualizeFlatMorphism(Morphism morph)
If either getHyperStyle() == true
, or this rule contains
non-binary edges, the rule is visualized using a hypergraph
representation; otherwise an ordinary graph representation is used.
The nodes and hyperedges of the graphical representation are put on random positions, whereas all edges will be straight lines from the source to the target node. In most cases, it will be necessary to layout the resulting graphical representation, either manually or with one of the graph layout algorithms provided with the VisiGraph library.
The result visualization uses the styles associated with the following style identifiers:
rule
- the rule to be visualizedjava.lang.NullPointerException
- if rule
is null
java.lang.IllegalArgumentException
- if rule
does not have an injective correspondence
morphismpublic de.uni_due.inf.ti.visigraph.VxGraph visualizeSystem(ExplicitTransitionSystem system)
This method ignores the property set by setHyperStyle(boolean)
and will always produce binary, directed graphs.
The result visualization uses the styles associated with the following style identifiers:
system
- system for which a visual representation is to be generatedpublic GraphVisualizer.VisualSynchronizer getSynchronizer()