Package java.awt.font

Examples of java.awt.font.LineMetrics


        int topThickness = thickness;

        String title = border.getTitle();
        if (title != null
            && title.length() > 0) {
            LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
            topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
        }

        Component content = border.getContent();
        if (content != null) {
            if (width != -1) {
View Full Code Here


        Component content = border.getContent();
        if (content != null) {
            String title = border.getTitle();
            if (title != null
                && title.length() > 0) {
                LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
                topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
            }

            int clientWidth = Math.max(width - (thickness * 2)
                - (padding.left + padding.right), 0);
            int clientHeight = Math.max(height - (topThickness + thickness) -
View Full Code Here

        int topThickness = thickness;

        String title = border.getTitle();
        if (title != null
            && title.length() > 0) {
            LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
            topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
        }

        Component content = border.getContent();
        if (content != null) {
            content.setLocation(padding.left + thickness,
View Full Code Here

        float titleAscent = 0;

        String title = border.getTitle();
        if (title != null
            && title.length() > 0) {
            LineMetrics lm = font.getLineMetrics(title, fontRenderContext);
            titleAscent = lm.getAscent();
            topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
        }

        // TODO Java2D doesn't support variable corner radii; we'll need to
        // "fake" this by drawing multiple arcs
        int cornerRadius = cornerRadii.topLeft;
View Full Code Here

        return new Dimensions(preferredWidth, preferredHeight);
    }

    @Override
    public int getBaseline(int width, int height) {
        LineMetrics lm = font.getLineMetrics("", FONT_RENDER_CONTEXT);
        float ascent = lm.getAscent();
        return margin.top + Math.round(ascent);
    }
View Full Code Here

        return new Dimensions(getPreferredWidth(-1), getPreferredHeight(-1));
    }

    @Override
    public int getBaseline(int width, int height) {
        LineMetrics lm = font.getLineMetrics("", FONT_RENDER_CONTEXT);
        float ascent = lm.getAscent();
        float textHeight = lm.getHeight();

        int baseline = Math.round((height - textHeight) / 2 + ascent);

        return baseline;
    }
View Full Code Here

        if (FONT_RENDER_CONTEXT.usesFractionalMetrics()) {
            graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                RenderingHints.VALUE_FRACTIONALMETRICS_ON);
        }

        LineMetrics lm = font.getLineMetrics("", FONT_RENDER_CONTEXT);
        float ascent = lm.getAscent();
        float textHeight = lm.getHeight();

        String prompt = textInput.getPrompt();

        if (glyphVector == null
            && prompt != null
View Full Code Here

            }
         }
      }
      else
      {
         LineMetrics metrics = font.getLineMetrics("ABCxyz",
                 g2.getFontRenderContext());
         maxHeight = metrics.getHeight()
                 + insets.getTop() + insets.getBottom();
      }
      return maxHeight;

   }
View Full Code Here

            }
         }
      }
      else
      {
         LineMetrics metrics = font.getLineMetrics("ABCxyz",
                 g2.getFontRenderContext());
         maxWidth = metrics.getHeight()
                 + insets.getTop() + insets.getBottom();
      }
      return maxWidth;

   }
View Full Code Here

            Paint fill = getFill();
            Paint stroke = getStroke();
            int strokeThickness = getStrokeThickness();

            LineMetrics lm = font.getLineMetrics("", FONT_RENDER_CONTEXT);
            float ascent = lm.getAscent();

            float y = 0;

            for (int i = 0, n = glyphVectors.getLength(); i < n; i++) {
                GlyphVector glyphVector = glyphVectors.get(i);
View Full Code Here

TOP

Related Classes of java.awt.font.LineMetrics

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.