Package fr.iut.tetris.models
Class BlockModel
- java.lang.Object
- 
- fr.iut.tetris.models.BlockModel
 
- 
 public class BlockModel extends java.lang.Object
- 
- 
Field SummaryFields Modifier and Type Field Description java.awt.image.BufferedImagebase_imagejava.awt.Colorcolorjava.awt.image.BufferedImageimagePieceModelparentjava.awt.Dimensionsizejava.awt.PointstandAlonePos
 - 
Constructor SummaryConstructors Constructor Description BlockModel(java.awt.Color color)BlockModel(java.awt.Color color, java.awt.image.BufferedImage base_image, java.awt.Dimension size, java.awt.Point standAlonePos, PieceModel parent)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockModelclone()voidrecalculate()Recalculate the piece color based on the stored color variable(package private) voidsetBaseImage()Load the image of the blockvoidsetParent(PieceModel parent)Set to which piece this perticular block is linkedvoidsetSize(java.awt.Dimension size)Change the size of the block (used for the image calculation)
 
- 
- 
- 
Field Detail- 
colorpublic java.awt.Color color 
 - 
imagepublic java.awt.image.BufferedImage image 
 - 
base_imagepublic java.awt.image.BufferedImage base_image 
 - 
sizepublic java.awt.Dimension size 
 - 
standAlonePospublic java.awt.Point standAlonePos 
 - 
parentpublic PieceModel parent 
 
- 
 - 
Constructor Detail- 
BlockModelpublic BlockModel(java.awt.Color color) 
 - 
BlockModelpublic BlockModel(java.awt.Color color, java.awt.image.BufferedImage base_image, java.awt.Dimension size, java.awt.Point standAlonePos, PieceModel parent)
 
- 
 - 
Method Detail- 
setSizepublic void setSize(java.awt.Dimension size) Change the size of the block (used for the image calculation)- Parameters:
- size- the size
 
 - 
setParentpublic void setParent(PieceModel parent) Set to which piece this perticular block is linked- Parameters:
- parent- the piece
 
 - 
setBaseImagevoid setBaseImage() Load the image of the block
 - 
recalculatepublic void recalculate() Recalculate the piece color based on the stored color variable
 - 
clonepublic BlockModel clone() - Overrides:
- clonein class- java.lang.Object
 
 
- 
 
-