draw the Amino acid sequence

@param g2D
@param y .. height of line to draw the sequence onto
@return the new y value
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;
	}
627935
private void paintArrowDown(Graphics2D g, JComponent c, int width, int height) {
        int xOffset = width / 2 - 3;
        int yOffset = height / 2 - 5;

        g.translate(xOffset, yOffset);

        Shape s = shapeGenerator.createArrowLeft(1, 1, 4.2, 6);

        g.setPaint(getCommonArrowPaint(s, type));
        g.fill(s);

        g.translate(-xOffset, -yOffset);
    }
696056
public void drawHighlight(Graphics2D g) {
		if (needsRefresh)
			refreshCurve();
		Graphics2D g2 = (Graphics2D) g.create();
		g2.setStroke(new java.awt.BasicStroke(6.0f));
		g2.setColor(HIGHLIGHT_COLOR);
		g2.draw(curve);
		g2.transform(affineToText);
		g2.fill(bounds);
		g2.dispose();
	}
369112
@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);

        // Translate the coordinate system related to insets
        G2.translate(getInnerBounds().x, getInnerBounds().y);

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

        // Draw LCD display
        if (isLcdVisible() && bImage != null) {
            // Draw lcd text
            if (getLcdColor() == LcdColor.CUSTOM) {
                G2.setColor(getCustomLcdForeground());
            } else {
                G2.setColor(getLcdColor().TEXT_COLOR);
            }
            G2.setFont(getLcdUnitFont());
            final double UNIT_STRING_WIDTH;
            if (isLcdUnitStringVisible() && !getLcdUnitString().isEmpty()) {
                unitLayout = new TextLayout(getLcdUnitString(), G2.getFont(), RENDER_CONTEXT);
                UNIT_BOUNDARY.setFrame(unitLayout.getBounds());
                //G2.drawString(getLcdUnitString(), (int) ((LCD.getWidth() - UNIT_BOUNDARY.getWidth()) - LCD.getWidth() * 0.03 + (getGaugeBounds().width - LCD.getWidth()) / 2.0), (int) (LCD.getHeight() * 0.6 + (getGaugeBounds().height - LCD.getHeight()) / 2.0));
                G2.drawString(getLcdUnitString(), (int) ((LCD.getWidth() - UNIT_BOUNDARY.getWidth()) - LCD.getWidth() * 0.03 + (getGaugeBounds().width - LCD.getWidth()) / 2.0), (int) (LCD.getHeight() * lcdTextYPositionFactor + getGaugeBounds().height * 0.425));
                UNIT_STRING_WIDTH = UNIT_BOUNDARY.getWidth();
            } else {
                UNIT_STRING_WIDTH = 0;
            }

            // Draw value
            G2.setFont(getLcdValueFont());
            switch (getLcdNumberSystem()) {
                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(), (int) ((LCD.getWidth() - UNIT_STRING_WIDTH - VALUE_BOUNDARY.getWidth()) - LCD.getWidth() * 0.09 + ((getGaugeBounds().width - LCD.getWidth()) / 2.0)), (int) (LCD.getHeight() * lcdTextYPositionFactor + getGaugeBounds().height * 0.425));
                    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()), (int) ((LCD.getWidth() - UNIT_STRING_WIDTH - VALUE_BOUNDARY.getWidth()) - LCD.getWidth() * 0.09 + ((getGaugeBounds().width - LCD.getWidth()) / 2.0)), (int) (LCD.getHeight() * lcdTextYPositionFactor + getGaugeBounds().height * 0.425));
                    break;

                case DEC:

                default:
                    valueLayout = new TextLayout(formatLcdValue(getLcdValue()), G2.getFont(), RENDER_CONTEXT);
                    VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                    G2.drawString(formatLcdValue(getLcdValue()), (int) ((LCD.getWidth() - UNIT_STRING_WIDTH - VALUE_BOUNDARY.getWidth()) - LCD.getWidth() * 0.09 + ((getGaugeBounds().width - LCD.getWidth()) / 2.0)), (int) (LCD.getHeight() * lcdTextYPositionFactor + getGaugeBounds().height * 0.425));
                    break;
            }

            // Draw lcd info string
            if (!getLcdInfoString().isEmpty() && !displayMulti) {
                G2.setFont(getLcdInfoFont());
                infoLayout = new TextLayout(getLcdInfoString(), G2.getFont(), RENDER_CONTEXT);
                INFO_BOUNDARY.setFrame(infoLayout.getBounds());
                G2.drawString(getLcdInfoString(), LCD.getBounds().x + 5, LCD.getBounds().y + (float) INFO_BOUNDARY.getHeight() + 5f);
            }

            if (displayMulti) {
                // Draw oldValue
                G2.setFont(lcdFormerValueFont);
                oldValueLayout = new TextLayout(formatLcdValue(oldValue), G2.getFont(), RENDER_CONTEXT);
                OLD_VALUE_BOUNDARY.setFrame(oldValueLayout.getBounds());
                //G2.drawString(formatLcdValue(oldValue), (int) ((LCD.getWidth() - OLD_VALUE_BOUNDARY.getWidth()) / 2.0 + (getGaugeBounds().width - LCD.getWidth()) / 2.0), (int) (LCD.getHeight() * 0.9 + (getGaugeBounds().height - LCD.getHeight()) / 2.0));
                G2.drawString(formatLcdValue(oldValue), (int) ((LCD.getWidth() - OLD_VALUE_BOUNDARY.getWidth()) / 2.0 + (getGaugeBounds().width - LCD.getWidth()) / 2.0), (int) (LCD.getHeight() * 0.9 + getGaugeBounds().height * 0.425));
            }

            // 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 user LED if enabled
        if (isUserLedVisible()) {
            G2.drawImage(getCurrentUserLedImage(), (int) (getGaugeBounds().width * getUserLedPosition().getX()), (int) (getGaugeBounds().height * getUserLedPosition().getY()), null);
        }

        // Draw combined foreground image
        G2.drawImage(fImage, 0, 0, null);

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

        // Translate the coordinate system back to original
        G2.translate(-getInnerBounds().x, -getInnerBounds().y);

        G2.dispose();
    }
