org.jzy3d.plot3d.rendering.legends
Class Legend

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

public abstract class Legend
extends ImageViewport
implements IDrawableListener

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

Last, a Legend optimizes rendering by :

Author:
Martin Pernollet

Constructor Summary
Legend(AbstractDrawable parent)
           
 
Method Summary
 void dispose()
           
abstract  void drawableChanged(DrawableChangedEvent e)
           
 java.awt.Rectangle getRectangle()
          Returns the (x,y) offset that was applied to make this AbstractViewport stand in the appropriate canvas part.
 boolean getStretchToFill()
           
 void saveImage()
           
 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(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
abstract  java.awt.Image toImage(int width, int height)
           
 void updateImage()
          Recompute the picture, using last used dimensions.
 
Methods inherited from class org.jzy3d.plot3d.rendering.view.ImageViewport
getImage, getMinimumSize, getPreferedSize, render, setImage, setImage, setImage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Legend

public Legend(AbstractDrawable parent)
Method Detail

dispose

public void dispose()

toImage

public abstract java.awt.Image toImage(int width,
                                       int height)

drawableChanged

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

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

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()
Recompute the picture, using last used dimensions.


saveImage

public void saveImage()

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.

getRectangle

public java.awt.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