public abstract class AbstractDrawableGraph2d<V,E> extends AbstractDrawable implements IDrawableGraph2d<V,E>
Pickable
objects should register
mapping between vertex model and vertex representation through
PickSupport.registerPickableObject(IPickable pickable, V v)
Registration should be done by overriding setGraphModel.
One can later listen to picking events through:
PickSupport.addVertexPickListener(IVertexPickListener listener)
Modifier and Type | Field and 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 TextBitmapRenderer |
txt |
protected static float |
Z |
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
Constructor and Description |
---|
AbstractDrawableGraph2d() |
Modifier and Type | Method and Description |
---|---|
void |
clearHighlighted() |
void |
draw(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
Call OpenGL2 routines for rendering the object.
|
protected abstract void |
drawEdges(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam) |
protected abstract void |
drawVertexLabels(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam) |
protected abstract void |
drawVertices(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam) |
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) |
addDrawableListener, applyGeometryTransform, call, call, callWithAlphaFactor, colorGL2, colorGLES2, dispose, doDrawBounds, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString, updateBounds, vertexGL2, vertexGLES2
protected IGraphFormatter<V,E> formatter
protected IGraphLayout2d<V> layout
protected Coord2d labelScreenOffset
protected Coord3d labelSceneOffset
protected static float Z
protected TextBitmapRenderer txt
public IGraphFormatter<V,E> getGraphFormatter()
getGraphFormatter
in interface IDrawableGraph2d<V,E>
public IGraphLayout2d<V> getGraphLayout()
getGraphLayout
in interface IDrawableGraph2d<V,E>
public IGraph<V,E> getGraphModel()
getGraphModel
in interface IDrawableGraph2d<V,E>
public void setGraphFormatter(IGraphFormatter<V,E> formatter)
setGraphFormatter
in interface IDrawableGraph2d<V,E>
public void setGraphLayout(IGraphLayout2d<V> layout)
setGraphLayout
in interface IDrawableGraph2d<V,E>
public void setGraphModel(IGraph<V,E> graph, PickingSupport picking)
setGraphModel
in interface IDrawableGraph2d<V,E>
public void setGraphModel(IGraph<V,E> graph)
setGraphModel
in interface IDrawableGraph2d<V,E>
public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)
AbstractDrawable
draw
in interface IGLRenderer
draw
in class AbstractDrawable
gl
- GL2 contextglu
- GLU contextcam
- a reference to a shooting Camera.protected abstract void drawVertices(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)
protected abstract void drawVertexLabels(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)
protected abstract void drawEdges(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)
public Coord2d getLabelScreenOffset()
public void setLabelScreenOffset(Coord2d labelOffset)
public Coord3d getLabelSceneOffset()
public void setLabelSceneOffset(Coord3d labelSceneOffset)
public boolean isEdgeHighlighted(E e)
isEdgeHighlighted
in interface IDrawableGraph2d<V,E>
public boolean isVertexHighlighted(V v)
isVertexHighlighted
in interface IDrawableGraph2d<V,E>
public void setVertexHighlighted(V v, boolean nodeDisplayed)
setVertexHighlighted
in interface IDrawableGraph2d<V,E>
public void clearHighlighted()
clearHighlighted
in interface IDrawableGraph2d<V,E>
Copyright © 2016. All rights reserved.