y25.view.realizer
Class PolyLineEdgeRealizer25D

java.lang.Object
  extended byy.view.EdgeRealizer
      extended byy.view.PolyLineEdgeRealizer
          extended byy25.view.realizer.PolyLineEdgeRealizer25D
All Implemented Interfaces:
EdgeLayout, EdgeLayout25D, EdgeRealizer25D

public class PolyLineEdgeRealizer25D
extends PolyLineEdgeRealizer
implements EdgeRealizer25D

Extends the PolyLineEdgeRealizer with 25D information.

This realizer aims to provide the same functionality as the y.view.PolyLineEdgeRealizer, except that it can also be used inside a Graph25D and therefore rendered into a Graph25DView.

When this realizer renders itself into an Graph25DView, it does so by either rendering a simple line to visualize the edge or by rendering a 3D cylinder. Whether a 2D or a 3D line is drawn can be set via setLineDisplayMode. Note that the arrow head is always rendered as a three dimensional cone.


Field Summary
protected  int displayMode
          Current drawing mode for lines.
 
Fields inherited from class y.view.EdgeRealizer
bends, path
 
Fields inherited from interface y25.view.EdgeRealizer25D
MODE_2D, MODE_3D
 
Constructor Summary
PolyLineEdgeRealizer25D()
          Creates a new PloyLineEdgeRealizer25D.
PolyLineEdgeRealizer25D(EdgeRealizer er)
          Creates a new PloyLineEdgeRealizer25D, while trying to copy as many properties of the passed realizer as possible.
 
Method Summary
 EdgeRealizer createCopy(EdgeRealizer er)
          Creates a copy of this realizer.
 int getLineDisplayMode()
          Returns the current display mode for edge lines when drawing into an Graph25DView.
 double getLineRadius()
          Returns the radius of the edge based on the LineType of this realizer.
 BoundingBox getRelativeBoundingBox()
          Returns the relative bounding box that encompasses the edge.
 void paintGL(GLAutoDrawable drawable, Camera camera)
          Renders the edge this realizer is bound to into the given drawable.
protected  void paintGLCylinderLine(GLAutoDrawable drawable, Camera camera)
          Renders the edge as a 3D cylinder.
protected  void paintGLCylinderLineSelfLoop(GLAutoDrawable drawable, Camera camera)
          Renders the self loop edge as a 3D cylinder.
protected  void paintGLLine(GLAutoDrawable drawable, Camera camera)
          Renders the edge as a 2D line.
protected  void paintGLLineSelfLoop(GLAutoDrawable drawable, Camera camera)
          Renders the self loop edge as a 2D line.
protected  void setCylinderMaterial(GLAutoDrawable drawable)
          Sets the cylinder material.
 void setLineDisplayMode(int mode)
          Returns the current display mode for edge lines when drawing into an Graph25DView.
protected  void unsetCylinderMaterial(GLAutoDrawable drawable)
          Unsets the cylinder material.
 
Methods inherited from class y.view.PolyLineEdgeRealizer
calculatePath, containsSeg, createBend, getSmoothedBends, insertBend, pathIntersects, read, reInsertBend, removeBend, setSmoothedBends, write
 
Methods inherited from class y.view.EdgeRealizer
addLabel, addPoint, appendBend, bendChanged, bendCount, bendPos, bends, bindEdge, calcUnionRect, clearBends, clearPoints, contains, createCopy, createEdgeLabel, firstBend, getArrow, getBend, getEdge, getHighlightedBendColor, getLabel, getLabel, getLabelText, getLayer, getLineColor, getLineType, getMinBendCount, getPath, getPoint, getSelectionColor, getSelectionStroke, getSourceArrow, getSourceIntersection, getSourcePoint, getSourcePort, getSourceRealizer, getTargetArrow, getTargetIntersection, getTargetPoint, getTargetPort, getTargetRealizer, intersects, isDirty, isSelected, isVisible, labelCount, lastBend, paint, paintArrows, paintHighlightedBends, paintLabels, paintPorts, paintSloppy, pointCount, recalculateFeatures, removeLabel, setArrow, setDirty, setHighlightedBendColor, setLabelText, setLayer, setLineColor, setLineType, setPoint, setPorts, setSelected, setSelectionColor, setSelectionStroke, setSourceArrow, setSourcePoint, setSourcePort, setTargetArrow, setTargetPoint, setTargetPort, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface y.layout.EdgeLayout
addPoint, clearPoints, getPoint, getSourcePoint, getTargetPoint, pointCount, setPoint, setSourcePoint, setTargetPoint
 

