public class DefaultHighlighter extends LayeredHighlighter
Highlighter
Modifier and Type | Class and Description |
---|---|
static class |
DefaultHighlighter.DefaultHighlightPainter
简单的突出的画家,填充一个突出的区域与一个坚实的颜色。
|
LayeredHighlighter.LayerPainter
Highlighter.Highlight, Highlighter.HighlightPainter
Modifier and Type | Field and Description |
---|---|
static LayeredHighlighter.LayerPainter |
DefaultPainter
默认实现layeredhighlighter.layerpainter可用于绘画的亮点。
|
Constructor and Description |
---|
DefaultHighlighter()
创建一个新的defaulthighlighther对象。
|
Modifier and Type | Method and Description |
---|---|
Object |
addHighlight(int p0, int p1, Highlighter.HighlightPainter p)
在视图中添加一个高亮。
|
void |
changeHighlight(Object tag, int p0, int p1)
改变一个亮点。
|
void |
deinstall(JTextComponent c)
打电话的时候,用户界面是从一个jtextcomponent界面删除。
|
boolean |
getDrawsLayeredHighlights() |
Highlighter.Highlight[] |
getHighlights()
做一个副本的亮点。
|
void |
install(JTextComponent c)
当UI被安装到一个jtextcomponent接口。
|
void |
paint(Graphics g)
呈现亮点。
|
void |
paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view)
当叶子视图(如labelview)绘制他们应该调用这个方法。
|
void |
removeAllHighlights()
删除所有亮点。
|
void |
removeHighlight(Object tag)
从视图中移除一个亮点。
|
void |
setDrawsLayeredHighlights(boolean newValue)
如果是真的,则以视图绘制文本为重点。
|
public static final LayeredHighlighter.LayerPainter DefaultPainter
截至1.4这一领域是最终。
public void paint(Graphics g)
g
-图形上下文
public void install(JTextComponent c)
c
-编辑组件
Highlighter.install(javax.swing.text.JTextComponent)
public void deinstall(JTextComponent c)
c
-组件
Highlighter.deinstall(javax.swing.text.JTextComponent)
public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter p) throws BadLocationException
p0
的起始偏移的一系列突出> = 0
p1
的结束偏移的一系列突出> = P0
p
-画家使用实际绘制突出
BadLocationException
-如果指定的位置无效
public void removeHighlight(Object tag)
tag
-突出的参考
public void removeAllHighlights()
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException
tag
最突出的标签
p0
-范围> = 0的开始
p1
-结束的范围> = P0
BadLocationException
-如果指定的位置无效
public Highlighter.Highlight[] getHighlights()
Highlighter.getHighlights()
public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view)
paintLayeredHighlights
方法重写,继承类
LayeredHighlighter
g
-用于绘制图形
p0
偏移出发
p1
结束偏移角度
viewBounds
-界的观点
editor
- JTextComponent
view
视图实例呈现
public void setDrawsLayeredHighlights(boolean newValue)
paintLayeredHighlight
这将导致在一个矩形绘制在文本绘制(如果偏移在高亮区域,)。这项工作的画家提供的一定是LayeredHighlightPainter的一个实例。
public boolean getDrawsLayeredHighlights()
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.