|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.graphic.display.dialog.OpenPatricianGameDialog
ch.sahits.game.graphic.display.dialog.ConsumtionProductionStockDialog
public class ConsumtionProductionStockDialog
This is a statistical dialog displaying the socked wares in the city and their prices.
| Nested Class Summary | |
|---|---|
private static class |
ConsumtionProductionStockDialog.DialogPositions
This class holds the positions where different elements are placed on the dialog. |
| 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 ConsumtionProductionStockDialog.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 | |
|---|---|
ConsumtionProductionStockDialog(Point topLeft,
double scale,
CityPlayerProxy cityProxy)
|
|
| Method Summary | |
|---|---|
private int |
computeCitizenConsumtion(DisplayImageDIResolver resolver,
ICity city,
EWare ware)
Compute the amount that all the citizens consume |
private boolean |
contains(IWare[] array,
IWare item)
check if the array contains the item |
private int |
drawAvailableAmount(Graphics2D g2d,
ICity city,
IWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
Draw the available amount (second column). |
private void |
drawChandlerConsumption(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity cityModel,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
Draw the amount the workshops consume of a ware |
private void |
drawChandlerProduction(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity cityModel,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
Draw the amount all the chandlers produce |
private void |
drawCitizensConsumtion(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity cityModel,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
Draw the amount the citizens consume |
private void |
drawCityProduction(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity city,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
Draw the amount the city produces per week |
private void |
drawTableHeader(Graphics2D g2d,
int y)
Draw the table header |
private void |
drawTotalConsumtion(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity cityModel,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
Draw the total amount that is consumed of the ware |
private void |
drawWareAmount(Graphics2D g2d,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y,
int amount,
int xPadding)
Optionally draw the amoount of wares (if positive) together with the correct icon |
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. |
protected void |
initInsets(double scale)
Compute the insets as a factor of the scaling |
boolean |
isEnabled()
|
void |
setEnabled(boolean flag)
|
| Methods inherited from class ch.sahits.game.graphic.display.dialog.OpenPatricianGameDialog |
|---|
getBounds, getInset |
| 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 |
|---|
private boolean enabled
private ClickablePolygons footerPolygons
private ConsumtionProductionStockDialog.DialogPositions positions
private IImageUtilities imageUtils
private IOpenPatricianPainter opPainter
| Constructor Detail |
|---|
public ConsumtionProductionStockDialog(Point topLeft,
double scale,
CityPlayerProxy cityProxy)
| Method Detail |
|---|
protected void init()
OpenPatricianGameDialog
init in class OpenPatricianGameDialogprotected void initInsets(double scale)
initInsets in class OpenPatricianGameDialogscale - protected void initiatePolygons()
OpenPatricianGameDialog
initiatePolygons in class OpenPatricianGameDialog
public void gameUpdate(Event e,
Object notice)
gameUpdate in interface IEventListenergameUpdate in interface Renderablepublic boolean isEnabled()
isEnabled in interface Renderablepublic void setEnabled(boolean flag)
setEnabled in interface Renderable
private void drawTableHeader(Graphics2D g2d,
int y)
throws FontFormatException,
IOException
g2d - y - position of the table header baseline
FontFormatException
IOException
protected BufferedImage initBackgroundImage(IImageLoader loader,
Point topLeft)
OpenPatricianGameDialog
initBackgroundImage in class OpenPatricianGameDialogloader - ImageLoader to retrieve images
public void gameRender(Graphics gScr)
gameRender in interface RenderablegameRender in class OpenPatricianGameDialog
private void drawTotalConsumtion(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity cityModel,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
throws FontFormatException,
IOException
g2d - 2D graphics context used for drawingresolver - Spring bean resolvercity - Reference to the cityware - Reference to the warebarrel - iconbale - icony - position of from the top
IOException
FontFormatException
private void drawChandlerConsumption(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity cityModel,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
throws FontFormatException,
IOException
g2d - 2D graphics context used for drawingresolver - Spring bean resolvercity - Reference to the cityware - Reference to the warebarrel - iconbale - icony - position of from the top
IOException
FontFormatException
private void drawCitizensConsumtion(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity cityModel,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
throws FontFormatException,
IOException
g2d - 2D graphics context used for drawingresolver - Spring bean resolvercity - Reference to the cityware - Reference to the warebarrel - iconbale - icony - position of from the top
IOException
FontFormatException
private int computeCitizenConsumtion(DisplayImageDIResolver resolver,
ICity city,
EWare ware)
resolver - Spring bean resolvercity - Reference to the cityware - Reference to the ware
private void drawChandlerProduction(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity cityModel,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
throws FontFormatException,
IOException
resolver - Spring bean resolverg2d - 2D graphics context used for drawingcity - Reference to the cityware - Reference to the warebarrel - iconbale - icony - position of from the top
IOException
FontFormatException
private void drawCityProduction(Graphics2D g2d,
DisplayImageDIResolver resolver,
ICity city,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
throws FontFormatException,
IOException
g2d - 2D graphics context used for drawingresolver - Spring bean resolvercity - Reference to the cityware - Reference to the warebarrel - iconbale - icony - position of from the top
IOException
FontFormatException
private void drawWareAmount(Graphics2D g2d,
EWare ware,
BufferedImage barrel,
BufferedImage bale,
int y,
int amount,
int xPadding)
throws FontFormatException,
IOException
g2d - ware - barrel - bale - y - amount - xPadding -
FontFormatException
IOException
private boolean contains(IWare[] array,
IWare item)
array - item -
private int drawAvailableAmount(Graphics2D g2d,
ICity city,
IWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
throws FontFormatException,
IOException
g2d - 2D graphics context used for drawingcity - Reference to the cityware - Reference to the warebarrel - iconbale - icony - position of from the top
FontFormatException - Error while creating a font
IOException - Error while reading a resource
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||