894045
@Override
	protected void drawFirstPassShape(Graphics2D g2, int pass, int series, int item, Shape shape) {
		g2.setStroke(getItemStroke(series, item));
		g2.setPaint(getLinePaint(series)); // this line is different from the original
		g2.draw(shape);
	}
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);
	}
502318
protected void drawBase (Graphics2D gfx, int x, int y)
    {
        gfx.fillRoundRect(
            x, y, _size.width - 1, _size.height - 1, _dia, _dia);
    }
58856
public void drawRectBaseRatio(double[] topLeft, double[] rightBottom) {
        if (!(projection instanceof Projection2D)) {
            throw new UnsupportedOperationException("Only 2D graphics supports drawing rectangles.");
        }

        int[] sc = projection.screenProjectionBaseRatio(topLeft);
        int[] sc2 = projection.screenProjectionBaseRatio(rightBottom);

        g2d.drawRect(sc[0], sc[1], sc2[0] - sc[0], sc2[1] - sc[1]);
    }
535763
public void drawBoxes(Graphics g){
		if ( fragmentPairs == null )
			return;

		g.setColor(Color.yellow);


		for (int i = 0; i < fragmentPairs.length; i++) {
			FragmentPair fp =fragmentPairs[i];
			int xp = fp.getPos1();
			int yp = fp.getPos2();

			int width = Math.round(scale);

			g.drawRect(Math.round(xp*scale),Math.round(yp*scale),width, width);

		}
	}
98901
protected void drawBullet(Graphics2D g)
    {
        ctx.updateGraphics(g);
    	int x = (int) Math.round(getAbsoluteContentX() - 1.2 * ctx.getEm());
    	int y = (int) Math.round(getAbsoluteContentY() + 0.5 * ctx.getEm());
    	int r = (int) Math.round(0.4 * ctx.getEm());
    	if (styleType == CSSProperty.ListStyleType.CIRCLE) 
    		g.drawOval(x, y, r, r);
    	else if (styleType == CSSProperty.ListStyleType.SQUARE) 
    		g.fillRect(x, y, r, r);
    	//else if (type == CSSProperty.ListStyleType.BOX) //not documented, recognized by Konqueror 
    	//	g.drawRect(x, y, r, r);
    	else if (styleType == CSSProperty.ListStyleType.DISC)
    		g.fillOval(x, y, r, r);
    	else if (styleType != CSSProperty.ListStyleType.NONE)
    	    drawText(g, getMarkerText());
    }
