/*
(non-Javadoc)
@see com.alibaba.simpleimage.render.DrawTextItem#drawText(java.awt.Graphics2D, int, int)
776190
@Override
    public void drawText(Graphics2D graphics, int width, int height) {
        if(StringUtils.isBlank(text) || StringUtils.isBlank(domainName)) {
            return ;
        }
        
        int x = 0, y = 0; 
        int fontsize = ((int)(width * textWidthPercent)) / domainName.length();
        if (fontsize < minFontSize) {
            return;
        }
        
        float fsize = (float)fontsize;
        Font font = domainFont.deriveFont(fsize);
        graphics.setFont(font);
        FontRenderContext context = graphics.getFontRenderContext();
        int sw = (int) font.getStringBounds(domainName, context).getWidth();

        x = width - sw - fontsize;
        y = height - fontsize;
        if(x <= 0 || y <= 0) {
            return ;
        }

        if (fontShadowColor != null) {
            graphics.setColor(fontShadowColor);
            graphics.drawString(domainName, x + getShadowTranslation(fontsize), y + getShadowTranslation(fontsize));
        }
        graphics.setColor(fontColor);
        graphics.drawString(domainName, x, y);
        
        //draw company name
        fsize = (float)fontsize;
        font = defaultFont.deriveFont(fsize);
        graphics.setFont(font);
        context = graphics.getFontRenderContext();
        sw = (int) font.getStringBounds(text, context).getWidth();
        x = width - sw - fontsize;
        y = height - (int)(fontsize * 2.5);
        if(x <= 0 || y <= 0) {
            return ;
        }
        
        if (fontShadowColor != null) {
            graphics.setColor(fontShadowColor);
            graphics.drawString(text, x + getShadowTranslation(fontsize), y + getShadowTranslation(fontsize));
        }
        graphics.setColor(fontColor);
        graphics.drawString(text, x, y);
    }
1022774
public void draw(Graphics2D g) {
		if (needsRefresh)
			refreshCurve();
		g.draw(curve); // Draws the main part of the arrow.
		drawArrow(g, end, control); // Draws the arrow head.
		drawText(g);
	}
373615
public void draw(GraphicContext graphicContext) {
        /*
         * Swap bitmaps here (and only here).
         * Swapping is done when layer manager has finished. Else draw old bitmap again.
         * This draw() is always called when layer manager has finished. This ensures that the
         * last generated frame is always put on screen.
         */

        // FIXME: resetting the background color is redundant if the background color of the map view is already set
        graphicContext.fillColor(this.displayModel.getBackgroundColor());

        swapBitmaps();

        synchronized (this.matrix) {
            Bitmap b = this.odBitmap.lock();
            if (b != null) {
                graphicContext.drawBitmap(b, this.matrix);
            }
        }

        /*
         * Release here so destroy() can free resources
         */
        this.odBitmap.release();
    }
976677
protected int drawSequence(Graphics2D g2D,  int y){
		//g2D.drawString(panelName,10,10);

		g2D.setColor(SEQUENCE_COLOR);
		int aminosize = Math.round(1*scale);
		if ( aminosize < 1)
			aminosize = 1;

		// only draw within the ranges of the Clip
		Rectangle drawHere = g2D.getClipBounds();
		int startpos = coordManager.getSeqPos(drawHere.x);
		//int endpos   = coordManager.getSeqPos(drawHere.x+drawHere.width-2);


		Composite oldComp = g2D.getComposite();
		g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.8f));
		//logger.info("paint l " + l + " length " + length );

		if ( startpos < 0)
			startpos = 999;

		if ( scale > SEQUENCE_SHOW){
			g2D.setColor(Color.black);


			//g2D.setColor(SCALE_COLOR);

			int i = startpos;

			// display the actual sequence!;
			for ( int gap = startpos ;   gap < apos.size() ;gap++){
				int xpos = coordManager.getPanelPos(gap) ;

				AlignedPosition m = apos.get(gap);
				if (m.getPos(position) == -1){
					// a gap position
					g2D.drawString("-",xpos+1,y+2+DEFAULT_Y_STEP);
					continue;
				}

				i = m.getPos(position);

				// TODO:
				// color amino acids by hydrophobicity

				g2D.drawString(seqArr[i].toString(),xpos+1,y+2+DEFAULT_Y_STEP);
			}

//			in full sequence mode we need abit more space to look nice

			y+=2;
		}
		g2D.setComposite(oldComp);
		y+= DEFAULT_Y_STEP + 2;
		return y;
	}
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();
    }
