|
|||||||||
| 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.TradingStockDialog
public class TradingStockDialog
This is a statistical dialog displaying the socked wares in the city and their prices.
| Nested Class Summary | |
|---|---|
private static class |
TradingStockDialog.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 TradingStockDialog.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 | |
|---|---|
TradingStockDialog(Point topLeft,
double scale,
CityPlayerProxy cityProxy)
|
|
| Method Summary | |
|---|---|
private int |
drawAvailableAmount(Graphics2D g2d,
ICity city,
IWare ware,
BufferedImage barrel,
BufferedImage bale,
int y)
Draw the available amount (second column). |
private void |
drawBuyFromCityPrice(Graphics2D g2d,
int availableAmount,
IWare ware,
BufferedImage coin,
int y)
Draw the text on the wax seal corresponding to the buy button |
private void |
drawSellIconText(Graphics2D g2d,
int availableAmount,
IWare ware,
BufferedImage coin,
int y)
Draw the text on the wax seal corresponding to the sell button |
private void |
drawTableHeader(Graphics2D g2d,
int y)
Draw the table header |
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 TradingStockDialog.DialogPositions positions
private IImageUtilities imageUtils
private IOpenPatricianPainter opPainter
| Constructor Detail |
|---|
public TradingStockDialog(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 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
private void drawBuyFromCityPrice(Graphics2D g2d,
int availableAmount,
IWare ware,
BufferedImage coin,
int y)
throws FontFormatException,
IOException
g2d - 2D graphics context used for drawingavailableAmount - amount that is actually availableware - Reference to the warecoin - icony - position of from the top
FontFormatException - Error while creating a font
IOException - Error while reading a resource
private void drawSellIconText(Graphics2D g2d,
int availableAmount,
IWare ware,
BufferedImage coin,
int y)
throws FontFormatException,
IOException
g2d - 2D graphics context used for drawingavailableAmount - amount that is actually availableware - Reference to the warecoin - 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 | ||||||||