List of usage examples for com.google.gwt.core.client JavaScriptObject cast
@Override @SuppressWarnings("unchecked") public <T extends JavascriptObjectEquivalent> T cast()
From source file:org.unitime.timetable.gwt.client.rooms.RoomSharingHint.java
License:Apache License
/** Never use from GWT code */ public static void _showRoomSharingHint(JavaScriptObject source, String locationId) { showHint((Element) source.cast(), Long.valueOf(locationId), false); }
From source file:org.unitime.timetable.gwt.client.rooms.RoomSharingHint.java
License:Apache License
/** Never use from GWT code */ public static void _showEventAvailabilityHint(JavaScriptObject source, String locationId) { showHint((Element) source.cast(), Long.valueOf(locationId), true); }
From source file:org.unitime.timetable.gwt.client.TimeHint.java
License:Apache License
/** Never use from GWT code */ public static void _showTimeHint(JavaScriptObject source, String parameter) { showHint((Element) source.cast(), parameter); }
From source file:org.vectomatic.svg.edit.client.command.edit.EditSVGPointsManipulator.java
License:Open Source License
@Override public boolean processMouseDown(MouseDownEvent event) { selectedVertices.clear();// w w w . j a va 2s . c o m JavaScriptObject target = event.getNativeEvent().getEventTarget(); OMSVGElement element = OMNode.convert((Node) target.cast()); m = g.getScreenCTM().inverse(); p0 = getCoordinates(event, m); if (target == ((OMSVGElement) posHandle).getElement()) { mode = Mode.VERTEX; selectedVertices.addAll(pointToVertex.keySet()); } else { GridSelectionModel<SVGPoint> selectionModel = getSelectionModel(); if (element instanceof OMSVGRectElement) { // Click on a vertex SVGRectElement v = (SVGRectElement) target.cast(); SVGPoint p = getModelPoint(v); boolean selected = selectionModel.isSelected(p); if (event.getNativeEvent().getShiftKey()) { selectionModel.select(true, p); mode = Mode.VERTEX; } else if (event.getNativeEvent().getCtrlKey()) { if (selected) { selectionModel.deselect(p); } else { selectionModel.select(true, p); mode = Mode.VERTEX; } } else { if (!selected) { selectionModel.select(false, p); } mode = Mode.VERTEX; } } else if (element instanceof OMSVGLineElement) { // Click on a line segment SVGLineElement l = (SVGLineElement) target.cast(); List<SVGPoint> plist = getModelEndpoints(l); boolean selected = selectionModel.isSelected(plist.get(0)) && selectionModel.isSelected(plist.get(1)); if (event.getNativeEvent().getShiftKey()) { selectionModel.select(plist, true); mode = Mode.VERTEX; } else if (event.getNativeEvent().getCtrlKey()) { if (selected) { selectionModel.deselect(plist); } else { selectionModel.select(plist, true); mode = Mode.VERTEX; } } else { if (!selected) { selectionModel.select(plist, false); } mode = Mode.VERTEX; } } if (mode == Mode.VERTEX) { for (SVGPoint p : getSelectionModel().getSelectedItems()) { selectedVertices.add(getManipulatorPoint(p)); } } } if (mode.consumeEvent()) { event.preventDefault(); event.stopPropagation(); } return true; }
From source file:org.waveprotocol.wave.client.common.util.JsoView.java
License:Apache License
/** * Unsafely cast any jso to a JsoView, exposing its internals. * * @param jso/*from ww w . j av a 2s . c o m*/ * @return a JsoView of the input javascript object */ public static JsoView as(JavaScriptObject jso) { return jso.cast(); }
From source file:thothbot.parallax.core.client.context.Canvas3dAttributes.java
License:Open Source License
/** * Converts a JavaScriptObject to this Canvas3dAttributes. * // ww w.j a v a2 s . c om * @param contextAttribs a JavaScriptObject whose type is * Canvas3dAttributes. */ Canvas3dAttributes(JavaScriptObject contextAttribs) { impl = contextAttribs.cast(); }