org.jzy3d.plot3d.rendering.legends.colorbars
Class ColorbarLegend

java.lang.Object
  extended by org.jzy3d.plot3d.rendering.view.ImageViewport
      extended by org.jzy3d.plot3d.rendering.legends.Legend
          extended by org.jzy3d.plot3d.rendering.legends.colorbars.ColorbarLegend
All Implemented Interfaces:
IDrawableListener

public class ColorbarLegend
extends Legend


Field Summary
protected  Color background
           
protected  Color foreground
           
protected  ViewPort lastViewPort
           
protected  Dimension minimumDimension
           
protected  ITickProvider provider
           
protected  float ratioHeight
           
protected  float ratioWidth
           
protected  ITickRenderer renderer
           
protected  boolean screenGridDisplayed
           
protected  int screenHeight
           
protected  int screenLeft
           
protected  int screenRight
           
protected  int screenSquaredDim
           
protected  int screenWidth
           
protected  int screenXOffset
           
protected  int screenYOffset
           
protected  boolean stretchToFill
           
 
Fields inherited from class org.jzy3d.plot3d.rendering.legends.Legend
parent
 
Fields inherited from class org.jzy3d.plot3d.rendering.view.ImageViewport
imageHeight, imageObj, imageWidth
 
Constructor Summary
ColorbarLegend(AbstractDrawable parent, IAxeLayout layout)
           
ColorbarLegend(AbstractDrawable parent, IAxeLayout layout, Color foreground)
           
ColorbarLegend(AbstractDrawable parent, IAxeLayout layout, Color foreground, Color background)
           
ColorbarLegend(AbstractDrawable parent, ITickProvider provider, ITickRenderer renderer)
           
ColorbarLegend(AbstractDrawable parent, ITickProvider provider, ITickRenderer renderer, Color foreground, Color background)
           
 
Method Summary
protected  void applyViewPort(javax.media.opengl.GL2 gl, javax.media.opengl.glu.GLU glu)
          Apply the GL viewport according to the settings given to setViewPort.
 void drawableChanged(DrawableChangedEvent e)
           
 ViewPort getLastViewPort()
           
 Dimension getMinimumSize()
          Return the minimum size for this graphic.
 Rectangle getRectangle()
          Returns the (x,y) offset that was applied to make this AbstractViewport stand in the appropriate canvas part.
 boolean getStretchToFill()
           
 void render(javax.media.opengl.GL2 gl, javax.media.opengl.glu.GLU glu)
          Renders the picture into the window, according to the viewport settings.
 void setMinimumSize(Dimension dimension)
           
 void setScreenGridDisplayed(boolean status)
          Set the status of the screen grid.
 void setStretchToFill(boolean status)
          Set the status of the stretching mode (activated or not).
 void setViewPort(int width, int height)
          Set the view port (size of the renderer).
 void setViewPort(ViewPort viewport)
           
 Image toImage(int width, int height)
           
 
Methods inherited from class org.jzy3d.plot3d.rendering.legends.Legend
dispose, saveImage, setViewPort, updateImage
 
Methods inherited from class org.jzy3d.plot3d.rendering.view.ImageViewport
getImage, getPreferedSize, setImage, setImage, setImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

provider

protected ITickProvider provider

renderer

protected ITickRenderer renderer

minimumDimension

protected Dimension minimumDimension

foreground

protected Color foreground

background

protected Color background

lastViewPort

protected ViewPort lastViewPort

screenLeft

protected int screenLeft

screenRight

protected int screenRight

screenXOffset

protected int screenXOffset

screenYOffset

protected int screenYOffset

screenWidth

protected int screenWidth

screenHeight

protected int screenHeight

screenSquaredDim

protected int screenSquaredDim

screenGridDisplayed

protected boolean screenGridDisplayed

stretchToFill

protected boolean stretchToFill

ratioWidth

protected float ratioWidth

ratioHeight

protected float ratioHeight
Constructor Detail

ColorbarLegend

public ColorbarLegend(AbstractDrawable parent,
                      IAxeLayout layout)

ColorbarLegend

public ColorbarLegend(AbstractDrawable parent,
                      IAxeLayout layout,
                      Color foreground)

ColorbarLegend

public ColorbarLegend(AbstractDrawable parent,
                      IAxeLayout layout,
                      Color foreground,
                      Color background)

ColorbarLegend

public ColorbarLegend(AbstractDrawable parent,
                      ITickProvider provider,
                      ITickRenderer renderer)

ColorbarLegend

public ColorbarLegend(AbstractDrawable parent,
                      ITickProvider provider,
                      ITickRenderer renderer,
                      Color foreground,
                      Color background)
Method Detail

render

public void render(javax.media.opengl.GL2 gl,
                   javax.media.opengl.glu.GLU glu)
Description copied from class: ImageViewport
Renders the picture into the window, according to the viewport settings. If the picture is bigger than the viewport, it is simply centered in it, otherwise, it is scaled in order to fit into the viewport.

Overrides:
render in class ImageViewport

toImage

public Image toImage(int width,
                     int height)
Specified by:
toImage in class Legend

drawableChanged

public void drawableChanged(DrawableChangedEvent e)
Specified by:
drawableChanged in interface IDrawableListener
Specified by:
drawableChanged in class Legend

getMinimumSize

public Dimension getMinimumSize()
Description copied from class: ImageViewport
Return the minimum size for this graphic.

Overrides:
getMinimumSize in class ImageViewport

setMinimumSize

public void setMinimumSize(Dimension dimension)

setStretchToFill

public void setStretchToFill(boolean status)
Set the status of the stretching mode (activated or not). Stretching consist in displaying the projection into the full screen slice (i.e. viewport).

Parameters:
status -

getStretchToFill

public boolean getStretchToFill()

setViewPort

public void setViewPort(int width,
                        int height)
Set the view port (size of the renderer).

Parameters:
width - the width of the target window.
height - the height of the target window.

setViewPort

public void setViewPort(ViewPort viewport)

getLastViewPort

public ViewPort getLastViewPort()

applyViewPort

protected void applyViewPort(javax.media.opengl.GL2 gl,
                             javax.media.opengl.glu.GLU glu)
Apply the GL viewport according to the settings given to setViewPort. If the screen grid was activated, the grid is rendered prior to the viewport definition. After a call to applyViewPort, one can query the offset that was applied to the viewport relative to the canvas. Indeed, when the stretchToFill option is disabled, the viewport is computed so that the content appears in a squared subpart of the canvas.

Parameters:
gl -
glu -

getRectangle

public Rectangle getRectangle()
Returns the (x,y) offset that was applied to make this AbstractViewport stand in the appropriate canvas part. and the actual width and height of the viewport. Only relevant after a call to applyViewPort.


setScreenGridDisplayed

public void setScreenGridDisplayed(boolean status)
Set the status of the screen grid.

Parameters:
status - the grid is displayed if status is set to true