/** * Adds an event to the event queue. * * @param event is the event to add to the event queue. */ public void add(Event event) { if (!HiddenAccess.isCriticalEvent(event)) { final int priority = getEventPriority(event.getClass().getName()); HiddenAccess.setEventPriority(event, priority); } addImpl(event); }
/** * Sets the event priority of events belonging to a specific class. * * @param eventClass is a string with the full class name of the event type to set the priority * for. * @param priority is the new priority */ public void setEventPriority(String eventClass, int priority) { if (eventClass == null) { return; } final Event event = eventNames.get(eventClass); if (event == null) { robotProxy.println("SYSTEM: Unknown event class: " + eventClass); return; } if (HiddenAccess.isCriticalEvent(event)) { robotProxy.println("SYSTEM: You may not change the priority of a system event."); } HiddenAccess.setEventPriority(event, priority); }