public class RepaintManager extends Object
截至1.6 RepaintManager
手柄摆动的顶层组件重画请求(JApplet
,JWindow
,JFrame
和JDialog
)。什么叫repaint
就其中一个会打电话到相应的addDirtyRegion
方法。
Constructor and Description |
---|
RepaintManager()
创建一个新的repaintmanager实例。
|
Modifier and Type | Method and Description |
---|---|
void |
addDirtyRegion(Applet applet, int x, int y, int w, int h)
applet 添加到需要重新粉刷
Component s列表。
|
void |
addDirtyRegion(JComponent c, int x, int y, int w, int h)
在要刷新的组件列表中添加一个组件。
|
void |
addDirtyRegion(Window window, int x, int y, int w, int h)
window 添加到需要重新粉刷
Component s列表。
|
void |
addInvalidComponent(JComponent invalidComponent)
马克组件需要布置和队列的事件调度线程,将验证组件的第一isvalidateroot()祖先可运行。
|
static RepaintManager |
currentManager(Component c)
返回给调用线程repaintmanager给定组件。
|
static RepaintManager |
currentManager(JComponent c)
返回给调用线程给repaintmanager JComponent。
|
Rectangle |
getDirtyRegion(JComponent aComponent)
返回一个组件的当前脏区域。
|
Dimension |
getDoubleBufferMaximumSize()
返回最大的双缓冲区大小。
|
Image |
getOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
返回屏幕缓冲区,应作为一种与组件
c 双缓冲。
|
Image |
getVolatileOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
返回一个挥发性画外的缓冲区,应作为一个指定的组件
c 双缓冲。
|
boolean |
isCompletelyDirty(JComponent aComponent)
方便的方法,返回true,如果
一个部件将完全画下paintdirtyregions()期间。
|
boolean |
isDoubleBufferingEnabled()
如果这repaintmanager是双缓冲返回true。
|
void |
markCompletelyClean(JComponent aComponent)
标记一个完全干净的组件。
|
void |
markCompletelyDirty(JComponent aComponent)
标记一个完全脏的组件。
|
void |
paintDirtyRegions()
油漆所有已标记脏的部件。
|
void |
removeInvalidComponent(JComponent component)
从无效组件的列表中删除一个组件。
|
static void |
setCurrentManager(RepaintManager aRepaintManager)
设置要用于调用线程的repaintmanager。
|
void |
setDoubleBufferingEnabled(boolean aFlag)
启用或禁用该repaintmanager双缓冲。
|
void |
setDoubleBufferMaximumSize(Dimension d)
设置最大的双缓冲区大小。
|
String |
toString()
返回显示并标识该对象属性的字符串。
|
void |
validateInvalidComponents()
验证已标记无效的所有组件。
|
public RepaintManager()
public static RepaintManager currentManager(Component c)
c
-组件-默认实现不使用,但可以通过重写的版本,还取决于组分不同的repaintmanager使用
public static RepaintManager currentManager(JComponent c)
注:此方法存在于对摆动库的早期版本的向后二进制兼容性。它只是返回返回的结果currentManager(Component)
。
c
- JComponent闲置
public static void setCurrentManager(RepaintManager aRepaintManager)
aRepaintManager
- repaintmanager对象使用
public void addInvalidComponent(JComponent invalidComponent)
public void removeInvalidComponent(JComponent component)
public void addDirtyRegion(JComponent c, int x, int y, int w, int h)
c
分量重绘,空结果什么也没发生。
x
区域的X坐标绘制
y
- y坐标重绘区域
w
区域的宽度要重画
h
区域的高度重
JComponent.repaint(long, int, int, int, int)
public void addDirtyRegion(Window window, int x, int y, int w, int h)
window
添加到需要重新粉刷
Component
s列表。
window
窗口重绘,空结果什么也没发生。
x
区域的X坐标绘制
y
- y坐标重绘区域
w
区域的宽度要重画
h
区域的高度重
JFrame.repaint(long, int, int, int, int)
,
JWindow.repaint(long, int, int, int, int)
,
JDialog.repaint(long, int, int, int, int)
public void addDirtyRegion(Applet applet, int x, int y, int w, int h)
applet
添加到需要重新粉刷
Component
s列表。
applet
-程序重绘,空结果什么也没发生。
x
区域的X坐标绘制
y
- y坐标重绘区域
w
区域的宽度要重画
h
区域的高度重
JApplet.repaint(long, int, int, int, int)
public Rectangle getDirtyRegion(JComponent aComponent)
public void markCompletelyDirty(JComponent aComponent)
public void markCompletelyClean(JComponent aComponent)
public boolean isCompletelyDirty(JComponent aComponent)
public void validateInvalidComponents()
public void paintDirtyRegions()
public Image getOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
c
双缓冲。默认情况下,在每repaintmanager双缓冲。缓冲可能小于
(proposedWidth,proposedHeight)
这发生在最大双缓冲区的大小被设置为接收重画经理。
public Image getVolatileOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
c
双缓冲。返回的图像将volatileimage实例,或null如果volatileimage对象不能被实例化。这个缓冲区可能比
(proposedWidth,proposedHeight)
。这发生在最大双缓冲区的大小已经为这个重画经理。
VolatileImage
public void setDoubleBufferMaximumSize(Dimension d)
public Dimension getDoubleBufferMaximumSize()
public void setDoubleBufferingEnabled(boolean aFlag)
aFlag
真正激活双缓冲
isDoubleBufferingEnabled()
public boolean isDoubleBufferingEnabled()
false
避免摆不必要的缓冲。平台上的原生双缓冲是不支持的,默认值将
true
。
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.