1012769
public void fill(Graphics2D g, Shape s) {
        Rectangle bounds = s.getBounds();
        int       width  = bounds.width;
        int       height = bounds.height;

        BufferedImage bimage = Effect.createBufferedImage(width, height, true);
        Graphics2D    gbi    = bimage.createGraphics();

        gbi.setColor(Color.BLACK);
        gbi.fill(s);

        g.drawImage(applyEffect(bimage, null, width, height), 0, 0, null);
    }
977180
public /*internal*/ function draw($im, $x1, $y1, $x2, $y2) {
        $x = 0;
        $y = 0;

        $fontDimension = $this->font->getDimension();

        if ($this->position === self::POSITION_TOP || $this->position === self::POSITION_BOTTOM) {
            if ($this->position === self::POSITION_TOP) {
                $y = $y1 - $this->spacing - $fontDimension[1];
            } elseif ($this->position === self::POSITION_BOTTOM) {
                $y = $y2 + $this->spacing;
            }

            if ($this->alignment === self::ALIGN_CENTER) {
                $x = ($x2 - $x1) / 2 + $x1 - $fontDimension[0] / 2 + $this->offset;
            } elseif ($this->alignment === self::ALIGN_LEFT)  {
                $x = $x1 + $this->offset;
            } else {
                $x = $x2 + $this->offset - $fontDimension[0];
            }
        } else {
            if ($this->position === self::POSITION_LEFT) {
                $x = $x1 - $this->spacing - $fontDimension[0];
            } elseif ($this->position === self::POSITION_RIGHT) {
                $x = $x2 + $this->spacing;
            }

            if ($this->alignment === self::ALIGN_CENTER) {
                $y = ($y2 - $y1) / 2 + $y1 - $fontDimension[1] / 2 + $this->offset;
            } elseif ($this->alignment === self::ALIGN_TOP)  {
                $y = $y1 + $this->offset;
            } else {
                $y = $y2 + $this->offset - $fontDimension[1];
            }
        }

        $this->font->setText($this->text);
        $this->font->draw($im, $x, $y);
    }
674600
protected void drawCheckerBoard(Graphics2D g2d) {
		g2d.setColor(getBackground());
		g2d.fillRect(0, 0, getWidth(), getHeight());
		g2d.setColor(getForeground());
		
		final int checkSize = this.checkerSize;
		final int halfCheckSize = checkSize/2;
		final Stroke checker = this.checkerStroke;
		final Stroke backup = g2d.getStroke();
		g2d.setStroke(checker);
		final int width = this.getWidth()+checkSize;
		final int height = this.getHeight()+checkSize;
		for(int i = halfCheckSize; i < height; i+=checkSize*2){
			g2d.drawLine(halfCheckSize, i, width, i);
			g2d.drawLine(checkSize+halfCheckSize, i+checkSize, width, i+checkSize);
		}
		g2d.setStroke(backup);
	}
794288
def draw_line(x1, y1, x2, y2)
      @context.drawLine(x1, y1, x2, y2)
    end
960940
public void drawContent(Graphics2D g)
    {
        //top left corner
        int x = absbounds.x;
        int y = absbounds.y;

        //Draw the string
        if (textEnd > textStart)
        {
            String t = text.substring(textStart, textEnd);
            Shape oldclip = g.getClip();
            if (clipblock != null)
                g.setClip(applyClip(oldclip, clipblock.getClippedContentBounds()));
            ctx.updateGraphics(g);
            
            if (wordSpacing == null && expwidth == 0)
                drawAttributedString(g, x, y, t);
            else
                drawByWords(g, x, y, t);
            
            g.setClip(oldclip);
        }
    }
176188
private void drawOverlayGraphic(Graphics2D g, int width, int height) {
        Shape s = shapeGenerator.createTabCloseIcon(2, 2, width - 4, height - 4);

        g.setPaint(graphicBase);
        g.fill(s);

        s = shapeGenerator.createTabCloseIcon(2, 3, width - 4, height - 4);
        g.setPaint(createGraphicDropShadowGradient(s));
        Shape oldClip = g.getClip();

        g.setClip(2, 3, width - 4, height - 4);
        g.fill(s);
        g.setClip(oldClip);
    }
1313184
@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);

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

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

        // Draw the symbol image
        if (on) {
            G2.drawImage(symbolOnImage, 0, 0, null);
        } else {
            G2.drawImage(symbolOffImage, 0, 0, null);
        }

        // Draw combined foreground image
        G2.drawImage(fImage, 0, 0, null);

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

        // Translate the coordinate system back to original
        G2.translate(-getInnerBounds().x, -getInnerBounds().y);

        G2.dispose();
    }