Package VASSAL.tools.imageop
Class GamePieceOpImpl
java.lang.Object
VASSAL.tools.opcache.AbstractOpImpl<BufferedImage>
VASSAL.tools.imageop.AbstractOpImpl
VASSAL.tools.imageop.AbstractTileOpImpl
VASSAL.tools.imageop.GamePieceOpImpl
- All Implemented Interfaces:
GamePieceOp
,ImageOp
,Op<BufferedImage>
- Since:
- 3.1.0
- Author:
- Joel Uckelman
-
Field Summary
Fields inherited from class VASSAL.tools.imageop.AbstractOpImpl
cache, size
-
Constructor Summary
ConstructorDescriptionConstructs anImageOp
which will produce an image from the givenGamePiece
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
eval()
Runs theOp
.protected void
fixSize()
Sets thesize
which is used byAbstractOpImpl.getSize()
,AbstractOpImpl.getHeight()
, andAbstractOpImpl.getWidth()
.get
(OpObserver<BufferedImage> obs) getFuture
(OpObserver<BufferedImage> obs) getPiece()
Returns the sourceGamePiece
.Returns a list ofOp
s on which thisOp
depends.getState()
int
hashCode()
boolean
Returnstrue
iff the sourceGamePiece
has changed state.Methods inherited from class VASSAL.tools.imageop.AbstractTileOpImpl
getFutureTile, getNumXTiles, getNumYTiles, getTile, getTileHeight, getTileIndices, getTileOp, getTileSize, getTileWidth
Methods inherited from class VASSAL.tools.imageop.AbstractOpImpl
clearCache, getFutureImage, getFutureTile, getHeight, getImage, getImage, getSize, getSizeFromCache, getTile, getTileOp, getWidth
Methods inherited from class VASSAL.tools.opcache.AbstractOpImpl
get, newKey, update
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
Constructor Details
-
GamePieceOpImpl
Constructs anImageOp
which will produce an image from the givenGamePiece
.- Parameters:
gp
- the source- Throws:
IllegalArgumentException
- ifgp == null
.
-
-
Method Details
-
get
public BufferedImage get(OpObserver<BufferedImage> obs) throws CancellationException, InterruptedException, ExecutionException - Overrides:
get
in classAbstractOpImpl<BufferedImage>
- Throws:
CancellationException
- if the operation was cancelledInterruptedException
- if the operation was interruptedExecutionException
- if the operation failed
-
getFuture
- Overrides:
getFuture
in classAbstractOpImpl<BufferedImage>
- Throws:
ExecutionException
- if the operation failed
-
getSources
Description copied from class:AbstractOpImpl
Returns a list ofOp
s on which thisOp
depends.- Specified by:
getSources
in interfaceOp<BufferedImage>
- Specified by:
getSources
in classAbstractOpImpl<BufferedImage>
- Returns:
- the
Op
s on which thisOp
depends
-
eval
Runs theOp
. This method should be called only by the caching framework.- Specified by:
eval
in interfaceImageOp
- Specified by:
eval
in interfaceOp<BufferedImage>
- Specified by:
eval
in classAbstractOpImpl
- Returns:
- the result of running this
Op
-
fixSize
protected void fixSize()Sets thesize
which is used byAbstractOpImpl.getSize()
,AbstractOpImpl.getHeight()
, andAbstractOpImpl.getWidth()
.- Specified by:
fixSize
in classAbstractOpImpl
-
getPiece
Returns the sourceGamePiece
.- Specified by:
getPiece
in interfaceGamePieceOp
- Returns:
- the source
-
getState
- Specified by:
getState
in interfaceGamePieceOp
-
isChanged
public boolean isChanged()Returnstrue
iff the sourceGamePiece
has changed state.- Specified by:
isChanged
in interfaceGamePieceOp
- Returns:
true
iff the source has changed.
-
equals
-
hashCode
-