KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmfClientComponents > gui > VisualIpAddressData


1 package ist.coach.coachEmfClientComponents.gui;
2
3 import javax.swing.ImageIcon JavaDoc;
4
5 import intt.itu.itut_x780.ManagedObjectValueType;
6 import ist.coach.coachEmsMib.IpAddressDataValueType;
7 import ist.coach.coachEmfClientComponents.InvokeSetData;
8
9 import ist.coach.coachEmfCommon.Utils;
10 public class VisualIpAddressData
11 extends MOTreeObject {
12
13     static String JavaDoc[] subordinate_names = new String JavaDoc[0];
14
15     static boolean canRefresh = false;
16     static String JavaDoc object_type = "IpAddressData";
17     static String JavaDoc emsClassName = "ist.coach.coachEmsMib.IpAddressData_F";
18
19     static String JavaDoc DISPLAY_TYPE = "IP Address Data";
20
21     //
22
// create arguments
23
//
24
static String JavaDoc[] create_arg_name = new String JavaDoc[0];
25     static String JavaDoc[] create_arg_editor = new String JavaDoc[0];
26     static String JavaDoc[] create_arg_renderer = new String JavaDoc[0];
27     //
28
// get/set arguments
29
//
30

31     static String JavaDoc[] attributes_name = { //ManagedObject
32
"Name",
33                                         "Element Type",
34                                         "Creation Source",
35                                         "Delete Policy",
36                                             //IpAddressData
37
"IP Address",
38                                         "Logical Interface Index",
39                                         "Subnet Mask",
40                                         "Least Significant Bit of Broadcast Address",
41                                         "Max Re-assemble Size"
42                     };
43
44      static boolean[] attributes_readonly = {
45                           //ManagedObject
46
false,
47                     false,
48                     false,
49                     false,
50                           //IpAddressData
51
false,
52                     false,
53                     false,
54                     false,
55                     false
56     };
57
58     public VisualIpAddressData(String JavaDoc key) {
59         super(key);
60         leafIcon = new ImageIcon JavaDoc(VisualIpAddressData.class.getResource(
61                 "images/ipaddressdata_icon.gif"));
62         nodeIcon = new ImageIcon JavaDoc(VisualIpAddressData.class.getResource(
63                 "images/ipaddressdata_icon.gif"));
64          toolTipText = new String JavaDoc(DISPLAY_TYPE);
65     }
66
67     public Object JavaDoc[] translate_values(ManagedObjectValueType original_value_type) {
68
69         Object JavaDoc[] values = new Object JavaDoc[attributes_name.length];
70         for (int i = 0; i < values.length; i++)
71             values[i] = "unspecified";
72
73         if (original_value_type == null)
74             return values;
75
76         Object JavaDoc[] mo_values = super.translate_values(original_value_type);
77         int i = 0;
78         for (i = 0; i < mo_values.length; i++)
79             values[i] = mo_values[i];
80
81         IpAddressDataValueType value_type;
82         value_type = (IpAddressDataValueType) original_value_type;
83
84         if (value_type.ipAdEntAddr != null && value_type.ipAdEntAddr.length > 0)
85           values[i] = new String JavaDoc(value_type.ipAdEntAddr);
86         i++;
87
88         values[i++] = String.valueOf(value_type.ipAdEntIfIndex);
89
90         if (value_type.ipAdEntNetMask != null && value_type.ipAdEntNetMask.length > 0)
91           values[i] = new String JavaDoc(value_type.ipAdEntNetMask);
92         i++;
93
94         switch(value_type.ipAdEntBcastAddr) {
95         case 1:
96             values[i++] = new String JavaDoc("Internet standard all-ones");
97             break;
98         default:
99             values[i++] = String.valueOf(value_type.ipAdEntBcastAddr);
100             break;
101         }
102         if (value_type.ipAdEntReasmMaxSize > 0)
103           values[i++] = String.valueOf(value_type.ipAdEntReasmMaxSize);
104
105         return values;
106     }
107
108     java.util.Vector JavaDoc translate_updates(java.util.Hashtable JavaDoc values) {
109
110         return new java.util.Vector JavaDoc();
111     }
112 }
113
Popular Tags