1
package latexDraw.parsers;
3
import latexDraw.lang.LaTeXDrawLang;
7
* This class define a kind of message which will be displayed in the
8
* ParserMessagesFrame.<br>
10
* This file is part of LaTeXDraw<br>
11
* Copyright (c) 2005-2008 Arnaud BLOUIN<br>
13
* LaTeXDraw is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 2 of the License, or
16
* (at your option) any later version.<br>
18
* LaTeXDraw is distributed without any warranty; without even the
19
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20
* PURPOSE. See the GNU General Public License for more details.<br>
23
* @author Arnaud BLOUIN<br>
26
public class ParserCmdMessage
28
/** The line in the PSTricks code at the origin of the message. */
31
/** The exception that occurred. */
32
private Exception exception;
34
/** The name of command which has launched the exception. */
35
private String command;
37
/** The number of column of the message. */
38
public static final short NB_COL = 3;
44
* @param ex The exception.
45
* @param cmd The command.
47
public ParserCmdMessage(int nl, Exception ex, String cmd)
59
public String getCommand()
68
* @return the exception
70
public Exception getException()
89
public String toString()
91
StringBuffer msg = new StringBuffer();
93
msg.append(LaTeXDrawLang.getString1_6("ParserCmdMessage.0")); //$NON-NLS-1$
94
msg.append(String.valueOf(nLine));
95
msg.append("; "); //$NON-NLS-1$
97
if(command!=null && command.length()!=0)
98
msg.append(LaTeXDrawLang.getString1_6("ParserCmdMessage.1")).append(command).append("; "); //$NON-NLS-1$//$NON-NLS-2$
101
msg.append(LaTeXDrawLang.getString1_6("ParserCmdMessage.2")).append(exception.toString()); //$NON-NLS-1$
103
return msg.toString();