G - graphics canvas typepublic class VisualGraph<G> extends Object
GraphLayoutManager and a DelegatingNodeLinkGraphic
to manage a graph and its node locations. The graph is maintained by the manager,
and the visual elements by the graphic.| Modifier and Type | Field and Description |
|---|---|
static com.googlecode.blaisemath.style.AttributeSet |
DEFAULT_EDGE_STYLE
Default graph edge style
|
static com.googlecode.blaisemath.style.AttributeSet |
DEFAULT_NODE_STYLE
Default graph node style
|
protected PropertyChangeListener |
layoutListener
Listens for changes from the layout
|
| Constructor and Description |
|---|
VisualGraph(com.google.common.graph.Graph graph)
Construct adapter with the specified graph.
|
VisualGraph(com.googlecode.blaisemath.graph.layout.GraphLayoutManager manager,
@Nullable java.util.function.Supplier<com.googlecode.blaisemath.graphics.impl.DelegatingNodeLinkGraphic<Object,com.google.common.graph.EndpointPair<Object>,G>> graphicSupplier)
Construct adapter with the specified manager.
|
| Modifier and Type | Method and Description |
|---|---|
com.googlecode.blaisemath.coordinate.CoordinateManager |
getCoordinateManager()
Return the coordinate manager responsible for node locations.
|
com.googlecode.blaisemath.graphics.Renderer<Shape,G> |
getEdgeRenderer()
Return edge renderer.
|
com.googlecode.blaisemath.style.ObjectStyler<com.google.common.graph.EndpointPair<Object>> |
getEdgeStyler()
Return edge styler.
|
com.google.common.graph.Graph |
getGraph()
Return the graph instance being visualized.
|
com.googlecode.blaisemath.graphics.Renderer<com.googlecode.blaisemath.primitive.AnchoredText,G> |
getLabelRenderer()
Return label renderer.
|
com.googlecode.blaisemath.graph.layout.GraphLayoutManager |
getLayoutManager()
Return the layout manager responsible for updating positions.
|
com.googlecode.blaisemath.graphics.Renderer<Point2D,G> |
getNodeRenderer()
Return node renderer.
|
com.googlecode.blaisemath.style.ObjectStyler<Object> |
getNodeStyler()
Return node styler.
|
com.googlecode.blaisemath.graphics.impl.DelegatingNodeLinkGraphic |
getViewGraph()
Return the graphic used for display.
|
protected void |
initViewGraph()
Initializes view graph for the graph in the graph manager.
|
void |
setEdgeRenderer(com.googlecode.blaisemath.graphics.Renderer<Shape,G> renderer)
Set edge renderer.
|
void |
setEdgeStyler(com.googlecode.blaisemath.style.ObjectStyler<com.google.common.graph.EndpointPair<Object>> styler)
Set edge styler.
|
void |
setGraph(com.google.common.graph.Graph g)
Set the graph instance being visualized.
|
void |
setLabelRenderer(com.googlecode.blaisemath.graphics.Renderer<com.googlecode.blaisemath.primitive.AnchoredText,G> renderer)
Set label renderer.
|
void |
setLayoutManager(com.googlecode.blaisemath.graph.layout.GraphLayoutManager manager)
Change the layout manager responsible for updating positions.
|
void |
setNodeRenderer(com.googlecode.blaisemath.graphics.Renderer<Point2D,G> renderer)
Set node renderer.
|
void |
setNodeStyler(com.googlecode.blaisemath.style.ObjectStyler<Object> styler)
Set node styler.
|
public static final com.googlecode.blaisemath.style.AttributeSet DEFAULT_NODE_STYLE
public static final com.googlecode.blaisemath.style.AttributeSet DEFAULT_EDGE_STYLE
protected final PropertyChangeListener layoutListener
public VisualGraph(com.google.common.graph.Graph graph)
graph - the graph to displaypublic VisualGraph(com.googlecode.blaisemath.graph.layout.GraphLayoutManager manager,
@Nullable java.util.function.Supplier<com.googlecode.blaisemath.graphics.impl.DelegatingNodeLinkGraphic<Object,com.google.common.graph.EndpointPair<Object>,G>> graphicSupplier)
manager - a GraphLayoutManager with the graph to displaygraphicSupplier - optional, provides a way to override default creation of the view graphprotected final void initViewGraph()
public com.googlecode.blaisemath.graphics.impl.DelegatingNodeLinkGraphic getViewGraph()
public com.googlecode.blaisemath.graph.layout.GraphLayoutManager getLayoutManager()
public final void setLayoutManager(com.googlecode.blaisemath.graph.layout.GraphLayoutManager manager)
manager - layout managerpublic com.googlecode.blaisemath.coordinate.CoordinateManager getCoordinateManager()
public com.google.common.graph.Graph getGraph()
public void setGraph(com.google.common.graph.Graph g)
g - the graphpublic com.googlecode.blaisemath.style.ObjectStyler<Object> getNodeStyler()
public void setNodeStyler(com.googlecode.blaisemath.style.ObjectStyler<Object> styler)
styler - object styler for nodespublic com.googlecode.blaisemath.graphics.Renderer<Point2D,G> getNodeRenderer()
public void setNodeRenderer(com.googlecode.blaisemath.graphics.Renderer<Point2D,G> renderer)
renderer - new rendererpublic com.googlecode.blaisemath.graphics.Renderer<com.googlecode.blaisemath.primitive.AnchoredText,G> getLabelRenderer()
public void setLabelRenderer(com.googlecode.blaisemath.graphics.Renderer<com.googlecode.blaisemath.primitive.AnchoredText,G> renderer)
renderer - new rendererpublic com.googlecode.blaisemath.style.ObjectStyler<com.google.common.graph.EndpointPair<Object>> getEdgeStyler()
public void setEdgeStyler(com.googlecode.blaisemath.style.ObjectStyler<com.google.common.graph.EndpointPair<Object>> styler)
styler - edge stylerpublic com.googlecode.blaisemath.graphics.Renderer<Shape,G> getEdgeRenderer()
Copyright © 2009–2019. All rights reserved.