/**
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
*/
@Override
protected IFigure createFigure() {
final MapObject obj = (MapObject) getModel();
final ScannedMap map = (ScannedMap) getParent().getModel();
final String symbol = EditPlugin.getBL().getProfile(map).getIcon(obj.getType());
final ImageDescriptor desc = EditUIPlugin.getImageDescriptor("/icons/" + symbol + ".png"); //$NON-NLS-1$ //$NON-NLS-2$
if (desc == null)
throw new IllegalArgumentException("Icon for " + obj.getType() + " not found! " //$NON-NLS-1$ //$NON-NLS-2$
+ symbol);
final Image img = desc.createImage();
final ImageFigure fig = new ImageFigure(img);
final Rectangle bounds = img.getBounds();
final CoordinateSystem cs = getCoordinateSystem();
final Point p = cs.toPoint(obj.getCenter().getNode().getPosition());
bounds.x = p.x - bounds.width / 2;
bounds.y = p.y - bounds.height / 2;
fig.setBounds(new org.eclipse.draw2d.geometry.Rectangle(bounds));
fig.setLayoutManager(new XYLayout());
return fig;