Class AbstractMultiLevelSource

java.lang.Object
com.bc.ceres.glevel.support.AbstractMultiLevelSource
All Implemented Interfaces:
MultiLevelSource
Direct Known Subclasses:
DefaultMultiLevelSource, FileMultiLevelSource, GenericMultiLevelSource

@Deprecated public abstract class AbstractMultiLevelSource extends Object implements MultiLevelSource
Deprecated.
An abstract base class for MultiLevelSource implementations. Level images are cached unless reset() is called. Subclasses are asked to implement createImage(int).
  • Constructor Details

    • AbstractMultiLevelSource

      protected AbstractMultiLevelSource(MultiLevelModel multiLevelModel)
      Deprecated.
  • Method Details

    • getModel

      public MultiLevelModel getModel()
      Deprecated.
      Description copied from interface: MultiLevelSource
      Gets the layout model for the multi-resolution image supported by this LevelImageSource.
      Specified by:
      getModel in interface MultiLevelSource
      Returns:
      the multi-resolution image model.
    • getImage

      public RenderedImage getImage(int level)
      Deprecated.
      Gets the RenderedImage at the given resolution level. Unless reset() is called, the method will always return the same image instance at the same resolution level. If a level image is requested for the first time, the method calls createImage(int) in order to retrieve the actual image instance.
      Specified by:
      getImage in interface MultiLevelSource
      Parameters:
      level - The resolution level.
      Returns:
      The RenderedImage at the given resolution level.
    • getImageShape

      public Shape getImageShape(int level)
      Deprecated.
      Description copied from interface: MultiLevelSource
      Gets the shape of the area where this image's raster data contains valid pixels at the given resolution level. The method returns null, if the entire image raster contains valid pixels.
      Specified by:
      getImageShape in interface MultiLevelSource
      Parameters:
      level - The resolution level.
      Returns:
      The shape of the area where the image has data, can be null.
    • createImage

      protected abstract RenderedImage createImage(int level)
      Deprecated.
      Called by getImage(int) if a level image is requested for the first time. Note that images created via this method will be disposed when reset() is called on this multi-level image source. See getImage(int).

      The dimension of the level image created must be the same as that obtained from {DefaultMultiLevelSource.getLevelImageBounds(Rectangle sourceBounds, double scale)} for the scale associated with the given resolution level.

      Parameters:
      level - The resolution level.
      Returns:
      An instance of a RenderedImage for the given resolution level.
    • reset

      public void reset()
      Deprecated.
      Removes all cached level images and also disposes any PlanarImages among them.

      Overrides should always call super.reset().

      Specified by:
      reset in interface MultiLevelSource
    • checkLevel

      protected void checkLevel(int level)
      Deprecated.
      Utility method which checks if a given level is valid.
      Parameters:
      level - The resolution level.
      Throws:
      IllegalArgumentException - if level < 0 || level >= getModel().getLevelCount()