For each element in matrix, draw it as a colored square or pixel.

The color of a matrix element with value x is specified as
- H: 1-x/scalevalue
- S: saturation
- B: 1-x/scalevalue
@param g1
174643
public void drawDistances(Graphics g1){
		Graphics2D g = (Graphics2D)g1;

		int c = matrix.getRowDimension();
		int d = matrix.getColumnDimension();

		float scale = getScale();
		int width = Math.round(scale);

		for (int i = 0; i < c; i++) {
			int ipaint = Math.round(i*scale);

			for (int j = 0; j < d; j++) {
				double val = matrix.get(i,j);

				int jpaint = Math.round(j*scale);

				Color color = cellColor.getColor(val);
				g.setColor(color);

				g.fillRect(ipaint,jpaint,width,width);
			}

		}

	}
166782
protected void fill(ZoomableGraphicsContext gc, T element) {
		final double radius = element.getRadius();
		final double diameter = radius * radius;
		final double minx = element.getX() - radius;
		final double miny = element.getY() - radius;
		gc.fillOval(minx, miny, diameter, diameter);
	}
463637
@Override
  public void paintComponent(Graphics g) {
    super.paintComponent(g);

    // Determine the width of the space available to draw the line number

    FontMetrics fontMetrics = component.getFontMetrics(component.getFont());
    Insets insets = getInsets();
    int availableWidth = getSize().width - insets.left - insets.right;

    // Determine the rows to draw within the clipped bounds.

    Rectangle clip = g.getClipBounds();
    int rowStartOffset = component.viewToModel(new Point(0, clip.y));
    int endOffset = component.viewToModel(new Point(0, clip.y + clip.height));

    while (rowStartOffset <= endOffset) {
      try {
        if (isCurrentLine(rowStartOffset))
          g.setColor(getCurrentLineForeground());
        else
          g.setColor(getForeground());

        // Get the line number as a string and then determine the
        // "X" and "Y" offsets for drawing the string.

        String lineNumber = getTextLineNumber(rowStartOffset);
        int stringWidth = fontMetrics.stringWidth(lineNumber);
        int x = getOffsetX(availableWidth, stringWidth) + insets.left;
        int y = getOffsetY(rowStartOffset, fontMetrics);
        g.drawString(lineNumber, x, y);

        // Move to the next row

        rowStartOffset = Utilities.getRowEnd(component, rowStartOffset) + 1;
      } catch (Exception e) {
        break;
      }
    }
  }
593654
@Override
	public void paint(final Graphics g)
	{
		Graphics2D g2;
		g2 = this.initGraphics2D(g);
		final FontRenderContext frc = g2.getFontRenderContext();
		final Font font = new Font("Arial", Font.BOLD, 16);
		final String display = new String(this.message.getBytes());
		final TextLayout textLayout = new TextLayout(display, font, frc);
		final Dimension dimension = this.getSize();
		textLayout.draw(g2, 0, dimension.height);
	}
