ks.common.view
Class IntegerView

java.lang.Object
  extended byks.common.view.Widget
      extended byks.common.view.IntegerView
All Implemented Interfaces:
ElementListener

public class IntegerView
extends Widget

A Widget for displaying an integer (such as score or number of cards left).


Constructor Summary
IntegerView(MutableInteger value)
          Construct view of this Integer model.
 
Method Summary
 java.awt.Color getColor()
          Get the color used within this IntegerView
 java.awt.Font getFont()
          Get the font used within this IntegerView
 int getFontSize()
          Return size of font being used.
 void redraw()
          Create image if we must.
 void setColor(java.awt.Color newColor)
          Set the color for use within this IntegerView.
 void setFont(java.awt.Font newFont)
          Set the font for use within this IntegerView; also updates fontSize
 void setFontSize(int newFontSize)
          Set the size of the font to be used within this IntegerView.
 
Methods inherited from class ks.common.view.Widget
getBounds, getCardImages, getContainer, getHeight, getImage, getModelElement, getMouseManager, getName, getWidth, getX, getXY, getY, inBounds, isDirty, modelChanged, paint, paint, paint, refresh, refresh, returnWidget, setBounds, setBounds, setContainer, setDirty, setHeight, setImage, setMouseAdapter, setMouseManager, setMouseMotionAdapter, setName, setUndoAdapter, setWidth, setX, setXY, setY, toString, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerView

public IntegerView(MutableInteger value)
Construct view of this Integer model.

Method Detail

getColor

public java.awt.Color getColor()
Get the color used within this IntegerView

Returns:
java.awt.Color

getFont

public java.awt.Font getFont()
Get the font used within this IntegerView

Returns:
java.awt.Font

getFontSize

public int getFontSize()
Return size of font being used.

Returns:
int

redraw

public void redraw()
Create image if we must. The existing Image is cleared and reused.

Specified by:
redraw in class Widget

setColor

public void setColor(java.awt.Color newColor)
Set the color for use within this IntegerView.

Parameters:
newColor - java.awt.Color

setFont

public void setFont(java.awt.Font newFont)
Set the font for use within this IntegerView; also updates fontSize

Parameters:
newFont - java.awt.Font

setFontSize

public void setFontSize(int newFontSize)
Set the size of the font to be used within this IntegerView. All other attributes of the existing font are kept the same.

Parameters:
newFontSize - int