final String content, final int x, final int y,
final int w, final int h) {
if (id == null) return;
RenderElement element = this.id2element.get(id);
CoordinatesType ct = CoordinatesType.DOCUMENT_BASED;
if (element == null) {
Class<? extends RenderElement> rType = RenderElement.class;
if (type != null) {
if (type.equals("text")) rType = TextualRenderElement.class;
if (type.equals("image")) rType = GraphicalRenderElement.class;
}
element = this.pseudorenderer.createElement(rType);
} else {
// Obtain last coordinates type, in order not to change it in case it has beed switched
// from DOCUMENT_BASED to WINDOW_BASED
ct = element.getCoordinatesType();
}
// Update the windowGeometry and id
element.setGeometry(new Rectangle(x, y, w, h), ct);
element.setIdentifier(id);
// Try to update content of the element
if (content != null && element instanceof TextualRenderElement) {
((TextualRenderElement) element).setContent(content);
}
// When updated, unset invalidity
element.setMetaAttribute(RenderElementMetaAttribute.INVALID, Boolean.FALSE);
this.id2element.put(id, element);
}