- java.lang.Object
-
- javax.swing.text.LayeredHighlighter.LayerPainter
-
- javax.swing.text.DefaultHighlighter.DefaultHighlightPainter
-
- All Implemented Interfaces:
-
Highlighter.HighlightPainter
- Enclosing class:
- DefaultHighlighter
public static class DefaultHighlighter.DefaultHighlightPainter extends LayeredHighlighter.LayerPainter
简单的高亮画家,用纯色填充突出显示的区域。
-
-
构造方法摘要
构造方法 Constructor 描述 DefaultHighlightPainter(Color c)构建一个新的亮点画家。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 ColorgetColor()返回突出显示的颜色。voidpaint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c)画亮点ShapepaintLayer(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c, View view)画出一部分亮点。
-
-
-
构造方法详细信息
-
DefaultHighlightPainter
public DefaultHighlightPainter(Color c)
构建一个新的亮点画家。 如果c为空,则将查询JTextComponent的选择颜色。- 参数
-
c- 高亮的颜色
-
-
方法详细信息
-
getColor
public Color getColor()
返回突出显示的颜色。- 结果
- 颜色
-
paint
public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c)
画亮点- 参数
-
g- 图形上下文 -
offs0- 起始模型偏移量> = 0 -
offs1- 结束模型偏移量> = offs1 -
bounds- 突出显示的边框 -
c- 编辑
-
paintLayer
public Shape paintLayer(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c, View view)
画出一部分亮点。- Specified by:
-
paintLayer在LayeredHighlighter.LayerPainter - 参数
-
g- 图形上下文 -
offs0- 起始模型偏移量> = 0 -
offs1- 结束模型偏移量> = offs1 -
bounds- 视图的边框,这不一定是要绘制的区域。 -
c- 编辑 -
view- 查看油画为 - 结果
- 区域绘图发生在
-
-