Package java.awt

Examples of java.awt.Font


    }

    public FSGlyphVector getGlyphVector(OutputDevice outputDevice, FSFont font, String text) {
        Object prevHint = null;
        Graphics2D graphics = ((Java2DOutputDevice)outputDevice).getGraphics();
        Font awtFont = ((AWTFSFont)font).getAWTFont();
       
        if (awtFont.getSize() > threshold && level > NONE ) {
            prevHint = graphics.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING);
            graphics.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, antiAliasRenderingHint );
        }
       
        GlyphVector vector = awtFont.createGlyphVector(
                graphics.getFontRenderContext(),
                text);
       
        if (awtFont.getSize() > threshold && level > NONE ) {
            graphics.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, prevHint );
        }
       
        return new AWTFSGlyphVector(vector);
    }
View Full Code Here


    JFreeChart pieChart = ChartFactory.createPieChart("Opportunities by Stage", pieData, true, true, false);

    // set the sub-title
    TextTitle t1 = new TextTitle("Total Forecasted: " + totalForecastString + "           " +
                                 "Total Amount: " + totalActualString,
                                 new Font("SansSerif", Font.PLAIN, 11));
    pieChart.addSubtitle(t1);

    // set the chart visual options
    PiePlot plot = (PiePlot)pieChart.getPlot();
    plot.setForegroundAlpha(0.65f);
View Full Code Here

                                                             true, true, false);

    // set the sub-title
    TextTitle t1 = new TextTitle("Total Forecasted: " + totalForecastString + "           " +
                                 "Total Amount: " + totalActualString,
                                 new Font("SansSerif", Font.PLAIN, 11));
    barChart.addSubtitle(t1);

    // set the chart visual options
    CategoryPlot plot = barChart.getCategoryPlot();
   
View Full Code Here

    }

    public FSFontMetrics getFSFontMetrics(
            FontContext fontContext, FSFont font, String string ) {
        Java2DFontContext fc = (Java2DFontContext)fontContext;
        Font awtFont = ((AWTFSFont)font).getAWTFont();
        return new LineMetricsAdapter(
                renderer.getLineMetrics(fc.getGraphics(), awtFont, string));
    }
View Full Code Here

    }
   
    public int getWidth(FontContext fontContext, FSFont font, String string) {
        Java2DFontContext fc = (Java2DFontContext)fontContext;
        Graphics2D graphics = fc.getGraphics();
        Font awtFont = ((AWTFSFont)font).getAWTFont();
        return (int)Math.ceil(renderer.getLogicalBounds(
                graphics, awtFont, string).getWidth());
    }
View Full Code Here

  if (isItalic())
      style |= Font.ITALIC;
  if (style == 0)
      style = Font.PLAIN;

  font = new Font(name, style, (int)getSize());
    }
    return font;
}
View Full Code Here

    channelLabel.setHorizontalTextPosition(SwingConstants.CENTER);

    JLabel titleLabel=new JLabel(program.getTitle());
    JPanel infoPanel=new JPanel(new GridLayout(2,1));

    Font font=titleLabel.getFont();

    titleLabel.setFont(new Font(font.getName(),Font.BOLD,font.getSize()+4));

    infoPanel.add(new JLabel(program.getDateString()));
    infoPanel.add(new JLabel(program.getTimeString()));

    JPanel headerPanel=new JPanel(new BorderLayout(20,0));
View Full Code Here

        if (italics)
        {
          fontstyle |= Font.ITALIC;
        }

        barcode.setFont(new Font(fontName, fontstyle, fontSize));
      }
      if (foregroundColor != null)
      {
        barcode.setForeground(foregroundColor);
      }
View Full Code Here

        labelMod.setPreferredSize(new Dimension(100, 25));
        labelFld.setPreferredSize(new Dimension(120, 25));
        labelOp.setPreferredSize(new Dimension(100, 25));
        labelVal.setPreferredSize(new Dimension(200, 25));
       
        Font font = labelFld.getFont();
        Font fontBold = new Font(font.getFamily(), Font.BOLD, font.getSize());
        Font fontCurs = new Font(font.getFamily(), Font.ITALIC, font.getSize());
       
        labelAnd.setFont(fontBold);
        labelFld.setFont(fontBold);
        labelMod.setFont(fontCurs);
        labelVal.setFont(fontBold);
View Full Code Here

                                                final boolean cellHasFocus)
  {
    defaultComp.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    abstractButton.setSelected(isSelected);
    abstractButton.setText(String.valueOf(value));
    abstractButton.setFont(new Font("Dialog", Font.PLAIN, 10));
    abstractButton.setMargin(new Insets(2, 0, 3, 0));

    return this;
  }
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.