软件包 | 描述 |
---|---|
java.awt |
包含创建用户界面和绘制图形和图像的所有类。
|
javax.accessibility |
定义用户界面组件和提供对这些组件的访问的辅助技术之间的一个合同。
|
javax.swing |
提供了一套“轻量级”(所有的java语言)组件,以最大可能的程度,在所有平台上工作。
|
javax.swing.plaf.basic |
根据基本的外观和感觉提供内置的用户界面对象。
|
javax.swing.plaf.synth |
它是一个可更换皮肤的外观和感觉的绘画是授。
|
javax.swing.table |
处理
javax.swing.JTable 提供类和接口。
|
javax.swing.text |
提供类和接口处理编辑和不可编辑的文本组件。
|
Modifier and Type | Method and Description |
---|---|
FontMetrics |
Graphics.getFontMetrics()
获取当前字体的字体度量。
|
abstract FontMetrics |
Graphics.getFontMetrics(Font f)
获取指定字体的字体度量。
|
FontMetrics |
List.AccessibleAWTList.AccessibleAWTListChild.getFontMetrics(Font f)
获得此对象的FontMetrics。
|
FontMetrics |
MenuComponent.AccessibleAWTMenuComponent.getFontMetrics(Font f)
获取此对象的
FontMetrics 。
|
FontMetrics |
Component.getFontMetrics(Font font)
获取指定字体的字体度量。
|
FontMetrics |
Component.AccessibleAWTComponent.getFontMetrics(Font f)
获取此对象的
FontMetrics 。
|
abstract FontMetrics |
Toolkit.getFontMetrics(Font font)
过时的。
作为JDK 1.2版本,由
Font getLineMetrics 更换方法。
|
Modifier and Type | Method and Description |
---|---|
FontMetrics |
AccessibleComponent.getFontMetrics(Font f)
获取此对象的根据。
|
Modifier and Type | Method and Description |
---|---|
FontMetrics |
DebugGraphics.getFontMetrics()
覆盖
Graphics.getFontMetrics 。
|
FontMetrics |
JComponent.getFontMetrics(Font font)
获取指定
Font 的
FontMetrics 。
|
FontMetrics |
DebugGraphics.getFontMetrics(Font f)
覆盖
Graphics.getFontMetrics 。
|
FontMetrics |
JList.AccessibleJList.AccessibleJListChild.getFontMetrics(Font f) |
FontMetrics |
JTree.AccessibleJTree.AccessibleJTreeNode.getFontMetrics(Font f) |
FontMetrics |
JTable.AccessibleJTable.AccessibleJTableCell.getFontMetrics(Font f)
获取此对象的
FontMetrics 。
|
Modifier and Type | Method and Description |
---|---|
static int |
SwingUtilities.computeStringWidth(FontMetrics fm, String str)
使用指定的“度量”(大小)的字体计算字符串的宽度。
|
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)
计算和返回图标原点的位置,文本基线的原点位置,以及复合标签字符串的可能裁剪的版本。
|
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)
计算和返回图标原点的位置,文本基线的原点位置,以及复合标签字符串的可能裁剪的版本。
|
Modifier and Type | Method and Description |
---|---|
protected FontMetrics |
BasicTabbedPaneUI.getFontMetrics() |
Modifier and Type | Method and Description |
---|---|
protected int |
BasicTabbedPaneUI.calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) |
protected String |
BasicInternalFrameTitlePane.getTitle(String text, FontMetrics fm, int availTextWidth) |
protected String |
BasicLabelUI.layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR)
将调用转发给layoutcompoundlabel() swingutilities。
|
protected void |
BasicTabbedPaneUI.layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) |
protected void |
BasicTabbedPaneUI.paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) |
Modifier and Type | Method and Description |
---|---|
protected FontMetrics |
SynthTabbedPaneUI.getFontMetrics() |
Modifier and Type | Method and Description |
---|---|
protected int |
SynthTabbedPaneUI.calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) |
int |
SynthGraphicsUtils.computeStringWidth(SynthContext ss, Font font, FontMetrics metrics, String text)
返回字符串中传递的大小。
|
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)
放置文本和一个图标返回,通过参考,将图标和文本放置的位置。
|
Modifier and Type | Method and Description |
---|---|
FontMetrics |
JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getFontMetrics(Font f) |
Modifier and Type | Field and Description |
---|---|
protected FontMetrics |
PlainView.metrics
当前字体的字体度量。
|
Modifier and Type | Method and Description |
---|---|
protected FontMetrics |
FieldView.getFontMetrics()
与托管该视图组件关联的字体度量。
|
protected FontMetrics |
LabelView.getFontMetrics()
过时的。
根据不用于字形渲染在JDK运行时。
|
FontMetrics |
StyleContext.getFontMetrics(Font f)
返回字体的字体度量。
|
Modifier and Type | Method and Description |
---|---|
static int |
Utilities.getBreakLocation(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)
确定给定的文本的相对偏移量,最好表示视图坐标系中的给定跨度。
|
static int |
Utilities.getTabbedTextOffset(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset, boolean round) |
static int |
Utilities.getTabbedTextWidth(Segment s, FontMetrics metrics, int x, TabExpander e, int startOffset)
确定给定的文本段的宽度,考虑到标签。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.