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
      • pixelScale

        protected Coord2d pixelScale
    • Method Detail

      • drawBarContour

        public 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

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

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

        public Coord2d getPixelScale()
      • setPixelScale

        public void setPixelScale​(Coord2d pixelScale)
      • getPreferedWidth

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

        public int getPreferedWidth​(int maxTextWidth)
      • getTextToBarHorizontalMargin

        public int getTextToBarHorizontalMargin()
      • setTextToBarHorizontalMargin

        public void setTextToBarHorizontalMargin​(int textToBarHorizontalMargin)
      • getMaxTickLabelWidth

        public int getMaxTickLabelWidth​(IPainter painter)