Package java.awt

Examples of java.awt.Graphics2D.drawString()


            int infoWidth = metrics.stringWidth(text);
            int infoDescent = metrics.getDescent();
            if(AppConstants.WATERMARK_STYLE_CROSS.equalsIgnoreCase(vo.getParams().getWatermarkTextStyle())){
                //cross text watermark style
                g.rotate(Math.toRadians(-45),sw*1.0f/2,sh*1.0f/2);
                g.drawString(vo.getParams().getWatermarkText(), (sw- infoWidth)/2, sh/2);
            } else if(AppConstants.WATERMARK_STYLE_TINY.equalsIgnoreCase(vo.getParams().getWatermarkTextStyle())){
                g.drawString(vo.getParams().getWatermarkText(), sw - infoWidth - 10, sh - infoDescent-10)
            }
            g.dispose();
            return true;
View Full Code Here


            if(AppConstants.WATERMARK_STYLE_CROSS.equalsIgnoreCase(vo.getParams().getWatermarkTextStyle())){
                //cross text watermark style
                g.rotate(Math.toRadians(-45),sw*1.0f/2,sh*1.0f/2);
                g.drawString(vo.getParams().getWatermarkText(), (sw- infoWidth)/2, sh/2);
            } else if(AppConstants.WATERMARK_STYLE_TINY.equalsIgnoreCase(vo.getParams().getWatermarkTextStyle())){
                g.drawString(vo.getParams().getWatermarkText(), sw - infoWidth - 10, sh - infoDescent-10)
            }
            g.dispose();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);

        graphics.setFont(f);
        graphics.setColor(couloir);
        graphics.drawString(str_text, 0, height - fmetrics.getMaxDescent());
        PlanarImage image = PlanarImage.wrapRenderedImage(bi);
        return image;
    }
}
View Full Code Here

              graphics.setColor(Color.WHITE);
              graphics.fillRect(0, 0, getTileSize(), getTileSize());
              graphics.setColor(Color.RED);
              graphics.drawLine(0, 0, getTileSize(), getTileSize());
              graphics.drawLine(0, getTileSize(), getTileSize(), 0);
              graphics.drawString("No Render Executor For Tile", getTileSize() / 2, getTileSize()/2); //$NON-NLS-1$
              graphics.dispose();
      }
      else {
        buffImage = renderExecutorComp.getContext().getImage();
      }
View Full Code Here

      int w = width - 2 * OUTER_PAD - CONTROL_CLOSE.getWidth(c) - 2 - ICON_PAD - image_width - ICON_TEXT_PAD;
      Graphics clipg = g.create(gx, 0, w, height);
      Graphics2D g2d = (Graphics2D) clipg;
      g2d.setColor(Color.white);
      g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
      g2d.drawString(title, 0, gy);
      g2d.dispose();
    }

    int w = CONTROL_CLOSE.getWidth(c);
    gx = x + width - OUTER_PAD - w - 2;
View Full Code Here

        public void paint(Graphics g) {
            Graphics2D g2d = (Graphics2D) g;

            g2d.setColor(Color.BLACK);
            g2d.drawString(name, 10, 10);

            g2d.setColor(Color.RED);
            g2d.drawString("Opt", 10, 50);
            g2d.draw(gp1);
View Full Code Here

            g2d.setColor(Color.BLACK);
            g2d.drawString(name, 10, 10);

            g2d.setColor(Color.RED);
            g2d.drawString("Opt", 10, 50);
            g2d.draw(gp1);

            g2d.setColor(Color.BLUE);
            g2d.drawString("Normal", 10, 100);
            g2d.draw(gp2.createTransformedShape(AffineTransform.getTranslateInstance(2, 2)));
View Full Code Here

            g2d.setColor(Color.RED);
            g2d.drawString("Opt", 10, 50);
            g2d.draw(gp1);

            g2d.setColor(Color.BLUE);
            g2d.drawString("Normal", 10, 100);
            g2d.draw(gp2.createTransformedShape(AffineTransform.getTranslateInstance(2, 2)));
        }

    }
}
View Full Code Here

    while(textIt.hasNext()){
      DiagramText text = textIt.next();
      g2.setFont(text.getFont());
      if(text.hasOutline()){
        g2.setColor(text.getOutlineColor());
        g2.drawString(text.getText(), text.getXPos() + 1, text.getYPos());
        g2.drawString(text.getText(), text.getXPos() - 1, text.getYPos());
        g2.drawString(text.getText(), text.getXPos(), text.getYPos() + 1);
        g2.drawString(text.getText(), text.getXPos(), text.getYPos() - 1);
      }
      g2.setColor(text.getColor());
View Full Code Here

      DiagramText text = textIt.next();
      g2.setFont(text.getFont());
      if(text.hasOutline()){
        g2.setColor(text.getOutlineColor());
        g2.drawString(text.getText(), text.getXPos() + 1, text.getYPos());
        g2.drawString(text.getText(), text.getXPos() - 1, text.getYPos());
        g2.drawString(text.getText(), text.getXPos(), text.getYPos() + 1);
        g2.drawString(text.getText(), text.getXPos(), text.getYPos() - 1);
      }
      g2.setColor(text.getColor());
      g2.drawString(text.getText(), text.getXPos(), text.getYPos());
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.