Class 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 two AbstractViewportManager
    • The View which handles its viewport with the Camera. If the view is and AWTView or children, it also allows defining 2D IViewOverlay 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 of Drawable having a ILegend set such as AWTColorbarLegend
    This allow making a composition of 3D and 2D content in a single screen.
    Author:
    Martin Pernollet
    • Field Detail

      • screenSeparator

        protected float screenSeparator
      • hasMeta

        protected boolean hasMeta
      • 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
    • Constructor Detail

      • ViewAndColorbarsLayout

        public ViewAndColorbarsLayout()
    • Method Detail

      • computeSeparator

        protected void computeSeparator​(ICanvas canvas,
                                        List<ILegend> list)
      • renderLegends

        protected void renderLegends​(IPainter painter,
                                     Chart chart)
      • 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).