Class Quality


  • public class Quality
    extends Object
    Provides a structure for setting the rendering quality, i.e., the tradeoff between computation speed, and graphic quality. Following mode have an impact on the way the View makes its GL2 initialization. The Quality may also activate an AbstractOrderingStrategy algorithm that enables clean alpha results.
    • Fastest: No transparency, no color shading, just handle depth buffer.
    • Intermediate: include Fastest mode abilities, Color shading, mainly usefull to have interpolated colors on polygons.
    • Advanced: include Intermediate mode abilities, Transparency (GL2 alpha blending + polygon ordering in scene graph)
    • Nicest: include Advanced mode abilities, Anti aliasing on wires
    Toggling rendering model: one may either choose to have a repaint-on-demand or repaint-continuously model. Setting isAnimated(false) will desactivate the IAnimator updating the choosen ICanvas implementation. setAutoSwapBuffer(false) will configure the ICanvas.
    Author:
    Martin Pernollet
    • Field Detail

      • Nicest

        protected static final Quality Nicest
      • Advanced

        protected static final Quality Advanced
      • Intermediate

        protected static final Quality Intermediate
      • Fastest

        protected static final Quality Fastest
      • depthActivated

        protected boolean depthActivated
      • alphaActivated

        protected boolean alphaActivated
      • smoothColor

        protected boolean smoothColor
      • smoothPoint

        protected boolean smoothPoint
      • smoothLine

        protected boolean smoothLine
      • smoothPolygon

        protected boolean smoothPolygon
      • disableDepthTestWhenAlpha

        protected boolean disableDepthTestWhenAlpha
      • isAnimated

        protected boolean isAnimated
      • isAutoSwapBuffer

        protected boolean isAutoSwapBuffer
      • preserveViewportSize

        protected boolean preserveViewportSize
      • DEFAULT_PRESERVE_VIEWPORT

        public static boolean DEFAULT_PRESERVE_VIEWPORT
    • Constructor Detail

      • Quality

        public Quality​(boolean depthActivated,
                       boolean alphaActivated,
                       boolean smoothColor,
                       boolean smoothPoint,
                       boolean smoothLine,
                       boolean smoothPolygon,
                       boolean disableDepthTestWhenAlphaActivated)
        Initialize a Quality configuration for a View.
    • Method Detail

      • Nicest

        public static final Quality Nicest()
        Enables alpha, color interpolation and antialiasing on lines, points, and polygons.
      • Advanced

        public static final Quality Advanced()
        Enables alpha and color interpolation. Set HiDPI on by default
      • Intermediate

        public static final Quality Intermediate()
        Enables color interpolation. Keep HiDPI off by default
      • Fastest

        public static final Quality Fastest()
        Minimal quality to allow fastest rendering (no alpha, interpolation or antialiasing).
      • isDepthActivated

        public boolean isDepthActivated()
      • setDepthActivated

        public Quality setDepthActivated​(boolean depthActivated)
      • isAlphaActivated

        public boolean isAlphaActivated()
      • setAlphaActivated

        public Quality setAlphaActivated​(boolean alphaActivated)
      • isSmoothColor

        public boolean isSmoothColor()
      • setSmoothColor

        public Quality setSmoothColor​(boolean smoothColor)
      • isSmoothLine

        public boolean isSmoothLine()
      • setSmoothEdge

        public Quality setSmoothEdge​(boolean smoothLine)
      • isSmoothPoint

        public boolean isSmoothPoint()
      • setSmoothPoint

        public Quality setSmoothPoint​(boolean smoothPoint)
      • isSmoothPolygon

        public boolean isSmoothPolygon()
      • setSmoothPolygon

        public Quality setSmoothPolygon​(boolean smoothPolygon)
      • isDisableDepthBufferWhenAlpha

        public boolean isDisableDepthBufferWhenAlpha()
      • setDisableDepthBufferWhenAlpha

        public Quality setDisableDepthBufferWhenAlpha​(boolean disableDepthBufferWhenAlpha)
      • isAnimated

        public boolean isAnimated()
      • setAnimated

        public Quality setAnimated​(boolean isAnimated)
      • isAutoSwapBuffer

        public boolean isAutoSwapBuffer()
      • setAutoSwapBuffer

        public Quality setAutoSwapBuffer​(boolean isAutoSwapBuffer)
      • isPreserveViewportSize

        public boolean isPreserveViewportSize()
        Used by a Canvas to setup pixel ratio. This might be used to avoid mouse pointer errors on Retina display as most canvas implementation will perform : if(quality.isPreserveViewportSize()) setPixelScale(new float[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE });
      • setPreserveViewportSize

        public Quality setPreserveViewportSize​(boolean preserveViewportSize)
      • isHiDPIEnabled

        public boolean isHiDPIEnabled()
      • getHiDPI

        public HiDPI getHiDPI()
      • setHiDPIEnabled

        public Quality setHiDPIEnabled​(boolean hidpi)
        If true, states that the chart should make use of HiDPI or Retina capabilities to draw more good looking charts due to higher number of physical pixels. A convenient shortcut to setPreserveViewportSize(!hidpi)
        Parameters:
        hidpi -
      • getColorModel

        public ColorModel getColorModel()
      • setColorModel

        public void setColorModel​(ColorModel model)