Class WriteSupport

java.lang.Object
org.apache.sis.internal.coverage.j2d.WriteSupport

public final class WriteSupport extends Object
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 Details

    • WriteSupport

      private WriteSupport()
      Do not allow (for now) instantiation of this class.
  • Method Details

    • addTileObserver

      public static TileObserver[] addTileObserver(TileObserver[] observers, TileObserver observer)
      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, or null.
      observer - the observer to add. Null values are ignored.
      Returns:
      the updated array of observers.
    • removeTileObserver

      public static TileObserver[] removeTileObserver(TileObserver[] observers, TileObserver observer)
      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, or null.
      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, or null 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 - if true, the tile will be grabbed for writing; otherwise it is being released.