コード例 #1
0
  /**
   * isFirtLifelineNodeFromFragment
   *
   * @param fragmentNode
   * @return boolean
   */
  private boolean isFirtLifelineNodeFromFragment(NotationNode fragmentNode) {
    List<LifeLineNode> list = new ArrayList<LifeLineNode>();
    List<AbstractNode> nodeList = diagram.getNodeList();

    CombinedFragment combindFragment = (CombinedFragment) fragmentNode.getUmlModel();
    EList<Lifeline> coveredsLifeline = combindFragment.getCovereds();
    for (Lifeline lifeline : coveredsLifeline) {
      for (AbstractNode abstractNode : nodeList) {
        if (abstractNode instanceof LifeLineNode && lifeline.equals(abstractNode.getUmlModel())) {
          if (list.size() == 0) {
            list.add((LifeLineNode) abstractNode);
          } else {
            if (list.get(0).getX() > abstractNode.getX()) {
              list.add(0, (LifeLineNode) abstractNode);
            } else {
              list.add((LifeLineNode) abstractNode);
            }
          }
        }
      }
    }

    if (node.equals(list.get(0))) {
      return true;
    }

    return false;
  }
コード例 #2
0
 /**
  * isResizeFragment
  *
  * @param fragmentNode
  * @return boolean
  */
 private boolean isResizeFragment(NotationNode fragmentNode) {
   CombinedFragment combindFragment = (CombinedFragment) fragmentNode.getUmlModel();
   if (combindFragment.getCovereds().contains(node.getUmlModel())) {
     if (!isFirtLifelineNodeFromFragment(fragmentNode)) {
       return true;
     }
   }
   return false;
 }