public class PixelModel extends Object
| Constructor and Description |
|---|
PixelModel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(ChangeListener listener)
Adds a
ChangeListener to the model. |
protected void |
fireChange()
Notifies the registered listeners that the model has changed.
|
int |
getX()
Returns the current x coordinate.
|
int |
getY()
Returns the current y coordinate.
|
boolean |
isInvalid()
Returns whether the pixel is marked as invalid by setting one of the coordinates to -1.
|
void |
removeChangeListener(ChangeListener listener)
Removes a
ChangeListener from the model. |
void |
set(int x,
int y)
Changes the pixel stored in this model.
|
public void addChangeListener(ChangeListener listener)
ChangeListener to the model.listener - the listener to addpublic void removeChangeListener(ChangeListener listener)
ChangeListener from the model.listener - the listener to removeprotected void fireChange()
public void set(int x,
int y)
x - the new x coordinatey - the new y coordinatepublic int getX()
public int getY()
public boolean isInvalid()
true if the model does not have a valid pixelCopyright © 2012. All Rights Reserved.