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,AWTSerieLegend,AWTSeriesLegend
A
AWTLegend represent information concerning a Drawable that may be displayed as
a metadata in the ChartView. ChartView renders legend on the right side of the
chart, hence avoiding superposition of legend and chart.
The constructor of a AWTLegend registers itself as listener of its parent
Drawable, and unregister itself when it is disposed.
When defining a concrete AWTLegend, one should:
- override the
toImage(int,int)method, that defines the picture representation. - override the
drawableChanged(org.jzy3d.events.DrawableChangedEvent)method, that must select events that actually triggers an image update.
AWTLegend optimizes rendering by :
- storing current image dimension,
- computing a new image only if the required
AWTLegenddimensions changed.
- Author:
- Martin Pernollet
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jzy3d.plot3d.rendering.view.AWTImageViewport
AWTImageViewport.ImageLayout -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Colorprotected Drawableprotected Colorprotected AWTImageGeneratorprotected DimensionFields inherited from class org.jzy3d.plot3d.rendering.view.AWTImageViewport
image, imageData, imageHeight, imageWidth, margin, pixelScaleFields inherited from class org.jzy3d.plot3d.rendering.view.AbstractViewportManager
applyWindowsHiDPIWorkaround, lastViewPort, mode, screenBottom, screenGridDisplayed, screenHeight, screenLeft, screenSquaredDim, screenWidth, screenXOffset, screenYOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()voidReturn the minimum size for this graphic.voidvoidsetBackground(Color background) voidsetForeground(Color foreground) voidvoidsetMinimumDimension(Dimension dimension) Deprecated.voidsetMinimumWidth(int minimumWidth) Deprecated.voidsetViewPort(int width, int height, float left, float right) Defines viewport dimensions, and precompute an image if required (i.e. if the viewport dimension have changedabstract BufferedImagetoImage(int width, int height) voidRecompute the picture, using last used dimensions.Methods inherited from class org.jzy3d.plot3d.rendering.view.AWTImageViewport
computeLayout, getImage, getMargin, getPixelScale, render, renderImage, setImage, setImage, setImage, setMargin, updatePixelScaleMethods inherited from class org.jzy3d.plot3d.rendering.view.AbstractViewportManager
apply_WindowsHiDPI_Workaround, apply_WindowsHiDPI_Workaround, applyViewport, applyViewportRectangle, applyViewportSquared, getLastViewPort, getRectangle, getScreenBottom, getScreenHeight, getScreenLeft, getScreenWidth, getScreenXOffset, getScreenYOffset, getSliceWidth, getViewPort, getViewportMode, getWindowsHiDPIScale_Workaround, isApplyWindowsHiDPIWorkaround, isScreenGridDisplayed, renderSubScreenGrid, setApplyWindowsHiDPIWorkaround, setScreenGridDisplayed, setScreenXOffset, setScreenYOffset, setViewPort, setViewPort, setViewportModeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jzy3d.plot3d.rendering.view.IImageViewport
getLastViewPort, getPixelScale, getSliceWidth, getViewportMode, render, setViewPort, setViewPort, setViewportMode, updatePixelScale
-
Field Details
-
drawable
-
foreground
-
background
-
minimumDimension
-
imageGenerator
-
-
Constructor Details
-
AWTLegend
-
AWTLegend
-
-
Method Details
-
dispose
public void dispose() -
toImage
-
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
- 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
- Throws:
IOException
-
getMinimumDimension
Description copied from class:AWTImageViewportReturn the minimum size for this graphic.- Specified by:
getMinimumDimensionin interfaceIImageViewport- Overrides:
getMinimumDimensionin classAWTImageViewport
-
setMinimumDimension
Deprecated.Now overriden by automatic processing of minimum dimension- Parameters:
dimension-
-
setMinimumWidth
Deprecated. -
setGeneratorColors
public void setGeneratorColors() -
getForeground
-
setForeground
-
getBackground
-
setBackground
-