Пример #1
0
 private void initChildren() {
   types.clear();
   types.addAll(maxMap.getKeys());
   Collections.sort(types, Comparators.toStringIgnoreCaseCollator());
   removeAllChildren();
   for (String key : types) {
     CompanionTypeNode child = new CompanionTypeNode(key);
     add(child);
   }
   for (CompanionFacade companion : companions) {
     addCompanion(companion, true);
   }
 }
Пример #2
0
 @Override
 public void keyAdded(MapEvent<String, Integer> e) {
   int insertIndex =
       Collections.binarySearch(types, e.getKey(), Comparators.toStringIgnoreCaseCollator());
   if (insertIndex < 0) {
     insertIndex = -(insertIndex + 1);
   }
   types.add(insertIndex, e.getKey());
   CompanionTypeNode child = new CompanionTypeNode(e.getKey());
   insertNodeInto(child, this, insertIndex);
 }
Пример #3
0
 @Override
 public void valueChanged(MapEvent<String, Integer> e) {
   int index = types.indexOf(e.getKey());
   nodeChanged(getChildAt(index));
 }
Пример #4
0
 @Override
 public void keyRemoved(MapEvent<String, Integer> e) {
   int index = types.indexOf(e.getKey());
   types.remove(index);
   removeNodeFromParent((MutableTreeNode) getChildAt(index));
 }