|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpt.ua.gboard.Gelem
pt.ua.gboard.ImageGelem
public class ImageGelem
This gelem draws an image in a rectangle of cells.
Field Summary | |
---|---|
boolean |
imageOk
|
Constructor Summary | |
---|---|
ImageGelem(java.awt.Image image,
GBoard board,
double cellOccupation)
Constructs a new ImageGelem (1x1 cells). |
|
ImageGelem(java.awt.Image image,
GBoard board,
double cellOccupation,
int numberOfLines,
int numberOfColumns)
Constructs a new ImageGelem. |
|
ImageGelem(java.lang.String imagePath,
GBoard board,
double cellOccupation)
Constructs a new ImageGelem (1x1 cells). |
|
ImageGelem(java.lang.String imagePath,
GBoard board,
double cellOccupation,
int numberOfLines,
int numberOfColumns)
Constructs a new ImageGelem. |
|
ImageGelem(java.net.URL imageURL,
GBoard board,
double cellOccupation)
Constructs a new ImageGelem (1x1 cells). |
|
ImageGelem(java.net.URL imageURL,
GBoard board,
double cellOccupation,
int numberOfLines,
int numberOfColumns)
Constructs a new ImageGelem. |
Method Summary | |
---|---|
void |
draw(java.awt.Graphics g,
int line,
int column,
int cellWidth,
int cellHeight,
java.awt.Color background)
Draw ImageGelem in GBoard. |
void |
erase(java.awt.Graphics g,
int line,
int column,
int cellWidth,
int cellHeight,
java.awt.Color background)
Erase ImageGelem from GBoard. |
boolean |
imageOk()
Indicates if the image was correctly loaded. |
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 |
Field Detail |
---|
public boolean imageOk
Constructor Detail |
---|
public ImageGelem(java.awt.Image image, GBoard board, double cellOccupation)
requires: image != null && board != null && cellOccupation >= 0.0 && cellOccupation <= 100.0
image
- image's objectboard
- GBoard where the image will be drawedcellOccupation
- total cell's occupation (%)public ImageGelem(java.lang.String imagePath, GBoard board, double cellOccupation)
requires: imagePath != null && board != null && cellOccupation >= 0.0 && cellOccupation <= 100.0
imagePath
- image's file pathboard
- GBoard where the image will be drawedcellOccupation
- total cell's occupation (%)public ImageGelem(java.lang.String imagePath, GBoard board, double cellOccupation, int numberOfLines, int numberOfColumns)
requires: imagePath != null && board != null && cellOccupation >= 0.0 && cellOccupation <= 100.0 && numberOfLines >= 1 && numberOfColumns >= 1
imagePath
- image's file pathboard
- GBoard where the image will be drawedcellOccupation
- total cell's occupation (%)numberOfLines
- number of linesnumberOfColumns
- number of columnspublic ImageGelem(java.net.URL imageURL, GBoard board, double cellOccupation)
requires: imageURL != null && board != null && cellOccupation >= 0.0 && cellOccupation <= 100.0
imageURL
- image's file urlboard
- GBoard where the image will be drawedcellOccupation
- total cell's occupation (%)public ImageGelem(java.net.URL imageURL, GBoard board, double cellOccupation, int numberOfLines, int numberOfColumns)
requires: imageURL != null && board != null && cellOccupation >= 0.0 && cellOccupation <= 100.0 && numberOfLines >= 1 && numberOfColumns >= 1
imageURL
- image's file urlboard
- GBoard where the image will be drawedcellOccupation
- total cell's occupation (%)numberOfLines
- number of linesnumberOfColumns
- number of columnspublic ImageGelem(java.awt.Image image, GBoard board, double cellOccupation, int numberOfLines, int numberOfColumns)
requires: image != null && board != null && cellOccupation >= 0.0 && cellOccupation <= 100.0 && numberOfLines >= 1 && numberOfColumns >= 1
image
- image's objectboard
- GBoard where the image will be drawedcellOccupation
- total cell's occupation (%)numberOfLines
- number of linesnumberOfColumns
- number of columnsMethod Detail |
---|
public void draw(java.awt.Graphics g, int line, int column, int cellWidth, int cellHeight, java.awt.Color background)
requires: Gelem.draw(java.awt.Graphics, int, int, int, int, java.awt.Color)
requires: imageOk()
draw
in class Gelem
g
- Java's Graphics object to use in drawingline
- line in GBoard to draw Gelem.column
- column in GBoard to draw Gelem.cellWidth
- number of horizontal pixels per cellcellHeight
- number of vertical pixels per cellbackground
- background colorpublic void erase(java.awt.Graphics g, int line, int column, int cellWidth, int cellHeight, java.awt.Color background)
requires: Gelem.erase(java.awt.Graphics, int, int, int, int, java.awt.Color)
requires: imageOk()
erase
in class Gelem
background
- background colorg
- Java's Graphics object to use in drawingline
- line in GBoard to draw Gelem.column
- column in GBoard to draw Gelem.cellWidth
- number of horizontal pixels per cellcellHeight
- number of vertical pixels per cellpublic boolean imageOk()
boolean
true if successfully loaded, otherwise it returns false
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |