1 33 34 package com.icesoft.applications.faces.auctionMonitor; 35 36 import java.sql.Time ; 37 38 42 public class Message { 43 private static final String SEPERATOR = ": "; 44 private String message; 45 private String sender; 46 private String color; 47 private String timestamp = ""; 48 49 public Message(String sender, String message, String color) { 50 this.sender = sender; 51 this.message = message; 52 this.color = color; 53 if (ChatState.getInstance().getTimeStampEnabled()) { 54 timestamp = (new Time (System.currentTimeMillis()).toString() + " "); 55 } 56 } 57 58 public String getMessage() { 59 return (message); 60 } 61 62 public String getColor() { 63 return (color); 64 } 65 66 public String getTimestamp() { 67 return ("<font color=\"#000000\">" + timestamp + "</font>"); 68 } 69 70 public String getSender() { 71 if (color != null) { 72 return ("<font color=\"" + color + "\">" + sender + "</font>"); 73 } 74 return (sender); 75 } 76 77 82 public String get() { 83 if (color != null) { 84 return (timestamp + "<font color=\"" + color + "\">" + sender + 85 "</font>" + SEPERATOR + message); 86 } 87 88 return (timestamp + sender + "</font>" + SEPERATOR + message); 89 } 90 } 91 | Popular Tags |