org.jzy3d.plot3d.rendering.legends
Class AWTLegend

java.lang.Object
  extended by org.jzy3d.plot3d.rendering.view.AWTImageViewport
      extended by org.jzy3d.plot3d.rendering.legends.AWTLegend
All Implemented Interfaces:
IDrawableListener, ILegend, IImageViewport
Direct Known Subclasses:
AWTColorbarLegend

public abstract class AWTLegend
extends AWTImageViewport
implements IDrawableListener, ILegend

A AWTLegend represent information concerning a AbstractDrawable that may be displayed as a metadata in the ChartView. The constructor of a AWTLegend registers itself as listener of its parent AbstractDrawable, and unregister itself when it is disposed. When defining a concrete AWTLegend, one should:

Last, a AWTLegend optimizes rendering by :

Author:
Martin Pernollet

Field Summary
protected  ViewportConfiguration lastViewPort
           
protected  ViewportMode mode
           
protected  AbstractDrawable parent
           
protected  float ratioHeight
           
protected  float ratioWidth
           
protected  int screenBottom
           
protected  boolean screenGridDisplayed
           
protected  int screenHeight
           
protected  int screenLeft
           
protected  int screenSquaredDim
           
protected  int screenWidth
           
protected  int screenXOffset
           
protected  int screenYOffset
           
 
Fields inherited from class org.jzy3d.plot3d.rendering.view.AWTImageViewport
imageHeight, imageObj, imageWidth
 
Constructor Summary
AWTLegend(AbstractDrawable parent)
           
 
Method Summary
protected  ViewportConfiguration applyViewport(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu)
          Build and return a ViewportConfiguration.
 void dispose()
           
abstract  void drawableChanged(DrawableChangedEvent e)
           
 ViewportConfiguration getLastViewPort()
           
 ViewportMode getMode()
           
 Rectangle getRectangle()
          Returns the (x,y) offset that was applied to make this AbstractViewportManager stand in the appropriate canvas part. and the actual width and height of the viewport.
 void saveImage(String filename)
           
 void setScreenGridDisplayed(boolean status)
          Set the status of the screen grid.
 void setViewPort(int width, int height)
          Set the view port (size of the renderer).
 void setViewPort(int width, int height, float left, float right)
          Defines viewport dimensions, and precompute an image if required (i.e. if the viewport dimension have changed
 void setViewPort(ViewportConfiguration viewport)
           
 void setViewportMode(ViewportMode mode)
           
abstract  BufferedImage toImage(int width, int height)
           
 void updateImage()
          Recompute the picture, using last used dimensions.
 
Methods inherited from class org.jzy3d.plot3d.rendering.view.AWTImageViewport
getImage, getMinimumSize, getPreferedSize, render, setImage, setImage, setImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jzy3d.plot3d.rendering.view.IImageViewport
getLastViewPort, getMinimumSize, getMode, getPreferedSize, render, setViewPort, setViewPort, setViewportMode
 

Field Detail

parent

protected AbstractDrawable parent

lastViewPort

protected ViewportConfiguration lastViewPort

screenLeft

protected int screenLeft

screenBottom

protected int screenBottom

screenXOffset

protected int screenXOffset

screenYOffset

protected int screenYOffset

screenWidth

protected int screenWidth

screenHeight

protected int screenHeight

screenSquaredDim

protected int screenSquaredDim

screenGridDisplayed

protected boolean screenGridDisplayed

mode

protected ViewportMode mode

ratioWidth

protected float ratioWidth

ratioHeight

protected float ratioHeight
Constructor Detail

AWTLegend

public AWTLegend(AbstractDrawable parent)
Method Detail

dispose

public void dispose()

toImage

public abstract BufferedImage toImage(int width,
                                      int height)

drawableChanged

public abstract void drawableChanged(DrawableChangedEvent e)
Specified by:
drawableChanged in interface IDrawableListener
Specified by:
drawableChanged in interface ILegend

setViewPort

public void setViewPort(int width,
                        int height,
                        float left,
                        float right)
Defines viewport dimensions, and precompute an image if required (i.e. if the viewport dimension have changed

Specified by:
setViewPort in interface IImageViewport
Parameters:
width - the width of the target window.
height - the height of the target window.
left - the width's ratio where this subscreen starts in the target window.
right - the width's ratio where this subscreen stops in the target window.

updateImage

public void updateImage()
Description copied from interface: ILegend
Recompute the picture, using last used dimensions.

Specified by:
updateImage in interface ILegend

saveImage

public void saveImage(String filename)
               throws IOException
Throws:
IOException

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.

getMode

public ViewportMode getMode()

setViewportMode

public void setViewportMode(ViewportMode mode)

setViewPort

public void setViewPort(ViewportConfiguration viewport)

getLastViewPort

public ViewportConfiguration getLastViewPort()

applyViewport

protected ViewportConfiguration applyViewport(javax.media.opengl.GL gl,
                                              javax.media.opengl.glu.GLU glu)
Build and return a ViewportConfiguration. Uses gl to

Parameters:
gl -
glu -

getRectangle

public Rectangle getRectangle()
Returns the (x,y) offset that was applied to make this AbstractViewportManager 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


Copyright © 2013. All rights reserved.