public class AnnotatedTypeGraphVisualizer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AnnotatedTypeGraphVisualizer.AddMode
Represents whether added objects are created, deleted or neither.
|
static class |
AnnotatedTypeGraphVisualizer.GraphColor
Specifies the color to be used for colored graphs.
|
static class |
AnnotatedTypeGraphVisualizer.MorphismVisi
Class used to return morphism visualizations.
|
static class |
AnnotatedTypeGraphVisualizer.RuleVisi
Class used to return morphism visualizations.
|
class |
AnnotatedTypeGraphVisualizer.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 |
grayNodeStyleName |
static java.lang.String |
hyperedgeStyleName |
static java.lang.String |
interfaceEdgeStyleName |
static java.lang.String |
interfaceNodeStyleName |
static java.lang.String |
labelStyleName |
static java.lang.String |
morphismEdgeStyleName |
static java.lang.String |
morphismStyleName |
static java.lang.String |
nodeStyleName |
static java.lang.String |
rightEdgeStyleName |
static java.lang.String |
rightNodeStyleName |
static java.lang.String |
stateStyleName |
static java.lang.String |
transitionStyleName |
Constructor and Description |
---|
AnnotatedTypeGraphVisualizer()
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.
|
AnnotatedTypeGraphVisualizer.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 |
hasEdgesMultiplicityStyle()
Returns whether this GraphVisualizer will always display multiplicities on edges.
|
boolean |
hasHyperStyle()
Returns whether this GraphVisualizer will always generate hypergraph
representations.
|
boolean |
hasNodeLabels()
Determines whether graph visualizations have node labels.
|
boolean |
hasNodeMultiplicityStyle()
Returns whether this GraphVisualizer will always display multiplicities on nodes instead of id's.
|
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 |
setMultiplicityStyle(boolean m)
Sets whether this GraphVisualizer will always display multiplicities.
|
void |
setNodeIDs(boolean nodeIDs)
Sets whether graph visualizations have node IDs.
|
void |
setNodeLabels(boolean nodeLabels)
Sets whether graph visualizations have node labels.
|
de.uni_due.inf.ti.visigraph.VxGraph |
visualizeColoredGraph(AnnotatedTypeGraph graph,
java.util.Set<de.uni_due.inf.ti.graph.Node> coloredNodes,
java.util.Set<de.uni_due.inf.ti.graph.Edge> coloredEdges,
AnnotatedTypeGraphVisualizer.GraphColor style,
boolean simplified)
Creates a VxGraph which visualizes a graph.
|
AnnotatedTypeGraphVisualizer.RuleVisi |
visualizeDPO(de.uni_due.inf.ti.graph.Morphism leftMorph,
de.uni_due.inf.ti.graph.Morphism rightMorph)
Creates a VxGraph which visualizes a morphism.
|
de.uni_due.inf.ti.visigraph.VxGraph |
visualizeFlatMorphism(de.uni_due.inf.ti.graph.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(AnnotatedTypeGraph graph)
Creates a VxGraph which visualizes a graph.
|
AnnotatedTypeGraphVisualizer.MorphismVisi |
visualizeMorphism(de.uni_due.inf.ti.graph.Morphism morph,
boolean leftMulti,
boolean rightMulti)
Creates a VxGraph which visualizes a morphism.
|
AnnotatedTypeGraphVisualizer.MorphismVisi |
visualizePostconditionMatch(de.uni_due.inf.ti.graph.Morphism morph,
java.util.Set<de.uni_due.inf.ti.graph.Node> coloredNodes,
java.util.Set<de.uni_due.inf.ti.graph.Edge> coloredEdges,
AnnotatedTypeGraphVisualizer.GraphColor color,
boolean simplified) |
de.uni_due.inf.ti.visigraph.VxGraph |
visualizeSystem(de.uni_due.inf.ti.graph.ExplicitTransitionSystem system)
Visualizes a transition system.
|
public static java.lang.String nodeStyleName
public static java.lang.String grayNodeStyleName
public static java.lang.String createdNodeStyleName
public static java.lang.String rightNodeStyleName
public static java.lang.String deletedNodeStyleName
public static java.lang.String interfaceNodeStyleName
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 rightEdgeStyleName
public static java.lang.String deletedEdgeStyleName
public static java.lang.String interfaceEdgeStyleName
public static java.lang.String morphismEdgeStyleName
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 AnnotatedTypeGraphVisualizer()
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()
public 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 setMultiplicityStyle(boolean m)
true
, the GraphVisualizer will generate
graphs which contain multiplicities on nodes and edges.m
- whether this GraphVisualizer will always display multiplicitiespublic boolean hasNodeMultiplicityStyle()
setMultiplicityStyle(boolean)
public boolean hasEdgesMultiplicityStyle()
setMultiplicityStyle(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 void setNodeIDs(boolean nodeIDs)
The default value is true
.
nodeIDs
- whether or not nodes will have their id numbers as labelshasNodeLabels()
public de.uni_due.inf.ti.visigraph.VxGraph visualizeGraph(AnnotatedTypeGraph 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 de.uni_due.inf.ti.visigraph.VxGraph visualizeColoredGraph(AnnotatedTypeGraph graph, java.util.Set<de.uni_due.inf.ti.graph.Node> coloredNodes, java.util.Set<de.uni_due.inf.ti.graph.Edge> coloredEdges, AnnotatedTypeGraphVisualizer.GraphColor style, boolean simplified)
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 generatedcoloredNodes
- the nodes to be coloredcoloredEdges
- the edges to be coloredstyle
- the graph color to be usedsimplified
- boolean if the graph should be simplifiedjava.lang.NullPointerException
- if graph
is null
public AnnotatedTypeGraphVisualizer.MorphismVisi visualizeMorphism(de.uni_due.inf.ti.graph.Morphism morph, boolean leftMulti, boolean rightMulti)
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 generatedleftMulti
- boolean if the domain graph has multiplicitiesrightMulti
- boolean if the codomain graph has multiplicitiesjava.lang.NullPointerException
- if morph
is null
public AnnotatedTypeGraphVisualizer.MorphismVisi visualizePostconditionMatch(de.uni_due.inf.ti.graph.Morphism morph, java.util.Set<de.uni_due.inf.ti.graph.Node> coloredNodes, java.util.Set<de.uni_due.inf.ti.graph.Edge> coloredEdges, AnnotatedTypeGraphVisualizer.GraphColor color, boolean simplified)
public AnnotatedTypeGraphVisualizer.RuleVisi visualizeDPO(de.uni_due.inf.ti.graph.Morphism leftMorph, de.uni_due.inf.ti.graph.Morphism rightMorph)
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:
leftMorph
- the left-hand morphism of which a visualization is generatedrightMorph
- the right-hand morphism of which a visualization is generatedjava.lang.NullPointerException
- if morph
is null
public de.uni_due.inf.ti.visigraph.VxGraph visualizeFlatMorphism(de.uni_due.inf.ti.graph.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:
morph
- the morphism 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(de.uni_due.inf.ti.graph.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 AnnotatedTypeGraphVisualizer.VisualSynchronizer getSynchronizer()