java.lang.Objectjavax.swing.RepaintManager
public class RepaintManager
This class manages repaint requests, allowing the number of repaints to be minimized, for example by collapsing multiple requests into a single repaint for members of a component tree.
| Constructor Summary | |
|---|---|
RepaintManager()
Create a new RepaintManager instance. |
|
| Method Summary | |
|---|---|
void |
addDirtyRegion(JComponent c,
int x,
int y,
int w,
int h)
Add a component in the list of components that should be refreshed. |
void |
addInvalidComponent(JComponent invalidComponent)
Mark the component as in need of layout and queue a runnable for the event dispatching thread that will validate the components first isValidateRoot() ancestor. |
static RepaintManager |
currentManager(Component c)
Return the RepaintManager for the calling thread given a Component. |
static RepaintManager |
currentManager(JComponent c)
Return the RepaintManager for the calling thread given a JComponent. |
Rectangle |
getDirtyRegion(JComponent aComponent)
Return the current dirty region for a component. |
Dimension |
getDoubleBufferMaximumSize()
Returns the maximum double buffer size. |
Image |
getOffscreenBuffer(Component c,
int proposedWidth,
int proposedHeight)
Return the offscreen buffer that should be used as a double buffer with the component c. |
Image |
getVolatileOffscreenBuffer(Component c,
int proposedWidth,
int proposedHeight)
Return a volatile offscreen buffer that should be used as a double buffer with the specified component c. |
boolean |
isCompletelyDirty(JComponent aComponent)
Convenience method that returns true if aComponent will be completely painted during the next paintDirtyRegions(). |
boolean |
isDoubleBufferingEnabled()
Returns true if this RepaintManager is double buffered. |
void |
markCompletelyClean(JComponent aComponent)
Mark a component completely clean. |
void |
markCompletelyDirty(JComponent aComponent)
Mark a component completely dirty. |
void |
paintDirtyRegions()
Paint all of the components that have been marked dirty. |
void |
removeInvalidComponent(JComponent component)
Remove a component from the list of invalid components. |
static void |
setCurrentManager(RepaintManager aRepaintManager)
Set the RepaintManager that should be used for the calling thread. |
void |
setDoubleBufferingEnabled(boolean aFlag)
Enables or disables double buffering in this RepaintManager. |
void |
setDoubleBufferMaximumSize(Dimension d)
Set the maximum double buffer size. |
String |
toString()
Returns a string that displays and identifies this object's properties. |
void |
validateInvalidComponents()
Validate all of the components that have been marked invalid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RepaintManager()
| Method Detail |
|---|
public static RepaintManager currentManager(Component c)
c - a Component -- unused in the default implementation, but could
be used by an overridden version to return a different RepaintManager
depending on the Component
public static RepaintManager currentManager(JComponent c)
Note: This method exists for backward binary compatibility with earlier
versions of the Swing library. It simply returns the result returned by
currentManager(Component).
c - a JComponent -- unused
public static void setCurrentManager(RepaintManager aRepaintManager)
aRepaintManager - the RepaintManager object to usepublic void addInvalidComponent(JComponent invalidComponent)
public void removeInvalidComponent(JComponent component)
public void addDirtyRegion(JComponent c, int x, int y, int w, int h)
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 String toString()
public Image getOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
c.
By default there is a double buffer per RepaintManager.
The buffer might be smaller than (proposedWidth,proposedHeight)
This happens when the maximum double buffer size as been set for the receiving
repaint manager.
public Image getVolatileOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
c.
The image returned will be an instance of VolatileImage, or null
if a VolatileImage object could not be instantiated.
This buffer might be smaller than (proposedWidth,proposedHeight).
This happens when the maximum double buffer size has been set for this
repaint manager.
VolatileImagepublic void setDoubleBufferMaximumSize(Dimension d)
public Dimension getDoubleBufferMaximumSize()
public void setDoubleBufferingEnabled(boolean aFlag)
aFlag - true to activate double bufferingisDoubleBufferingEnabled()public boolean isDoubleBufferingEnabled()
false
to avoid unnecessary buffering in Swing.
On platforms where native double buffering is not supported,
the default value will be true.
Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
6 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)