KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > ir > gui > remoteobject > ObjectRepresentant


1 /*
2  * JacORB - a free Java ORB
3  *
4  * Copyright (C) 1999-2004 Gerald Brose
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */

21 package org.jacorb.ir.gui.remoteobject;
22
23
24
25 import org.jacorb.ir.gui.typesystem.*;
26
27 import org.jacorb.ir.gui.typesystem.remote.*;
28
29 import javax.swing.tree.*;
30
31 import org.jacorb.ir.gui.typesystem.*;
32
33
34
35 /**
36
37  * This class was generated by a SmartGuide.
38
39  *
40
41  */

42
43
44
45 public class ObjectRepresentant extends ModelParticipant
46
47 {
48
49     protected Object JavaDoc counterPart;
50
51     // da können echte entfernte Objekte und lokale Objekte drinstecken
52

53     protected String JavaDoc name;
54
55     protected TypeSystemNode typeSystemNode;
56
57
58
59
60
61
62
63     /**
64
65      * This method was created by a SmartGuide.
66
67      * @param counterPart java.lang.Object
68
69      */

70
71     protected ObjectRepresentant (Object JavaDoc counterPart, TypeSystemNode type, String JavaDoc name) {
72
73     this.counterPart = counterPart;
74
75     if (name!=null) {
76
77             setName(name);
78
79     }
80
81     else {
82
83             setName("this");
84
85     }
86
87     typeSystemNode = type;
88
89     System.out.println(this+" value: "+value());
90
91     }
92
93     /**
94
95      * This method was created by a SmartGuide.
96
97      * @return int
98
99      * @param other org.jacorb.ir;.gui.typesystem.ModelParticipant
100
101      */

102
103     public int compareTo(ModelParticipant other) {
104
105     return this.toString().compareTo(other.toString());
106
107     }
108
109     /**
110
111      * This method was created by a SmartGuide.
112
113      * @return TreeModel
114
115      */

116
117     public TreeModel getTreeModel() {
118
119     return ModelBuilder.getSingleton().buildTreeModelAsync(this);
120
121     }
122
123     /**
124
125      * This method was created by a SmartGuide.
126
127      * @return org.jacorb.ir;.gui.typesystem.TypeSystemNode
128
129      */

130
131     public TypeSystemNode getTypeSystemNode() {
132
133     return typeSystemNode;
134
135     }
136
137     /**
138
139      * This method was created by a SmartGuide.
140
141      * @param name java.lang.String
142
143      */

144
145     protected void setName(String JavaDoc name) {
146
147     this.name = name;
148
149     }
150
151     /**
152
153      * This method was created by a SmartGuide.
154
155      * @return java.lang.String
156
157      */

158
159     public String JavaDoc toString() {
160
161     if (typeSystemNode!=null) { // kann null sein z.B. bei PIDLs
162

163             return typeSystemNode.getAbsoluteName() + " " + name;
164
165     }
166
167     else {
168
169             return name;
170
171     }
172
173     }
174
175     /**
176
177      * This method was created by a SmartGuide.
178
179      * @return java.lang.String
180
181      */

182
183     public String JavaDoc value() {
184
185     if (counterPart!=null) {
186
187             return counterPart.toString();
188
189     }
190
191     else {
192
193             return "nil";
194
195     }
196
197     }
198
199 }
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
Popular Tags