public class Utilities extends Object
Constructor and Description |
---|
Utilities() |
Modifier and Type | Method and Description |
---|---|
static int |
drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset)
绘制给定的文本,扩大使用给定的制表符扩展技术所包含的任何制表符。
|
static int |
getBreakLocation(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset)
确定在给定的范围内打破给定的文本以适应。
|
static int |
getNextWord(JTextComponent c, int offs)
确定给定位置的下一个单词的开始。
|
static Element |
getParagraphElement(JTextComponent c, int offs)
确定用于段落/行的元素。
|
static int |
getPositionAbove(JTextComponent c, int offs, int x)
确定在该行中与给定视图位置最接近的模型中的位置。
|
static int |
getPositionBelow(JTextComponent c, int offs, int x)
在下面的行中确定与给定视图位置最接近的模型中的位置。
|
static int |
getPreviousWord(JTextComponent c, int offs)
确定对于给定的位置上一词开始。
|
static int |
getRowEnd(JTextComponent c, int offs)
确定包含指定模型位置的行的结束行模型位置。
|
static int |
getRowStart(JTextComponent c, int offs)
确定包含指定模型位置的行的起始行模型位置。
|
static int |
getTabbedTextOffset(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset)
确定给定的文本的相对偏移量,最好表示视图坐标系中的给定跨度。
|
static int |
getTabbedTextOffset(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset, boolean round) |
static int |
getTabbedTextWidth(Segment s, FontMetrics metrics, int x, TabExpander e, int startOffset)
确定给定的文本段的宽度,考虑到标签。
|
static int |
getWordEnd(JTextComponent c, int offs)
确定给定位置的一个字的结束。
|
static int |
getWordStart(JTextComponent c, int offs)
确定给定模型位置的一个单词的开始。
|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset)
s
-文本的来源
x
- X的起源> = 0
y
- Y起源> = 0
g
-图形上下文
e
-如何扩大标签。如果此值为空,则标签将被扩展为空格字符。
startOffset
-起始偏移量在文件> = 0的文本
public static final int getTabbedTextWidth(Segment s, FontMetrics metrics, int x, TabExpander e, int startOffset)
s
-文本的来源
metrics
-字体度量用于计算
x
- X的起源> = 0
e
-如何扩大标签。如果此值为空,则标签将被扩展为空格字符。
startOffset
-起始偏移量在文件> = 0的文本
public static final int getTabbedTextOffset(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset)
s
-文本的来源
metrics
-字体度量用于计算
x0
-起始视图的位置代表给定文本> = 0开始。
x
-目标定位来看翻译偏移到文本> = 0。
e
-如何扩大标签。如果此值为空,则标签将被扩展为空格字符。
startOffset
-起始偏移量在文件> = 0的文本
public static final int getTabbedTextOffset(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset, boolean round)
public static final int getBreakLocation(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset)
s
-文本的来源
metrics
-字体度量用于计算
x0
-起始视图的位置代表给定的文本的开始。
x
-目标视图位置偏移到文本翻译。
e
-如何扩大标签。如果此值为空,则标签将被扩展为空格字符。
startOffset
-起始偏移在文本文档
public static final int getRowStart(JTextComponent c, int offs) throws BadLocationException
c
-编辑
offs
在文件> = 0的偏移
BadLocationException
如果偏移超出范围
public static final int getRowEnd(JTextComponent c, int offs) throws BadLocationException
c
-编辑
offs
-偏移量在文件> = 0
BadLocationException
如果偏移超出范围
public static final int getPositionAbove(JTextComponent c, int offs, int x) throws BadLocationException
c
-编辑
offs
在文件> = 0的偏移
x
- x坐标> = 0
BadLocationException
如果偏移超出范围
public static final int getPositionBelow(JTextComponent c, int offs, int x) throws BadLocationException
c
-编辑
offs
在文件> = 0的偏移
x
- x坐标> = 0
BadLocationException
如果偏移超出范围
public static final int getWordStart(JTextComponent c, int offs) throws BadLocationException
c
-编辑
offs
-偏移量在文件> = 0
BadLocationException
如果偏移超出范围
public static final int getWordEnd(JTextComponent c, int offs) throws BadLocationException
c
-编辑
offs
-偏移量在文件> = 0
BadLocationException
如果偏移超出范围
public static final int getNextWord(JTextComponent c, int offs) throws BadLocationException
c
-编辑
offs
在文件> = 0的偏移
BadLocationException
如果偏移超出范围
public static final int getPreviousWord(JTextComponent c, int offs) throws BadLocationException
c
-编辑
offs
在文件> = 0的偏移
BadLocationException
如果偏移超出范围
public static final Element getParagraphElement(JTextComponent c, int offs)
c
-编辑
offs
在文件> = 0的起始偏移
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.