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 LogBean implements Serializable {
014: private static final long serialVersionUID = 7935235546339138095L;
015: private int backgroundColor;
016: private int foregroundColor;
017: private String id;
018: private String logFilePath;
019: private String logName;
020: private int logOrder;
021:
022: /**
023: * Sets up log name and log path.
024: *
025: * @param logName
026: * Log name.
027: * @param logFilePath
028: * Log path.
029: */
030: LogBean(int logOrder, String logName, String logPath,
031: int foregroundColor, int backgroundColor) {
032: this .logOrder = logOrder;
033: this .logName = logName;
034: this .logFilePath = logPath;
035: this .foregroundColor = foregroundColor;
036: this .backgroundColor = backgroundColor;
037: this .id = Util.getUniqueId();
038: }
039:
040: /**
041: * @return the backgroundColor
042: */
043: public int getBackgroundColor() {
044: return backgroundColor;
045: }
046:
047: /**
048: * Returns font color.
049: *
050: * @return Font color.
051: */
052: public int getForegroundColor() {
053: return foregroundColor;
054: }
055:
056: /**
057: * @return the id
058: */
059: public String getId() {
060: return id;
061: }
062:
063: /**
064: * Returns log path.
065: *
066: * @return Log path.
067: */
068: public String getLogFilePath() {
069: return logFilePath;
070: }
071:
072: /**
073: * Returns log name.
074: *
075: * @return Log name.
076: */
077: public String getLogName() {
078: return logName;
079: }
080:
081: /**
082: * @return the logOrder
083: */
084: public int getLogOrder() {
085: return logOrder;
086: }
087:
088: /**
089: * @param backgroundColor
090: * the backgroundColor to set
091: */
092: public void setBackgroundColor(int backgroundColor) {
093: this .backgroundColor = backgroundColor;
094: }
095:
096: /**
097: * Sets font color.
098: *
099: * @param foregroundColor
100: * Font color.
101: */
102: public void setForegroundColor(int foregroundColor) {
103: this .foregroundColor = foregroundColor;
104: }
105:
106: /**
107: * @param id
108: * the id to set
109: */
110: public void setId(String id) {
111: this .id = id.trim();
112: }
113:
114: /**
115: * Sets log path.
116: *
117: * @param logFilePath
118: * Log path.
119: */
120: public void setLogFilePath(String logPath) {
121: this .logFilePath = logPath;
122: }
123:
124: /**
125: * Sets log name.
126: *
127: * @param logName
128: * Log name.
129: */
130: public void setLogName(String logName) {
131: this .logName = logName;
132: }
133:
134: /**
135: * @param logOrder
136: * the logOrder to set
137: */
138: public void setLogOrder(int logOrder) {
139: this.logOrder = logOrder;
140: }
141:
142: }
|