Creates a placeholder place @param layerId layer @param x x coordinate @param y y coordinate
(int layerId, int x, int y)
| 168 | * @param y y coordinate |
| 169 | */ |
| 170 | public void putPlaceholder(int layerId, int x, int y){ |
| 171 | try { |
| 172 | Place place = new Place(Place.PLACEHOLDER_NAME, x, y, null); |
| 173 | |
| 174 | // find or create placeholder group |
| 175 | PlaceGroup placeGroup = null; |
| 176 | for(PlaceGroup a: placeGroups) if(a.getName().equals("placeholder")){ |
| 177 | placeGroup = a; |
| 178 | break; |
| 179 | } |
| 180 | // create new placeholder group |
| 181 | if(placeGroup == null) addPlaceGroup(placeGroup = new PlaceGroup("placeholder", Color.GREEN)); |
| 182 | |
| 183 | place.setPlaceGroup(placeGroup); |
| 184 | place.setInfoRing(getInformationColor(0)); |
| 185 | |
| 186 | Layer layer = getLayer(layerId); |
| 187 | if(layer == null){ |
| 188 | addLayer(new Layer(layerId, this)); |
| 189 | layer = getLayer(layerId); |
| 190 | } |
| 191 | layer.put(place, x, y); |
| 192 | } catch(PlaceNotInsertedException ex){ // ignore |
| 193 | } catch (Exception ex) { |
| 194 | Logger.getLogger(World.class.getName()).log(Level.WARNING, "Couldn't put placeholder to map: " + ex, ex); |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | // --------- layers -------------------------------------------------------- |
| 199 | /** |