Package ca.cgjennings.apps.arkham.diy
Interface Handler
-
- All Superinterfaces:
PortraitProvider
- All Known Implementing Classes:
DIY
public interface Handler extends PortraitProvider
This adapter interface acts as the bridge between a Strange Eons game component and a DIY script. The DIY script is expected to implement these functions.Note: As of Strange Eons 3.0, this interface extends the
PortraitProviderinterface. However, scripts do not have to implement functions for that interface unless they perform their own portrait handling.- Author:
- Chris Jennings
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreate(DIY diy)Called when the DIY component is first created.voidcreateBackPainter(DIY diy, DIYSheet sheet)Called to set up any objects needed to paint the component's back face(s).voidcreateFrontPainter(DIY diy, DIYSheet sheet)Called to set up any objects needed to paint the component's front face(s).voidcreateInterface(DIY diy, DIYEditor editor)Called to create a user interface that can edit the component.PortraitgetPortrait(int index)Returns aPortraitthat can be used to manipulate one of the portrait images used by a component.intgetPortraitCount()Returns the number of portraits available from this provider.voidonClear(DIY diy)Called when the user wants to reset the component to a blank state.voidonRead(DIY diy, java.io.ObjectInputStream objectInputStream)Called when the component is being read from a file, after all regular content has been loaded.voidonWrite(DIY diy, java.io.ObjectOutputStream objectOutputStream)Called when the component is being written to a file, after all regular content has been saved.voidpaintBack(java.awt.Graphics2D g, DIY diy, DIYSheet sheet)Called to paint content on the component's back face(s).voidpaintFront(java.awt.Graphics2D g, DIY diy, DIYSheet sheet)Called to paint content on the component's front face(s).
-
-
-
Method Detail
-
create
void create(DIY diy)
Called when the DIY component is first created. This is used to set up the component's basic features (face style, base key, etc.). This method andonReadare the only places where these values can be changed without throwing an exception.- Parameters:
diy- the component
-
createInterface
void createInterface(DIY diy, DIYEditor editor)
Called to create a user interface that can edit the component.- Parameters:
diy- the componenteditor- the editor that will display the component editing controls
-
createFrontPainter
void createFrontPainter(DIY diy, DIYSheet sheet)
Called to set up any objects needed to paint the component's front face(s).- Parameters:
diy- the componentsheet- the sheet representing the face in question
-
createBackPainter
void createBackPainter(DIY diy, DIYSheet sheet)
Called to set up any objects needed to paint the component's back face(s).- Parameters:
diy- the componentsheet- the sheet representing the face in question
-
paintFront
void paintFront(java.awt.Graphics2D g, DIY diy, DIYSheet sheet)Called to paint content on the component's front face(s).- Parameters:
g- the graphics context to use for paintingdiy- the componentsheet- the sheet representing the face in question
-
paintBack
void paintBack(java.awt.Graphics2D g, DIY diy, DIYSheet sheet)Called to paint content on the component's back face(s).- Parameters:
g- the graphics context to use for paintingdiy- the componentsheet- the sheet representing the face in question
-
onClear
void onClear(DIY diy)
Called when the user wants to reset the component to a blank state.- Parameters:
diy- the component
-
onRead
void onRead(DIY diy, java.io.ObjectInputStream objectInputStream)
Called when the component is being read from a file, after all regular content has been loaded.- Parameters:
diy- the componentobjectInputStream- theSEObjectInputStreamused to read the component
-
onWrite
void onWrite(DIY diy, java.io.ObjectOutputStream objectOutputStream)
Called when the component is being written to a file, after all regular content has been saved.- Parameters:
diy- the componentobjectOutputStream- theSEObjectOutputStreamused to write the component
-
getPortraitCount
int getPortraitCount()
Description copied from interface:PortraitProviderReturns the number of portraits available from this provider. The number of portraits should remain fixed over the lifetime of a provider.- Specified by:
getPortraitCountin interfacePortraitProvider- Returns:
- the number of portraits that can be obtained with
PortraitProvider.getPortrait(int)(may be 0)
-
getPortrait
Portrait getPortrait(int index)
Description copied from interface:PortraitProviderReturns aPortraitthat can be used to manipulate one of the portrait images used by a component. A component may use more than one portrait. The value ofindexindicates which portrait is desired, and must be be between 0 andPortraitProvider.getPortraitCount()-1 (inclusive).- Specified by:
getPortraitin interfacePortraitProvider- Parameters:
index- the index of the desired portrait (0 for the primary portrait)- Returns:
- a portrait instance that controls the requested portrait
-
-