827377
public void drawTextBaseRatio(String label, double horizontalReference, double verticalReference, double[] coord) {
        drawTextBaseRatio(label, horizontalReference, verticalReference, 0.0, coord);
    }
164492
protected void renderContent(Graphics2D g, Shape a, Color fg, int p0, int p1)
    {
        TextLayout layout = getTextLayout();
        Rectangle absoluteBounds = box.getAbsoluteBounds();
        Rectangle absoluteContentBounds = box.getAbsoluteContentBounds();

        int pStart = getStartOffset();
        int pEnd = getEndOffset();
        int x = absoluteBounds.x;
        int y = absoluteBounds.y;

        Shape oldclip = g.getClip();
        BlockBox clipblock = box.getClipBlock();
        if (clipblock != null)
        {
            Rectangle newclip = clipblock.getClippedContentBounds();
            Rectangle clip = toRect(oldclip).intersection(newclip);
            g.setClip(clip);
        }
        
        g.setFont(getFont());
        g.setColor(fg);

        // -- Draw the string at specified positions --

        if (p0 > pStart || p1 < pEnd)
        {
            try
            {
                // TextLayout can't render only part of it's range, so if a
                // partial range is required, add a clip region.
                Shape s = modelToView(p0, Position.Bias.Forward, p1, Position.Bias.Backward, a);
                absoluteContentBounds = absoluteContentBounds.intersection(toRect(s));
            } catch (BadLocationException ignored)
            {
            }
        }

        // render the text
        layout.draw(g, x, y + layout.getAscent());

        //render the decoration
        if (underline || strike || overline)
        {
            Stroke origStroke = g.getStroke();

            int w;
            if (getFont().isBold())
                w = getFont().getSize() / 8;
            else
                w = getFont().getSize() / 10;
            if (w < 1) w = 1;
            y += w / 2;
            
            g.setStroke(new BasicStroke(w));

            int xx = absoluteContentBounds.x + absoluteContentBounds.width;
            if (overline)
            {
                g.drawLine(absoluteContentBounds.x, y, xx, y);
            }
            if (underline)
            {
                int yy = y + absoluteContentBounds.height - (int) layout.getDescent();
                g.drawLine(absoluteContentBounds.x, yy, xx, yy);
            }
            if (strike)
            {
                int yy = y + absoluteContentBounds.height / 2;
                g.drawLine(absoluteContentBounds.x, yy, xx, yy);
            }
            
            g.setStroke(origStroke);
        }

        g.setClip(oldclip);
    }
604732
private void drawLine(BufferedImage image) {
        Random r = new Random();
        Graphics2D g2 = (Graphics2D) image.getGraphics();
        int max = this.textLength * this.linePower;
        for (int i = 0; i < max; i++) {
            int x1 = r.nextInt(w);
            int y1 = r.nextInt(h);
            int x2 = r.nextInt(w);
            int y2 = r.nextInt(h);
            g2.setStroke(new BasicStroke(1.5F));
            g2.setColor(this.randomColor());
            g2.drawLine(x1, y1, x2, y2);
        }
        g2.dispose();
    }
1166320
@Override
    public void draw(Canvas canvas) {
        drawSpacings(canvas);
        drawBaselineGrid(canvas);
        drawKeylines(canvas);
    }
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);
	}
3609
def draw_text(self, text:str, x:float, y:float, *,
                  font_name:str, font_size:float, fill:Color) -> None:
        """"""
        pass
