String name = (String) vertex.getAttribute(ObjectType.ATTRIBUTE_SHAPE);
IShape shape = ShapeFactory.createShape(name);
// Creates the figure with the specified properties, sets its id
Font font = ((GraphicalEditPart) getParent()).getFigure().getFont();
VertexFigure figure = new VertexFigure(font, dimension, color, shape);
String id = (String) vertex.getValue(ObjectType.PARAMETER_ID);
figure.setId(id);
// update the figure position (if the graph has layout information)
if ((Boolean) vertex.getParent().getValue(Graph.PROPERTY_HAS_LAYOUT)) {
Rectangle bounds = (Rectangle) vertex
.getValue(Vertex.PROPERTY_SIZE);
if (bounds != null) {
figure.setBounds(bounds);
}
}
// update its size
updatePorts(figure);