本文整理汇总了Java中com.google.gwt.event.dom.client.HumanInputEvent.isShiftKeyDown方法的典型用法代码示例。如果您正苦于以下问题:Java HumanInputEvent.isShiftKeyDown方法的具体用法?Java HumanInputEvent.isShiftKeyDown怎么用?Java HumanInputEvent.isShiftKeyDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.dom.client.HumanInputEvent
的用法示例。
在下文中一共展示了HumanInputEvent.isShiftKeyDown方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDown
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
/**
* Start dragging, register base for selection rectangle.
*
* @param event
* event
*/
@Override
public void onDown(HumanInputEvent<?> event) {
if (dragging && leftWidget) {
// mouse was moved outside of widget
doSelect(event);
} else if (!isRightMouseButton(event)) {
// no point trying to select when there is no active layer
dragging = true;
leftWidget = false;
timestamp = new Date().getTime();
begin = getLocation(event, RenderSpace.SCREEN);
bounds = new Bbox(begin.getX(), begin.getY(), 0.0, 0.0);
shift = event.isShiftKeyDown();
rectangle = new Rectangle("selectionRectangle");
rectangle.setStyle(rectangleStyle);
rectangle.setBounds(bounds);
mapWidget.render(rectangle, RenderGroup.SCREEN, RenderStatus.UPDATE);
}
}
示例2: onDown
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
public void onDown(HumanInputEvent<?> event) {
if (service.getEditingState() == GeometryEditState.IDLE) {
if (event.isShiftKeyDown()) {
// Add to or remove from selection:
if (service.getIndexStateService().isSelected(index)) {
service.getIndexStateService().deselect(Collections.singletonList(index));
event.stopPropagation();
} else {
service.getIndexStateService().select(Collections.singletonList(index));
}
} else {
// Deselect all and select only this index:
service.getIndexStateService().deselectAll();
service.getIndexStateService().select(Collections.singletonList(index));
}
}
}
示例3: onDown
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onDown(HumanInputEvent<?> event) {
if (!isRightMouseButton(event)) {
dragging = true;
begin = getLocation(event, RenderSpace.SCREEN);
shift = event.isShiftKeyDown();
circle = new Circle((int) begin.getX(), (int) begin.getY(), 0);
circle.setFillColor(fillColor);
circle.setFillOpacity(fillOpacity);
circle.setStrokeColor(strokeColor);
circle.setStrokeWidth(strokeWidth);
getContainer().add(circle);
line = new Line((int) begin.getX(), (int) begin.getY(), (int) begin.getX(), (int) begin.getY());
line.setStrokeColor(strokeColor);
line.setStrokeWidth(strokeWidth);
getContainer().add(line);
}
}
示例4: onUp
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onUp(HumanInputEvent<?> event) {
// Assure dragging or clicking started inside this widget
if (dragging) {
shift |= event.isShiftKeyDown(); // shift is used when depressed either at beginning or end
updateCircle(event);
Geometry geometry = new Geometry(Geometry.POINT, 0, -1);
Coordinate[] coordinates = new Coordinate[]{new Coordinate(circle.getUserX(), circle.getUserY())};
geometry.setCoordinates(coordinates);
ViewPort viewPort = mapPresenter.getViewPort();
execute(viewPort.getTransformationService().transform(geometry, RenderSpace.SCREEN, RenderSpace.WORLD),
circle.getRadius() * viewPort.getResolution());
stopDragging();
dragging = false;
}
}
示例5: addStateMasks
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private static void addStateMasks(HumanInputEvent event, MouseEvent me) {
if (event.isShiftKeyDown()) {
me.stateMask |= SWT.SHIFT;
}
if (event.isControlKeyDown()) {
me.stateMask |= SWT.CONTROL;
}
if (event.isAltKeyDown()) {
me.stateMask |= SWT.ALT;
}
}
示例6: onDown
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onDown(HumanInputEvent<?> event) {
if (event.isControlKeyDown() || event.isShiftKeyDown()) {
zooming = true;
zoomToRectangleController.onDown(event);
} else if (!isRightMouseButton(event)) {
panning = true;
mapWidget.getMapModel().getMapView().setPanDragging(true);
begin = getLocation(event, RenderSpace.SCREEN);
if (!isShowCursorOnMove()) {
mapWidget.setCursor(Cursor.MOVE);
}
}
lastClickPosition = getLocation(event, RenderSpace.WORLD);
}
示例7: doSelect
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private void doSelect(HumanInputEvent<?> event) {
dragging = false;
shift |= event.isShiftKeyDown(); // shift is used when depressed either at beginning or end
updateRectangle(event);
WorldViewTransformer transformer = new WorldViewTransformer(mapWidget.getMapModel().getMapView());
Bbox worldBounds = transformer.viewToWorld(bounds);
selectRectangle(worldBounds);
mapWidget.render(rectangle, RenderGroup.SCREEN, RenderStatus.DELETE);
}
示例8: onDown
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onDown(HumanInputEvent<?> event) {
switch (selectionMethod) {
case CLICK_AND_DRAG:
selectionRectangleController.onDown(event);
break;
default:
onDownLocation = getLocation(event, RenderSpace.SCREEN);
if (!event.isShiftKeyDown() && !event.isControlKeyDown()) {
super.onDown(event);
}
}
}
示例9: onUp
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onUp(HumanInputEvent<?> event) {
switch (selectionMethod) {
case CLICK_AND_DRAG:
if (isDownPosition(event)) {
searchAtLocation(getLocation(event, RenderSpace.WORLD), event.isShiftKeyDown());
selectionRectangleController.cleanup();
} else {
selectionRectangleController.onUp(event);
}
break;
case CLICK_ONLY:
stopPanning(null);
if (!event.isShiftKeyDown() && !event.isControlKeyDown()) {
super.onUp(event);
}
if (isDownPosition(event)) {
searchAtLocation(getLocation(event, RenderSpace.WORLD), event.isShiftKeyDown());
}
break;
default:
stopPanning(null);
if (!event.isShiftKeyDown() && !event.isControlKeyDown()) {
super.onUp(event);
}
if (isDownPosition(event)) {
searchAtLocation(getLocation(event, RenderSpace.WORLD), false);
}
}
}
示例10: onDown
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onDown(HumanInputEvent<?> event) {
if (!isRightMouseButton(event)) {
dragging = true;
begin = getLocation(event, RenderSpace.SCREEN);
shift = event.isShiftKeyDown();
rectangle = new Rectangle((int) begin.getX(), (int) begin.getY(), 0, 0);
rectangle.setFillColor(fillColor);
rectangle.setFillOpacity(fillOpacity);
rectangle.setStrokeColor(strokeColor);
rectangle.setStrokeOpacity(strokeOpacity);
rectangle.setStrokeWidth(strokeWidth);
getContainer().add(rectangle);
}
}
示例11: onUp
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onUp(HumanInputEvent<?> event) {
// Assure dragging or clicking started inside this widget
if (dragging) {
shift |= event.isShiftKeyDown(); // shift is used when depressed either at beginning or end
updateRectangle(event);
Bbox bounds = new Bbox(rectangle.getX(), rectangle.getY(), rectangle.getWidth(), rectangle.getHeight());
execute(mapPresenter.getViewPort().getTransformationService()
.transform(bounds, RenderSpace.SCREEN, RenderSpace.WORLD));
stopDragging();
dragging = false;
}
}
示例12: onDown
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onDown(HumanInputEvent<?> event) {
if (event.isControlKeyDown() || event.isShiftKeyDown()) {
zooming = true;
} else if (!isRightMouseButton(event)) {
dragging = true;
dragOrigin = getLocation(event, RenderSpace.SCREEN);
dragPositions.clear();
dragTimes.clear();
mapPresenter.setCursor("move");
}
lastClickPosition = getLocation(event, RenderSpace.WORLD);
}
示例13: begin
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private void begin(WebPlotView pv, ScreenPt spt, HumanInputEvent ev) {
if (!_drawMan.isVisibleGuess()) return;
WebPlot plot= pv.getPrimaryPlot();
_mouseInfo.setEnableAllPersistent(true);
_mouseInfo.setEnableAllExclusive(false);
switch (_mode) {
case SELECT :
_firstPt= plot.getImageWorkSpaceCoords(spt);
_currentPt= _firstPt;
break;
case EDIT :
RecSelection sel= (RecSelection)pv.getAttribute(WebPlot.SELECTION);
if (sel==null) {
WebAssert.tst(false, "no RecSelection found in plot");
}
Pt inPtAr[]= new Pt[] { sel.getPt0(), sel.getPt1()};
ScreenPt ptAry[]= new ScreenPt[4];
ptAry[0]= plot.getScreenCoords(inPtAr[0]);
ptAry[2]= plot.getScreenCoords(inPtAr[1]);
if (ptAry[0]==null || ptAry[2]==null) return;
ptAry[1]= new ScreenPt(ptAry[2].getIX(), ptAry[0].getIY());
ptAry[3]= new ScreenPt(ptAry[0].getIX(), ptAry[2].getIY());
int idx= findClosestPtIdx(ptAry,spt);
ScreenPt testPt= plot.getScreenCoords(ptAry[idx]);
if (testPt==null) return;
double dist= distance(testPt,spt);
if (dist<EDIT_DISTANCE) {
int oppoIdx= (idx+2) % 4;
_firstPt= plot.getImageWorkSpaceCoords(ptAry[oppoIdx]);
_currentPt= plot.getImageWorkSpaceCoords(ptAry[idx]);
if (_firstPt==null || _currentPt==null) return;
}
else {
if (ev.isShiftKeyDown()) {
changeMode(Mode.SELECT,true);
begin(pv, spt, ev);
}
else {
_mouseDown= false;
_mouseInfo.setEnableAllExclusive(true);
}
}
break;
// _debugLabel.setText("begin-edit: dist="+dist+", mouse down="+_mouseDown);
default :
WebAssert.argTst(false, "only support for SelectType of SELECT or EDIT");
break;
}
}