public void onBrowserEvent(Event event) { switch (DOM.eventGetType(event)) { case Event.ONMOUSEDOWN: case Event.ONMOUSEUP: case Event.ONMOUSEMOVE: case Event.ONMOUSEOVER: case Event.ONMOUSEOUT: if (mouseListeners != null) mouseListeners.fireMouseEvent(this, event); break; } }
/** * set container * * @param container container * @return content layer */ public Element init( Element container, int insetLeft, int insetTop, int insetRight, int insetBottom) { this.container = container; if (!"absolute".equals(container.getStyle().getPosition()) && !"relative".equals(container.getStyle().getPosition())) { container.getStyle().setPosition(Style.Position.RELATIVE); } Element contentLayer = DOM.createDiv(); contentLayer.getStyle().setPosition(Style.Position.ABSOLUTE); if (insetTop > 0) contentLayer.getStyle().setPaddingTop(insetTop, Style.Unit.PX); if (insetLeft > 0) contentLayer.getStyle().setPaddingLeft(insetLeft, Style.Unit.PX); if (insetRight > 0) contentLayer.getStyle().setPaddingRight(insetRight, Style.Unit.PX); if (insetBottom > 0) contentLayer.getStyle().setPaddingBottom(insetBottom, Style.Unit.PX); container.appendChild(contentLayer); return contentLayer; }