001: package net.sourceforge.tracelog.config;
002:
003: import java.io.Serializable;
004:
005: import net.sourceforge.tracelog.utils.Util;
006:
007: /**
008: * LogFile is a value object that contains information about the log, such as
009: * log name, log file path and the color of log text (when displayed).
010: *
011: * @author Choon-Chern Lim (Mike)
012: */
013: public class LogFile implements Serializable {
014: private static final long serialVersionUID = 5339819668361806191L;
015: public int backgroundColor;
016: public int foregroundColor;
017: public String id;
018: public String logName;
019: public int logOrder;
020: public String logPath;
021:
022: public LogFile() {
023: this (0, "", "", 0, 0);
024: }
025:
026: public LogFile(int logOrder, String logName, String logPath,
027: int foregroundColor, int backgroundColor) {
028: this .logOrder = logOrder;
029: this .logName = logName;
030: this .logPath = logPath;
031: this .foregroundColor = foregroundColor;
032: this .backgroundColor = backgroundColor;
033: this .id = Util.getUniqueId();
034: }
035:
036: /**
037: * @return the backgroundColor
038: */
039: public int getBackgroundColor() {
040: return backgroundColor;
041: }
042:
043: /**
044: * @return the foregroundColor
045: */
046: public int getForegroundColor() {
047: return foregroundColor;
048: }
049:
050: /**
051: * @return the id
052: */
053: public String getId() {
054: return id;
055: }
056:
057: /**
058: * @return the logName
059: */
060: public String getLogName() {
061: return logName;
062: }
063:
064: /**
065: * @return the logOrder
066: */
067: public int getLogOrder() {
068: return logOrder;
069: }
070:
071: /**
072: * @return the logPath
073: */
074: public String getLogPath() {
075: return logPath;
076: }
077:
078: /**
079: * @param backgroundColor
080: * the backgroundColor to set
081: */
082: public void setBackgroundColor(int backgroundColor) {
083: this .backgroundColor = backgroundColor;
084: }
085:
086: /**
087: * @param foregroundColor
088: * the foregroundColor to set
089: */
090: public void setForegroundColor(int foregroundColor) {
091: this .foregroundColor = foregroundColor;
092: }
093:
094: /**
095: * @param id
096: * the id to set
097: */
098: public void setId(String id) {
099: this .id = id.trim();
100: }
101:
102: /**
103: * @param logName
104: * the logName to set
105: */
106: public void setLogName(String logName) {
107: this .logName = logName.trim();
108: }
109:
110: /**
111: * @param logOrder
112: * the logOrder to set
113: */
114: public void setLogOrder(int logOrder) {
115: this .logOrder = logOrder;
116: }
117:
118: /**
119: * @param logPath
120: * the logPath to set
121: */
122: public void setLogPath(String logPath) {
123: this.logPath = logPath.trim();
124: }
125:
126: }
|