/**
* Constructs the tile info panel.
*/
public TileInfoPanel (EditorContext ctx, EditorModel model)
{
TileSetRepository tsrepo = ctx.getTileSetRepository();
// set up our key observers
registerKeyListener(ctx);
_model = model;
_model.addListener(this);
_ctx = ctx;
// we're going to sort all of the available tilesets into those
// which are applicable to each layer
try {
_layerLengths = new int[2];
for (int ii=0; ii < 2; ii++) {
_layerSets.put(ii, new ArrayList<TileSetRecord>());
}
Iterator<Integer> tsids = tsrepo.enumerateTileSetIds();
while (tsids.hasNext()) {
Integer tsid = tsids.next();
TileSet set = tsrepo.getTileSet(tsid.intValue());
// determine which layer to which this tileset applies
int lidx = TileSetUtil.getLayerIndex(set);
if (lidx != -1) {
TileSetRecord rec = new TileSetRecord(lidx, tsid.intValue(), set);