87 |
|
//---PUBLIC METHODS--- |
88 |
|
|
89 |
|
/** |
90 |
< |
* The write() method takes a message, formats it using the |
91 |
< |
* formatLogLine() method, and then outputs it to the screen |
92 |
< |
* using the text area. The source is usually the |
93 |
< |
* calling object, referenced by `this'. The method has been |
94 |
< |
* made synchronized to avoid it being called by two different |
95 |
< |
* objects and the output ending up merged on the screen. |
96 |
< |
* |
97 |
< |
* @param source A string representation of the calling object. |
98 |
< |
* @param verbosity the verbosity of this message |
99 |
< |
* @param message The text to be logged. |
100 |
< |
*/ |
90 |
> |
* The write() method takes a line of text, pre-formatted |
91 |
> |
* and outputs it using a method defined by the actual |
92 |
> |
* implementation. The verbosity is given in case the |
93 |
> |
* implementation wishes to utilise it in the layout - |
94 |
> |
* eg. a different colour or font. |
95 |
> |
* |
96 |
> |
* This instance writes the line to a Swing based GUI |
97 |
> |
* logger. |
98 |
> |
* |
99 |
> |
* @param line A line of formatted text to be logged |
100 |
> |
* @param verbosity the verbosity of this message |
101 |
> |
*/ |
102 |
|
public synchronized void write(String line, int verbosity) { |
103 |
|
_textArea.insert(line + "\n",0); |
104 |
|
_textArea.setRows(_maxMessages); |
122 |
|
|
123 |
|
//---PRIVATE METHODS--- |
124 |
|
|
125 |
+ |
/** |
126 |
+ |
* This method is provided if this class wishes to log |
127 |
+ |
* a message itself. |
128 |
+ |
* |
129 |
+ |
* @param source A String representation of the source |
130 |
+ |
* @param verbosity the verbosity of this message |
131 |
+ |
* @param message The message to log |
132 |
+ |
*/ |
133 |
|
private void write(String source, int verbosity, String message) { |
134 |
|
write(FormatName.formatLogLine(source, verbosity, message), verbosity); |
135 |
|
} |