Beispiel #1
0
 @Override
 public Object getData(SkillFacade obj, int column) {
   if (selectionModel.isSelectionEmpty()) {
     switch (column) {
       case 0:
       case 1:
       case 4:
         return 0;
       case 2:
         return 0.0;
       case 3:
       case 5:
         return null;
       case 6:
         return obj.getSource();
       default:
         return null;
     }
   }
   int index = selectionModel.getMinSelectionIndex();
   CharacterLevelFacade level = levels.getElementAt(index);
   SkillBreakdown skillBreakdown = levels.getSkillBreakdown(level, obj);
   switch (column) {
     case 0:
       return skillBreakdown.total;
     case 1:
       return skillBreakdown.modifier;
     case 2:
       return skillBreakdown.ranks;
     case 3:
       return levels.getSkillCost(level, obj) == SkillCost.CLASS
           ? LanguageBundle.getString("in_yes")
           : //$NON-NLS-1$
           LanguageBundle.getString("in_no"); // $NON-NLS-1$
     case 4:
       return levels.getSkillCost(level, obj).getCost();
     case 5:
       return character.getInfoFactory().getDescription(obj);
     case 6:
       return obj.getSource();
     default:
       return null;
   }
 }
Beispiel #2
0
 @Override
 @SuppressWarnings("unchecked")
 public List<TreeViewPath<SkillFacade>> getPaths(SkillFacade pobj) {
   TreeViewPath<SkillFacade> path;
   switch (this) {
     case NAME:
       path = new TreeViewPath<SkillFacade>(pobj);
       break;
     case TYPE_NAME:
       path = createTreeViewPath(pobj, pobj.getDisplayType());
       break;
     case KEYSTAT_NAME:
       path = new TreeViewPath<SkillFacade>(pobj, pobj.getKeyStat());
       break;
     case KEYSTAT_TYPE_NAME:
       path = createTreeViewPath(pobj, pobj.getKeyStat(), pobj.getDisplayType());
       break;
     default:
       throw new InternalError();
   }
   return Arrays.asList(path);
 }
Beispiel #3
0
 @Override
 @SuppressWarnings("unchecked")
 public List<TreeViewPath<SkillFacade>> getPaths(SkillFacade pobj) {
   List<Object> path = new ArrayList<Object>();
   int index = selectionModel.getMinSelectionIndex();
   if (index >= 0) {
     CharacterLevelFacade level = levels.getElementAt(index);
     path.add(levels.getSkillCost(level, pobj));
   }
   path.add(pobj.getDisplayType());
   return Arrays.asList(createTreeViewPath(pobj, path.toArray()));
   //
   //			return Arrays.asList(
   //					new TreeViewPath<SkillFacade>(pobj,
   //												  null,
   //												  pobj.getType()));
 }