Line | Hits | Source |
---|---|---|
1 | /******************************************************************************* | |
2 | * Demetrix process modelling system | |
3 | * | |
4 | * Copyright (c) 2003, 2004 Dimitri A. Pissarenko | |
5 | * | |
6 | * This file is part of Demetrix. | |
7 | * | |
8 | * Demetrix is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; either version 2.1 of the License, or | |
11 | * (at your option) any later version. | |
12 | * | |
13 | * Demetrix is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with Demetrix; if not, write to the Free Software | |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | * | |
22 | * For further information you may | |
23 | * | |
24 | * - send an e-mail in Russian, German or English to dimitri.pissarenko@gmx.net | |
25 | * - look at http://sourceforge.net/projects/demetrix/ | |
26 | * - look at http://demetrix.sourceforge.net/ | |
27 | * - look at http://members.inode.at/d.pissarenko/ | |
28 | * | |
29 | *****************************************************************************/ | |
30 | ||
31 | package net.sourceforge.demetrix.ui.balancesheets; | |
32 | ||
33 | import java.util.ArrayList; | |
34 | ||
35 | import javax.swing.JPanel; | |
36 | ||
37 | import javax.swing.JTable; | |
38 | ||
39 | import org.apache.log4j.Logger; | |
40 | ||
41 | import org.swixml.SwingEngine; | |
42 | ||
43 | /** | |
44 | * @author Dimitri Pissarenko | |
45 | * | |
46 | */ | |
47 | public class SwixMLBalanceSheetRenderer implements BalanceSheetRenderer { | |
48 | ||
49 | private Logger logger = Logger.getLogger(getClass()); | |
50 | public final static String UI_DEF_FILE_NAME="net/sourceforge/demetrix/ui/balancesheets/SwixMLBalanceSheetRenderer.xml"; | |
51 | public JPanel panel; | |
52 | ||
53 | public JTable outputsTable; | |
54 | ||
55 | public JTable inputsTable; | |
56 | ||
57 | 5 | private ArrayList inputs = null; |
58 | ||
59 | 5 | private ArrayList outputs = null; |
60 | ||
61 | 5 | public SwixMLBalanceSheetRenderer() { |
62 | ||
63 | try { | |
64 | ||
65 | 5 | this.panel = |
66 | (JPanel) (new SwingEngine(this)).render( | |
67 | ClassLoader.getSystemClassLoader().getResource(UI_DEF_FILE_NAME)); | |
68 | ||
69 | 0 | } catch (Exception exception) { |
70 | ||
71 | this.logger.error("", exception); | |
72 | ||
73 | 5 | } |
74 | ||
75 | 5 | } |
76 | ||
77 | public JPanel getPanel() { | |
78 | ||
79 | 5 | return panel; |
80 | ||
81 | } | |
82 | ||
83 | /* (non-Javadoc) | |
84 | * @see net.sourceforge.demetrix.ui.balancesheets.BalanceSheetRenderer#render() | |
85 | */ | |
86 | ||
87 | public void render() { | |
88 | 1 | this.inputsTable.setModel(new BalanceSheetTableModel(inputs)); |
89 | ||
90 | 1 | this.outputsTable.setModel(new BalanceSheetTableModel(outputs)); |
91 | ||
92 | 1 | } |
93 | ||
94 | /** | |
95 | * @return | |
96 | */ | |
97 | ||
98 | public ArrayList getOutputs() { | |
99 | ||
100 | 1 | return outputs; |
101 | ||
102 | } | |
103 | ||
104 | /** | |
105 | * @param list | |
106 | */ | |
107 | ||
108 | public void setOutputs(ArrayList list) { | |
109 | ||
110 | 2 | outputs = list; |
111 | ||
112 | 2 | } |
113 | ||
114 | /** | |
115 | * @return | |
116 | */ | |
117 | ||
118 | public ArrayList getInputs() { | |
119 | ||
120 | 1 | return inputs; |
121 | ||
122 | } | |
123 | ||
124 | /** | |
125 | * @param list | |
126 | */ | |
127 | ||
128 | public void setInputs(ArrayList list) { | |
129 | ||
130 | 2 | inputs = list; |
131 | ||
132 | 2 | } |
133 | ||
134 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |