Package com.nerius.game
Interface CanvasAWTStub
-
- All Known Subinterfaces:
BoardAWTStub,HeadlessBoardAWTStub
- All Known Implementing Classes:
BoardAWTAdapter,CanvasAWTAdapter
public interface CanvasAWTStubThis class is used in conjunction with anAbstractCanvas. It encapsulates only the most important functionality that a game board or an animation may need.- See Also:
AbstractCanvas
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.awt.ImageproduceImage(int width, int height)Images are useful for doing double buffering.java.awt.ImageproduceImage(java.awt.image.ImageProducer producer)getGraphics()on the returned image will fail; in other words the returned image is good for rendering and not so good for drawing onto.voidrequestUpdate()This method triggers a call toupdate(Graphics)on a correspondingAbstractCanvas.
-
-
-
Method Detail
-
produceImage
java.awt.Image produceImage(int width, int height)Images are useful for doing double buffering. The returned image can be rendered and it can be drawn into by way ofgetGraphics().
-
produceImage
java.awt.Image produceImage(java.awt.image.ImageProducer producer)
getGraphics()on the returned image will fail; in other words the returned image is good for rendering and not so good for drawing onto.
-
requestUpdate
void requestUpdate() throws java.lang.IllegalMonitorStateExceptionThis method triggers a call toupdate(Graphics)on a correspondingAbstractCanvas. This method blocks until theupdate()method finishes. By agreement, this method shall only be called by a correspondingAbstractCanvas, and only by the thread invokingAbstractCanvas.run().- Throws:
java.lang.IllegalMonitorStateException- if a second thread calls this method.
-
-