public class ImageGelem extends Gelem
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
imageOk()
Indicates if the image was correctly loaded.
|
static boolean |
isImage(java.lang.String imagePath)
Check is filepath corresponds to a readable compatible image file.
|
className, draw, erase, height, intersects, isMutable, mutable, mutableDraw, mutableErase, numberOfColumns, numberOfLines, width, x, y
public ImageGelem(java.awt.Image image, GBoard board, double cellOccupation)
requires: image != null
requires: board != null
requires: 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 && !imagePath.isEmpty()
requires: isImage(imagePath)
requires: board != null
requires: 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 && !imagePath.isEmpty()
requires: isImage(imagePath)
requires: board != null
requires: cellOccupation >= 0.0 && cellOccupation <= 100.0
requires: numberOfLines >= 1
requires: 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
requires: imageURL.getFile() != null && !imageURL.getFile().isEmpty()
requires: board != null
requires: 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
requires: imageURL.getFile() != null && !imageURL.getFile().isEmpty()
requires: board != null
requires: cellOccupation >= 0.0 && cellOccupation <= 100.0
requires: numberOfLines >= 1
requires: 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
requires: board != null
requires: cellOccupation >= 0.0 && cellOccupation <= 100.0
requires: numberOfLines >= 1
requires: numberOfColumns >= 1
image
- image's objectboard
- GBoard where the image will be drawedcellOccupation
- total cell's occupation (%)numberOfLines
- number of linesnumberOfColumns
- number of columnspublic static boolean isImage(java.lang.String imagePath)
requires: imagePath != null && !imagePath.isEmpty()
imagePath
- image's file pathboolean
true if is a valid image file, otherwise it returns falsepublic boolean imageOk()
boolean
true if successfully loaded, otherwise it returns false