Package java.awt

Examples of java.awt.Graphics2D.drawString()


      int[] xs = {0, titleW, titleW + titleHeight, 0};
      int[] ys = {0, 0, titleHeight, titleHeight};
      gg.fillPolygon(xs, ys, 4);
      gg.fillRect(0, titleHeight, width, height);
      gg.setColor(c.getForeground());
      gg.drawString(title, 10, titleHeight - titleDescent);
    } else {
      gg.fillRect(0, 0, width, height);
    }
   
    gg.dispose();
View Full Code Here


        g2d.setFont(DEFAULT_FONT);

        int fontHeight = getFontMetrics(DEFAULT_FONT).getAscent();

        for ( int i = 0; i < LABELS.length; i++ ) {
            g2d.drawString(LABELS[i] + stats[i], x, y);
            y += fontHeight;
        }
    }
}
View Full Code Here

            g2.drawRect(0, 0, getWidth() - 1, getHeight() - 1);
            g2.fillRect(0, 0, getWidth(), getHeight());

            g2.setPaint(new Color(0, 0, 0, 128));
            g2.setFont(new Font("Sansserif", Font.BOLD, 18));
            g2.drawString("Translucent", 16, 26);
        }
    }
}
View Full Code Here

                g2.fillRect(0, 0, getWidth(), getHeight());
                g2.drawImage(image, null, 0, 0);
                g2.setColor(Color.white);
                g2.setFont(font);
                g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
                g2.drawString("lightweight overlay", 100, 200);
            }
        };
        panel.setBackground(Color.black);
        panel.setOpaque(true);
        panel.setPreferredSize(new Dimension(width, height));
View Full Code Here

            g2.setComposite(AlphaComposite.SrcOver.derive(0.3f));
            g2.fillRoundRect(100, 100, 100, 80, 32, 32);
            g2.setComposite(AlphaComposite.SrcOver);
            g2.setColor(Color.white);
            g2.setFont(font);
            g2.drawString("vlcj direct media player", 130, 150);
        }
    }

    private final class TestRenderCallback extends RenderCallbackAdapter {
View Full Code Here

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

        g2d.setColor(Color.black);
        g2d.drawString(name, (getX() + getWidth() / 2) - fm.stringWidth(name)
                / 2, getY() + 15);

        for (int i = 0; i < sizeInformation(); i++)
            g2d.drawString((String) (data.getValue(getCodeInformation(i),
                    DictionnaireTable.NAME)), getX() + 10, getY() + 40 + i
View Full Code Here

        g2d.setColor(Color.black);
        g2d.drawString(name, (getX() + getWidth() / 2) - fm.stringWidth(name)
                / 2, 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));

    }

View Full Code Here

        g2d.setColor(Color.black);
        g2d.draw(l);

        if (Math.abs(x1 - x2) > Math.abs(y1 - y2))
            g2d.drawString(cardMin + ", " + cardMax, (x1 + x2) / 2,
                    (y1 + y2 + 25) / 2);
        else
            g2d.drawString(cardMin + ", " + cardMax, (x1 + x2 + 10) / 2,
                    (y1 + y2) / 2);
    }
View Full Code Here

        if (Math.abs(x1 - x2) > Math.abs(y1 - y2))
            g2d.drawString(cardMin + ", " + cardMax, (x1 + x2) / 2,
                    (y1 + y2 + 25) / 2);
        else
            g2d.drawString(cardMin + ", " + cardMax, (x1 + x2 + 10) / 2,
                    (y1 + y2) / 2);
    }

    /** @return la cardinalité minimale */
    public String getCardMin()
View Full Code Here

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

        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));
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.