Examples of drawString()


Examples of java.awt.Graphics2D.drawString()

        isNormalTextSpacing(renderableText))
    {
      final int maxLength = computeMaximumTextSize(renderableText, contentX2);
      final String text = gs.getText(renderableText.getOffset(), maxLength, codePointBuffer);
      final float y = (float) StrictGeomUtility.toExternalValue(posY + awtBaseLine);
      g2.drawString(text, (float) StrictGeomUtility.toExternalValue(posX), y);
    }
    else
    {
      final int maxPos = renderableText.getOffset() + computeMaximumTextSize(renderableText, contentX2);
      long runningPos = posX;
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

      final long baselineDelta = awtBaseLine - baseline;
      for (int i = renderableText.getOffset(); i < maxPos; i++)
      {
        final Glyph g = gs.getGlyph(i);
        final float y = (float) StrictGeomUtility.toExternalValue(posY + g.getBaseLine() + baselineDelta);
        g2.drawString(gs.getGlyphAsString(i, codePointBuffer), (float) StrictGeomUtility.toExternalValue(runningPos), y);
        runningPos += g.getWidth() + g.getSpacing().getMinimum();
      }
    }
    g2.dispose();
  }
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

    g2.setTransform(AffineTransform.getTranslateInstance(20, 20));
    radio.paint(g2);
    g2.setTransform(AffineTransform.getTranslateInstance(0, 0));
    g2.setPaint(Color.green);
    g2.setFont(new Font("Serif", Font.PLAIN, 10));
    g2.drawString("You are viewing a graphics of JFreeReport on index "
        + event.getState().getCurrentDataItem(), 10, 10);
    g2.dispose();
    try
    {
      functionValue = new DefaultImageReference(image);
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

        Graphics2D g2D = (Graphics2D) g;
        AffineTransform oldAt = g2D.getTransform();
        AffineTransform at = new AffineTransform(oldAt);
        at.rotate(angle, x, y);
        g2D.setTransform(at);
        g2D.drawString(text, x, y);
        g2D.setTransform(oldAt);
    }

    /**
     * Returns the font.
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

    BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);
    Graphics2D g = (Graphics2D) image.getGraphics();

    g.setColor(Color.RED);
    g.drawString(error, 10, height / 2);

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    ImageIO.write(image, "PNG", out);
    out.flush();
    byte[] result = out.toByteArray();
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

            super(new FlowLayout());
            message = new JLabel() {
                public void paint(Graphics g) {
                    Graphics2D g2 = (Graphics2D) g;
                    g2.setColor(textColor);
                    g2.drawString(getText(), 0, 12);
                }
            };
            if (size != -1) {
                message.setPreferredSize(new Dimension(size, 16));
                message.setMaximumSize(new Dimension(size, 16));
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

        for (int y = 0; y < classNames.length; y++) {
            AffineTransform trans = g.getTransform();
            g.transform(AffineTransform.getTranslateInstance(CELL_PAD * 2
                    + width, CELLS_SIZE + y * (CELLS_SIZE + CELL_PAD)));
            g.transform(AffineTransform.getRotateInstance(Math.PI / 12));
            g.drawString(classNames[y], 0, 0);
            g.setTransform(trans);
        }

        for (int x = 0; x < jarNames.length; x++) {
            AffineTransform trans = g.getTransform();
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

        for (int x = 0; x < jarNames.length; x++) {
            AffineTransform trans = g.getTransform();
            g.transform(AffineTransform.getTranslateInstance(CELL_PAD * 2 + x
                    * (CELLS_SIZE + CELL_PAD), heigh + CELL_PAD * 2));
            g.transform(AffineTransform.getRotateInstance(Math.PI / 2.5));
            g.drawString(jarNames[x], 0, 0);
            g.setTransform(trans);
        }

        FileOutputStream fos = new FileOutputStream("test.png");
        ImageIO.write(img, "png", fos);
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

        g2D.translate(xFixedHeader, yFixedHeader);
        this.fixedHeaderLabel.print(g2D);
        g2D.translate(-xFixedHeader, -yFixedHeader);
      }
      if (header != null) {
        g2D.drawString(header, xHeader, yHeader);
      }
      if (footer != null) {
        g2D.drawString(footer, xFooter, yFooter);
      }
      if (this.fixedFooterLabel != null) {
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

      }
      if (header != null) {
        g2D.drawString(header, xHeader, yHeader);
      }
      if (footer != null) {
        g2D.drawString(footer, xFooter, yFooter);
      }
      if (this.fixedFooterLabel != null) {
        g2D.translate(xFixedFooter, yFixedFooter);
        this.fixedFooterLabel.print(g2D);
        g2D.translate(-xFixedFooter, -yFixedFooter);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.