Package java.awt

Examples of java.awt.Font


    cb.setTextMatrix((float) mx[0], (float) mx[1], (float) mx[2], (float) mx[3], (float) mx[4], (float) mx[5]);
    double width = 0;
    if (fontSize > 0)
    {
      final float scale = 1000 / fontSize;
      final Font font = this.font.deriveFont(AffineTransform.getScaleInstance(scale, scale));
      final Rectangle2D stringBounds = font.getStringBounds(s, getFontRenderContext());
      width = stringBounds.getWidth() / scale;
    }
    if (s.length() > 1)
    {
      final float adv = ((float) width - lastBaseFont.getWidthPoint(s, fontSize)) / (s.length() - 1);
View Full Code Here


        if (!eunit.bottom1.equals("")) {
            int x = point1.x + (symbol_.getIconWidth() / 2);
            int y = point1.y + symbol_.getIconHeight()
                    + echelon_.getIconHeight();
            Font font = new Font("Helvetica", java.awt.Font.PLAIN, 10);
            g.setFont(font);
            FontMetrics fm = g.getFontMetrics();
            int w = fm.stringWidth(eunit.bottom1);
            int h = fm.getHeight();
            total_height += h;
View Full Code Here

   */
  private Font font;

  public SurveyScaleLegendItem()
  {
    font = new Font("Serif", Font.ITALIC, 10); //$NON-NLS-1$
  }
View Full Code Here

    g2.translate(-x, -y);
    x += b.getWidth() / 2.0 + 3.0;
    g2.setFont(this.font);

    final FontRenderContext frc = g2.getFontRenderContext();
    final Font f = g2.getFont();
//    final FontMetrics fm = g2.getFontMetrics(f);
    final LineMetrics metrics = f.getLineMetrics(label, frc);
    final float ascent = metrics.getAscent();
    final float halfAscent = ascent / 2.0f;
    g2.drawString(label, (float) x, (float) (y + halfAscent));
  }
View Full Code Here

   */
  public Font getFont()
  {
    if (font == null)
    {
      font = new Font(getFontName(), getFontStyle(), getFontSize());
    }
    return font;
  }
View Full Code Here

    g2.setColor(Color.blue);
    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
    {
View Full Code Here

        "SansSerif", 10, true, Color.black, new Color(220, 255, 220));

    final SurveyScale scaleHeader = new SurveyScale(1, 5, null);
    scaleHeader.setDrawScaleValues(true);
    scaleHeader.setDrawTickMarks(false);
    scaleHeader.setScaleValueFont(new Font("SansSerif", Font.PLAIN, 9));
    report.getParameterValues().put("SCALE_HEADER", scaleHeader);

    final ContentFieldElementFactory dfef = new ContentFieldElementFactory();
    dfef.setName("ScaleHeaderElement");
    dfef.setAbsolutePosition(new Point2D.Double(X2, BOX_TOP));
View Full Code Here

        //**********************************************************
        status.setPreferredSize(new Dimension(500, 22));
        status.setText(DataCrow.getVersion().getFullString());
        status.setHorizontalAlignment(JLabel.CENTER);
        status.setVerticalAlignment(JLabel.CENTER);
        status.setFont(new Font("Tahoma", Font.BOLD, 11));
        status.setForeground(Color.WHITE);
       
        getContentPane().setBackground(Color.BLACK);
        status.setBackground(Color.BLACK);

View Full Code Here

    public static String getHtmlStyle(String additionalStyleInfo) {
        return getHtmlStyle(additionalStyleInfo, null);
    }
   
    public static String getHtmlStyle(String additionalStyleInfo, Color bg) {
        Font font = DcSettings.getFont(DcRepository.Settings.stSystemFontNormal);
        Color color = ComponentFactory.getCurrentForegroundColor();
        String foreground = Utilities.getHexColor(color);
       
        String fontstyle = "";
        if (font.isItalic())
            fontstyle = ";font-style:italic";
        else if (font.isBold())
            fontstyle = ";font-weigth:bolder";
       
        StringBuffer sb = new StringBuffer();
        sb.append("style=\"");
        sb.append("font-family:");
        sb.append(font.getFamily());
        sb.append(";font-size:");
        sb.append(font.getSize());
        sb.append(fontstyle);
       
        if (bg != null) {
            String background = Utilities.getHexColor(bg);
            sb.append(";background:");
View Full Code Here

        }
      }

      if (linesAxis != null)
      {
        final Font labelFont = Font.decode(getLabelFont());
        linesAxis.setLabelFont(labelFont);
        linesAxis.setTickLabelFont(labelFont);

        if (getLineTitleFont() != null)
        {
View Full Code Here

TOP

Related Classes of java.awt.Font

Copyright © 2015 www.massapicom. 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.