this.document = document;
ResizeListener resizeListener = new ResizeListener(this);
this.addComponentListener(resizeListener);
mouseEventHandler = new MouseEventHandler(document);
this.addMouseListener(mouseEventHandler);
if (MouseEventHandler.MOUSE_MOTION) {
this.addMouseMotionListener(mouseEventHandler);
}