pt.ua.gboard
Class OneColorGelem

java.lang.Object
  extended by pt.ua.gboard.Gelem
      extended by pt.ua.gboard.OneColorGelem
Direct Known Subclasses:
CircleGelem, FilledGelem, PacmanGelem, StringGelem

public abstract class OneColorGelem
extends Gelem

Abstract graphical element with a unique color.


Constructor Summary
OneColorGelem(java.awt.Color color)
          Constructs a new OneColorGelem (1x1 cells).
OneColorGelem(java.awt.Color color, int numberOfLines, int numberOfColumns)
          Constructs a new OneColorGelem.
 
Method Summary
 void draw(java.awt.Graphics g, int line, int column, int cellWidth, int cellHeight, java.awt.Color background)
          Draw Gelem in GBoard (it should be exported only to GBoard).
 void erase(java.awt.Graphics g, int line, int column, int cellWidth, int cellHeight, java.awt.Color background)
          Erase Gelem from GBoard (it should be exported only to GBoard).
 
Methods inherited from class pt.ua.gboard.Gelem
height, intersects, isMutable, mutable, numberOfColumns, numberOfLines, width, x, y
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneColorGelem

public OneColorGelem(java.awt.Color color)
Constructs a new OneColorGelem (1x1 cells).

requires: color != null

Parameters:
color - gelem's color

OneColorGelem

public OneColorGelem(java.awt.Color color,
                     int numberOfLines,
                     int numberOfColumns)
Constructs a new OneColorGelem.

requires: color != null

Parameters:
color - gelem's color
numberOfLines - number of lines
numberOfColumns - number of columns
Method Detail

draw

public void draw(java.awt.Graphics g,
                 int line,
                 int column,
                 int cellWidth,
                 int cellHeight,
                 java.awt.Color background)
Description copied from class: Gelem
Draw Gelem in GBoard (it should be exported only to GBoard).

requires: g != null && background != null (incomplete!)

Specified by:
draw in class Gelem
Parameters:
g - Java's Graphics object to use in drawing
line - line in GBoard to draw Gelem.
column - column in GBoard to draw Gelem.
cellWidth - number of horizontal pixels per cell
cellHeight - number of vertical pixels per cell
background - background color

erase

public void erase(java.awt.Graphics g,
                  int line,
                  int column,
                  int cellWidth,
                  int cellHeight,
                  java.awt.Color background)
Description copied from class: Gelem
Erase Gelem from GBoard (it should be exported only to GBoard).

requires: g != null && background != null (incomplete!)

Specified by:
erase in class Gelem
Parameters:
g - Java's Graphics object to use in drawing
line - line in GBoard to draw Gelem.
column - column in GBoard to draw Gelem.
cellWidth - number of horizontal pixels per cell
cellHeight - number of vertical pixels per cell