1132198
@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);

        G2.translate(getFramelessOffset().getX(), getFramelessOffset().getY());
        final AffineTransform OLD_TRANSFORM = G2.getTransform();

        // Draw combined background image
        G2.drawImage(bImage, 0, 0, null);

        // Draw an Arc2d object that will visualize the range of measured values
        if (isRangeOfMeasuredValuesVisible()) {
            G2.setPaint(getModel().getRangeOfMeasuredValuesPaint());
            if ((getGaugeType() == GaugeType.TYPE3 || getGaugeType() == GaugeType.TYPE4) && isLcdVisible()) {
                final Area area = getModel().getRadialAreaOfMeasuredValues();
                area.subtract(lcdArea);
                G2.fill(area);
            } else {
                G2.fill(getModel().getRadialShapeOfMeasuredValues());
            }
        }

        // Highlight active area
        if (isHighlightArea()) {
            for(Section area : getAreas()) {
                if (area.contains(getValue())) {
                    G2.setColor(area.getHighlightColor());
                    if ((getGaugeType() == GaugeType.TYPE3 || getGaugeType() == GaugeType.TYPE4) && isLcdVisible()) {
                        final Area currentArea = new Area(area.getFilledArea());
                        currentArea.subtract(lcdArea);
                        G2.fill(currentArea);
                    } else {
                        G2.fill(area.getFilledArea());
                    }
                    break;
                }
            }
        }

        // Highlight active section
        if (isHighlightSection()) {
            for(Section section : getSections()) {
                if (section.contains(getValue())) {
                    G2.setColor(section.getHighlightColor());
                    G2.fill(section.getSectionArea());
                    break;
                }
            }
        }

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

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

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

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

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

        // Draw LCD display
        if (isLcdVisible()) {
            if (getLcdColor() == LcdColor.CUSTOM) {
                G2.setColor(getCustomLcdForeground());
            } else {
                G2.setColor(getLcdColor().TEXT_COLOR);
            }
            // Draw LCD text only if isVisible() in AbstractGauge (this is needed for lcd blinking)
            if (isLcdTextVisible()) {
            G2.setFont(getLcdUnitFont());
            if (isLcdUnitStringVisible()) {
                unitLayout = new TextLayout(getLcdUnitString(), G2.getFont(), RENDER_CONTEXT);
                UNIT_BOUNDARY.setFrame(unitLayout.getBounds());
                G2.drawString(getLcdUnitString(), (int) (LCD.getX() + (LCD.getWidth() - UNIT_BOUNDARY.getWidth()) - LCD.getWidth() * 0.03), (int) (LCD.getY() + LCD.getHeight() * 0.76));
                unitStringWidth = UNIT_BOUNDARY.getWidth();
            } else {
                unitStringWidth = 0;
            }
            G2.setFont(getLcdValueFont());
            switch (getModel().getNumberSystem()) {
                case HEX:
                    valueLayout = new TextLayout(Integer.toHexString((int) getLcdValue()).toUpperCase(), G2.getFont(), RENDER_CONTEXT);
                    VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                    G2.drawString(Integer.toHexString((int) getLcdValue()).toUpperCase(), (float) (LCD.getX() + (LCD.getWidth() - unitStringWidth - VALUE_BOUNDARY.getWidth()) - LCD.getHeight() * 0.333333333), (float) (LCD.getY() + LCD.getHeight() * 0.76));
                    break;

                case OCT:
                    valueLayout = new TextLayout(Integer.toOctalString((int) getLcdValue()), G2.getFont(), RENDER_CONTEXT);
                    VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                    G2.drawString(Integer.toOctalString((int) getLcdValue()), (float) (LCD.getX() + (LCD.getWidth() - unitStringWidth - VALUE_BOUNDARY.getWidth()) - LCD.getHeight() * 0.333333333), (float) (LCD.getY() + LCD.getHeight() * 0.76));
                    break;

                case DEC:

                default:
                    int digitalFontNo_1Offset = 0;
                    if (isDigitalFont() && Double.toString(getLcdValue()).startsWith("1")) {
                        digitalFontNo_1Offset = (int) (LCD.getHeight() * 0.2166666667);
                    }
                    valueLayout = new TextLayout(formatLcdValue(getLcdValue()), G2.getFont(), RENDER_CONTEXT);
                    VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                    G2.drawString(formatLcdValue(getLcdValue()), (float) (LCD.getX() + (LCD.getWidth() - unitStringWidth - VALUE_BOUNDARY.getWidth()) - LCD.getHeight() * 0.333333333) - digitalFontNo_1Offset, (float) (LCD.getY() + LCD.getHeight() * 0.76));
                    break;
            }
            }
            // Draw lcd info string
            if (!getLcdInfoString().isEmpty()) {
                G2.setFont(getLcdInfoFont());
                infoLayout = new TextLayout(getLcdInfoString(), G2.getFont(), RENDER_CONTEXT);
                INFO_BOUNDARY.setFrame(infoLayout.getBounds());
                G2.drawString(getLcdInfoString(), (float) LCD.getBounds().x + 5f, LCD.getBounds().y + (float) INFO_BOUNDARY.getHeight() + 5f);
            }
            // Draw lcd threshold indicator
            if (getLcdNumberSystem() == NumberSystem.DEC && isLcdThresholdVisible() && getLcdValue() >= getLcdThreshold()) {
                G2.drawImage(lcdThresholdImage, (int) (LCD.getX() + LCD.getHeight() * 0.0568181818), (int) (LCD.getY() + LCD.getHeight() - lcdThresholdImage.getHeight() - LCD.getHeight() * 0.0568181818), null);
            }
        }

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

        // Draw combined foreground image
        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, 1.0f));
            } else {
                G2.drawImage(glowImageOff, 0, 0, null);
            }
        }

        // Draw disabled image if component isEnabled() == false
        if (!isEnabled()) {
            G2.drawImage(disabledImage, 0, 0, null);
        }

        G2.dispose();
    }
