Class AWTColorbarLegend
java.lang.Object
org.jzy3d.plot3d.rendering.view.AbstractViewportManager
org.jzy3d.plot3d.rendering.view.AWTImageViewport
org.jzy3d.plot3d.rendering.legends.AWTLegend
org.jzy3d.plot3d.rendering.legends.colorbars.AWTColorbarLegend
- All Implemented Interfaces:
IDrawableListener, IColorbarLegend, ILegend, IImageViewport
Handle a colorbar rendered as an AWT
Schema
sources
Schema
sources
BufferedImage.
Content and coloring
A colorbar is configured with- a colormap defined by the input
Drawableif it isIMultiColorableand if it has aColorMapperdefined. - a set of axis ticks defined and formated by
.
invalid reference
IAxisLayout
Layout
The size of the colorbar image is driven byAWTLegend.setViewPort(int, int, float, float)which indicates the canvas dimension on screen and the slice that the colorbar should occupy. The image width will beimageWidth = width * (right - left). The viewport is set byViewAndColorbarsLayout.
ViewAndColorbarsLayout which render the
prepared image at the layout given position for this colorbar (which is defined with left/right
parameters).
Schema
sources
Rendering path
EmulGL and Native have different rendering pathes- Native chart have their colorbar image rendered by
render(IPainter). - EmulGL chart have their colorbar image rendered by AWT as bypassed by
, which customize the way pixel scale should be handled for rendering such image in a good layoout
invalid reference
EmulGLViewAndColorbarLayout
Schema
sources-
Nested Class Summary
Nested classes/interfaces inherited from class AWTImageViewport
AWTImageViewport.ImageLayout -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected intprotected intprotected static final intprotected Fontprotected ITickProviderprotected ITickRendererFields inherited from class AWTLegend
background, drawable, foreground, imageGenerator, minimumDimensionFields inherited from class AWTImageViewport
image, imageData, imageHeight, imageWidth, margin, pixelScaleFields inherited from class AbstractViewportManager
applyWindowsHiDPIWorkaround, lastViewPort, mode, screenBottom, screenGridDisplayed, screenHeight, screenLeft, screenSquaredDim, screenWidth, screenXOffset, screenYOffset -
Constructor Summary
ConstructorsConstructorDescriptionAWTColorbarLegend(Drawable parent, Chart chart) AWTColorbarLegend(Drawable parent, AxisLayout layout) AWTColorbarLegend(Drawable parent, AxisLayout layout, Color foreground) AWTColorbarLegend(Drawable parent, AxisLayout layout, Color foreground, Color background) AWTColorbarLegend(Drawable parent, ITickProvider provider, ITickRenderer renderer) AWTColorbarLegend(Drawable parent, ITickProvider provider, ITickRenderer renderer, Color foreground, Color background) -
Method Summary
Modifier and TypeMethodDescriptionintintgetFont()intReturn the minimum size for this graphic.intgetWidth()protected voidinitImageGenerator(Drawable parent, ITickProvider provider, ITickRenderer renderer) booleanvoidvoidsetEmulGLUnscale(boolean emulGLUnscale) voidUpdate image generator fontvoidUpdate image according to new margin.toImage(int width, int height) protected BufferedImageGenerate an image for this dimension, margin and pixel scale.voidvoidupdateMinimumDimension(IPainter painter) Pre process an ideal width for the colorbar based on text width and other settingsvoidupdatePixelScale(Coord2d pixelScale) Update the image with pixel scale if scale changedMethods inherited from class AWTLegend
dispose, drawableChanged, getBackground, getForeground, saveImage, setBackground, setForeground, setGeneratorColors, setMinimumDimension, setMinimumWidth, setViewPortMethods inherited from class AWTImageViewport
computeLayout, getImage, getMargin, getPixelScale, renderImage, setImage, setImage, setImageMethods inherited from class AbstractViewportManager
apply_WindowsHiDPI_Workaround, apply_WindowsHiDPI_Workaround, applyViewport, applyViewportRectangle, applyViewportSquared, getLastViewPort, getRectangle, getScreenBottom, getScreenHeight, getScreenLeft, getScreenWidth, getScreenXOffset, getScreenYOffset, getSliceWidth, getViewPort, getViewportMode, getWindowsHiDPIScale_Workaround, glViewport, isApplyWindowsHiDPIWorkaround, isScreenGridDisplayed, renderSubScreenGrid, setApplyWindowsHiDPIWorkaround, setScreenGridDisplayed, setScreenXOffset, setScreenYOffset, setViewPort, setViewPort, setViewportModeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IColorbarLegend
drawableChanged, getMargin, setMinimumDimensionMethods inherited from interface IImageViewport
getLastViewPort, getPixelScale, getSliceWidth, getViewportMode, setViewPort, setViewPort, setViewportMode
-
Field Details
-
provider
-
renderer
-
askedWidth
protected int askedWidth -
askedHeight
protected int askedHeight -
choosenWidth
protected int choosenWidth -
choosenHeight
protected int choosenHeight -
font
-
DEFAULT_MARGIN_HEIGHT
protected static final int DEFAULT_MARGIN_HEIGHT- See Also:
-
-
Constructor Details
-
AWTColorbarLegend
-
AWTColorbarLegend
-
AWTColorbarLegend
-
AWTColorbarLegend
-
AWTColorbarLegend
-
AWTColorbarLegend
public AWTColorbarLegend(Drawable parent, ITickProvider provider, ITickRenderer renderer, Color foreground, Color background)
-
-
Method Details
-
initImageGenerator
-
getMinimumDimension
Description copied from class:AWTImageViewportReturn the minimum size for this graphic.- Specified by:
getMinimumDimensionin interfaceIColorbarLegend- Specified by:
getMinimumDimensionin interfaceIImageViewport- Overrides:
getMinimumDimensionin classAWTLegend
-
render
- Specified by:
renderin interfaceIColorbarLegend- Specified by:
renderin interfaceIImageViewport- Overrides:
renderin classAWTImageViewport
-
updateMinimumDimension
Pre process an ideal width for the colorbar based on text width and other settings- Specified by:
updateMinimumDimensionin interfaceILegend
-
toImage
-
toImage
Generate an image for this dimension, margin and pixel scale. If running on a HiDPI screen, width and height parameter will grow. -
updateImage
public void updateImage()- Specified by:
updateImagein interfaceILegend- Overrides:
updateImagein classAWTLegend
-
setMargin
Update image according to new margin.- Specified by:
setMarginin interfaceIColorbarLegend- Overrides:
setMarginin classAWTImageViewport
-
updatePixelScale
Update the image with pixel scale if scale changed- Specified by:
updatePixelScalein interfaceIImageViewport- Overrides:
updatePixelScalein classAWTImageViewport
-
setFont
-
getFont
-
getImageGenerator
-
getWidth
-
getHeight
-
getChoosenWidth
public int getChoosenWidth() -
getChoosenHeight
public int getChoosenHeight() -
isEmulGLUnscale
public boolean isEmulGLUnscale() -
setEmulGLUnscale
public void setEmulGLUnscale(boolean emulGLUnscale)
-