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; | |
32 | ||
33 | import net.sourceforge.demetrix.properties.DemetrixPropertiesHolder; | |
34 | ||
35 | import org.jgraph.graph.DefaultGraphCell; | |
36 | ||
37 | /** | |
38 | * @author Dimitri Pissarenko | |
39 | * | |
40 | */ | |
41 | ||
42 | public class NodePropertiesPanel | |
43 | extends PropertiesPanel | |
44 | implements CurrentlySelectedNodeObserver { | |
45 | ||
46 | public NodePropertiesPanel() { | |
47 | ||
48 | 5 | super(); |
49 | ||
50 | 5 | CurrentlySelectedNodeSingleton.getInstance().attach(this); |
51 | ||
52 | 5 | } |
53 | ||
54 | /* (non-Javadoc) | |
55 | * @see net.sourceforge.demetrix.ui.CurrentlySelectedNodeObserver#currentlySelectedNodeChanged() | |
56 | */ | |
57 | ||
58 | public void currentlySelectedNodeChanged() { | |
59 | ||
60 | 25 | DefaultGraphCell cell = null; |
61 | ||
62 | 25 | cell = |
63 | CurrentlySelectedNodeSingleton | |
64 | .getInstance() | |
65 | .getCurrentlySelectedNode(); | |
66 | ||
67 | 25 | if ((cell!=null) && (cell.getUserObject()!=null) && (cell.getUserObject() instanceof DemetrixPropertiesHolder)) { |
68 | ||
69 | 11 | this.setPropertiesHolder( |
70 | (DemetrixPropertiesHolder) cell.getUserObject()); | |
71 | ||
72 | 11 | this.nodeLabel.setText( |
73 | CurrentlySelectedNodeSingleton | |
74 | .getInstance() | |
75 | .getCurrentlySelectedNode() | |
76 | .toString()); | |
77 | ||
78 | 11 | this.newPropertyButton.setEnabled(true); |
79 | ||
80 | 11 | this.updatePropertiesPanel(); |
81 | ||
82 | } else { | |
83 | ||
84 | 14 | this.nodeLabel.setText(""); |
85 | ||
86 | 14 | this.newPropertyButton.setEnabled(false); |
87 | ||
88 | } | |
89 | ||
90 | 25 | } |
91 | ||
92 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |