org.jzy3d.plot3d.rendering.legends
Class AWTLegend
- java.lang.Object
-
- org.jzy3d.plot3d.rendering.view.AbstractViewportManager
-
- org.jzy3d.plot3d.rendering.view.AWTImageViewport
-
- 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
AAWTLegendrepresent information concerning aAbstractDrawablethat may be displayed as a metadata in theChartView. The constructor of aAWTLegendregisters itself as listener of its parentAbstractDrawable, and unregister itself when it is disposed. When defining a concreteAWTLegend, one should:- override the
toImage(int width, int height)method, that defines the picture representation. - override the
drawableChanged(DrawableChangedEvent e)method, that must select events that actually triggers an image update.
AWTLegendoptimizes rendering by :- storing current image dimension,
- computing a new image only if the required
AWTLegenddimensions changed.
-
-
Constructor Summary
Constructors Constructor and Description AWTLegend(AbstractDrawable drawable)AWTLegend(AbstractDrawable drawable, Color foreground, Color background)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voiddispose()voiddrawableChanged(DrawableChangedEvent e)ColorgetBackground()ColorgetForeground()DimensiongetMinimumDimension()DimensiongetMinimumSize()Return the minimum size for this graphic.voidsaveImage(java.lang.String filename)voidsetBackground(Color background)voidsetForeground(Color foreground)voidsetGeneratorColors()voidsetMinimumDimension(Dimension minimumDimension)voidsetMinimumSize(Dimension dimension)voidsetViewPort(int width, int height, float left, float right)Defines viewport dimensions, and precompute an image if required (i.e.abstract java.awt.image.BufferedImagetoImage(int width, int height)voidupdateImage()Recompute the picture, using last used dimensions.-
Methods inherited from class org.jzy3d.plot3d.rendering.view.AWTImageViewport
getImage, getPreferedSize, render, setImage, setImage, setImage
-
Methods inherited from class org.jzy3d.plot3d.rendering.view.AbstractViewportManager
getLastViewPort, getMode, getRectangle, setScreenGridDisplayed, setViewPort, setViewPort, setViewportMode
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jzy3d.plot3d.rendering.view.IImageViewport
getLastViewPort, getMode, getPreferedSize, render, setViewPort, setViewPort, setViewportMode
-
-
-
-
Constructor Detail
-
AWTLegend
public AWTLegend(AbstractDrawable drawable)
-
AWTLegend
public AWTLegend(AbstractDrawable drawable, Color foreground, Color background)
-
-
Method Detail
-
dispose
public void dispose()
-
toImage
public abstract java.awt.image.BufferedImage toImage(int width, int height)
-
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:
setViewPortin interfaceIImageViewport- Overrides:
setViewPortin classAbstractViewportManager- 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.
-
drawableChanged
public void drawableChanged(DrawableChangedEvent e)
- Specified by:
drawableChangedin interfaceIDrawableListener- Specified by:
drawableChangedin interfaceILegend
-
updateImage
public void updateImage()
Description copied from interface:ILegendRecompute the picture, using last used dimensions.- Specified by:
updateImagein interfaceILegend
-
saveImage
public void saveImage(java.lang.String filename) throws java.io.IOException- Throws:
java.io.IOException
-
getMinimumSize
public Dimension getMinimumSize()
Description copied from class:AWTImageViewportReturn the minimum size for this graphic.- Specified by:
getMinimumSizein interfaceIImageViewport- Overrides:
getMinimumSizein classAWTImageViewport
-
setMinimumSize
public void setMinimumSize(Dimension dimension)
-
setGeneratorColors
public void setGeneratorColors()
-
getForeground
public Color getForeground()
-
setForeground
public void setForeground(Color foreground)
-
getBackground
public Color getBackground()
-
setBackground
public void setBackground(Color background)
-
getMinimumDimension
public Dimension getMinimumDimension()
-
setMinimumDimension
public void setMinimumDimension(Dimension minimumDimension)
-
-
DMelt 3.0 © DataMelt by jWork.ORG