public void registeredToFrame(ChatFrame chatframe) { this._chatFrame = chatframe; _chatFrame.addWindowToFronListener(this); }
/** * Remove listeners from the "window-alway-on-top" information * @param chatRoom */ public void addWindowToFronListener(ChatRoom chatRoom) { _windowToFrontListeners.add(chatRoom); fireWindowOnTopListeners(chatFrame.isAlwaysOnTop()); }
/** * set if the chatFrame should always stay on top * @param active */ public void setWindowAlwaysOnTop(boolean active) { SettingsManager.getLocalPreferences().setChatWindowAlwaysOnTop(active); chatFrame.setAlwaysOnTop(active); this.fireWindowOnTopListeners(active); }
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); chatFrame.setAlwaysOnTop(true); chatFrame.setAlwaysOnTop(false); chatFrame.setAlwaysOnTop(true); setIconImage(SparkManager.getApplicationImage().getImage()); getContentPane().setLayout(new BorderLayout()); getContentPane().add(SparkManager.getChatManager().getChatContainer(), BorderLayout.CENTER); setMinimumSize( new Dimension( 300, 300 ) ); final Rectangle chatFrameBounds = LayoutSettingsManager.getLayoutSettings().getChatFrameBounds(); if (chatFrameBounds == null || chatFrameBounds.width <= 0 || chatFrameBounds.height <= 0) setSize(500, 400); GraphicUtils.centerWindowOnScreen(this); setBounds( chatFrameBounds ); addComponentListener( new ComponentAdapter() addWindowFocusListener(this); addWindowListener(new WindowAdapter() { addComponentListener(new ComponentAdapter() {
chatFrame = MainWindow.getInstance(); } else { chatFrame = new ChatFrame(); chatFrame.setState(Frame.NORMAL); chatFrame.setAutoRequestFocus(false); chatFrame.setState(Frame.ICONIFIED); chatFrame.setVisible(true); chatFrame.addWindowListener(new WindowAdapter() { public void windowActivated(WindowEvent windowEvent) { stopFlashing();
@Override public void componentResized( ComponentEvent e ) { // Don't do this for subclasses. if ( e.getComponent().getClass().getSimpleName().equalsIgnoreCase( "ChatFrame" ) ) { LayoutSettingsManager.getLayoutSettings().setChatFrameBounds( getBounds() ); } }
/** * Activates the specified ChatRoom. * * @param room the ChatRoom to activate. */ public void activateChatRoom(ChatRoom room) { int tabLocation = indexOfComponent(room); setSelectedIndex(tabLocation); chatFrame.bringFrameIntoFocus(); focusChat(); }
if (chatFrame != null) { if (SettingsManager.getLocalPreferences().isBuzzEnabled()) { chatFrame.buzz(); SparkManager.getChatManager().getChatContainer() .activateChatRoom(room);
@Override public void componentMoved( ComponentEvent e ) { // Don't do this for subclasses. if ( e.getComponent().getClass().getSimpleName().equalsIgnoreCase( "ChatFrame" ) ) { LayoutSettingsManager.getLayoutSettings().setChatFrameBounds( getBounds() ); } } } );
/** * Activates the component in tabbed pane. * * @param component the component contained within the tab to activate. */ public void activateComponent(Component component) { int tabLocation = indexOfComponent(component); if (tabLocation != -1) { setSelectedIndex(tabLocation); } chatFrame.bringFrameIntoFocus(); focusChat(); }