public class Block
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
color
The color of the block.
|
protected double |
dx
The x translation for drawing (0-1).
|
protected double |
dy
The y translation for drawing (0-1).
|
protected Block |
lower
The block where this block is located on.
|
protected int |
number
The number of the block.
|
jadex.commons.SimplePropertyChangeSupport |
pcs
The helper object for bean events.
|
protected Block |
upper
The block located on upper of this block.
|
Constructor and Description |
---|
Block(java.awt.Color color,
Block lower)
Create a new block.
|
Block(int number,
java.awt.Color color,
Block lower)
Create a new block.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addBlock(Block block)
Add a block to this block.
|
void |
addPropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
|
boolean |
equals(java.lang.Object o)
Check for equality.
|
java.awt.Color |
getColor()
Get the color of the block.
|
Block |
getLower()
Get the block where this block is located on.
|
protected static int |
getNumber()
Get an instance number.
|
Block |
getUpper()
Get the upper.
|
int |
hashCode() |
boolean |
isClear()
Check if this block is clear.
|
protected void |
removeBlock(Block block)
Remove a block from this block.
|
void |
removePropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.
|
protected void |
setLower(Block lower)
Set the lower block, where this block is located on.
|
void |
stackOn(Block lower)
Move this block on top of another block.
|
java.lang.String |
toString()
Create a string representation of this block.
|
protected int number
protected java.awt.Color color
protected Block lower
protected Block upper
public jadex.commons.SimplePropertyChangeSupport pcs
protected double dx
protected double dy
public Block(java.awt.Color color, Block lower)
color
- The color of the block.lower
- The block where this block is located on.public Block(int number, java.awt.Color color, Block lower)
number
- The number of the block.color
- The color of the block.lower
- The block where this block is located on.protected static int getNumber()
public java.awt.Color getColor()
public Block getLower()
public Block getUpper()
public boolean isClear()
public void stackOn(Block lower)
protected void setLower(Block lower)
lower
- The lower block.protected void addBlock(Block block)
protected void removeBlock(Block block)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void addPropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be added.public void removePropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removed.