1 package ist.coach.coachEmfClientComponents.gui; 2 3 import javax.swing.ImageIcon ; 4 5 import intt.itu.itut_x780.ManagedObjectValueType; 6 import intt.itu.itut_x780.AdministrativeStateType; 7 import intt.itu.itut_x780.OperationalStateType; 8 import intt.itu.itut_x780.UsageStateType; 9 import ist.coach.coachEmsMib.IpToMACAddressValueType; 10 import ist.coach.coachEmfClientComponents.InvokeSetData; 11 12 import ist.coach.coachEmfCommon.Utils; 13 public class VisualIpToMACAddress 14 extends MOTreeObject { 15 16 static String [] subordinate_names = new String [0]; 17 19 static String object_type = "IpToMACAddress"; 22 static String emsClassName = "ist.coach.coachEmsMib.IpToMACAddress_F"; 23 24 static String DISPLAY_TYPE = "Logical Interface"; 25 static boolean canRefresh = false; 26 static String [] create_arg_name = new String [0]; 30 static String [] create_arg_editor = new String [0]; 31 static String [] create_arg_renderer = new String [0]; 32 36 static String [] attributes_name = { "Name", 38 "Element Type", 39 "Creation Source", 40 "Delete Policy", 41 "Logical Interface Index", 43 "Media-dependent Physical Address", 44 "Corresponding IP Address", 45 "Type of Mapping", 46 47 }; 48 49 static boolean[] attributes_readonly = { 50 false, 51 false, 52 false, 53 false, 54 false, 55 false, 56 false, false, 58 59 }; 60 61 62 public VisualIpToMACAddress(String key) { 63 64 super(key); 65 leafIcon = new ImageIcon (VisualIpToMACAddress.class.getResource( 66 "images/iptomacaddress_icon.gif")); 67 nodeIcon = new ImageIcon (VisualIpToMACAddress.class.getResource( 68 "images/iptomacaddress_icon.gif")); 69 toolTipText = new String (DISPLAY_TYPE); 70 71 72 } 73 74 public Object [] translate_values(ManagedObjectValueType original_value_type) { 75 76 Object [] values = new Object [attributes_name.length]; 77 for (int i = 0; i < values.length; i++) 78 values[i] = "unspecified"; 79 80 if (original_value_type == null) 81 return values; 82 83 Object [] mo_values = super.translate_values(original_value_type); 84 int i = 0; 85 for (i = 0; i < mo_values.length; i++) 86 values[i] = mo_values[i]; 87 88 IpToMACAddressValueType value_type; 89 value_type = (IpToMACAddressValueType) original_value_type; 90 91 95 if (value_type.ipNetToMediaIfIndex >= 0) 96 values[i] = String.valueOf(value_type.ipNetToMediaIfIndex); 97 i++; 98 99 if (value_type.ipNetToMediaPhysAddress != null && 100 value_type.ipNetToMediaPhysAddress.length > 0) { 101 102 104 String hexAddressStr = new String (); 105 String shortStr = new String (); 106 for (int j = 0; j < value_type.ipNetToMediaPhysAddress.length; j++) { 107 hexAddressStr += Integer.toHexString( 108 new Byte ((value_type.ipNetToMediaPhysAddress[j])).intValue() & 0x000000ff); 109 110 if (j < value_type.ipNetToMediaPhysAddress.length - 1) 111 hexAddressStr += ":"; 112 } 113 values[i] = hexAddressStr; 114 115 } 116 i++; 117 118 if (value_type.ipNetToMediaNetAddress != null && 119 value_type.ipNetToMediaNetAddress.length > 0) { 120 121 values[i] = new String (value_type.ipNetToMediaNetAddress); 122 } 123 i++; 124 125 switch(value_type.ipNetToMediaType) { 126 case 1 : 127 values[i] = "Other (neither invalid/dynamic/static)"; 128 break; 129 case 2 : 130 values[i] = "invalid"; 131 break; 132 case 3 : 133 values[i] = "dynamic"; 134 break; 135 case 4 : 136 values[i] = "static"; 137 break; 138 default: 139 values[i++] = new String ("Unknown"); 140 } 141 return values; 142 } 143 144 java.util.Vector translate_updates(java.util.Hashtable values) { 145 return new java.util.Vector (); 146 } 147 148 } 149 | Popular Tags |