org.jzy3d.plot3d.primitives.graphs
Class AbstractDrawableGraph2d<V,E>

java.lang.Object
  extended by org.jzy3d.plot3d.primitives.AbstractDrawable
      extended by 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 AbstractDrawable
implements IDrawableGraph2d<V,E>

An implementation based on IPickable 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)


Constructor Summary
AbstractDrawableGraph2d()
           
 
Method Summary
 void clearHighlighted()
           
 void draw(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, Camera cam)
          Call OpenGL routines for rendering the object.
 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, PickingSupport picking)
           
 void setLabelSceneOffset(Coord3d labelSceneOffset)
           
 void setLabelScreenOffset(Coord2d labelOffset)
           
 void setVertexHighlighted(V v, boolean nodeDisplayed)
           
 
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
addDrawableListener, dispose, getBarycentre, getBounds, getDistance, getFace, getLongestDistance, getShortestDistance, getTransform, hasFace, isDisplayed, isFace2dDisplayed, removeDrawableListener, setDisplayed, setLegend, setLegendDisplayed, setTransform, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractDrawableGraph2d

public AbstractDrawableGraph2d()
Method Detail

getGraphFormatter

public IGraphFormatter<V,E> getGraphFormatter()
Specified by:
getGraphFormatter in interface IDrawableGraph2d<V,E>

getGraphLayout

public IGraphLayout2d<V> getGraphLayout()
Specified by:
getGraphLayout in interface IDrawableGraph2d<V,E>

getGraphModel

public IGraph<V,E> getGraphModel()
Specified by:
getGraphModel in interface IDrawableGraph2d<V,E>

setGraphFormatter

public void setGraphFormatter(IGraphFormatter<V,E> formatter)
Specified by:
setGraphFormatter in interface IDrawableGraph2d<V,E>

setGraphLayout

public void setGraphLayout(IGraphLayout2d<V> layout)
Specified by:
setGraphLayout in interface IDrawableGraph2d<V,E>

setGraphModel

public void setGraphModel(IGraph<V,E> graph,
                          PickingSupport picking)
Specified by:
setGraphModel in interface IDrawableGraph2d<V,E>

draw

public void draw(javax.media.opengl.GL gl,
                 javax.media.opengl.glu.GLU glu,
                 Camera cam)
Description copied from class: AbstractDrawable
Call OpenGL routines for rendering the object.

Specified by:
draw in interface IGLRenderer
Specified by:
draw in class AbstractDrawable
Parameters:
gl - GL context
glu - GLU context
cam - a reference to a shooting Camera.

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 interface IDrawableGraph2d<V,E>

isVertexHighlighted

public boolean isVertexHighlighted(V v)
Specified by:
isVertexHighlighted in interface IDrawableGraph2d<V,E>

setVertexHighlighted

public void setVertexHighlighted(V v,
                                 boolean nodeDisplayed)
Specified by:
setVertexHighlighted in interface IDrawableGraph2d<V,E>

clearHighlighted

public void clearHighlighted()
Specified by:
clearHighlighted in interface IDrawableGraph2d<V,E>