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
BufferedImage
.
Content and coloring
A colorbar is configured with- a colormap defined by the input
Drawable
if it isIMultiColorable
and if it has aColorMapper
defined. - a set of axis ticks defined and formated by
invalid @link
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
invalid @link
EmulGLViewAndColorbarLayout
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jzy3d.plot3d.rendering.view.AWTImageViewport
AWTImageViewport.ImageLayout
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected int
protected int
protected int
protected static final int
protected Font
protected ITickProvider
protected ITickRenderer
Fields inherited from class org.jzy3d.plot3d.rendering.legends.AWTLegend
background, drawable, foreground, imageGenerator, minimumDimension
Fields inherited from class org.jzy3d.plot3d.rendering.view.AWTImageViewport
image, imageData, imageHeight, imageWidth, margin, pixelScale
Fields inherited from class org.jzy3d.plot3d.rendering.view.AbstractViewportManager
applyWindowsHiDPIWorkaround, lastViewPort, mode, screenBottom, screenGridDisplayed, screenHeight, screenLeft, screenSquaredDim, screenWidth, screenXOffset, screenYOffset
-
Constructor Summary
ConstructorDescriptionAWTColorbarLegend
(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 TypeMethodDescriptionint
int
getFont()
int
Return the minimum size for this graphic.int
getWidth()
protected void
initImageGenerator
(Drawable parent, ITickProvider provider, ITickRenderer renderer) boolean
void
Renders the picture into the window, according to the viewport settings.void
setEmulGLUnscale
(boolean emulGLUnscale) void
Update image generator fontvoid
Update image according to new margin.toImage
(int width, int height) protected BufferedImage
Generate an image for this dimension, margin and pixel scale.void
Recompute the picture, using last used dimensions.void
updateMinimumDimension
(IPainter painter) Pre process an ideal width for the colorbar based on text width and other settingsvoid
updatePixelScale
(Coord2d pixelScale) Update the image with pixel scale if scale changedMethods inherited from class org.jzy3d.plot3d.rendering.legends.AWTLegend
dispose, drawableChanged, getBackground, getForeground, saveImage, setBackground, setForeground, setGeneratorColors, setMinimumDimension, setMinimumWidth, setViewPort
Methods inherited from class org.jzy3d.plot3d.rendering.view.AWTImageViewport
computeLayout, getImage, getMargin, getPixelScale, renderImage, setImage, setImage, setImage
Methods 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, setViewportMode
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.legends.colorbars.IColorbarLegend
drawableChanged, getMargin, setMinimumDimension
Methods inherited from interface org.jzy3d.plot3d.rendering.view.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:AWTImageViewport
Return the minimum size for this graphic.- Specified by:
getMinimumDimension
in interfaceIColorbarLegend
- Specified by:
getMinimumDimension
in interfaceIImageViewport
- Overrides:
getMinimumDimension
in classAWTLegend
-
render
Description copied from interface:IImageViewport
Renders the picture into the window, according to the viewport settings. If the picture is bigger than the viewport, it is simply centered in it, otherwise, it is scaled in order to fit into the viewport.- Specified by:
render
in interfaceIColorbarLegend
- Specified by:
render
in interfaceIImageViewport
- Overrides:
render
in classAWTImageViewport
-
updateMinimumDimension
Pre process an ideal width for the colorbar based on text width and other settings- Specified by:
updateMinimumDimension
in 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()Description copied from interface:ILegend
Recompute the picture, using last used dimensions.- Specified by:
updateImage
in interfaceILegend
- Overrides:
updateImage
in classAWTLegend
-
setMargin
Update image according to new margin.- Specified by:
setMargin
in interfaceIColorbarLegend
- Overrides:
setMargin
in classAWTImageViewport
-
updatePixelScale
Update the image with pixel scale if scale changed- Specified by:
updatePixelScale
in interfaceIImageViewport
- Overrides:
updatePixelScale
in classAWTImageViewport
-
setFont
Update image generator font -
getFont
-
getImageGenerator
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getChoosenWidth
public int getChoosenWidth() -
getChoosenHeight
public int getChoosenHeight() -
isEmulGLUnscale
public boolean isEmulGLUnscale() -
setEmulGLUnscale
public void setEmulGLUnscale(boolean emulGLUnscale)
-