@PostConstruct public void init() { imBridge = new WebQQBridge(); imBridge.setApp(this); UIEventDispatcher uiEventDispatcher = new UIEventDispatcher(this); eventService.register(uiEventDispatcher.getEventTypes(), uiEventDispatcher); }
public IMDialog(IMFrame owner) { super(owner); this.owner = owner; i18nService = IMContext.getBean(I18nService.class); skinService = IMContext.getBean(SkinService.class); resourceService = IMContext.getBean(ResourceService.class); eventService = IMContext.getBean(EventService.class); setDefaultCloseOperation(WebFrame.DISPOSE_ON_CLOSE); getRootPane().setDoubleBuffered(true); // 创建wrap,并设置为默认面板(该面板为窗口阴影面板) contentWrap = new IMFrameWrap(); contentWrap.installSkin(getSkinService()); super.setContentPane(contentWrap); // 去了默认边框 setUndecorated(true); // 把窗口设置为透明 AWTUtilities.setWindowOpaque(this, false); UIEventDispatcher uiEventDispatcher = new UIEventDispatcher(this); eventService.register(uiEventDispatcher.getEventTypes(), uiEventDispatcher); }
@IMEventHandler(IMEventType.IMAGE_VERIFY_NEED) protected void processNeedVerify(IMEvent imEvent) { eventService.broadcast(new UIEvent(UIEventType.IMAGE_VERIFY_NEED, imEvent.getTarget())); }
@IMEventHandler(IMEventType.LOGIN_ERROR) protected void processLoginError(IMEvent imEvent) { QQException ex = (QQException) imEvent.getTarget(); eventService.broadcast(new UIEvent(UIEventType.LOGIN_ERROR, ex.getMessage())); }
@IMEventHandler(IMEventType.LOGIN_SUCCESS) protected void processLoginSuccess(IMEvent imEvent) { eventService.broadcast(new UIEvent(UIEventType.LOGIN_SUCCESS)); }
@IMEventHandler(IMEventType.USER_FACE_UPDATE) protected void processUserFaceUpdate(IMEvent imEvent) { eventService.broadcast(new UIEvent(UIEventType.USER_FACE_UPDATE, imEvent.getTarget())); }
@IMEventHandler(IMEventType.BUDDY_LIST_UPDATE) protected void processBuddyListUpdate(IMEvent imEvent) { eventService.broadcast(new UIEvent(UIEventType.BUDDY_LIST_UPDATE, imEvent.getTarget())); }
@IMEventHandler(IMEventType.SELF_SIGN_UPDATE) protected void processSelfSignUpdate(IMEvent imEvent) { eventService.broadcast(new UIEvent(UIEventType.SELF_SIGN_UPDATE, imEvent.getTarget())); }
/** * 广播 UIEvent * * @param type * @param target */ protected void broadcastUIEvent(UIEventType type, Object target) { eventService.broadcast(new UIEvent(type, target)); }
/** * 广播 UIEvent * * @param uiEvent */ public void broadcastUIEvent(UIEvent uiEvent) { eventService.broadcast(uiEvent); }