Class AWTColorbarImageGenerator

    • Field Detail

      • min

        protected double min
      • max

        protected double max
      • BAR_WIDTH_DEFAULT

        public static int BAR_WIDTH_DEFAULT
      • barWidth

        protected int barWidth
      • textToBarHorizontalMargin

        protected int textToBarHorizontalMargin
      • addTextHeightToVerticalMargin

        protected boolean addTextHeightToVerticalMargin
      • pixelScale

        protected Coord2d pixelScale
    • Method Detail

      • toImage

        public BufferedImage toImage​(int width,
                                     int height,
                                     int barWidth)
        Renders the colorbar to an image.
      • drawBarContour

        protected void drawBarContour​(int height,
                                      int barWidth,
                                      Graphics2D graphic)
        Draw a bar border. Keep a space of half text height between the top of image and top of colorbar (same for bottom) to ensure a tick label at max or min position would not be cut at image border. The text size is given by AWTAbstractImageGenerator.setFont(org.jzy3d.painters.Font)
        Parameters:
        height -
        barWidth -
        graphic -
      • drawBarColors

        protected void drawBarColors​(int height,
                                     int barWidth,
                                     Graphics2D graphic)
        Draw a bar content using the provided color mapper.
        Parameters:
        height -
        barWidth -
        graphic -
      • drawTextAnnotations

        protected void drawTextAnnotations​(int height,
                                           int barWidth,
                                           Graphics2D graphic)
      • getPixelScale

        public Coord2d getPixelScale()
      • setPixelScale

        public void setPixelScale​(Coord2d pixelScale)
      • getScaledBarWidth

        protected int getScaledBarWidth()
      • getPreferedWidth

        public int getPreferedWidth​(IPainter painter)
        Compute the optimal image width to contain the text as defined by the tick provided and renderer.
      • getPreferedWidth

        protected int getPreferedWidth​(int maxTextWidth)
      • getTextToBarHorizontalMargin

        public int getTextToBarHorizontalMargin()
      • setTextToBarHorizontalMargin

        public void setTextToBarHorizontalMargin​(int textToBarHorizontalMargin)
      • getMaxTickLabelWidth

        protected int getMaxTickLabelWidth​(IPainter painter)