437924
@Override
    protected void paintComponent(Graphics g) {
        if (img != null) {
            setOpaque(false);
            Map<RenderingHints.Key, Object> hints = new HashMap<RenderingHints.Key, Object>();
            hints.put(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            hints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
            hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            ((Graphics2D) g).addRenderingHints(hints);
            g.drawImage(img, 0, 0, 
                    (int)(DisplayUtils.getScaledSize(img.getWidth()) * scale),
                    (int)(DisplayUtils.getScaledSize(img.getHeight()) * scale), null);
        }
        
        super.paintComponent(g);
    }
463731
def set_draw_color(self, r,g=-1,b=-1):
        ""
        if((r==0 and g==0 and b==0) or g==-1):
            self.draw_color=sprintf('%.3f G',r/255.0)
        else:
            self.draw_color=sprintf('%.3f %.3f %.3f RG',r/255.0,g/255.0,b/255.0)
        if(self.page>0):
            self._out(self.draw_color)
968341
public final void render(GL2 gl) {
    gl.glMatrixMode(GL2.GL_PROJECTION);
    gl.glPushMatrix();
    gl.glLoadIdentity();
    gl.glMatrixMode(GL2.GL_MODELVIEW);
    gl.glPushMatrix();
    gl.glLoadIdentity();

    gl.glOrtho(0, width, 0, height, -1, +1);
    gl.glColor4f(0f, 0f, 0f, .5f);

    // Fade background:
    gl.glBegin(GL2.GL_QUADS);
    gl.glVertex2f(0f, 0f);
    gl.glVertex2f(width, 0f);
    gl.glVertex2f(width, height);
    gl.glVertex2f(0f, height);
    gl.glEnd();
    
    renderContents(gl);

    gl.glMatrixMode(GL2.GL_PROJECTION);
    gl.glPopMatrix();
    gl.glMatrixMode(GL2.GL_MODELVIEW);
    gl.glPopMatrix();
  }
724557
@Override
    protected void paintComponent(Graphics g) {
        final Graphics2D G2 = (Graphics2D) g.create();

        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
        G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

        G2.translate(getInnerBounds().x, getInnerBounds().y);

        if (lcdBackgroundVisible) {
        G2.drawImage(lcdImage, 0, 0, null);
        }

        // Draw lcd text
        if (lcdColor == LcdColor.CUSTOM) {
            G2.setColor(customLcdForeground);
        } else {
            G2.setColor(lcdColor.TEXT_COLOR);
        }
        G2.setFont(lcdUnitFont);
        final double UNIT_STRING_WIDTH;
        if (lcdUnitStringVisible && !lcdUnitString.isEmpty()) {
            unitLayout = new TextLayout(lcdUnitString, G2.getFont(), RENDER_CONTEXT);
            UNIT_BOUNDARY.setFrame(unitLayout.getBounds());
            if (lcdTextVisible) {
            G2.drawString(lcdUnitString, (float) ((lcdImage.getWidth() - UNIT_BOUNDARY.getWidth()) - lcdImage.getHeight() * 0.15f), (lcdImage.getHeight() * 0.6f));
            }
            UNIT_STRING_WIDTH = UNIT_BOUNDARY.getWidth();
        } else {
            UNIT_STRING_WIDTH = 0;
        }

        // Draw value and oldValue
        switch (numberSystem) {
            case DEC:

            default:
                G2.setFont(lcdValueFont);
                valueLayout = new TextLayout(formatLcdValue(lcdValue), G2.getFont(), RENDER_CONTEXT);
                VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                if (lcdTextVisible) {
                G2.drawString(formatLcdValue(lcdValue), (float)((lcdImage.getMinX() + (lcdImage.getWidth() - UNIT_STRING_WIDTH - VALUE_BOUNDARY.getWidth()) - lcdImage.getHeight() * 0.3)), (lcdImage.getHeight() * 0.6f));
                }

                G2.setFont(lcdFormerValueFont);
                oldValueLayout = new TextLayout(formatLcdValue(oldValue), G2.getFont(), RENDER_CONTEXT);
                OLD_VALUE_BOUNDARY.setFrame(oldValueLayout.getBounds());
                if (lcdTextVisible) {
                G2.drawString(formatLcdValue(oldValue), (float) ((lcdImage.getWidth() - OLD_VALUE_BOUNDARY.getWidth()) / 2f), (lcdImage.getHeight() * 0.9f));
                }
                break;

            case HEX:
                G2.setFont(lcdValueFont);
                valueLayout = new TextLayout(Integer.toHexString((int) lcdValue).toUpperCase(), G2.getFont(), RENDER_CONTEXT);
                VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                if (lcdTextVisible) {
                G2.drawString(Integer.toHexString((int) lcdValue).toUpperCase(), (float)((lcdImage.getMinX() + (lcdImage.getWidth() - UNIT_STRING_WIDTH - VALUE_BOUNDARY.getWidth()) - lcdImage.getHeight() * 0.3)), (lcdImage.getHeight() * 0.6f));
                }

                G2.setFont(lcdFormerValueFont);
                oldValueLayout = new TextLayout(Integer.toHexString((int) oldValue).toUpperCase(), G2.getFont(), RENDER_CONTEXT);
                OLD_VALUE_BOUNDARY.setFrame(oldValueLayout.getBounds());
                if (lcdTextVisible) {
                G2.drawString(Integer.toHexString((int) oldValue).toUpperCase(), (float) ((lcdImage.getWidth() - OLD_VALUE_BOUNDARY.getWidth()) / 2f), (lcdImage.getHeight() * 0.9f));
                }
                break;

            case OCT:
                G2.setFont(lcdValueFont);
                valueLayout = new TextLayout(Integer.toOctalString((int) lcdValue), G2.getFont(), RENDER_CONTEXT);
                VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                if (lcdTextVisible) {
                G2.drawString(Integer.toOctalString((int) lcdValue), (float)((lcdImage.getMinX() + (lcdImage.getWidth() - UNIT_STRING_WIDTH - VALUE_BOUNDARY.getWidth()) - lcdImage.getHeight() * 0.3)), (lcdImage.getHeight() * 0.6f));
                }

                G2.setFont(lcdFormerValueFont);
                oldValueLayout = new TextLayout(Integer.toOctalString((int) oldValue), G2.getFont(), RENDER_CONTEXT);
                OLD_VALUE_BOUNDARY.setFrame(oldValueLayout.getBounds());
                if (lcdTextVisible) {
                G2.drawString(Integer.toOctalString((int) oldValue), (float) ((lcdImage.getWidth() - OLD_VALUE_BOUNDARY.getWidth()) / 2f), (lcdImage.getHeight() * 0.9f));
                }
                break;
        }

        // Draw lcd info string
        if (!lcdInfoString.isEmpty()) {
            G2.setFont(lcdInfoFont);
            infoLayout = new TextLayout(lcdInfoString, G2.getFont(), RENDER_CONTEXT);
            INFO_BOUNDARY.setFrame(infoLayout.getBounds());
            G2.drawString(lcdInfoString, 5f, (float) INFO_BOUNDARY.getHeight() + 5f);
        }

        // Draw lcd threshold indicator
        if (numberSystem == NumberSystem.DEC && lcdThresholdVisible && lcdValue >= lcdThreshold) {
            if (!lcdThresholdBehaviourInverted) {
                if (lcdValue >= lcdThreshold) {
                    G2.drawImage(lcdThresholdImage, 5, getHeight() - lcdThresholdImage.getHeight() - 5, null);
                }
            } else {
                if (lcdValue <= lcdThreshold) {
                    G2.drawImage(lcdThresholdImage, 5, getHeight() - lcdThresholdImage.getHeight() - 5, null);
                }
            }
        }

        if (glowVisible && glowing) {
            G2.drawImage(glowImageOn, 0, 0, null);
        }

        if (!isEnabled()) {
            G2.setColor(DISABLED_COLOR);
            G2.fill(disabledShape);
        }

        G2.translate(-getInnerBounds().x, -getInnerBounds().y);

        G2.dispose();
    }
81579
public void paintComponent(Graphics g)
    {
        super.paintComponent(g);        // Just in case the image is bad/not loaded

        Rectangle rectangle = this.getBounds();
        if (m_compAnchor != null)
           this.calcOffset(m_compAnchor, m_offset);

        if (m_imageBackground != null) if (m_imageBackground.getImageLoadStatus() == MediaTracker.COMPLETE)
        {
            for (int y = m_offset.y; y < rectangle.height; y = y + m_imageBackground.getIconHeight())
            {
                for (int x = m_offset.x; x < rectangle.width; x = x + m_imageBackground.getIconWidth())
                {
                    //+ if intersect()
                    m_imageBackground.paintIcon(this, g, x, y);
                }
            }
        }
    }
721142
protected void paint(SeaGlassContext context, Graphics g) {
        Rectangle clip = g.getClipBounds();

        Rectangle bounds = table.getBounds();
        // Account for the fact that the graphics has already been translated
        // into the table's bounds.
        bounds.x = bounds.y = 0;

        // This check prevents us from painting the entire table when the clip
        // doesn't intersect our bounds at all.
        if (table.getRowCount() <= 0 || table.getColumnCount() <= 0 || !bounds.intersects(clip)) {
            paintDropLines(context, g);
            return;
        }

        boolean ltr = table.getComponentOrientation().isLeftToRight();

        Point upperLeft = clip.getLocation();

        if (!ltr) {
            upperLeft.x++;
        }

        Point lowerRight = new Point(clip.x + clip.width - (ltr ? 1 : 0), clip.y + clip.height);

        int rMin = table.rowAtPoint(upperLeft);
        int rMax = table.rowAtPoint(lowerRight);
        // This should never happen (as long as our bounds intersect the clip,
        // which is why we bail above if that is the case).
        if (rMin == -1) {
            rMin = 0;
        }
        // If the table does not have enough rows to fill the view we'll get -1.
        // (We could also get -1 if our bounds don't intersect the clip,
        // which is why we bail above if that is the case).
        // Replace this with the index of the last row.
        if (rMax == -1) {
            rMax = table.getRowCount() - 1;
        }

        int cMin = table.columnAtPoint(ltr ? upperLeft : lowerRight);
        int cMax = table.columnAtPoint(ltr ? lowerRight : upperLeft);
        // This should never happen.
        if (cMin == -1) {
            cMin = 0;
        }
        // If the table does not have enough columns to fill the view we'll get
        // -1.
        // Replace this with the index of the last column.
        if (cMax == -1) {
            cMax = table.getColumnCount() - 1;
        }

        // Paint the grid.
        if (!(table.getParent() instanceof JViewport)
                || (table.getParent() != null && !(table.getParent().getParent() instanceof JScrollPane))) {
            // FIXME We need to not repaint the entire table any time something
            // changes.
            // paintGrid(context, g, rMin, rMax, cMin, cMax);
            paintStripesAndGrid(context, g, table, table.getWidth(), table.getHeight(), 0);
        }

        // Paint the cells.
        paintCells(context, g, rMin, rMax, cMin, cMax);

        paintDropLines(context, g);
    }
1171157
def set_fill_color(self,r,g=-1,b=-1):
        ""
        if((r==0 and g==0 and b==0) or g==-1):
            self.fill_color=sprintf('%.3f g',r/255.0)
        else:
            self.fill_color=sprintf('%.3f %.3f %.3f rg',r/255.0,g/255.0,b/255.0)
        self.color_flag=(self.fill_color!=self.text_color)
        if(self.page>0):
            self._out(self.fill_color)
289185
protected void paintBackground (Graphics g)
    {
        // simply fill our background color
        g.setColor(getBackground());
        g.fillRect(0, 0, getWidth(), getHeight());
    }
576421
function (x0, y0, x1, y1, color, c)
    {
        PixelArt.put(x, y, color, c)
        var dx = x1 - x0;
        var dy = y1 - y0;
        var adx = Math.abs(dx);
        var ady = Math.abs(dy);
        var eps = 0;
        var sx = dx > 0 ? 1 : -1;
        var sy = dy > 0 ? 1 : -1;
        if (adx > ady)
        {
            for (var x = x0, y = y0; sx < 0 ? x >= x1 : x <= x1; x += sx)
            {
                PixelArt.put(x, y)
                eps += ady;
                if ((eps << 1) >= adx)
                {
                    y += sy;
                    eps -= adx;
                }
            }
        } else
        {
            for (var x = x0, y = y0; sy < 0 ? y >= y1 : y <= y1; y += sy)
            {
                PixelArt.put(x, y)
                eps += adx;
                if ((eps << 1) >= ady)
                {
                    x += sx;
                    eps -= ady;
                }
            }
        }
    }
755727
public double render(Graphics2D g2) {
		double labelSize = (double)getMetrics().getTextFontWidth(ScoreElements.PART_LABEL, getText());
		Font previousFont = g2.getFont();
		Color previousColor = g2.getColor();
		setColor(g2, ScoreElements.PART_LABEL);
		Rectangle2D bb = getBoundingBox();
		g2.setFont(getTemplate().getTextFont(ScoreElements.PART_LABEL));
		float descent = g2.getFont().getLineMetrics(getText(), g2.getFontRenderContext())
			.getDescent();
		g2.drawString(getText(), (int)(bb.getCenterX() - labelSize/2),
				(int)(bb.getY() + bb.getHeight() - descent));
		g2.setFont(previousFont);
		g2.draw(bb);
		g2.setColor(previousColor);
		return getWidth();
	}
966938
public void setGraphics(java.awt.Graphics2D g2d) {
        this.g2d = g2d;
        // anti-aliasing methods
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
    }
551185
public void paint(final Graphics g) {
        // Draw grid on background image, which is faster
        final int numberOfColumns = this.cellGrid.getNumberOfColumns();
        final int numberOfRows = this.cellGrid.getNumberOfRows();
        if ( this.backgroundImage == null ) {
            final Dimension d = getSize();
            this.backgroundImage = createImage( d.width,
                                           d.height );
            final Graphics backgroundImageGraphics = this.backgroundImage.getGraphics();
            // draw background (MSIE doesn't do that)
            backgroundImageGraphics.setColor( getBackground() );
            backgroundImageGraphics.fillRect( 0,
                                              0,
                                              d.width,
                                              d.height );
            backgroundImageGraphics.setColor( CellGridCanvas.BACKGROUND_COLOR );
            backgroundImageGraphics.fillRect( 0,
                                              0,
                                              this.cellSize * numberOfColumns - 1,
                                              this.cellSize * numberOfRows - 1 );
            backgroundImageGraphics.setColor( CellGridCanvas.GRID_COLOR );
            for ( int x = 1; x < numberOfColumns; x++ ) {
                backgroundImageGraphics.drawLine( x * this.cellSize - 1,
                                                  0,
                                                  x * this.cellSize - 1,
                                                  this.cellSize * numberOfRows - 1 );
            }
            for ( int y = 1; y < numberOfRows; y++ ) {
                backgroundImageGraphics.drawLine( 0,
                                                  y * this.cellSize - 1,
                                                  this.cellSize * numberOfColumns - 1,
                                                  y * this.cellSize - 1 );
            }
        }
        g.drawImage( this.backgroundImage,
                     0,
                     0,
                     null );

        // draw populated cells
        for ( int row = 0; row < numberOfRows; row++ ) {
            for ( int column = 0; column < numberOfColumns; column++ ) {
                final Cell cell = this.cellGrid.getCellAt( row,
                                                column );
                if ( cell.getCellState() == CellState.LIVE ) {
                    g.drawImage( this.liveCellImage,
                                 column * this.cellSize,
                                 row * this.cellSize,
                                 this );
                }
            }
        }
    }
903514
@Override
    protected void paintComponent(Graphics g) {
        if (!isInitialized()) {
            return;
        }

        final Graphics2D G2 = (Graphics2D) g.create();

        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
        G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

        // Translate coordinate system related to insets
        G2.translate(getFramelessOffset().getX(), getFramelessOffset().getY());

        final AffineTransform OLD_TRANSFORM = G2.getTransform();

        G2.drawImage(bImage, 0, 0, null);

        // Highlight active area
        if (isHighlightArea()) {
            switch (getOrientation()) {
                case EAST:
                    break;
                case SOUTH:
                    break;
                case WEST:
                    G2.translate(CENTER.getX() / 2.2, 0);
                    break;
                case NORTH:

                default:
                    G2.translate(0, CENTER.getY() / 2.2);
                    break;
            }

            for(Section area : getAreas()) {
                if (area.contains(getValue())) {
                    G2.setColor(area.getHighlightColor());
                    G2.fill(area.getFilledArea());
                    break;
                }
            }
            G2.setTransform(OLD_TRANSFORM);
        }

        // Highlight active section
        if (isHighlightSection()) {

            switch (getOrientation()) {
                case EAST:
                    break;
                case SOUTH:
                    break;
                case WEST:
                    G2.translate(CENTER.getX() / 2.2, 0);
                    break;
                case NORTH:

                default:
                    G2.translate(0, CENTER.getY() / 2.2);
                    break;
            }

            for(Section section : getSections()) {
                if (section.contains(getValue())) {
                    G2.setColor(section.getHighlightColor());
                    G2.fill(section.getSectionArea());
                    break;
                }
            }
            G2.setTransform(OLD_TRANSFORM);
        }

        // Draw title
        final FontRenderContext RENDER_CONTEXT = new FontRenderContext(null, true, true);
        if (!getTitle().isEmpty()) {
            if (isLabelColorFromThemeEnabled()) {
                G2.setColor(getBackgroundColor().LABEL_COLOR);
            } else {
                G2.setColor(getLabelColor());
            }
            G2.setFont(new Font("Verdana", 0, (int) (0.04672897196261682 * getGaugeBounds().width)));
            final TextLayout TITLE_LAYOUT = new TextLayout(getTitle(), G2.getFont(), RENDER_CONTEXT);
            final Rectangle2D TITLE_BOUNDARY = TITLE_LAYOUT.getBounds();
            G2.drawString(getTitle(), (float) ((getGaugeBounds().width - TITLE_BOUNDARY.getWidth()) / 2.0), 0.4f * getGaugeBounds().width + TITLE_LAYOUT.getAscent() - TITLE_LAYOUT.getDescent());
        }

        // Draw unit string
        if (!getUnitString().isEmpty()) {
            if (isLabelColorFromThemeEnabled()) {
                G2.setColor(getBackgroundColor().LABEL_COLOR);
            } else {
                G2.setColor(getLabelColor());
            }
            G2.setFont(new Font("Verdana", 0, (int) (0.04672897196261682 * getGaugeBounds().width)));
            final TextLayout UNIT_LAYOUT = new TextLayout(getUnitString(), G2.getFont(), RENDER_CONTEXT);
            final Rectangle2D UNIT_BOUNDARY = UNIT_LAYOUT.getBounds();
            G2.drawString(getUnitString(), (float) ((getGaugeBounds().width - UNIT_BOUNDARY.getWidth()) / 2.0), 0.47f * getGaugeBounds().width + UNIT_LAYOUT.getAscent() - UNIT_LAYOUT.getDescent());
        }

        switch (getOrientation()) {
            case NORTH:
                break;
            case EAST:
                break;
            case SOUTH:
                break;
            case WEST:
                G2.rotate(-Math.PI / 2.0, CENTER.getX(), CENTER.getY());
                break;
            default:
                break;
        }

        final AffineTransform FORMER_TRANSFORM = G2.getTransform();

        // Draw the track
        if (isTrackVisible()) {
            G2.drawImage(trackImage, 0, 0, null);
        }

        // Draw the tickmarks
        G2.drawImage(tickmarksImage, 0, 0, null);

        // Draw threshold indicator
        if (isThresholdVisible()) {
            if (!isLogScale()) {
                G2.rotate(getRotationOffset() + (getThreshold() - getMinValue()) * getAngleStep(), CENTER.getX(), getGaugeBounds().width * 0.7336448598);
            } else {
                G2.rotate(getRotationOffset() + UTIL.logOfBase(BASE, getThreshold() - getMinValue()) * getLogAngleStep(), CENTER.getX(), getGaugeBounds().width * 0.7336448598);
            }
            G2.drawImage(thresholdImage, 0, 0, null);
            G2.setTransform(FORMER_TRANSFORM);
        }

        // Draw min measured value indicator
        if (isMinMeasuredValueVisible()) {
            if (!isLogScale()) {
                G2.rotate(getRotationOffset() + (getMinMeasuredValue() - getMinValue()) * getAngleStep(), CENTER.getX(), getGaugeBounds().width * 0.7336448598);
            } else {
                G2.rotate(getRotationOffset() + UTIL.logOfBase(BASE, getMinMeasuredValue() - getMinValue()) * getLogAngleStep(), CENTER.getX(), getGaugeBounds().width * 0.7336448598);
            }
            G2.drawImage(minMeasuredImage, 0, 0, null);
            G2.setTransform(FORMER_TRANSFORM);
        }

        // Draw max measured value indicator
        if (isMaxMeasuredValueVisible()) {
            if (!isLogScale()) {
                G2.rotate(getRotationOffset() + (getMaxMeasuredValue() - getMinValue()) * getAngleStep(), CENTER.getX(), getGaugeBounds().width * 0.7336448598);
            } else {
                G2.rotate(getRotationOffset() + UTIL.logOfBase(BASE, getMaxMeasuredValue() - getMinValue()) * getLogAngleStep(), CENTER.getX(), getGaugeBounds().width * 0.7336448598);
            }
            G2.drawImage(maxMeasuredImage, 0, 0, null);
            G2.setTransform(FORMER_TRANSFORM);
        }

        // Draw LED if enabled
        if (isLedVisible()) {
            G2.setTransform(OLD_TRANSFORM);
            G2.drawImage(getCurrentLedImage(), (int) (getGaugeBounds().width * getLedPosition().getX()), (int) (getGaugeBounds().width * getLedPosition().getY()), null);
            G2.setTransform(FORMER_TRANSFORM);
        }

        // Draw user LED if enabled
        if (isUserLedVisible()) {
            G2.setTransform(OLD_TRANSFORM);
            G2.drawImage(getCurrentUserLedImage(), (int) (getGaugeBounds().width * getUserLedPosition().getX()), (int) (getGaugeBounds().width * getUserLedPosition().getY()), null);
            G2.setTransform(FORMER_TRANSFORM);
        }

        // Draw the pointer
        if (!isLogScale()) {
            angle = getRotationOffset() + (getValue() - getMinValue()) * getAngleStep();
        } else {
            angle = getRotationOffset() + UTIL.logOfBase(BASE, getValue() - getMinValue()) * getLogAngleStep();
        }
        //G2.rotate(ANGLE + (Math.cos(Math.toRadians(ANGLE - ROTATION_OFFSET - 91.5))), CENTER.getX(), backgroundImage.getHeight() * 0.7336448598);
        G2.rotate(angle, CENTER.getX(), getGaugeBounds().height * 0.7336448598 + 2);
        G2.drawImage(pointerShadowImage, 0, 0, null);
        G2.setTransform(FORMER_TRANSFORM);
        G2.rotate(angle, CENTER.getX(), getGaugeBounds().height * 0.7336448598);
        G2.drawImage(pointerImage, 0, 0, null);
        G2.setTransform(FORMER_TRANSFORM);

        // Draw posts
        G2.drawImage(postsImage, 0, 0, null);

        switch (getOrientation()) {
            case NORTH:
                break;
            case EAST:
                break;
            case SOUTH:
                break;
            case WEST:
                G2.setTransform(OLD_TRANSFORM);
                break;
            default:
                break;
        }

        G2.drawImage(fImage, 0, 0, null);

        // Draw glow indicator
        if (isGlowVisible()) {
            if (isGlowing()) {
                G2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, getGlowAlpha()));
                G2.drawImage(glowImageOn, 0, 0, null);
                G2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f));
            } else
            {
                G2.drawImage(glowImageOff, 0, 0, null);
            }
        }

        if (!isEnabled()) {
            G2.drawImage(disabledImage, 0, 0, null);
        }

        G2.dispose();
    }