|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.rendering.AbstractRenderPart
ch.sahits.game.graphic.display.gameplay.MainView
public class MainView
This represents the main game screen
| Field Summary | |
|---|---|
private CityPlayerProxy |
city
Model of the city currently displayed. |
private OpenPatricianGameDialog |
dialog
|
private static String[] |
imageNames
|
private IImageUtilities |
imageUtils
|
private BufferedImage |
img
This image holds the background of the currently rendered View |
private IImageLoader |
loader
|
private static org.apache.log4j.Logger |
logger
|
private EScene |
viewState
Use low level byte to indicate what is displayed instead of an enum. |
private IDataImageLoader |
xmlLoader
|
| Fields inherited from class ch.sahits.game.rendering.AbstractRenderPart |
|---|
rect |
| Constructor Summary | |
|---|---|
MainView(Rectangle rect,
IImageLoader loader,
IClient cl)
Instantiate the main view with the port scene of the players home town |
|
| Method Summary | |
|---|---|
private boolean |
canDelegateToSceneHandler(Event e,
Object eventNotice)
Check if the event can be delegated to the scene handler. |
void |
gameRender(Graphics gScr)
|
void |
gameUpdate(Event e,
Object eventNotice)
|
BufferedImage |
getDialogFringe()
Retrieve the fringe of the dialog |
private void |
handleDialogChange(ENoticeItem noticeItem)
Update the dialog according to the indicated selection |
private void |
handleViewChange(EScene newScene)
Hanlde method for changing the main view image |
private boolean |
isDialogChange(Event e,
Object eventNotice)
Check if this as a view change due to selecting something on the notice board |
private void |
replaceImage(String imgName,
Dimension targetDim)
Scale an image down to target dimension and replace it in the loader cache |
private void |
resetDialog()
Scale the dialog so it has the correct proportions |
void |
updateDialog(OpenPatricianGameDialog dialog)
Pass the dialog with that should be updated |
| Methods inherited from class ch.sahits.game.rendering.AbstractRenderPart |
|---|
getBounds, isEnabled, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.apache.log4j.Logger logger
private BufferedImage img
private OpenPatricianGameDialog dialog
private static final String[] imageNames
private EScene viewState
private CityPlayerProxy city
private final IImageUtilities imageUtils
private final IDataImageLoader xmlLoader
private final IImageLoader loader
| Constructor Detail |
|---|
public MainView(Rectangle rect,
IImageLoader loader,
IClient cl)
rect - loader - cl - | Method Detail |
|---|
private void resetDialog()
private void replaceImage(String imgName,
Dimension targetDim)
imgName - targetDim - public void gameRender(Graphics gScr)
gameRender in interface Renderable
public void gameUpdate(Event e,
Object eventNotice)
gameUpdate in interface IEventListenergameUpdate in interface Renderableprivate void handleDialogChange(ENoticeItem noticeItem)
noticeItem -
private boolean isDialogChange(Event e,
Object eventNotice)
e - eventNotice -
private boolean canDelegateToSceneHandler(Event e,
Object eventNotice)
e - eventNotice -
private void handleViewChange(EScene newScene)
newScene - public void updateDialog(OpenPatricianGameDialog dialog)
updateDialog in interface IUpdatableDialogpublic BufferedImage getDialogFringe()
IUpdatableDialog
getDialogFringe in interface IUpdatableDialog
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||