{
if (coordinates.length != 4)
{
throw new ParseException("Rect-shape needs four coordinate-values", getLocator());
}
return new RectangleImageMapEntry(coordinates[0], coordinates[1], coordinates[2], coordinates[3]);
}
if ("circle".equals(type))
{
if (coordinates.length != 3)
{
throw new ParseException("Circle-shape needs three coordinate-values", getLocator());
}
return new CircleImageMapEntry(coordinates[0], coordinates[1], coordinates[2]);
}
if ("poly".equals(type))
{
if ((coordinates.length % 2) != 0)
{
throw new ParseException("Polygon-shape needs an even number of coordinate-values", getLocator());
}
return new PolygonImageMapEntry(coordinates);
}
if ("default".equals(type))
{
return new DefaultImageMapEntry();
}
if (coordinates.length != 4)
{
throw new ParseException("Implied Rect-shape needs four coordinate-values", getLocator());
}
return new RectangleImageMapEntry(coordinates[0], coordinates[1], coordinates[2], coordinates[3]);
}