Class ViewAndColorbarsLayout
- java.lang.Object
-
- org.jzy3d.plot3d.rendering.view.layout.ViewAndColorbarsLayout
-
- All Implemented Interfaces:
IViewportLayout
- Direct Known Subclasses:
EmulGLViewAndColorbarsLayout
,NativeViewAndColorbarsLayout
public class ViewAndColorbarsLayout extends Object implements IViewportLayout
This class handles the layout of a main 3D plot on the left with additional legends (colorbars) on the right side. The canvas is composed of twoAbstractViewportManager
- The
View
which handles its viewport with theCamera
. If the view is andAWTView
or children, it also allows defining 2DIViewOverlay
that can span on the left 3D side only or on the full canvas (hence also covering the 2D right side). - The
ILegend
objects which handle their viewport on their own. They are added to the right of the chart according to the number ofDrawable
having aILegend
set such asAWTColorbarLegend
- Author:
- Martin Pernollet
-
-
Field Summary
Fields Modifier and Type Field Description protected ViewportConfiguration
backgroundViewport
protected Chart
chart
protected int
colorbarRightMargin
protected boolean
hasMeta
protected float
legendsWidth
protected ViewportConfiguration
sceneViewport
protected float
screenSeparator
protected boolean
shrinkColorbar
This shrink colorbar is actually not supported by this implementation but made available and used by classes that inherit this class
-
Constructor Summary
Constructors Constructor Description ViewAndColorbarsLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
computeSeparator(ICanvas canvas, List<ILegend> list)
ViewportConfiguration
getBackgroundViewport()
Return the scene viewport as it was processed to cover the whole canvas.int
getColorbarRightMargin()
protected List<ILegend>
getLegends(Chart chart)
float
getLegendsWidth()
Return the legend width as it was processed at the rendering stage.ViewportConfiguration
getSceneViewport()
Return the scene viewport as it was processed according to the number of legends to display.boolean
isShrinkColorbar()
void
render(IPainter painter, Chart chart)
Once rendered, this layout knows the colorbar width which can be retrieved withgetLegendsWidth()
protected void
renderLegends(IPainter painter, float left, float right, List<ILegend> legends, ICanvas canvas)
Renders the legend within the screen slice given by the left and right parameters.protected void
renderLegends(IPainter painter, Chart chart)
void
setColorbarRightMargin(int colorbarRightMargin)
Set a right margin for colorbar.void
setShrinkColorbar(boolean shrinkColorbar)
If true, will let the colorbar be as thin as possible and stick to the right of the chart.void
update(Chart chart)
-
-
-
Field Detail
-
screenSeparator
protected float screenSeparator
-
hasMeta
protected boolean hasMeta
-
sceneViewport
protected ViewportConfiguration sceneViewport
-
backgroundViewport
protected ViewportConfiguration backgroundViewport
-
legendsWidth
protected float legendsWidth
-
shrinkColorbar
protected boolean shrinkColorbar
This shrink colorbar is actually not supported by this implementation but made available and used by classes that inherit this class
-
colorbarRightMargin
protected int colorbarRightMargin
-
chart
protected Chart chart
-
-
Method Detail
-
update
public void update(Chart chart)
- Specified by:
update
in interfaceIViewportLayout
-
render
public void render(IPainter painter, Chart chart)
Once rendered, this layout knows the colorbar width which can be retrieved withgetLegendsWidth()
- Specified by:
render
in interfaceIViewportLayout
-
renderLegends
protected void renderLegends(IPainter painter, float left, float right, List<ILegend> legends, ICanvas canvas)
Renders the legend within the screen slice given by the left and right parameters.
-
getSceneViewport
public ViewportConfiguration getSceneViewport()
Return the scene viewport as it was processed according to the number of legends to display.
-
getBackgroundViewport
public ViewportConfiguration getBackgroundViewport()
Return the scene viewport as it was processed to cover the whole canvas.
-
isShrinkColorbar
public boolean isShrinkColorbar()
-
setShrinkColorbar
public void setShrinkColorbar(boolean shrinkColorbar)
If true, will let the colorbar be as thin as possible and stick to the right of the chart. If the input value is different than internal state, then the chart will be updated to ensure the setting takes effect immediately.
-
getColorbarRightMargin
public int getColorbarRightMargin()
-
setColorbarRightMargin
public void setColorbarRightMargin(int colorbarRightMargin)
Set a right margin for colorbar. If the input value is different than internal state, then the chart will be updated to ensure the setting takes effect immediately.
-
getLegendsWidth
public float getLegendsWidth()
Return the legend width as it was processed at the rendering stage. Hence this value is defined after a first rendering. It is used for processing the remaining part of the layout (other viewport needing the colorbar width information).
-
-