Search in sources :

Example 1 with BroadcastArrow

use of net.sf.sdedit.drawable.BroadcastArrow in project abstools by abstools.

the class BroadcastMessage method updateView.

@Override
public void updateView() {
    if (getData().getBroadcastType() == FIRST) {
        getDiagram().getPaintDevice().announce(getConfiguration().getSpaceBeforeActivation() + 3 + Arrow.getInnerHeight(this) + diagram.arrowSize / 2);
        extendLifelines(getConfiguration().getSpaceBeforeActivation() + 3);
    }
    Arrow arrow;
    if (getCaller().getPosition() < getCallee().getPosition()) {
        arrow = new BroadcastArrow(this, Direction.RIGHT, v());
    } else {
        arrow = new BroadcastArrow(this, Direction.LEFT, v());
    }
    setArrow(arrow);
    if (getData().getBroadcastType() == LAST) {
        extendLifelines(arrow.getInnerHeight());
        for (Lifeline callee : otherCallees) {
            if (!callee.isAlwaysActive() && isActivating()) {
                callee.setActive(true);
            }
        }
        if (!getCallee().isAlwaysActive() && isActivating()) {
            getCallee().setActive(true);
        }
    }
    getDiagram().getPaintDevice().addSequenceElement(arrow);
}
Also used : Arrow(net.sf.sdedit.drawable.Arrow) BroadcastArrow(net.sf.sdedit.drawable.BroadcastArrow) Lifeline(net.sf.sdedit.diagram.Lifeline) BroadcastArrow(net.sf.sdedit.drawable.BroadcastArrow)

Aggregations

Lifeline (net.sf.sdedit.diagram.Lifeline)1 Arrow (net.sf.sdedit.drawable.Arrow)1 BroadcastArrow (net.sf.sdedit.drawable.BroadcastArrow)1