/// invoked by SgEngine void sessionDeactivated(SessionEvent e) { for (int i = 0; i < sessionListeners.size(); i++) { SessionListener sl = (SessionListener) sessionListeners.get(i); AbstractEventRedirector r = new AbstractEventRedirector(sl) { public void redirectEvent(EventObject e) { SessionEvent se = (SessionEvent) e; SessionListener sl = (SessionListener) getListener(); sl.sessionDeactivated(se); } }; SgEngine.getInstance().getEventQueue().addQueueEntry(r, e); SgEngine.getInstance().getEventQueue().processEvents(); } }
/** * Fires the given event to the registered listener, using the <code>SgEngine</code>s event queue. * * @param e The event. */ protected void fireElementRemovedEvent(SessionElementEvent e) { EventQueueHandler eventQueue = SgEngine.getInstance().getEventQueue(); for (int i = 0; i < sessionElementListeners.size(); i++) { SessionElementListener l = (SessionElementListener) sessionElementListeners.get(i); AbstractEventRedirector rd = new AbstractEventRedirector(l) { public void redirectEvent(EventObject e) { ((SessionElementListener) getListener()).elementRemoved((SessionElementEvent) e); } }; eventQueue.addQueueEntry(rd, e); } eventQueue.processEvents(); }
/** * Fires the given event to the registered listener, using the <code>SgEngine</code>s event queue. * * @param e The event. */ protected void fireObjectSelectionChangedEvent(ObjectSelectionChangedEvent e) { EventQueueHandler eventQueue = SgEngine.getInstance().getEventQueue(); for (int i = 0; i < objectSelectionChangeListeners.size(); i++) { ObjectSelectionChangeListener l = objectSelectionChangeListeners.get(i); AbstractEventRedirector rd = new AbstractEventRedirector(l) { public void redirectEvent(EventObject e) { ((ObjectSelectionChangeListener) getListener()) .objectSelectionChanged((ObjectSelectionChangedEvent) e); } }; eventQueue.addQueueEntry(rd, e); } eventQueue.processEvents(); }