Exemplo n.º 1
0
 public SteedChitComponent(GameObject obj) {
   super(obj);
   try {
     lightColor = MagicRealmColor.getColor(getAttribute("trot", "chit_color"));
     darkColor = MagicRealmColor.getColor(getAttribute("gallop", "chit_color"));
   } catch (Exception ex) {
     System.out.println("problem with " + obj.getName() + ": " + ex);
   }
 }
 public Object getValueAt(int row, int col) {
   if (row < data.size()) {
     GameObject obj = (GameObject) data.get(row);
     switch (col) {
       case 0:
         return new Long(obj.getId());
       case 1:
         return obj.getName();
       case 2:
         GameObject hb = obj.getHeldBy();
         return hb == null ? "" : hb.toString();
       case 3:
         return new Integer(obj.getHoldCount());
       default:
         throw new IllegalArgumentException("Invalid column index");
     }
   }
   return null;
 }