API java : WritableRenderedImage


java.awt.image
Interface WritableRenderedImage

All Superinterfaces:
RenderedImage
All Known Implementing Classes:
BufferedImage

public interface WritableRenderedImage
extends RenderedImage

WriteableRenderedImage is a common interface for objects which contain or can produce image data in the form of Rasters and which can be modified and/or written over. The image data may be stored/produced as a single tile or a regular array of tiles.

WritableRenderedImage provides notification to other interested objects when a tile is checked out for writing (via the getWritableTile method) and when the last writer of a particular tile relinquishes its access (via a call to releaseWritableTile). Additionally, it allows any caller to determine whether any tiles are currently checked out (via hasTileWriters), and to obtain a list of such tiles (via getWritableTileIndices, in the form of a Vector of Point objects).

Objects wishing to be notified of changes in tile writability must implement the TileObserver interface, and are added by a call to addTileObserver. Multiple calls to addTileObserver for the same object will result in multiple notifications. An existing observer may reduce its notifications by calling removeTileObserver; if the observer had no notifications the operation is a no-op.

It is necessary for a WritableRenderedImage to ensure that notifications occur only when the first writer acquires a tile and the last writer releases it.


Method Summary
 void addTileObserver(TileObserver to)
          Adds an observer.
 WritableRaster getWritableTile(int tileX, int tileY)
          Checks out a tile for writing.
 Point[] getWritableTileIndices()
          Returns an array of Point objects indicating which tiles are checked out for writing.
 boolean hasTileWriters()
          Returns whether any tile is checked out for writing.
 boolean isTileWritable(int tileX, int tileY)
          Returns whether a tile is currently checked out for writing.
 void releaseWritableTile(int tileX, int tileY)
          Relinquishes the right to write to a tile.
 void removeTileObserver(TileObserver to)
          Removes an observer.
 void setData(Raster r)
          Sets a rect of the image to the contents of the Raster r, which is assumed to be in the same coordinate space as the WritableRenderedImage.
 
Methods inherited from interface java.awt.image.RenderedImage
copyData, getColorModel, getData, getData, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getPropertyNames, getSampleModel, getSources, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth
 

Method Detail

addTileObserver

void addTileObserver(TileObserver to)
Adds an observer. If the observer is already present, it will receive multiple notifications.

Parameters:
to - the specified TileObserver

removeTileObserver

void removeTileObserver(TileObserver to)
Removes an observer. If the observer was not registered, nothing happens. If the observer was registered for multiple notifications, it will now be registered for one fewer.

Parameters:
to - the specified TileObserver

getWritableTile

WritableRaster getWritableTile(int tileX,
                               int tileY)
Checks out a tile for writing. The WritableRenderedImage is responsible for notifying all of its TileObservers when a tile goes from having no writers to having one writer.

Parameters:
tileX - the X index of the tile.
tileY - the Y index of the tile.
Returns:
a writable tile.

releaseWritableTile

void releaseWritableTile(int tileX,
                         int tileY)
Relinquishes the right to write to a tile. If the caller continues to write to the tile, the results are undefined. Calls to this method should only appear in matching pairs with calls to getWritableTile; any other use will lead to undefined results. The WritableRenderedImage is responsible for notifying all of its TileObservers when a tile goes from having one writer to having no writers.

Parameters:
tileX - the X index of the tile.
tileY - the Y index of the tile.

isTileWritable

boolean isTileWritable(int tileX,
                       int tileY)
Returns whether a tile is currently checked out for writing.

Parameters:
tileX - the X index of the tile.
tileY - the Y index of the tile.
Returns:
true if specified tile is checked out for writing; false otherwise.

getWritableTileIndices

Point[] getWritableTileIndices()
Returns an array of Point objects indicating which tiles are checked out for writing. Returns null if none are checked out.

Returns:
an array containing the locations of tiles that are checked out for writing.

hasTileWriters

boolean hasTileWriters()
Returns whether any tile is checked out for writing. Semantically equivalent to (getWritableTileIndices() != null).

Returns:
true if any tiles are checked out for writing; false otherwise.

setData

void setData(Raster r)
Sets a rect of the image to the contents of the Raster r, which is assumed to be in the same coordinate space as the WritableRenderedImage. The operation is clipped to the bounds of the WritableRenderedImage.

Parameters:
r - the specified Raster

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

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 :

Quels sont les motivations de cette démarche?

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.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

7 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.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-2726
Document créé le 31/08/06 02:35, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-java/awt/image/WritableRenderedImage.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,38 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
L'instinct dicte le devoir et l'intelligence fournit des prétextes pour l'éluder.

Marcel Proust [Extrait de Le temps retrouvé]
 
l'infobrol
Nous sommes le Vendredi 01 Juin 2012, 14:57, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)