542505
@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 the coordinate system related to insets
        G2.translate(getFramelessOffset().getX(), getFramelessOffset().getY());

        final AffineTransform OLD_TRANSFORM = G2.getTransform();

        // Draw combined background image
        G2.drawImage(bImage, 0, 0, null);

        // Draw blips
        G2.setColor(BLIP_TEXT_COLOR);
        G2.setFont(BLIP_FONT);
        for (Poi poi : blips.values()) {
            if (poi.distanceTo(MY_LOCATION) < this.range) {
                G2.drawImage(poi.getPoiImage(), (int) (CENTER.getX() - poi.getPoiImage().getWidth() / 2.0 + (poi.getLocationXY().getX() - CENTER_XY.getX()) / pixelScaleX), (int) (CENTER.getY() - poi.getPoiImage().getWidth() / 2.0 + (poi.getLocationXY().getY() - CENTER_XY.getY()) / pixelScaleY), null);
                G2.drawString(poi.getName(), (int) (CENTER.getX() - poi.getPoiImage().getWidth() + (poi.getLocationXY().getX() - CENTER_XY.getX()) / pixelScaleX), (int) (CENTER.getY() - poi.getPoiImage().getWidth() + (poi.getLocationXY().getY() - CENTER_XY.getY()) / pixelScaleY));
            }
        }

        // Draw the beam
        G2.rotate(rotationAngle, CENTER.getX(), CENTER.getY());
        G2.drawImage(beamImage, 0, 0, null);
        G2.setTransform(OLD_TRANSFORM);

        G2.rotate(Math.toRadians(-135) + rotationAngle, CENTER.getX(), CENTER.getY());
        G2.setColor(BEAM_COLOR);
        G2.draw(BEAM);
        G2.setTransform(OLD_TRANSFORM);

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

        G2.dispose();
    }
1083555
@Override
	public void drawScreen(int mouseX, int mouseY, float partialTick)
	{
		counter++;
		xCounter = 0;
		xTotal = 0;

		ar.animate();

		renderer.setup(partialTick);

		try
		{
			update();

			if (guiscreenBackground)
				drawWorldBackground(1);

			screen.render(renderer);

			//don't draw tooltip if mouse has itemStack
			boolean renderTooltip = tooltip != null;
			if (inventoryContainer != null)
				renderTooltip &= !renderer.renderPickedItemStack(inventoryContainer.getPickedItemStack());

			if (renderTooltip)
				tooltip.render(renderer);
		}
		catch (Exception e)
		{
			MalisisCore.message("A problem occured while rendering screen : " + getClass().getSimpleName() + ": " + e.getMessage());
			MalisisCore.log.error("A problem occured while rendering " + getClass().getSimpleName(), e);
		}

		renderer.clean();
	}
549224
private void drawAttributedString(Graphics2D g, int x, int y, String text)
    {
        if (!ctx.getTextDecoration().isEmpty()) 
        {
            AttributedString as = new AttributedString(text);
            as.addAttribute(TextAttribute.FONT, ctx.getFont());
            if (ctx.getTextDecoration().contains(CSSProperty.TextDecoration.UNDERLINE))
                as.addAttribute(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
            if (ctx.getTextDecoration().contains(CSSProperty.TextDecoration.LINE_THROUGH))
                as.addAttribute(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
            g.drawString(as.getIterator(), x, y + getBaselineOffset());
        } 
        else
            g.drawString(text, x, y + getBaselineOffset());
    }
1229980
public void drawString(String str, float x, float y) {
		predraw();
		font.drawString(x, y, str, currentColor);
		postdraw();
	}
1248812
private void showText2(String text) {
        if (state.fontDetails == null)
            throw new NullPointerException("Font and size must be set before writing any text");
        byte b[] = state.fontDetails.convertToBytes(text);
        escapeString(b, content);
    }