This commit is contained in:
BetaSteward 2010-09-01 03:01:43 +00:00
parent df642c2bd5
commit 3fa0e8b8f4
544 changed files with 13327 additions and 3074 deletions

View file

@ -34,12 +34,14 @@
package mage.client.chat;
import java.awt.Color;
import java.awt.event.KeyEvent;
import java.util.UUID;
import java.util.logging.Logger;
import mage.client.MageFrame;
import mage.client.remote.Session;
import mage.util.Logging;
import mage.view.ChatMessage.MessageColor;
/**
*
* @author BetaSteward_at_googlemail.com
@ -69,7 +71,24 @@ public class ChatPanel extends javax.swing.JPanel {
session.leaveChat(chatId);
}
public void receiveMessage(String message) {
public void receiveMessage(String message, MessageColor color) {
switch (color) {
case BLACK:
this.txtConversation.setForeground(Color.BLACK);
break;
case RED:
this.txtConversation.setForeground(Color.RED);
break;
case GREEN:
this.txtConversation.setForeground(Color.GREEN);
break;
case BLUE:
this.txtConversation.setForeground(Color.BLUE);
break;
case ORANGE:
this.txtConversation.setForeground(Color.ORANGE);
break;
}
this.txtConversation.append(message + "\n");
txtConversation.setCaretPosition(txtConversation.getText().length() - 1);
}