Package java.awt

Examples of java.awt.Graphics2D.drawString()


        g2d.setColor(Color.black);
        g2d.drawString(name, getX() + 10, getY() + 15);

        for (int i = 0; i < sizeInformation(); i++)
            g2d.drawString((String) (data.getValue(getCodeInformation(i),
                    DictionnaireTable.NAME)), getX() + 10, getY() + 40 + i
                    * (fm.getMaxDescent() + 15));

        if (sizeInformation() > 0) {
            String nom = (String) (data.getValue(getCodeInformation(0),
View Full Code Here


        g2d.setColor(Color.blue);
        g2d.draw(r);
        g2d.draw(l);

        g2d.setColor(Color.black);
        g2d.drawString(getName(), getX() + 10, getY() + 15);

        for (int i = 0; i < informations.size(); i++)
            g2d.drawString(getCodeInformation(i), getX() + 10, getY() + 40 + i
                    * (fm.getMaxDescent() + 15));

View Full Code Here

        g2d.setColor(Color.black);
        g2d.drawString(getName(), getX() + 10, getY() + 15);

        for (int i = 0; i < informations.size(); i++)
            g2d.drawString(getCodeInformation(i), getX() + 10, getY() + 40 + i
                    * (fm.getMaxDescent() + 15));

        for (int i = 0; i < nbIdentifiant; i++) {
            String nom = getCodeInformation(i);
            l = new Line2D.Double(getX() + 10, 45 + getY() + i
View Full Code Here

                formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a, z");
            formatter.setTimeZone (tz);
            Font font = gfx.getFont();
            Font newFont = new Font(font.getName(), font.getStyle(), config.getTimestampFontSize());
            gfx.setFont(newFont);
            gfx.drawString(formatter.format(cal.getTime()), config.getTextMarginLeft() * 4, this.height - 1);
        }
       
        return toImageData(image);
    }

View Full Code Here

      // actually do the drawing
      g2.setColor(new Color(0, 0, 0));
      g2.fillRect(0, 0, width, height);
      g2.setColor(new Color(255, 255, 255));
      // We position it to the center. Note that this is not the upper left corner
      g2.drawString(text, (int) (requiredWidth / 2 - bounds.getWidth() / 2), (int) (requiredHeight / 2 + bounds.getHeight() / 4));

      // Write the data, and send the modification data to let the client cache it
      Bucket data = ctx.getBucketFactory().makeBucket(-1);
      OutputStream os = data.getOutputStream();
      try {
View Full Code Here

      int width = metrics.stringWidth(text);
      int descent = metrics.getDescent();
      int x = button.getWidth() / 2 - width / 2 + 1;
      int y = button.getHeight() / 2 + descent + 1;
      g2d.setColor(TEXT_LIGHT);
      g2d.drawString(text, ++x, ++y);
      g2d.setColor(TEXT_DARK);
      g2d.drawString(text, --x, --y);
    } finally {
      g2d.dispose();
    }
View Full Code Here

      int x = button.getWidth() / 2 - width / 2 + 1;
      int y = button.getHeight() / 2 + descent + 1;
      g2d.setColor(TEXT_LIGHT);
      g2d.drawString(text, ++x, ++y);
      g2d.setColor(TEXT_DARK);
      g2d.drawString(text, --x, --y);
    } finally {
      g2d.dispose();
    }
  }
View Full Code Here

      TextLayout layout = new TextLayout(text, font, context);
      int x = width / 2 - (int) (layout.getAdvance() / 2f);
      int y = height / 2 + (int) (layout.getAscent() / 2f) - 1;
     
      graphics.setColor(Color.DARK_GRAY.darker());
      graphics.drawString(text, x-1, y-1);
      graphics.setColor(Color.WHITE);
      graphics.drawString(text, x, y);
   
    } finally {
      graphics.dispose();
View Full Code Here

      int y = height / 2 + (int) (layout.getAscent() / 2f) - 1;
     
      graphics.setColor(Color.DARK_GRAY.darker());
      graphics.drawString(text, x-1, y-1);
      graphics.setColor(Color.WHITE);
      graphics.drawString(text, x, y);
   
    } finally {
      graphics.dispose();
    }
  }
View Full Code Here

                prev = next;
            }

            int i = 0;
            for (Point p : spline.points) {
                g.drawString(i + "", p.x, p.y);
                if (mousePressed) {
                    int x = mouse.x - p.x;
                    int y = mouse.y - p.y;
                    if (x >= 0 && x <= 9 && y <= 0 && y >= -9)
                        selected = i;
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.