@Override public void tilesRemoved(Dimension dimension, Set<Tile> tiles) { for (Tile tile : tiles) { tile.removeListener(this); } zSortedTiles.removeAll(tiles); // renderedTiles.remove(new Point(tile.getX(), tile.getY())); // TODO: the tile will be re-added if it was on the render queue, but // since this can currently never happen anyway we will deal with that // when it becomes necessary }
@Override public void hierarchyChanged(HierarchyEvent event) { if ((event.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) { if (isDisplayable()) { // for (Tile tile: dimension.getTiles()) { // threeDeeRenderManager.renderTile(tile); // } timer = new Timer(250, this); timer.start(); } else { timer.stop(); timer = null; threeDeeRenderManager.stop(); for (Tile tile : dimension.getTiles()) { tile.removeListener(this); } dimension.removeDimensionListener(this); } } }