Search in sources :

Example 1 with EntityPriorityConstraint

use of org.eclipse.zest.layouts.constraints.EntityPriorityConstraint in project archi by archimatetool.

the class SimpleNode method populateLayoutConstraint.

/**
 * Populate the specified layout constraint
 */
@Override
public void populateLayoutConstraint(LayoutConstraint constraint) {
    if (constraint instanceof LabelLayoutConstraint) {
        LabelLayoutConstraint labelConstraint = (LabelLayoutConstraint) constraint;
        labelConstraint.label = realObject.toString();
        labelConstraint.pointSize = 18;
    } else if (constraint instanceof BasicEntityConstraint) {
    // noop
    } else if (constraint instanceof EntityPriorityConstraint) {
        EntityPriorityConstraint priorityConstraint = (EntityPriorityConstraint) constraint;
        priorityConstraint.priority = Math.random() * 10 + 1;
    }
}
Also used : EntityPriorityConstraint(org.eclipse.zest.layouts.constraints.EntityPriorityConstraint) LabelLayoutConstraint(org.eclipse.zest.layouts.constraints.LabelLayoutConstraint) BasicEntityConstraint(org.eclipse.zest.layouts.constraints.BasicEntityConstraint)

Aggregations

BasicEntityConstraint (org.eclipse.zest.layouts.constraints.BasicEntityConstraint)1 EntityPriorityConstraint (org.eclipse.zest.layouts.constraints.EntityPriorityConstraint)1 LabelLayoutConstraint (org.eclipse.zest.layouts.constraints.LabelLayoutConstraint)1