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());
}
}
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();
}
}
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);
}
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);
}
}
Aggregations