本文整理匯總了Java中com.google.gwt.user.client.Event.BUTTON_LEFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Event.BUTTON_LEFT屬性的具體用法?Java Event.BUTTON_LEFT怎麽用?Java Event.BUTTON_LEFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.gwt.user.client.Event
的用法示例。
在下文中一共展示了Event.BUTTON_LEFT屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: captureEvents
protected void captureEvents(Event event) {
event.preventDefault();
if (isEnabled() && event.getButton() == Event.BUTTON_LEFT) {
if (!dragDrop) {
dragDrop = true;
DOM.setCapture(resizeElement);
ComputedStyle cs = new ComputedStyle(getElement());
setWidth(cs.getProperty("width"));
setHeight(cs.getProperty("height"));
getTextArea().getStyle().setProperty("width", "100%");
getTextArea().getStyle().setProperty("height", "100%");
}
}
}
示例2: releaseCapture
protected void releaseCapture(Event event) {
if (event.getButton() == Event.BUTTON_LEFT && dragDrop) {
dragDrop = false;
DOM.releaseCapture(resizeElement);
if (resizeHandler != null) {
ComputedStyle cs = new ComputedStyle(getElement());
resizeHandler.sizeChanged(cs.getProperty("width"), cs.getProperty("height"));
resizeHandler.textChanged(getText());
}
}
}
示例3: mouseButtons
/**
* @return A string describing which mouse buttons were pressed,
* e.g., " left"
*/
private static String mouseButtons(Event event) {
if (event.getButton() == -1) {
return "";
} else {
return ((event.getButton() & Event.BUTTON_LEFT) != 0 ? " left" : "")
+ ((event.getButton() & Event.BUTTON_MIDDLE) != 0 ? " middle" : "")
+ ((event.getButton() & Event.BUTTON_RIGHT) != 0 ? " right" : "");
}
}