Package java.awt.font

Examples of java.awt.font.FontRenderContext


            xpt = constraints.getMaximumColumnValue();
       
        boolean paint = false;
       
        DecimalFormat df = c.getYDecimalFormat();
    FontRenderContext frc = c.getFontRenderContext();
        Font f = c.getFont();
   
        for(double d = min; d <= max; d += tick) {
            if(paint) {
                String sb = df.format(d);
View Full Code Here


        Point2D p = new Point2D.Double(0.0, 0.0);
        Point2D v;
        Line2D ticks = new Line2D.Double(0.0, 0.0, 0.0, 0.0);
       
    DecimalFormat df = c.getXDecimalFormat();
    FontRenderContext frc = c.getFontRenderContext();
        Font f = c.getFont();
       
    boolean paint = false;
   
        g.setFont(f);
View Full Code Here

        Point2D oldv = null;
       
        Line2D ticks = new Line2D.Double(0.0, 0.0, 0.0, 0.0);
       
    DecimalFormat df = c.getXDecimalFormat();
    FontRenderContext frc = c.getFontRenderContext();
        Font f = c.getFont();
       
        boolean paint = false;
        boolean paintLabels = c.isPaintLabels();
        g.setFont(f);
View Full Code Here

        Point2D v;
        Line2D ticks = new Line2D.Double(0.0, 0.0, 0.0, 0.0);
        boolean paint = false;
       
        DecimalFormat df = c.getYDecimalFormat();
    FontRenderContext frc = c.getFontRenderContext();
        Font f = c.getFont();
   
    Color backupColor = g.getColor();
        g.setFont(f);
        boolean paintLabels = c.isPaintLabels();
View Full Code Here

            ((AlphaComposite)oldComposite).getAlpha() * 0.7f));
        } else {
          g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));
        }
        g2D.setStroke(new BasicStroke(3 / planScale));
        FontRenderContext fontRenderContext = g2D.getFontRenderContext();
        TextLayout textLayout = new TextLayout(lengthText, font, fontRenderContext);
        g2D.draw(textLayout.getOutline(new AffineTransform()));
        g2D.setComposite(oldComposite);
        g2D.setPaint(foregroundColor);
      }
View Full Code Here

     */
    public static BufferedImage createImageFromText(String text, Font font) {
        //You may want to change these setting, or make them parameters
        boolean isAntiAliased = true;
        boolean usesFractionalMetrics = false;
        FontRenderContext frc = new FontRenderContext(null, isAntiAliased, usesFractionalMetrics);
        TextLayout layout = new TextLayout(text, font, frc);
        Rectangle2D bounds = layout.getBounds();
        int w = (int) Math.ceil(bounds.getWidth());
        int h = (int) Math.ceil(bounds.getHeight()) + 2;
        BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); //for example;
View Full Code Here

    public void reflow(TextManager.Renderer renderer, int width, TextDataImpl text) {
        flowList.clear();
        int numLines = 0;
        TextRenderer joglRenderer = renderer.getJOGLRenderer();
        FontRenderContext frc = joglRenderer.getFontRenderContext();

        String paragraph = text.getLine().getText();
        Map attrs = new HashMap();
        attrs.put(TextAttribute.FONT, joglRenderer.getFont());
        AttributedString str = new AttributedString(paragraph, attrs);
View Full Code Here

      // text broken into multiline paragraphs

      int descTextWidth = getDescriptionTextWidth();
      int width = ins.left + 2 * gap + descTextWidth + ins.right;
      RichTooltip tooltipInfo = richTooltipPanel.getTooltipInfo();
      FontRenderContext frc = new FontRenderContext(
          new AffineTransform(), true, false);
      if (tooltipInfo.getMainImage() != null) {
        width += tooltipInfo.getMainImage().getWidth(null);
      }

View Full Code Here

      Font font = FlamingoUtilities.getFont(parent, "Ribbon.font",
          "Button.font", "Panel.font");
      Insets ins = richTooltipPanel.getInsets();
      int y = ins.top;
      RichTooltip tooltipInfo = richTooltipPanel.getTooltipInfo();
      FontRenderContext frc = new FontRenderContext(
          new AffineTransform(), true, false);
      int gap = getLayoutGap();

      int fontHeight = parent.getFontMetrics(font).getHeight();
View Full Code Here

        return shadowedTile;
    }

    public BufferedImage textButton(String text, int width, int buttonType) {
        Font font = new Font("Lucida Grande", Font.PLAIN, 12);
        TextLayout layout = new TextLayout(text, font, new FontRenderContext(null, true, true));

        Rectangle2D bounds = layout.getBounds();
        if (width == 0)
            width = (int) bounds.getWidth() + 16;
        int height = 20; // (int) bounds.getHeight() + 8;
View Full Code Here

TOP

Related Classes of java.awt.font.FontRenderContext

Copyright © 2018 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.