Class WriteSupport
java.lang.Object
org.apache.sis.internal.coverage.j2d.WriteSupport
Helper methods for
WritableRenderedImage
implementations.
A future version of this class may extends PlanarImage
or ComputedImage
.
We have not yet decided which case would be useful.
- Since:
- 1.1
- Version:
- 1.1
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Do not allow (for now) instantiation of this class. -
Method Summary
Modifier and TypeMethodDescriptionstatic TileObserver[]
addTileObserver
(TileObserver[] observers, TileObserver observer) Returns a new array with the specified observer added to the array of observers.static void
fireTileUpdate
(TileObserver[] observers, WritableRenderedImage image, int tileX, int tileY, boolean willBeWritable) Notifies all listeners that the specified tile has been checked out for writing.static TileObserver[]
removeTileObserver
(TileObserver[] observers, TileObserver observer) Returns a new array with the specified observer removed from the specified array of observers.
-
Constructor Details
-
WriteSupport
private WriteSupport()Do not allow (for now) instantiation of this class.
-
-
Method Details
-
addTileObserver
Returns a new array with the specified observer added to the array of observers. If the observer is already present, it will receive multiple notifications.- Parameters:
observers
- the array where to add the observer, ornull
.observer
- the observer to add. Null values are ignored.- Returns:
- the updated array of observers.
-
removeTileObserver
Returns a new array with the specified observer removed from the specified array of observers. If the observer was not registered, nothing happens and the given array is returned as-is. If the observer was registered for multiple notifications, it will now be registered for one fewer.- Parameters:
observers
- the array where to remove the observer, ornull
.observer
- the observer to remove.- Returns:
- the updated array of observers.
-
fireTileUpdate
public static void fireTileUpdate(TileObserver[] observers, WritableRenderedImage image, int tileX, int tileY, boolean willBeWritable) Notifies all listeners that the specified tile has been checked out for writing.- Parameters:
observers
- the observers to notify, ornull
if none.image
- the image that owns the tile.tileX
- the x index of the tile that is being updated.tileY
- the y index of the tile that is being updated.willBeWritable
- iftrue
, the tile will be grabbed for writing; otherwise it is being released.
-