y25.view.realizer
Class ShapeNodeRealizer25D

java.lang.Object
  extended byy.view.NodeRealizer
      extended byy.view.ShapeNodeRealizer
          extended byy25.view.realizer.ShapeNodeRealizer25D
All Implemented Interfaces:
NodeLayout, NodeLayout25D, NodeRealizer25D

public class ShapeNodeRealizer25D
extends ShapeNodeRealizer
implements NodeRealizer25D

Extends the ShapeNodeRealizer with 25D information.

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


Field Summary
protected  double depth
          The depth of this realizer.
 
Fields inherited from class y.view.ShapeNodeRealizer
DIAMOND, ELLIPSE, HEXAGON, OCTAGON, PARALLELOGRAM, RECT, RECT_3D, ROUND_RECT, shape, TRAPEZOID, TRAPEZOID_2, TRIANGLE
 
Fields inherited from class y.view.NodeRealizer
height, HOTSPOT_E, HOTSPOT_N, HOTSPOT_NE, HOTSPOT_NONE, HOTSPOT_NW, HOTSPOT_S, HOTSPOT_SE, HOTSPOT_SW, HOTSPOT_W, width, x, y
 
Constructor Summary
ShapeNodeRealizer25D()
          Creates a new ShapeNodeRealizer25D with the default depth.
ShapeNodeRealizer25D(NodeRealizer nr)
          Creates a new ShapeNodeRealizer25D that copies as many attributes of the passed realizer as possible.
 
Method Summary
 NodeRealizer createCopy(NodeRealizer nr)
           
 double getDepth()
          Returns the depth of the node, which is its extent in the z-dimension.
 BoundingBox getRelativeBoundingBox()
          Returns the relative bounding box that encompasses the node.
 Point3D intersect(Point3D source, Point3D target, float nodeZ)
          Intersects a line segment with this node and returns the intersection point.
 void paintGL(GLAutoDrawable drawable, Camera camera)
          Renders the node this realizer belongs to into the given drawable.
 void setDepth(double depth)
          Sets the depth of the node, which is its extent in the z-dimension.
 void setSize(double width, double height, double depth)
          Sets the size of the node in all three dimensions.
 
Methods inherited from class y.view.ShapeNodeRealizer
contains, findIntersection, getShapeType, moveBy, paintNode, read, setCenter, setLocation, setShapeType, setSize, shapeTypeToStringMap, write
 
Methods inherited from class y.view.NodeRealizer
addLabel, calcUnionRect, calcUnionRect, createCopy, createNodeLabel, findBBIntersection, getBoundingBox, getCenterX, getCenterY, getFillColor, getFillColor2, getHeight, getHotSpotColor, getLabel, getLabel, getLabelText, getLayer, getLineColor, getLineType, getNode, getPortCandidates, getSloppySelectionColor, getWidth, getX, getY, hotSpotHit, intersects, isInBox, isSelected, isTransparent, isVisible, labelCount, paint, paintHotSpots, paintLayer, paintLayerSloppy, paintSloppy, paintText, removeLabel, setCenterX, setCenterY, setEdgesDirty, setFillColor, setFillColor2, setFrame, setFrame, setHeight, setHotSpotColor, setLabel, setLabelText, setLayer, setLayer, setLineColor, setLineType, setSelected, setSloppySelectionColor, setTransparent, setVisible, setWidth, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface y.layout.NodeLayout
getHeight, getWidth, getX, getY, setLocation, setSize
 

Field Detail

depth

protected double depth
The depth of this realizer.

Constructor Detail

ShapeNodeRealizer25D

public ShapeNodeRealizer25D()
Creates a new ShapeNodeRealizer25D with the default depth.


ShapeNodeRealizer25D

public ShapeNodeRealizer25D(NodeRealizer nr)
Creates a new ShapeNodeRealizer25D that copies as many attributes of the passed realizer as possible.

Method Detail

createCopy

public NodeRealizer createCopy(NodeRealizer nr)
See Also:
NodeRealizer.createCopy(y.view.NodeRealizer)

getDepth

public double getDepth()
Description copied from interface: NodeLayout25D
Returns the depth of the node, which is its extent in the z-dimension.

Specified by:
getDepth in interface NodeLayout25D
See Also:
NodeLayout25D.getDepth()

setDepth

public void setDepth(double depth)
Description copied from interface: NodeLayout25D
Sets the depth of the node, which is its extent in the z-dimension.

Specified by:
setDepth in interface NodeLayout25D
See Also:
NodeLayout25D.setDepth(double)

setSize

public void setSize(double width,
                    double height,
                    double depth)
Description copied from interface: NodeLayout25D
Sets the size of the node in all three dimensions.

Specified by:
setSize in interface NodeLayout25D
See Also:
NodeLayout25D.setSize(double, double, double)

getRelativeBoundingBox

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

"Relative" means, that the z-position of the node is treated as the origin. For example, if a node is located at position (x,y,z) = (4,5,80) and has a width, height and depth of 4 then the relative bounding box is defined by the two points bb_min = (2, 3, -2) and bb_max = (6, 7, 2). Simply put, the z-position of the node is just irrelevant.

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

paintGL

public void paintGL(GLAutoDrawable drawable,
                    Camera camera)
Description copied from interface: NodeRealizer25D
Renders the node this realizer belongs to into the given drawable.

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

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

intersect

public Point3D intersect(Point3D source,
                         Point3D target,
                         float nodeZ)
Description copied from interface: NodeRealizer25D
Intersects a line segment with this node and returns the intersection point.

The line segment in three dimensional space is defined by the two points: source and target. Since a node's z-position is determined only by the layer it resides in, this information is not available inside the realizer and therefore has to be passed in nodeZ.

This method should return an intersection point only if the passed line segment actually intersects the node. It should return null, if the line segment is completely outside or completely inside the node. If the line segment intersects the node at more than one position, the first of these intersections has to be returned, i.e. the one that is closest to source.

Specified by:
intersect in interface NodeRealizer25D
See Also:
NodeRealizer25D.intersect(y25.graphics.Point3D, y25.graphics.Point3D, float)