|
|||||||||
| 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.notice.NoticeView
public class NoticeView
This represents the notice view
| Nested Class Summary | |
|---|---|
private class |
NoticeView.MarketBoothChangeAction
Inner class handling the clicks on the notice for the market booth |
private class |
NoticeView.ScrollDownAction
Action for the scrolling down |
private class |
NoticeView.ScrollUpAction
Action for the scrolling up |
private class |
NoticeView.TradeDialogeChangeAction
|
private class |
NoticeView.TradingOfficeChangeAction
Inner class handling the clicks on the notice for the trading office |
| Field Summary | |
|---|---|
private int |
font18Height
height of the font in size 18 |
private IFontLoader |
fontLoader
|
private BufferedImage |
fullNotice
Full notice, not all may be visible |
private static org.apache.log4j.Logger |
logger
|
private INoticeMetaData |
metaData
Data object that corresponds to the rendered data in fullNotice. |
private int |
noticeOffset
Offset indicating how far the fullNotice is scrolled down. |
private ClickableOffsetPolygons |
offsetPolys
Polygons in the fullNotice image |
private IOpenPatricianPainter |
opPainter
|
private ClickablePolygons |
polygons
Polygons of the scrollbar |
private static int |
SCROLL_OFFSET
Offset that is scrolled with one click on the scroll bar |
private BufferedImage |
scrollDown
|
private BufferedImage |
scrollUp
|
| Fields inherited from class ch.sahits.game.rendering.AbstractRenderPart |
|---|
rect |
| Constructor Summary | |
|---|---|
NoticeView(Rectangle rect,
IImageLoader loader)
|
|
| Method Summary | |
|---|---|
private void |
addOffsetPolygon(Rectangle bounds,
GlyphVector gv,
int x,
int y,
String polyName,
Runnable action)
Add a named polygon to the offset polygon list. |
private void |
createMarketBoothNotice(ViewChangeCityPlayerProxy n)
Initialize the full notice with the market boot notice |
private void |
createOrUpdateTradeNotice()
|
private void |
createOrUpdateTradingOfficeNotice()
Create or update the trading office notice based on the meta data object |
private void |
createTradeNotice(ICityPlayerProxy proxy)
Initialize the full notice with the trade notice |
private void |
createTradingOfficeNotice(ViewChangeCityPlayerProxy proxy)
Initialize the full notice with the trading office |
private void |
creatOrUpdateMarketBoothNotice()
Create or update the market booth notice based on the meta data object |
private void |
drawNotice(Graphics gScr)
Draw the visible part of the notice image |
private void |
drawScrollBar(Graphics gScr)
Draw the scrollbar only if needed |
void |
gameRender(Graphics gScr)
|
void |
gameUpdate(Event e,
Object notice)
|
Insets |
getInsets()
Insets for the notice board |
private void |
initPolygons()
Initialize common polygons |
private boolean |
isScrolledToBottom()
Check if the bottom of the notice is shown |
private boolean |
isScrolledToTop()
check if the top of the notice is shown |
private boolean |
needsScrollBar()
check if the notice is to large to be displayed without scrolling |
private void |
resetNoticeView()
Reset the notice view and other affiliated members |
| 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 final IOpenPatricianPainter opPainter
private final IFontLoader fontLoader
private static final int SCROLL_OFFSET
private final BufferedImage scrollUp
private final BufferedImage scrollDown
private BufferedImage fullNotice
private int noticeOffset
private final int font18Height
private final ClickablePolygons polygons
private ClickableOffsetPolygons offsetPolys
private INoticeMetaData metaData
fullNotice.
The meta data provide the necessairy informations to process updates in the
notice.
| Constructor Detail |
|---|
public NoticeView(Rectangle rect,
IImageLoader loader)
| Method Detail |
|---|
private void initPolygons()
public void gameRender(Graphics gScr)
gameRender in interface Renderableprivate void drawScrollBar(Graphics gScr)
gScr - public Insets getInsets()
private void drawNotice(Graphics gScr)
gScr -
public void gameUpdate(Event e,
Object notice)
gameUpdate in interface IEventListenergameUpdate in interface Renderableprivate void resetNoticeView()
private void createMarketBoothNotice(ViewChangeCityPlayerProxy n)
throws FontFormatException,
IOException
n -
IOException
FontFormatException
private void createTradingOfficeNotice(ViewChangeCityPlayerProxy proxy)
throws FontFormatException,
IOException
n -
IOException
FontFormatException
private void createTradeNotice(ICityPlayerProxy proxy)
throws FontFormatException,
IOException
IOException
FontFormatException
private void createOrUpdateTradingOfficeNotice()
throws FontFormatException,
IOException
IOException
FontFormatException
private void creatOrUpdateMarketBoothNotice()
throws FontFormatException,
IOException
IOException
FontFormatException
private void createOrUpdateTradeNotice()
throws FontFormatException,
IOException
FontFormatException
IOException
private void addOffsetPolygon(Rectangle bounds,
GlyphVector gv,
int x,
int y,
String polyName,
Runnable action)
bounds - Bounds of the viewgv - GlyphVector holding the stringx - position of the left most charactery - position of the strings baselinepolyName - name of the Polygonaction - to be executed when run.private boolean needsScrollBar()
private boolean isScrolledToTop()
private boolean isScrolledToBottom()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||