/**
* {@inheritDoc}
*/
public void insertUpdate(DocumentEvent e) {
// Here we need to implement the resizing method
MultilineLayout layout = MultilineLayouter.getInstance().calculateLayout(
((Graphics2D) getGraphics()).getFontRenderContext(), getFont(),
getText(), getSize().getWidth());
Dimension2D size2D = layout.getSize();
Dimension size = new Dimension((int) size2D.getWidth(),
(int) size2D.getHeight() + MAGIC_OFFSET);
setSize(size);
}