Field Detail

displayMode

protected int displayMode
Current drawing mode for lines.

Constructor Detail

PolyLineEdgeRealizer25D

public PolyLineEdgeRealizer25D()
Creates a new PloyLineEdgeRealizer25D. Edges willbe drawn as 2D lines.


PolyLineEdgeRealizer25D

public PolyLineEdgeRealizer25D(EdgeRealizer er)
Creates a new PloyLineEdgeRealizer25D, while trying to copy as many properties of the passed realizer as possible.

Method Detail

createCopy

public EdgeRealizer createCopy(EdgeRealizer er)
Creates a copy of this realizer.

See Also:
EdgeRealizer.createCopy(y.view.EdgeRealizer)

getLineDisplayMode

public int getLineDisplayMode()
Returns the current display mode for edge lines when drawing into an Graph25DView. Can be eiter PolyLineEdgeRealizer.MODE_2D or PolyLineEdgeRealizer.MODE_3D.

Specified by:
getLineDisplayMode in interface EdgeRealizer25D

setLineDisplayMode

public void setLineDisplayMode(int mode)
Returns the current display mode for edge lines when drawing into an Graph25DView. mode can be eiter PolyLineEdgeRealizer.MODE_2D or PolyLineEdgeRealizer.MODE_3D.

Specified by:
setLineDisplayMode in interface EdgeRealizer25D

paintGL

public void paintGL(GLAutoDrawable drawable,
                    Camera camera)
Description copied from interface: EdgeRealizer25D
Renders the edge this realizer is bound to into the given drawable. If no edge is bound to the realizer, nothing happens.

The passed camera is the one that is used to display this edge. It can be used, for example, to render an edge differently depending on the viewing position, or to display labels that always face the viewer.

Specified by:
paintGL in interface EdgeRealizer25D
See Also:
EdgeRealizer25D.paintGL(javax.media.opengl.GLAutoDrawable, y25.graphics.Camera)

paintGLLine

protected void paintGLLine(GLAutoDrawable drawable,
                           Camera camera)
Renders the edge as a 2D line.


paintGLLineSelfLoop

protected void paintGLLineSelfLoop(GLAutoDrawable drawable,
                                   Camera camera)
Renders the self loop edge as a 2D line.


setCylinderMaterial

protected void setCylinderMaterial(GLAutoDrawable drawable)
Sets the cylinder material.


unsetCylinderMaterial

protected void unsetCylinderMaterial(GLAutoDrawable drawable)
Unsets the cylinder material.


paintGLCylinderLine

protected void paintGLCylinderLine(GLAutoDrawable drawable,
                                   Camera camera)
Renders the edge as a 3D cylinder.


paintGLCylinderLineSelfLoop

protected void paintGLCylinderLineSelfLoop(GLAutoDrawable drawable,
                                           Camera camera)
Renders the self loop edge as a 3D cylinder.


getRelativeBoundingBox

public BoundingBox getRelativeBoundingBox()
Description copied from interface: EdgeLayout25D
Returns the relative bounding box that encompasses the edge.

"Relative" means, that the z-position of the layer that the edge belongs to is treated as the origin.

Specified by:
getRelativeBoundingBox in interface EdgeLayout25D
See Also:
EdgeLayout25D.getRelativeBoundingBox()

getLineRadius

public double getLineRadius()
Returns the radius of the edge based on the LineType of this realizer.