Search in sources :

Example 1 with Rectangle

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

the class Lifeline method toggleWaitingStatus.

public void toggleWaitingStatus() {
    if (!active) {
        throw new IllegalArgumentException("an inactive lifeline cannot change its waiting status");
    }
    waiting = !waiting;
    int y = view.getTop() + view.getHeight();
    if (waiting) {
        lastLine = new Line(1, this);
        lastLine.setLeft(view.getLeft() + view.getWidth() / 2);
        view = lastLine;
    } else {
        view = new Rectangle(computeDrawableWidth(), this);
    }
    view.setTop(y);
}
Also used : Line(net.sf.sdedit.drawable.Line) Rectangle(net.sf.sdedit.drawable.Rectangle)

Example 2 with Rectangle

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

the class Lifeline method setActive.

public void setActive(boolean active) {
    if (this.active == active) {
        return;
    }
    this.active = active;
    if (this != getRoot()) {
        if (active) {
            view.setTop(parent.getView().getTop() + parent.getView().getHeight());
            view.setHeight(0);
        } else {
            diagram.clearMnemonic(this);
        }
        return;
    }
    int y = view.getTop() + view.getHeight();
    if (active) {
        view = new Rectangle(computeDrawableWidth(), this);
    } else {
        // view = new Line(computeDrawableWidth(), this);
        view = new Line(1, this);
        diagram.clearMnemonic(this);
        lastLine = (Line) view;
    }
    view.setTop(y);
}
Also used : Line(net.sf.sdedit.drawable.Line) Rectangle(net.sf.sdedit.drawable.Rectangle)

Aggregations

Line (net.sf.sdedit.drawable.Line)2 Rectangle (net.sf.sdedit.drawable.Rectangle)2