Search in sources :

Example 1 with LabelLayoutConstraint

use of org.eclipse.zest.layouts.constraints.LabelLayoutConstraint 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)

Example 2 with LabelLayoutConstraint

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

the class SimpleRelationship method populateLayoutConstraint.

/**
 * Populate the specified layout constraint
 */
@Override
public void populateLayoutConstraint(LayoutConstraint constraint) {
    if (constraint instanceof LabelLayoutConstraint) {
        LabelLayoutConstraint labelConstraint = (LabelLayoutConstraint) constraint;
        labelConstraint.label = this.label;
        labelConstraint.pointSize = 18;
    } else if (constraint instanceof BasicEdgeConstraints) {
    // noop
    }
}
Also used : BasicEdgeConstraints(org.eclipse.zest.layouts.constraints.BasicEdgeConstraints) LabelLayoutConstraint(org.eclipse.zest.layouts.constraints.LabelLayoutConstraint)

Aggregations

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