use of net.sf.sdedit.message.AnswerToSelf in project abstools by abstools.
the class LoopArrow method init.
private void init() {
Message message = getMessage();
Configuration conf = message.getConfiguration();
xExtent = conf.getSelfMessageHorizontalSpace();
setWidth(diagram.messagePadding + xExtent + diagram.subLifelineWidth + textWidth());
isAnswer = message instanceof AnswerToSelf;
from = message.getCaller().getView();
to = message.getCallee().getView();
if (getAlign() == Direction.LEFT) {
// loop arrows on the left must have a left neighbour
setLeftEndpoint(message.getCallee().getLeftNeighbour().getView());
if (message.getCaller().getSideLevel() < message.getCallee().getSideLevel()) {
setRightEndpoint(message.getCaller().getView());
} else {
setRightEndpoint(message.getCallee().getView());
}
} else {
int p = message.getCallee().getPosition();
if (p < message.getDiagram().getNumberOfLifelines() - 1 && message.getDiagram().getLifelineAt(p + 1).isAlive()) {
setRightEndpoint(message.getCallee().getRightNeighbour().getView());
} else {
setRightEndpoint(message.getDiagram().getPaintDevice().getRightBound());
}
if (message.getCaller().getSideLevel() < message.getCallee().getSideLevel()) {
setLeftEndpoint(message.getCaller().getView());
} else {
setLeftEndpoint(message.getCallee().getView());
}
}
}
Aggregations