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
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs anImageOpwhich will produce an image from the givenGamePiece. -
Method Summary
Modifier and TypeMethodDescriptionbooleaneval()Runs theOp.protected voidfixSize()Sets thesizewhich is used byAbstractOpImpl.getSize(),AbstractOpImpl.getHeight(), andAbstractOpImpl.getWidth().get(OpObserver<BufferedImage> obs) getFuture(OpObserver<BufferedImage> obs) getPiece()Returns the sourceGamePiece.Returns a list ofOps on which thisOpdepends.getState()inthashCode()booleanReturnstrueiff the sourceGamePiecehas changed state.Methods inherited from class AbstractTileOpImpl
getFutureTile, getNumXTiles, getNumYTiles, getTile, getTileHeight, getTileIndices, getTileOp, getTileSize, getTileWidthModifier and TypeMethodDescriptiongetFutureTile(int tileX, int tileY, ImageOpObserver obs) Submits a request for tile(tileX,tileY), and returns a reference to that request.intReturns the number of tiles along the x-axis.intReturns the number of tiles along the y-axis.getTile(int tileX, int tileY, ImageOpObserver obs) Calculates tile(tileX,tileY), and reports completion or failure to the specifiedImageOpObserver.intReturns the standard height of theBufferedImagetiles which are returned byImageOp.getTile(Point, ImageOpObserver).Point[]getTileIndices(Rectangle rect) Returns an array ofPoints representing the tiles intersecting the givenRectangle.getTileOp(int tileX, int tileY) Returns anImageOpwhich can produce the requested tile.Returns the standard size of theBufferedImagetiles which are returned byImageOp.getTile(Point, ImageOpObserver).intReturns the standard width of theBufferedImagetiles which are returned byImageOp.getTile(Point, ImageOpObserver).Methods inherited from class AbstractOpImpl
clearCache, getFutureImage, getFutureTile, getHeight, getImage, getImage, getSize, getSizeFromCache, getTile, getTileOp, getWidthModifier and TypeMethodDescriptionstatic voidSubmits a request for theBufferedImageproduced by this operation, and returns a reference to that request.getFutureTile(Point p, ImageOpObserver obs) Submits a request for tile(tileX,tileY), and returns a reference to that request.intReturns the height of theBufferedImagewhich would be returned byImageOp.getImage().getImage()Calculates theBufferedImageproduced by this operation.getImage(ImageOpObserver obs) Calculates theBufferedImageproduced by this operation, and reports completion or failure to the specifiedImageOpObserver.getSize()Returns the size of theBufferedImagewhich would be returned byImageOp.getImage().protected DimensionA utility method for retrieving the size of the computedImagefrom the cache if theImageis cached.getTile(Point p, ImageOpObserver obs) Calculates tile(p.x,p.y), and reports completion or failure to the specifiedImageOpObserver.Returns anImageOpwhich can produce the requested tile.intgetWidth()Returns the width of theBufferedImagewhich would be returned byImageOp.getImage().
-
Constructor Details
-
GamePieceOpImpl
Constructs anImageOpwhich 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:
getin classAbstractOpImpl<BufferedImage>- Throws:
CancellationException- if the operation was cancelledInterruptedException- if the operation was interruptedExecutionException- if the operation failed
-
getFuture
- Overrides:
getFuturein classAbstractOpImpl<BufferedImage>- Throws:
ExecutionException- if the operation failed
-
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
-
fixSize
protected void fixSize()Sets thesizewhich is used byAbstractOpImpl.getSize(),AbstractOpImpl.getHeight(), andAbstractOpImpl.getWidth().- Specified by:
fixSizein classAbstractOpImpl
-
getPiece
Returns the sourceGamePiece.- Specified by:
getPiecein interfaceGamePieceOp- Returns:
- the source
-
getState
- Specified by:
getStatein interfaceGamePieceOp
-
isChanged
public boolean isChanged()Returnstrueiff the sourceGamePiecehas changed state.- Specified by:
isChangedin interfaceGamePieceOp- Returns:
trueiff the source has changed.
-
equals
-
hashCode
-