~ubuntu-branches/debian/squeeze/latexdraw/squeeze

« back to all changes in this revision

Viewing changes to latexDraw/parsers/ParserCmdMessage.java

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2009-05-03 23:49:35 UTC
  • Revision ID: james.westby@ubuntu.com-20090503234935-cls7n48x018g0vk2
Tags: upstream-2.0.2+1
ImportĀ upstreamĀ versionĀ 2.0.2+1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package latexDraw.parsers;
 
2
 
 
3
import latexDraw.lang.LaTeXDrawLang;
 
4
 
 
5
 
 
6
/** 
 
7
 * This class define a kind of message which will be displayed in the
 
8
 * ParserMessagesFrame.<br>
 
9
 * <br>
 
10
 * This file is part of LaTeXDraw<br>
 
11
 * Copyright (c) 2005-2008 Arnaud BLOUIN<br>
 
12
 *<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>
 
17
 *<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>
 
21
 * <br>
 
22
 * 02/02/06<br>
 
23
 * @author Arnaud BLOUIN<br>
 
24
 * @version 2.0.0<br>
 
25
 */
 
26
public class ParserCmdMessage
 
27
{
 
28
        /** The line in the PSTricks code at the origin of the message. */
 
29
        private int nLine;
 
30
        
 
31
        /** The exception that occurred. */
 
32
        private Exception exception;
 
33
        
 
34
        /** The name of command which has launched the exception. */
 
35
        private String command;
 
36
        
 
37
        /** The number of column of the message. */
 
38
        public static final short NB_COL = 3;
 
39
        
 
40
        
 
41
        /**
 
42
         * The constructor.
 
43
         * @param nl The line.
 
44
         * @param ex The exception.
 
45
         * @param cmd The command.
 
46
         */
 
47
        public ParserCmdMessage(int nl, Exception ex, String cmd)
 
48
        {
 
49
                nLine = nl;
 
50
                exception = ex;
 
51
                command = cmd;
 
52
        }
 
53
 
 
54
 
 
55
        
 
56
        /**
 
57
         * @return the command
 
58
         */
 
59
        public String getCommand()
 
60
        {
 
61
                return command;
 
62
        }
 
63
 
 
64
 
 
65
        
 
66
        
 
67
        /**
 
68
         * @return the exception
 
69
         */
 
70
        public Exception getException()
 
71
        {
 
72
                return exception;
 
73
        }
 
74
 
 
75
 
 
76
        
 
77
        
 
78
        /**
 
79
         * @return the nLine
 
80
         */
 
81
        public int getNLine()
 
82
        {
 
83
                return nLine;
 
84
        }
 
85
        
 
86
        
 
87
 
 
88
        @Override
 
89
        public String toString()
 
90
        {
 
91
                StringBuffer msg = new StringBuffer();
 
92
                
 
93
                msg.append(LaTeXDrawLang.getString1_6("ParserCmdMessage.0")); //$NON-NLS-1$
 
94
                msg.append(String.valueOf(nLine));
 
95
                msg.append("; "); //$NON-NLS-1$
 
96
                
 
97
                if(command!=null && command.length()!=0)
 
98
                        msg.append(LaTeXDrawLang.getString1_6("ParserCmdMessage.1")).append(command).append("; "); //$NON-NLS-1$//$NON-NLS-2$
 
99
                
 
100
                if(exception!=null)
 
101
                        msg.append(LaTeXDrawLang.getString1_6("ParserCmdMessage.2")).append(exception.toString()); //$NON-NLS-1$
 
102
                
 
103
                return msg.toString();
 
104
        }
 
105
}