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

java.lang.Object
  extended by ch.sahits.game.graphic.display.dialog.OpenPatricianGameDialog
Direct Known Subclasses:
ConsumtionProductionStockDialog, TradeDialog, TradingOfficeBalanceDialog, TradingOfficePersonalDialog, TradingOfficeWareStorageDialog, TradingOfficeWeaponStorageDialog, TradingStockDialog

public abstract class OpenPatricianGameDialog
extends Object

This is a dialog that renderes a wooden frame with an inlaid parchment at a given position. Based on what the dialog represents the subclass may implement a RenderablePart.

Author:
Andi Hotz, (c) Sahits GmbH, 2011 Created on Nov 18, 2011

Nested Class Summary
protected static class OpenPatricianGameDialog.CloseAction
           
 
Field Summary
private  Rectangle bounds
          Top left corner of the frame
protected  CityPlayerProxy city
          Reference to the city view model
private  BufferedImage img
          Frame that is rendered
protected  Insets inset
           
protected  IImageLoader loader
           
 
Constructor Summary
OpenPatricianGameDialog(Point topLeft, IImageLoader loader, double scale, CityPlayerProxy cityProxy)
           
 
Method Summary
private static BufferedImage deepCopy(BufferedImage bi)
          Create a copy of an image
 void gameRender(Graphics gScr)
           
 Rectangle getBounds()
           
 Insets getInset()
          Retrieve the insets of the dialog border
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.
protected  void initInsets(double scale)
          Compute the insets as a factor of the scaling
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

img

private final BufferedImage img
Frame that is rendered


bounds

private final Rectangle bounds
Top left corner of the frame


inset

protected Insets inset

loader

protected IImageLoader loader

city

protected final CityPlayerProxy city
Reference to the city view model

Constructor Detail

OpenPatricianGameDialog

public OpenPatricianGameDialog(Point topLeft,
                               IImageLoader loader,
                               double scale,
                               CityPlayerProxy cityProxy)
Method Detail

initInsets

protected void initInsets(double scale)
Compute the insets as a factor of the scaling

Parameters:
scale -

init

protected void init()
Initialize class specific stuff which might be need later in the initialisation


initiatePolygons

protected void initiatePolygons()
Instanciate the any polygon member variables. This method is intended to be overriden if the dialog uses polygons.


initBackgroundImage

protected BufferedImage initBackgroundImage(IImageLoader loader,
                                            Point topLeft)
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.

Parameters:
loader - ImageLoader to retrieve images
Returns:
Image that will be stored as background

getBounds

public final Rectangle getBounds()

gameRender

public void gameRender(Graphics gScr)

getInset

public Insets getInset()
Retrieve the insets of the dialog border

Returns:

deepCopy

private static BufferedImage deepCopy(BufferedImage bi)
Create a copy of an image

Parameters:
bi -
Returns:


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