|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
An interface to describe a subset of N2.
The word "cell" will be used to denote a point in N2.
Note that, like the Point, Dimension, and Rectangle
basic geometry APIs, all symmetric methods take arguments x first, y second.
| Inner Class Summary | |
static class |
CellsSet.Factory
A factory to clone CellsSet objects, and create default ones |
static interface |
CellsSet.Listener
A call-back for tracking changes |
| Method Summary | |
void |
addListener(CellsSet.Listener l)
Adds Listener l to the list of Listeners that
will be notified of any changes to the model by the invocation of
their method markAsChanged with a r argument
containing all changes. |
void |
clear()
Empties the set |
void |
clearCells(java.awt.Rectangle r)
Ensures that all cells in the specified rectangle are withdrawn from the set |
java.lang.Object |
clone()
Necessary to allow public access to the clone method. |
boolean |
containsCell(int x,
int y)
Tests whether the cell defined by coordinates x,y is in the set |
java.awt.Rectangle |
getBounds()
Returns the smallest rectangle including all the cells in the subset |
int |
getCellsCount(int maxwidth,
int maxheight)
Returns the number of cells inside some (optional) limits |
void |
insertColumns(int start,
int count)
Inserts count columns before position start. |
void |
insertRows(int start,
int count)
Inserts count rows before position start. |
boolean |
isEmpty()
Tests whether the set is empty |
java.util.Iterator |
iterator()
Returns the sequence of points in the set, ordered by y, x |
void |
removeColumns(int start,
int count)
Removes count columns at column start |
void |
removeListener(CellsSet.Listener l)
Removes Listener l from the list of Listeners that
will be notified of any changes to the model by the invocation of
their method markAsChanged with a r argument
containing all changes. |
void |
removeRows(int start,
int count)
Removes count rows at row start |
void |
setCells(java.awt.Rectangle r)
Ensures that all cells in the specified rectangle are added to the set |
| Method Detail |
public int getCellsCount(int maxwidth,
int maxheight)
maxwidth - the excluded horizontal upper bound applied to this call.
If no bound, -1.maxheight - the excluded vertical upper bound applied to this call.
If no bound, -1.public boolean isEmpty()
true only if the set is structurally empty.
public boolean containsCell(int x,
int y)
x,y is in the setx - the x coord of the tested cell.y - the y coord of the tested cell.public java.awt.Rectangle getBounds()
public java.util.Iterator iterator()
public void clear()
public void setCells(java.awt.Rectangle r)
r - The rectangle to add.public void clearCells(java.awt.Rectangle r)
r - The rectangle to exclude.public void addListener(CellsSet.Listener l)
Listener l to the list of Listeners that
will be notified of any changes to the model by the invocation of
their method markAsChanged with a r argument
containing all changes.public void removeListener(CellsSet.Listener l)
Listener l from the list of Listeners that
will be notified of any changes to the model by the invocation of
their method markAsChanged with a r argument
containing all changes.
public void insertRows(int start,
int count)
count rows before position start.start - the position of insertion.count - the number of inserted positions.
public void removeRows(int start,
int count)
count rows at row startstart - the position of deletion.count - the number of deleted rows.
public void insertColumns(int start,
int count)
count columns before position start.start - the position of insertion.count - the number of inserted positions.
public void removeColumns(int start,
int count)
count columns at column startstart - the position of deletion.count - the number of deleted columns.
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||