ewe.fx
Interface OnScreenImage

All Superinterfaces:
IImage
All Known Implementing Classes:
IconAndText, mImage

public interface OnScreenImage
extends IImage

This is an Image that is being displayed on some control surface or other. It allows you to set the ImageRefresher for the IImage.

The ImageRefresher is weakly referenced by the Image. This allows separate threads animate the image but stop when the surface the Image is being displayed on no longer exists.


Field Summary
 
Fields inherited from interface ewe.fx.IImage
DISABLED, OUTLINED
 
Method Summary
 boolean changeRefresher(ImageRefresher newRefresher, ImageRefresher oldRefresher)
          Change the ImageRefresher for the Image only if the old Refresher is the same as the one specified.
 ImageRefresher getRefresher()
          Retrieve the ImageRefresher for the image which is weakly referenced by the OnScreenImage.
 void setRefresher(ImageRefresher refresher)
          Weakly set the ImageRefresher for the Image.
 
Methods inherited from interface ewe.fx.IImage
draw, free, getBackground, getHeight, getPixels, getWidth, usesAlpha
 

Method Detail

setRefresher

public void setRefresher(ImageRefresher refresher)
Weakly set the ImageRefresher for the Image.


changeRefresher

public boolean changeRefresher(ImageRefresher newRefresher,
                               ImageRefresher oldRefresher)
Change the ImageRefresher for the Image only if the old Refresher is the same as the one specified.

Parameters:
newRefresher - The new ImageRefresher for the image.
oldRefresher - What the old ImageRefresher was expected to be.
Returns:
true if the refresher was changed, false if it was not changed because the old Refresher was not the same as that specified in the parameter.

getRefresher

public ImageRefresher getRefresher()
Retrieve the ImageRefresher for the image which is weakly referenced by the OnScreenImage.