JavaScript is disabled on your browser.
JavaScript is disabled on your browser.
Uses of Class java.awt.FontMetrics
Packages that use FontMetrics
Package
Description
com.sun.java.accessibility.util
Provides a collection of interfaces and classes that compose the Java Accessibility
Utilities.
java.awt
Contains all of the classes for creating user interfaces and for painting
graphics and images.
javax.accessibility
Defines a contract between user-interface components and an assistive
technology that provides access to those components.
javax.swing
Provides a set of "lightweight" (all-Java language) components
that, to the maximum degree possible, work the same on all platforms.
javax.swing.plaf.basic
Provides user interface objects built according to the Basic look and feel.
javax.swing.plaf.synth
Synth is a skinnable look and feel in which all painting is delegated.
javax.swing.table
Provides classes and interfaces for dealing with javax.swing.JTable
.
javax.swing.text
Provides classes and interfaces that deal with editable and noneditable text
components.
Methods in javax.swing with parameters of type FontMetrics
Modifier and Type
Method
Description
static int
SwingUtilities. computeStringWidth (FontMetrics fm,
String str)
Compute the width of the string using a font with the specified
"metrics" (sizes).
static String
SwingUtilities. layoutCompoundLabel (FontMetrics fm,
String text,
Icon icon,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int horizontalTextPosition,
Rectangle viewR,
Rectangle iconR,
Rectangle textR,
int textIconGap)
Compute and return the location of the icons origin, the
location of origin of the text baseline, and a possibly clipped
version of the compound labels string.
static String
SwingUtilities. layoutCompoundLabel (JComponent c,
FontMetrics fm,
String text,
Icon icon,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int horizontalTextPosition,
Rectangle viewR,
Rectangle iconR,
Rectangle textR,
int textIconGap)
Compute and return the location of the icons origin, the
location of origin of the text baseline, and a possibly clipped
version of the compound labels string.
Methods in javax.swing.plaf.basic with parameters of type FontMetrics
Modifier and Type
Method
Description
protected int
BasicTabbedPaneUI. calculateTabWidth (int tabPlacement,
int tabIndex,
FontMetrics metrics)
Calculates the tab width.
static String
BasicGraphicsUtils. getClippedString (JComponent c,
FontMetrics fm,
String string,
int availTextWidth)
Clips the passed in string to the space provided.
static float
BasicGraphicsUtils. getStringWidth (JComponent c,
FontMetrics fm,
String string)
Returns the width of the passed in string using text properties
and anti-aliasing hints from the provided component.
protected String
BasicInternalFrameTitlePane. getTitle (String text,
FontMetrics fm,
int availTextWidth)
Returns the title.
protected String
BasicLabelUI. layoutCL (JLabel label,
FontMetrics fontMetrics,
String text,
Icon icon,
Rectangle viewR,
Rectangle iconR,
Rectangle textR)
Forwards the call to SwingUtilities.layoutCompoundLabel().
protected void
BasicTabbedPaneUI. layoutLabel (int tabPlacement,
FontMetrics metrics,
int tabIndex,
String title,
Icon icon,
Rectangle tabRect,
Rectangle iconRect,
Rectangle textRect,
boolean isSelected)
Laysout a label.
protected void
BasicTabbedPaneUI. paintText (Graphics g,
int tabPlacement,
Font font,
FontMetrics metrics,
int tabIndex,
String title,
Rectangle textRect,
boolean isSelected)
Paints text.
Methods in javax.swing.plaf.synth with parameters of type FontMetrics
Modifier and Type
Method
Description
protected int
SynthTabbedPaneUI. calculateTabWidth (int tabPlacement,
int tabIndex,
FontMetrics metrics)
Calculates the tab width.
int
SynthGraphicsUtils. computeStringWidth (SynthContext ss,
Font font,
FontMetrics metrics,
String text)
Returns the size of the passed in string.
String
SynthGraphicsUtils. layoutText (SynthContext ss,
FontMetrics fm,
String text,
Icon icon,
int hAlign,
int vAlign,
int hTextPosition,
int vTextPosition,
Rectangle viewR,
Rectangle iconR,
Rectangle textR,
int iconTextGap)
Lays out text and an icon returning, by reference, the location to
place the icon and text.
Methods in javax.swing.text with parameters of type FontMetrics
Modifier and Type
Method
Description
static int
Utilities. getBreakLocation (Segment s,
FontMetrics metrics,
float x0,
float x,
TabExpander e,
int startOffset)
Determine where to break the given text to fit
within the given span.
static int
Utilities. getBreakLocation (Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset)
static int
Utilities. getTabbedTextOffset (Segment s,
FontMetrics metrics,
float x0,
float x,
TabExpander e,
int startOffset,
boolean round)
Determines the relative offset into the given text that
best represents the given span in the view coordinate
system.
static int
Utilities. getTabbedTextOffset (Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset)
static int
Utilities. getTabbedTextOffset (Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset,
boolean round)
static float
Utilities. getTabbedTextWidth (Segment s,
FontMetrics metrics,
float x,
TabExpander e,
int startOffset)
Determines the width of the given segment of text taking tabs
into consideration.
static int
Utilities. getTabbedTextWidth (Segment s,
FontMetrics metrics,
int x,
TabExpander e,
int startOffset)
JavaScript is disabled on your browser.
Report a bug or suggest an enhancement For further API reference and developer documentation see the Java SE Documentation , which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries. Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA. All rights reserved. Use is subject to license terms and the documentation redistribution policy .
Scripting on this page tracks web page traffic, but does not change the content in any way.