Fixes Esc behavior in chat window.

cusax-fix
Yana Stamcheva 16 years ago
parent e5592501c5
commit 88f86aaa10

@ -151,6 +151,7 @@ public ChatPanel(ChatContainer chatContainer)
topPanel.setBackground(Color.WHITE);
topPanel.setBorder(
BorderFactory.createMatteBorder(1, 0, 1, 0, Color.GRAY));
initTypingNotificationLabel();
this.writeMessagePanel = new ChatWritePanel(this);
@ -347,31 +348,12 @@ public Window getConversationContainerWindow()
*/
public void addTypingNotification(String typingNotification)
{
if (typingNotificationLabel == null)
{
typingNotificationLabel
= new JLabel( typingNotification,
typingIcon,
SwingConstants.CENTER);
typingNotificationLabel.setPreferredSize(new Dimension(500, 20));
typingNotificationLabel.setForeground(Color.GRAY);
typingNotificationLabel.setFont(
typingNotificationLabel.getFont().deriveFont(11f));
typingNotificationLabel.setVerticalTextPosition(JLabel.BOTTOM);
typingNotificationLabel.setHorizontalTextPosition(JLabel.LEFT);
typingNotificationLabel.setIconTextGap(0);
topPanel.add(typingNotificationLabel, BorderLayout.SOUTH);
}
else
{
typingNotificationLabel.setText(typingNotification);
typingNotificationLabel.setText(typingNotification);
if (typingNotification != null && !typingNotification.equals(" "))
typingNotificationLabel.setIcon(typingIcon);
else
typingNotificationLabel.setIcon(null);
}
if (typingNotification != null && !typingNotification.equals(" "))
typingNotificationLabel.setIcon(typingIcon);
else
typingNotificationLabel.setIcon(null);
revalidate();
repaint();
@ -385,6 +367,23 @@ public void removeTypingNotification()
addTypingNotification(" ");
}
/**
* Initializes the typing notification label.
*/
private void initTypingNotificationLabel()
{
typingNotificationLabel
= new JLabel(" ", SwingConstants.CENTER);
typingNotificationLabel.setPreferredSize(new Dimension(500, 20));
typingNotificationLabel.setForeground(Color.GRAY);
typingNotificationLabel.setFont(
typingNotificationLabel.getFont().deriveFont(11f));
typingNotificationLabel.setVerticalTextPosition(JLabel.BOTTOM);
typingNotificationLabel.setHorizontalTextPosition(JLabel.LEFT);
typingNotificationLabel.setIconTextGap(0);
topPanel.add(typingNotificationLabel, BorderLayout.SOUTH);
}
/**
* Returns the conversation panel, contained in this chat panel.

@ -711,7 +711,8 @@ else if (writePanelRightMenu.isVisible())
writePanelRightMenu.setVisible(false);
}
else if ((menuBar.getSelectedMenu() != null)
|| mainToolBar.getSmileysBox().isVisible())
|| mainToolBar.getSmileysBox()
.getPopupMenu().isVisible())
{
MenuSelectionManager.defaultManager().clearSelectedPath();
}

Loading…
Cancel
Save