Package VASSAL.tools.imageop
Class SourceOpSVGImpl
java.lang.Object
VASSAL.tools.opcache.AbstractOpImpl<BufferedImage>
VASSAL.tools.imageop.AbstractOpImpl
VASSAL.tools.imageop.AbstractTiledOpImpl
VASSAL.tools.imageop.SourceOpSVGImpl
- All Implemented Interfaces:
ImageOp,SourceOp,SVGOp,Op<BufferedImage>
public class SourceOpSVGImpl extends AbstractTiledOpImpl implements SourceOp, SVGOp
An
ImageOp which loads an image from the DataArchive.- Since:
- 3.1.0
- Author:
- Joel Uckelman
-
Field Summary
Fields Modifier and Type Field Description protected DataArchivearchiveThe zip file from which the image will be loadedprotected inthashThe cached hash code of this object.protected StringnameThe name of the image file.Fields inherited from class VASSAL.tools.imageop.AbstractTiledOpImpl
numXTiles, numYTiles, tiles, tileSizeFields inherited from class VASSAL.tools.imageop.AbstractOpImpl
cache, size -
Constructor Summary
Constructors Constructor Description SourceOpSVGImpl(String name)Constructs anImageOpwhich will load the given file.SourceOpSVGImpl(String name, DataArchive archive) -
Method Summary
Modifier and Type Method Description protected ImageOpcreateTileOp(int tileX, int tileY)booleanequals(Object o)BufferedImageeval()Runs theOp.protected voidfixSize()Sets thesizewhich is used byAbstractOpImpl.getSize(),AbstractOpImpl.getHeight(), andAbstractOpImpl.getWidth().protected DimensiongetImageSize()StringgetName()Returns the name of the image whichAbstractOpImpl.getImage()will produce.List<Op<?>>getSources()Returns a list ofOps on which thisOpdepends.inthashCode()Methods inherited from class VASSAL.tools.imageop.AbstractTiledOpImpl
fixTileSize, getFutureTile, getNumXTiles, getNumYTiles, getTile, getTileHeight, getTileIndices, getTileOp, getTileSize, getTileWidthMethods inherited from class VASSAL.tools.imageop.AbstractOpImpl
clearCache, getFutureImage, getFutureTile, getHeight, getImage, getImage, getSize, getSizeFromCache, getTile, getTileOp, getWidthMethods inherited from class VASSAL.tools.opcache.AbstractOpImpl
get, get, getFuture, newKey, updateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.tools.imageop.ImageOp
getFutureImage, getFutureTile, getFutureTile, getHeight, getImage, getImage, getNumXTiles, getNumYTiles, getSize, getTile, getTile, getTileHeight, getTileIndices, getTileOp, getTileOp, getTileSize, getTileWidth, getWidth
-
Field Details
-
name
The name of the image file. -
hash
protected final int hashThe cached hash code of this object. -
archive
The zip file from which the image will be loaded
-
-
Constructor Details
-
SourceOpSVGImpl
Constructs anImageOpwhich will load the given file.- Parameters:
name- the name of the image to load- Throws:
IllegalArgumentException- ifnameisnull.
-
SourceOpSVGImpl
-
-
Method Details
-
getSources
Description copied from class:AbstractOpImplReturns a list ofOps on which thisOpdepends.- Specified by:
getSourcesin interfaceOp<BufferedImage>- Specified by:
getSourcesin classAbstractOpImpl<BufferedImage>- Returns:
- the
Ops on which thisOpdepends
-
eval
Runs theOp. This method should be called only by the caching framework.- Specified by:
evalin interfaceImageOp- Specified by:
evalin interfaceOp<BufferedImage>- Specified by:
evalin classAbstractOpImpl- Returns:
- the result of running this
Op - Throws:
IOException- if the image cannot be loaded from the image file.ImageIOException
-
fixSize
protected void fixSize()Sets thesizewhich is used byAbstractOpImpl.getSize(),AbstractOpImpl.getHeight(), andAbstractOpImpl.getWidth().- Specified by:
fixSizein classAbstractOpImpl
-
getImageSize
-
createTileOp
- Specified by:
createTileOpin classAbstractTiledOpImpl
-
getName
Returns the name of the image whichAbstractOpImpl.getImage()will produce.- Specified by:
getNamein interfaceSourceOp- Specified by:
getNamein interfaceSVGOp- Returns:
- the name of the image in the
DataArchive.
-
equals
-
hashCode
public int hashCode()
-