use of net.sf.sdedit.util.Direction in project abstools by abstools.
the class MessageToSelf method updateView.
@Override
public void updateView() {
getDiagram().getPaintDevice().announce(getConfiguration().getSpaceBeforeActivation() + Arrow.getInnerHeight(this) + diagram.arrowSize / 2);
extendLifelines(getConfiguration().getSpaceBeforeSelfMessage());
Direction align = getCallee().getDirection();
if (align == Direction.CENTER) {
// This is true for instantly returning self-messages directed onto
// the root lifeline
align = Direction.RIGHT;
}
Arrow arrow = new LoopArrow(this, ArrowStroke.SOLID, align, v());
setArrow(arrow);
extendLifelines(arrow.getInnerHeight());
getCallee().setActive(true);
getDiagram().getPaintDevice().addSequenceElement(arrow);
}
use of net.sf.sdedit.util.Direction in project abstools by abstools.
the class AnswerToSelf method updateView.
public void updateView() {
getDiagram().getPaintDevice().announce(getConfiguration().getSpaceBeforeAnswerToSelf() + Arrow.getInnerHeight(this) + diagram.arrowSize / 2);
getDiagram().getFragmentManager().finishFragmentsNotIncluding(this);
extendLifelines(getConfiguration().getSpaceBeforeAnswerToSelf());
Direction align = getCaller().getDirection();
Arrow arrow = new LoopArrow(this, ArrowStroke.DASHED, align, v());
arrow.setVisible(getText().length() > 0 || diagram.returnArrowVisible);
setArrow(arrow);
getDiagram().getPaintDevice().addSequenceElement(arrow);
terminate();
extendLifelines(arrow.getInnerHeight());
}
use of net.sf.sdedit.util.Direction in project abstools by abstools.
the class Arrow method computeLayoutInformation.
/**
* @see net.sf.sdedit.drawable.Drawable#computeLayoutInformation()
*/
public void computeLayoutInformation() {
int left = getLeftEndpoint().getLeft() + getLeftEndpoint().getWidth();
int right = getRightEndpoint().getLeft();
Direction align = getAlign();
if (align == Direction.LEFT) {
left = left + space;
} else {
right = right - space;
}
setLeft(left);
setWidth(Math.max(getWidth(), right - left));
int x_from = align == Direction.LEFT ? getLeft() + getWidth() : getLeft();
int x_to = align == Direction.LEFT ? getLeft() : getLeft() + getWidth();
int sgn = align == Direction.LEFT ? 1 : -1;
int text_x = sgn == 1 ? x_from - diagram.messagePadding - textWidth() - rightPadding() : x_from + diagram.messagePadding + leftPadding();
int v = getTop() + textHeight() + diagram.messageLabelSpace;
pts = new Point[2];
pts[0] = new Point(x_from, v);
pts[1] = new Point(x_to, v);
textPoint = new Point(text_x, v - diagram.messageLabelSpace);
}
use of net.sf.sdedit.util.Direction in project abstools by abstools.
the class Primitive method updateView.
public void updateView() {
if (!isVoid()) {
getDiagram().getPaintDevice().announce(getConfiguration().getSpaceBeforeActivation() + Arrow.getInnerHeight(this));
if (!(getCaller().isAlwaysActive())) {
extendLifelines(getConfiguration().getSpaceBeforeActivation());
}
}
getCaller().setActive(true);
if (!isVoid()) {
final Direction direction = getCaller().getDirection() == Direction.LEFT ? Direction.LEFT : Direction.RIGHT;
final Arrow arrow = new Arrow(this, ArrowStroke.NONE, direction, v());
setArrow(arrow);
getDiagram().getPaintDevice().addSequenceElement(arrow);
extendLifelines(arrow.getInnerHeight());
}
}