Selection.enableTextSelection();
}
protected void onBackgroundMouseDown(final int mouseX, final int mouseY) {
final Element handle = this.getHandle().getElement();
final InlineStyle inlineStyle = InlineStyle.getInlineStyle(handle);
final ComputedStyle computedStyle = ComputedStyle.getComputedStyle(handle);
boolean killTimer = false;
final int x = this.getXValue();
final int handleX = computedStyle.getInteger(Css.LEFT, CssUnit.PX, 0);
int deltaX = mouseX - handleX;
if (0 != deltaX) {
if (deltaX < 0) {
this.onBeforeHandleXMouseDown();
} else {
this.onAfterHandleXMouseDown();
}
final int handleXAfter = computedStyle.getInteger(Css.LEFT, CssUnit.PX, 0);
final int deltaXAfter = mouseX - handleXAfter;
if (deltaX < 0 ^ deltaXAfter < 0) {
this.setXValue(x);
inlineStyle.setInteger(Css.LEFT, mouseX, CssUnit.PX);
deltaX = 0;
}
}
final int y = this.getYValue();
final int handleY = computedStyle.getInteger( Css.TOP, CssUnit.PX, 0);
int deltaY = mouseY - handleY;
if (0 != deltaY) {
if (deltaY < 0) {
this.onBeforeHandleYMouseDown();
} else {
this.onAfterHandleYMouseDown();
}
final int handleYAfter = computedStyle.getInteger(Css.TOP, CssUnit.PX, 0);
final int deltaYAfter = mouseY - handleYAfter;
if (deltaY < 0 ^ deltaYAfter < 0) {
this.setYValue(y);
inlineStyle.setInteger(Css.TOP, mouseY, CssUnit.PX);
deltaY = 0;
}
}
if (killTimer || deltaX == 0 && deltaY == 0) {
this.clearTimer();