int connections = (o instanceof Connected) ? ((Connected)o).getLinks().size() : 0;
String id = (o instanceof IdentifiableDiagramElement) ? ((IdentifiableDiagramElement)o).getID() : o.toString().replace("\n", "");
RenderingInformation ri = ((PositionableDiagramElement)o).getRenderingInformation();
if (ri instanceof RectangleRenderingInformation) {
RectangleRenderingInformation rri = (RectangleRenderingInformation) ri;
double width = rri.getSize().getWidth();
double height = rri.getSize().getHeight();
return new String[] { id, ""+width, ""+height, ""+connections };
} else {
RouteRenderingInformation rri = (RouteRenderingInformation) ri;
Dimension2D bounds = rri.getBoundingSize();
double width = bounds.getWidth();
double height = bounds.getHeight();
return new String[] { id, ""+width, ""+height, ""+connections };
}