y25.view.realizer
Class TransparentLayerRealizer25D

java.lang.Object
  extended byy25.view.realizer.TransparentLayerRealizer25D
All Implemented Interfaces:
LayerLayout25D, LayerRealizer25D

public class TransparentLayerRealizer25D
extends Object
implements LayerRealizer25D

Displays a layer as a transparent rectangle.


Field Summary
protected  double z
          The z-position of the layer.
 
Constructor Summary
TransparentLayerRealizer25D()
          Creates a new TransparentLayerRealizer25D with zero size.
 
Method Summary
 LayerRealizer25D createCopy()
          Creates a copy of this realizer and returns it.
 String getLabelText()
          Returns the label text of the label associated with this realizer.
 float getOpacity()
          Returns the opacity of the layer rectangle.
 BoundingBox getRealativeBoundingBox()
          Returns the relative bounding box of the layer.
 double getZ()
          Returns the z-position of the layer.
 boolean isSelected()
          Returns true if this realizer is currently selected, false otherwise.
 void paintGL(GLAutoDrawable drawable, Camera camera)
          Renders the layer this realizer belongs to into the given drawable.
 void paintLabels(GLAutoDrawable drawable, Camera camera)
          Renders the labels of this realizer into the given drawable.
 void setLabelText(String text)
          Sets the label text of the label associated with this realizer.
 void setOpacity(float o)
          Sets the opacity of the layer rectangle to the passed value.
 void setRelativeBoundingBox(BoundingBox bb)
          Sets the relative bounding box of the layer, thereby determining the layer's extent in the (x,y) plane (z-values of the bounding box should therefore be 0).
 void setRGB(int r, int g, int b)
          Sets the color of the layer rectangle to the specified red, green and blue values.
 void setSelected(boolean selected)
          Sets the selection state of this realizer.
 void setZ(double z)
          Sets the z-position of the layer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

z

protected double z
The z-position of the layer.

Constructor Detail

TransparentLayerRealizer25D

public TransparentLayerRealizer25D()
Creates a new TransparentLayerRealizer25D with zero size.

Method Detail

createCopy

public LayerRealizer25D createCopy()
Description copied from interface: LayerRealizer25D
Creates a copy of this realizer and returns it.

Specified by:
createCopy in interface LayerRealizer25D
See Also:
LayerRealizer25D.createCopy()

getZ

public double getZ()
Description copied from interface: LayerLayout25D
Returns the z-position of the layer.

Specified by:
getZ in interface LayerLayout25D
See Also:
LayerLayout25D.getZ()

setZ

public void setZ(double z)
Description copied from interface: LayerLayout25D
Sets the z-position of the layer.

Specified by:
setZ in interface LayerLayout25D
See Also:
LayerLayout25D.setZ(double)

setRelativeBoundingBox

public void setRelativeBoundingBox(BoundingBox bb)
Description copied from interface: LayerLayout25D
Sets the relative bounding box of the layer, thereby determining the layer's extent in the (x,y) plane (z-values of the bounding box should therefore be 0).

Specified by:
setRelativeBoundingBox in interface LayerLayout25D
See Also:
LayerLayout25D.setRelativeBoundingBox(y25.graphics.BoundingBox)

getRealativeBoundingBox

public BoundingBox getRealativeBoundingBox()
Description copied from interface: LayerLayout25D
Returns the relative bounding box of the layer. "Relative" here means relative to the z-position the layer resides at (z values of the bounding box are therefore 0).

Specified by:
getRealativeBoundingBox in interface LayerLayout25D
See Also:
LayerLayout25D.getRealativeBoundingBox()

setRGB

public void setRGB(int r,
                   int g,
                   int b)
Sets the color of the layer rectangle to the specified red, green and blue values. These values have to be in the range [0,255].


setOpacity

public void setOpacity(float o)
Sets the opacity of the layer rectangle to the passed value. The value has to be in the range [0.0,1.0].


getOpacity

public float getOpacity()
Returns the opacity of the layer rectangle.


paintGL

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

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

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

paintLabels

public void paintLabels(GLAutoDrawable drawable,
                        Camera camera)
Renders the labels of this realizer into the given drawable.

Parameters:
drawable - the drawable that the labels will be rendered into.
camera - used to determine the orientation of the label such that is faces the viewer.

isSelected

public boolean isSelected()
Description copied from interface: LayerRealizer25D
Returns true if this realizer is currently selected, false otherwise.

Specified by:
isSelected in interface LayerRealizer25D
See Also:
LayerRealizer25D.isSelected()

setSelected

public void setSelected(boolean selected)
Description copied from interface: LayerRealizer25D
Sets the selection state of this realizer.

Specified by:
setSelected in interface LayerRealizer25D
See Also:
LayerRealizer25D.setSelected(boolean)

getLabelText

public String getLabelText()
Description copied from interface: LayerRealizer25D
Returns the label text of the label associated with this realizer.

Specified by:
getLabelText in interface LayerRealizer25D
See Also:
LayerRealizer25D.getLabelText()

setLabelText

public void setLabelText(String text)
Description copied from interface: LayerRealizer25D
Sets the label text of the label associated with this realizer.

Specified by:
setLabelText in interface LayerRealizer25D