propertiesCoordinates.clear();
// Get all properties of all selected tiles...
MapLayer ml = editor.getCurrentLayer();
if (ml instanceof TileLayer) {
TileLayer tl = (TileLayer) ml;
Rectangle r = selection.getSelectedAreaBounds();
int maxJ = (int) (r.getY() + r.getHeight());
int maxI = (int) (r.getX() + r.getWidth());
// todo: BL - Why are tiles checked on null? Surely whether a tile
// todo: is null or not has nothing to do with whether you can place
// todo: a property as a certain location?
for (int j = (int) r.getY(); j < maxJ; j++) {
for (int i = (int) r.getX(); i < maxI; i++) {
Tile t = selection.getTileAt(i, j);
if (t != null) {
propertiesCoordinates.add(new Point(i, j));
}
}
}
if (!propertiesCoordinates.isEmpty()) {
// Start with properties of first tile instance
Point point = propertiesCoordinates.get(0);
Properties p = tl.getTileInstancePropertiesAt(point.x, point.y);
if (p != null) {
mergedProperties.putAll(p);
for (int i = 1; i < propertiesCoordinates.size(); i++) {
// Merge the other properties...
point = propertiesCoordinates.get(i);
p = tl.getTileInstancePropertiesAt(point.x, point.y);
if (p != null) {
for (Enumeration<?> e = mergedProperties.keys(); e.hasMoreElements();) {
// We only care for properties that are already
// "known"...