本文整理汇总了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" : "");
}
}