/** Converts an AU request to a client-info event. * @since 5.0.0 */ public static final ClientInfoEvent getClientInfoEvent(AuRequest request) { final Map<String, Object> data = request.getData(); //Note: ClientInfoEvent is a broadcast event List inf = (List) data.get(""); // ZK-3133 have to add inf 10, 11 if it's from the original onClientEvent not from match media command if (inf.size() == 10) { inf.add(false); inf.add(null); } return new ClientInfoEvent(request.getCommand(), getInt(inf, 0), getInt(inf, 1), getInt(inf, 2), getInt(inf, 3), getInt(inf, 4), getInt(inf, 5), getInt(inf, 6), getInt(inf, 7), getDouble(inf, 8), (String) inf.get(9), (Boolean) inf.get(10), (String) inf.get(11)); }
/** * Utility to check if the current orientation is landscape on tablet/mobile device. * @see #isLandscape() * @since 6.5.0 */ public boolean isHorizontal() { return isLandscape(); }
/** * Utility to check if the current orientation is portrait on tablet/mobile device. * @see #isPortrait() * @since 6.5.0 */ public boolean isVertical() { return isPortrait(); }
public int sendCommand(String command, Map<String, Object> args) { checkInit(); final Set<Property> notifys = new HashSet<Property>(); Event evt = null; //ZK-3133 if (args != null && args.containsKey(BinderCtrl.CLIENT_INFO)) { Map<String, Object> inf = new HashMap<String, Object>(); inf.put("", args.get(BinderCtrl.CLIENT_INFO)); evt = ClientInfoEvent.getClientInfoEvent(new AuRequest(_rootComp.getDesktop(), command, inf)); } //args come from user, we don't eval it. int result = doCommand(_rootComp, null, command, evt, args, notifys); if (result == COMMAND_FAIL_VALIDATE && _validationMessages != null) { notifys.add(new PropertyImpl(_validationMessages, ".", null)); } fireNotifyChanges(notifys); return result; }
Events.postEvent(evt); } else if (Events.ON_CLIENT_INFO.equals(cmd)) { Events.postEvent(ClientInfoEvent.getClientInfoEvent(request)); } else if (Events.ON_VISIBILITY_CHANGE.equals(cmd)) { Events.postEvent(VisibilityChangeEvent.getVisibilityChangeEvent(request));