Search in sources :

Example 6 with Arrow

use of net.sf.sdedit.drawable.Arrow 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());
    }
}
Also used : Arrow(net.sf.sdedit.drawable.Arrow) Direction(net.sf.sdedit.util.Direction)

Example 7 with Arrow

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

the class Answer method updateView.

public void updateView() {
    getDiagram().getFragmentManager().finishFragmentsNotIncluding(this);
    if (getCallee().isAlwaysActive()) {
        return;
    }
    ArrowStroke stroke;
    if (getText().equals("") && getCallee().isAlwaysActive()) {
        stroke = ArrowStroke.NONE;
    } else {
        stroke = ArrowStroke.DASHED;
    }
    Arrow arrow;
    getDiagram().getPaintDevice().announce(Arrow.getInnerHeight(this) + diagram.arrowSize / 2);
    if (getCaller().getPosition() < getCallee().getPosition()) {
        arrow = new Arrow(this, stroke, Direction.RIGHT, v());
    } else {
        arrow = new Arrow(this, stroke, Direction.LEFT, v());
    }
    arrow.setVisible(getText().length() > 0 || diagram.returnArrowVisible);
    setArrow(arrow);
    getDiagram().getPaintDevice().addSequenceElement(arrow);
    extendLifelines(arrow.getInnerHeight());
    if (!(getCaller().isAlwaysActive())) {
        terminate();
    }
}
Also used : ArrowStroke(net.sf.sdedit.drawable.ArrowStroke) Arrow(net.sf.sdedit.drawable.Arrow)

Example 8 with Arrow

use of net.sf.sdedit.drawable.Arrow 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)

Example 9 with Arrow

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

the class ConstructorMessage method updateView.

public void updateView() {
    int headHeight = getCallee().getHead().getHeight();
    getDiagram().getPaintDevice().announce(getConfiguration().getSpaceBeforeConstruction() + Math.max(0, Arrow.getInnerHeight(this) - headHeight / 2) + headHeight + getDiagram().getConfiguration().getInitialSpace());
    extendLifelines(getConfiguration().getSpaceBeforeConstruction());
    int s = 0;
    Arrow arrow;
    if (getCaller().getPosition() < getCallee().getPosition()) {
        arrow = new Arrow(this, ArrowStroke.SOLID, Direction.RIGHT, v());
    } else {
        arrow = new Arrow(this, ArrowStroke.SOLID, Direction.LEFT, v());
        s = 3;
    }
    setArrow(arrow);
    arrow.setSpace(s + getCallee().getHead().getWidth() / 2);
    // - getConfiguration().getMainLifelineWidth() / 2);
    getDiagram().getPaintDevice().addSequenceElement(arrow);
    int diff = arrow.getInnerHeight() - headHeight / 2;
    if (diff > 0) {
        extendLifelines(diff);
    }
    getCallee().getHead().setTop(v());
    extendLifelines(headHeight / 2);
    getCallee().giveBirth();
    getCallee().getView().setTop(v());
    getCallee().getView().setHeight(0);
    extendLifelines(headHeight / 2 + getDiagram().getConfiguration().getInitialSpace());
    if (isActivating()) {
        getCallee().setActive(true);
    }
}
Also used : Arrow(net.sf.sdedit.drawable.Arrow)

Aggregations

Arrow (net.sf.sdedit.drawable.Arrow)9 Direction (net.sf.sdedit.util.Direction)3 LoopArrow (net.sf.sdedit.drawable.LoopArrow)2 Point (java.awt.Point)1 Diagram (net.sf.sdedit.diagram.Diagram)1 Lifeline (net.sf.sdedit.diagram.Lifeline)1 ArrowStroke (net.sf.sdedit.drawable.ArrowStroke)1 BroadcastArrow (net.sf.sdedit.drawable.BroadcastArrow)1 Drawable (net.sf.sdedit.drawable.Drawable)1 Fragment (net.sf.sdedit.drawable.Fragment)1 PanelPaintDevice (net.sf.sdedit.ui.PanelPaintDevice)1