예제 #1
0
  void updateClassType(AgeAbstractClassImprint classImprint, boolean abstr) {
    classImprint.setAbstract(abstr);

    for (ImprintTreeNode tn : nodeMap.get(classImprint)) {
      tn.updateType();
    }

    getData().setRoot(getData().getRoot());
  }
예제 #2
0
  void updateClassName(AgeAbstractClassImprint classImprint, String newName) {
    classImprint.setName(newName);

    for (ImprintTreeNode tn : nodeMap.get(classImprint)) {
      tn.setTitle(newName);
    }

    getData().setRoot(getData().getRoot());
  }
예제 #3
0
  private void addNodeToMap(ImprintTreeNode node) {
    Collection<ImprintTreeNode> coll = nodeMap.get(node.getClassImprint());

    if (coll == null) {
      coll = new ArrayList<ImprintTreeNode>(5);
      nodeMap.put(node.getClassImprint(), coll);
    }

    coll.add(node);
  }
예제 #4
0
  private void createTreeStructure(AgeAbstractClassImprint cls, ImprintTreeNode node) {
    addNodeToMap(node);

    if ((direction == Direction.PARENT2CHILD && cls.getChildren() == null)
        || (direction == Direction.CHILD2PARENT && cls.getParents() == null)) return;

    TreeNode[] children =
        new TreeNode
            [direction == Direction.PARENT2CHILD
                ? cls.getChildren().size()
                : cls.getParents().size()];

    int i = 0;
    for (AgeAbstractClassImprint subcls :
        direction == Direction.PARENT2CHILD ? cls.getChildren() : cls.getParents()) {
      ImprintTreeNode ctn = nodeCreator.create(subcls);
      children[i++] = ctn;

      createTreeStructure(subcls, ctn);
    }

    node.setChildren(children);
  }