ch.sahits.game.graphic.display.dialog
Class TradingOfficeWareStorageDialog

java.lang.Object
  extended by ch.sahits.game.graphic.display.dialog.OpenPatricianGameDialog
      extended by ch.sahits.game.graphic.display.dialog.TradingOfficeWareStorageDialog
All Implemented Interfaces:
IEventListener, Renderable, RenderablePart

public class TradingOfficeWareStorageDialog
extends OpenPatricianGameDialog
implements IEventListener, RenderablePart

Overview of the weapons stored in the trading office

Author:
Andi Hotz, (c) Sahits GmbH, 2012 Created on Jul 25, 2012

Nested Class Summary
private static class TradingOfficeWareStorageDialog.DialogPositions
          This class holds the positions where different elements are placed on the dialog.
private  class TradingOfficeWareStorageDialog.GuardNumberChange
           
 
Nested classes/interfaces inherited from class ch.sahits.game.graphic.display.dialog.OpenPatricianGameDialog
OpenPatricianGameDialog.CloseAction
 
Field Summary
private  boolean enabled
           
private  ClickablePolygons footerPolygons
           
private  IImageUtilities imageUtils
          reference to the utilities for image manipulation
private  IOpenPatricianPainter opPainter
           
private  ClickablePolygons polygons
           
private  TradingOfficeWareStorageDialog.DialogPositions positions
          Hold all the positioning information, initialized in initBackgroundImage
 
Fields inherited from class ch.sahits.game.graphic.display.dialog.OpenPatricianGameDialog
city, inset, loader
 
Constructor Summary
TradingOfficeWareStorageDialog(Point topLeft, double scale, CityPlayerProxy cityProxy)
           
 
Method Summary
private  int drawRow(Graphics2D g2d, int y, int leftBorder, String text)
          Draw a text string at a defined position.
 void gameRender(Graphics gScr)
           
 void gameUpdate(Event e, Object notice)
           
protected  void init()
          Initialize class specific stuff which might be need later in the initialisation
protected  BufferedImage initBackgroundImage(IImageLoader loader, Point topLeft)
          Initialize the background image that is stored as a reference.
protected  void initiatePolygons()
          Instanciate the any polygon member variables.
 boolean isEnabled()
           
 void setEnabled(boolean flag)
           
 
Methods inherited from class ch.sahits.game.graphic.display.dialog.OpenPatricianGameDialog
getBounds, getInset, initInsets
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.sahits.game.rendering.RenderablePart
getBounds
 

Field Detail

imageUtils

private IImageUtilities imageUtils
reference to the utilities for image manipulation


opPainter

private IOpenPatricianPainter opPainter

enabled

private boolean enabled

polygons

private ClickablePolygons polygons

footerPolygons

private ClickablePolygons footerPolygons

positions

private TradingOfficeWareStorageDialog.DialogPositions positions
Hold all the positioning information, initialized in initBackgroundImage

Constructor Detail

TradingOfficeWareStorageDialog

public TradingOfficeWareStorageDialog(Point topLeft,
                                      double scale,
                                      CityPlayerProxy cityProxy)
Method Detail

init

protected void init()
Description copied from class: OpenPatricianGameDialog
Initialize class specific stuff which might be need later in the initialisation

Overrides:
init in class OpenPatricianGameDialog

initiatePolygons

protected void initiatePolygons()
Description copied from class: OpenPatricianGameDialog
Instanciate the any polygon member variables. This method is intended to be overriden if the dialog uses polygons.

Overrides:
initiatePolygons in class OpenPatricianGameDialog

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface Renderable

setEnabled

public void setEnabled(boolean flag)
Specified by:
setEnabled in interface Renderable

gameUpdate

public void gameUpdate(Event e,
                       Object notice)
Specified by:
gameUpdate in interface IEventListener
Specified by:
gameUpdate in interface Renderable

drawRow

private int drawRow(Graphics2D g2d,
                    int y,
                    int leftBorder,
                    String text)
             throws FontFormatException,
                    IOException
Draw a text string at a defined position. The Y-position is passed as an argument, updated for the next row and returned. The X-coordinate is computed from the left border argument and the visual length of the text string

Parameters:
g2d - Graphic context
y - position
leftBorder - left inset
text - to be drawn
Returns:
updated y coordinate
Throws:
FontFormatException
IOException

initBackgroundImage

protected BufferedImage initBackgroundImage(IImageLoader loader,
                                            Point topLeft)
Description copied from class: OpenPatricianGameDialog
Initialize the background image that is stored as a reference. This method should be overridden by any subclass that contains static elements in the dialog. This implementation returns a copy of the background image stored in the cache, so that image can be further processed, without inflicting conflicts.

Overrides:
initBackgroundImage in class OpenPatricianGameDialog
Parameters:
loader - ImageLoader to retrieve images
Returns:
Image that will be stored as background

gameRender

public void gameRender(Graphics gScr)
Specified by:
gameRender in interface Renderable
Overrides:
gameRender in class OpenPatricianGameDialog


Copyright © 2011-2012 Sahits GmbH. All Rights Reserved.