Class AbstractDrawableGraph2d<V,E>
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.Drawable
-
- org.jzy3d.plot3d.primitives.graphs.AbstractDrawableGraph2d<V,E>
-
- All Implemented Interfaces:
IDrawableGraph2d<V,E>
,IGLRenderer
,ISortableDraw
- Direct Known Subclasses:
DefaultDrawableGraph2d
public abstract class AbstractDrawableGraph2d<V,E> extends Drawable implements IDrawableGraph2d<V,E>
An implementation based onPickable
objects should register mapping between vertex model and vertex representation through {@link PickSupport.registerPickableObject(IPickable pickable, V v)} Registration should be done by overriding setGraphModel. One can later listen to picking events through: {@link PickSupport.addVertexPickListener(IVertexPickListenerlistener)}
-
-
Field Summary
Fields Modifier and Type Field Description protected IGraphFormatter<V,E>
formatter
protected IGraph<V,E>
graph
protected Map<V,Boolean>
highlights
protected Coord3d
labelSceneOffset
protected Coord2d
labelScreenOffset
protected IGraphLayout2d<V>
layout
protected TextRenderer
txt
protected static float
Z
-
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
-
Constructor Summary
Constructors Constructor Description AbstractDrawableGraph2d()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clearHighlighted()
void
draw(IPainter painter)
Call OpenGL2 routines for rendering the object.protected abstract void
drawEdges(IPainter painter)
protected abstract void
drawVertexLabels(IPainter painter)
protected abstract void
drawVertices(IPainter painter)
IGraphFormatter<V,E>
getGraphFormatter()
IGraphLayout2d<V>
getGraphLayout()
IGraph<V,E>
getGraphModel()
Coord3d
getLabelSceneOffset()
Coord2d
getLabelScreenOffset()
boolean
isEdgeHighlighted(E e)
boolean
isVertexHighlighted(V v)
void
setGraphFormatter(IGraphFormatter<V,E> formatter)
void
setGraphLayout(IGraphLayout2d<V> layout)
void
setGraphModel(IGraph<V,E> graph)
void
setGraphModel(IGraph<V,E> graph, PickingSupport picking)
void
setLabelSceneOffset(Coord3d labelSceneOffset)
void
setLabelScreenOffset(Coord2d labelOffset)
void
setVertexHighlighted(V v, boolean nodeDisplayed)
-
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, applyGeometryTransform, asWireframeable, dispose, doDrawBoundsIfDisplayed, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString, updateBounds
-
-
-
-
Field Detail
-
formatter
protected IGraphFormatter<V,E> formatter
-
layout
protected IGraphLayout2d<V> layout
-
labelScreenOffset
protected Coord2d labelScreenOffset
-
labelSceneOffset
protected Coord3d labelSceneOffset
-
Z
protected static float Z
-
txt
protected TextRenderer txt
-
-
Method Detail
-
getGraphFormatter
public IGraphFormatter<V,E> getGraphFormatter()
- Specified by:
getGraphFormatter
in interfaceIDrawableGraph2d<V,E>
-
getGraphLayout
public IGraphLayout2d<V> getGraphLayout()
- Specified by:
getGraphLayout
in interfaceIDrawableGraph2d<V,E>
-
getGraphModel
public IGraph<V,E> getGraphModel()
- Specified by:
getGraphModel
in interfaceIDrawableGraph2d<V,E>
-
setGraphFormatter
public void setGraphFormatter(IGraphFormatter<V,E> formatter)
- Specified by:
setGraphFormatter
in interfaceIDrawableGraph2d<V,E>
-
setGraphLayout
public void setGraphLayout(IGraphLayout2d<V> layout)
- Specified by:
setGraphLayout
in interfaceIDrawableGraph2d<V,E>
-
setGraphModel
public void setGraphModel(IGraph<V,E> graph, PickingSupport picking)
- Specified by:
setGraphModel
in interfaceIDrawableGraph2d<V,E>
-
setGraphModel
public void setGraphModel(IGraph<V,E> graph)
- Specified by:
setGraphModel
in interfaceIDrawableGraph2d<V,E>
-
draw
public void draw(IPainter painter)
Description copied from class:Drawable
Call OpenGL2 routines for rendering the object.- Specified by:
draw
in interfaceIGLRenderer
- Specified by:
draw
in classDrawable
-
drawVertices
protected abstract void drawVertices(IPainter painter)
-
drawVertexLabels
protected abstract void drawVertexLabels(IPainter painter)
-
drawEdges
protected abstract void drawEdges(IPainter painter)
-
getLabelScreenOffset
public Coord2d getLabelScreenOffset()
-
setLabelScreenOffset
public void setLabelScreenOffset(Coord2d labelOffset)
-
getLabelSceneOffset
public Coord3d getLabelSceneOffset()
-
setLabelSceneOffset
public void setLabelSceneOffset(Coord3d labelSceneOffset)
-
isEdgeHighlighted
public boolean isEdgeHighlighted(E e)
- Specified by:
isEdgeHighlighted
in interfaceIDrawableGraph2d<V,E>
-
isVertexHighlighted
public boolean isVertexHighlighted(V v)
- Specified by:
isVertexHighlighted
in interfaceIDrawableGraph2d<V,E>
-
setVertexHighlighted
public void setVertexHighlighted(V v, boolean nodeDisplayed)
- Specified by:
setVertexHighlighted
in interfaceIDrawableGraph2d<V,E>
-
clearHighlighted
public void clearHighlighted()
- Specified by:
clearHighlighted
in interfaceIDrawableGraph2d<V,E>
-
-