/** * 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; }
/** Undo된 Move의 위치에 따라서 다이어그램 내의 다른 LifeLine의 위치를 조정한다. void */ private void unSetLifeLineLayout() { LifeLineNode lifeLineNode; LifeLineNode otherLifeLineNode; for (int i = 0; i < lifeLineNodeList.size(); i++) { lifeLineNode = (LifeLineNode) lifeLineNodeList.get(i); if (node.equals(lifeLineNode)) { for (int k = i + 1; k < lifeLineNodeList.size(); k++) { otherLifeLineNode = (LifeLineNode) lifeLineNodeList.get(k); otherLifeLineNode.setX(otherLifeLineNode.getX() - (newX - oldX)); } break; } } }
/** Move 되는 위치에 따라서 다이어그램 내의 다른 LifeLine의 위치를 조정한다. void */ private void setLifeLineLayout() { LifeLineNode lifeLineNode; LifeLineNode otherLifeLineNode; for (int i = 0; i < lifeLineNodeList.size(); i++) { lifeLineNode = (LifeLineNode) lifeLineNodeList.get(i); if (node.equals(lifeLineNode)) { for (int k = i + 1; k < lifeLineNodeList.size(); k++) { otherLifeLineNode = (LifeLineNode) lifeLineNodeList.get(k); otherLifeLineNode.setX(otherLifeLineNode.getX() + (newX - oldX)); } break; } } layoutCombinedFragment(SequenceUtil.getOnlyCombindFragmentNodeList(diagram.getNodeList())); }