if (vLayer.getLayerInfo().getLayerType() == LayerType.LINESTRING
|| vLayer.getLayerInfo().getLayerType() == LayerType.MULTILINESTRING) {
// Lines, draw a LineString;
Coordinate[] coordinates = new Coordinate[4];
coordinates[0] = new Coordinate(10, y);
coordinates[1] = new Coordinate(10 + 10, y + 5);
coordinates[2] = new Coordinate(10 + 5, y + 10);
coordinates[3] = new Coordinate(10 + 15, y + 15);
LineString line = mapModel.getGeometryFactory().createLineString(coordinates);
graphics.drawLine(parentGroup, "style" + lineCount, line, style);
} else if (vLayer.getLayerInfo().getLayerType() == LayerType.POLYGON
|| vLayer.getLayerInfo().getLayerType() == LayerType.MULTIPOLYGON) {
// Polygons: draw a rectangle:
Bbox rect = new Bbox(10, y, 16, 16);
graphics.drawRectangle(parentGroup, "style" + lineCount, rect, style);
} else if (vLayer.getLayerInfo().getLayerType() == LayerType.POINT
|| vLayer.getLayerInfo().getLayerType() == LayerType.MULTIPOINT) {
// Points: draw a symbol:
graphics.drawSymbol(parentGroup, "style" + lineCount, new Coordinate(18, y + 8), style,
styleInfo.getStyleId());
}
// After the style, draw the style's name:
Coordinate textPosition = new Coordinate(30, y - 2);
graphics.drawText(parentGroup, "text" + lineCount, styleInfo.getName(), textPosition,
fontStyle);
y += 21;
}
} else if (layer instanceof RasterLayer) {
// For raster layers; show a nice symbol:
lineCount++;
graphics.drawImage(parentGroup, "style" + lineCount, Geomajas.getIsomorphicDir()
+ "geomajas/osgeo/layer-raster.png", new Bbox(10, y, 16, 16), new PictureStyle(1));
Coordinate textPosition = new Coordinate(30, y - 2);
graphics.drawText(parentGroup, "text" + lineCount, layer.getLabel(), textPosition, fontStyle);
y += 20;
}
}
}