use of com.ait.lienzo.client.core.shape.Group in project drools-wb by kiegroup.
the class BaseGuidedDecisionTreeShape method setupControls.
protected void setupControls() {
ctrlGroupDeleteIcon = setupControl(GuidedDecisionTreeResources.INSTANCE.images().ctrlDelete(), new Command() {
@Override
public void execute() {
shapesManager.deleteShape(BaseGuidedDecisionTreeShape.this);
}
});
ctrlGroupEditIcon = setupControl(GuidedDecisionTreeResources.INSTANCE.images().ctrlEdit(), new Command() {
@Override
public void execute() {
presenter.editModelNode(BaseGuidedDecisionTreeShape.this.getModelNode(), new Command() {
@Override
public void execute() {
updateLabels(BaseGuidedDecisionTreeShape.this);
BaseGuidedDecisionTreeShape.this.getLayer().batch();
}
private void updateLabels(final BaseGuidedDecisionTreeShape parent) {
parent.setNodeLabel(parent.getNodeLabel());
for (WiresBaseTreeNode child : parent.getChildren()) {
if (child instanceof BaseGuidedDecisionTreeShape) {
final BaseGuidedDecisionTreeShape cs = (BaseGuidedDecisionTreeShape) child;
cs.setNodeLabel(cs.getNodeLabel());
updateLabels(cs);
}
}
}
});
}
});
ctrlGroupCollapseIcon = setupControl(GuidedDecisionTreeResources.INSTANCE.images().ctrlCollapse(), new Command() {
@Override
public void execute() {
BaseGuidedDecisionTreeShape.this.collapse(new Command() {
@Override
public void execute() {
// Nothing to do when the animation completes
}
});
final List<Group> controls = new ArrayList<Group>() {
{
add(ctrlGroupDeleteIcon);
add(ctrlGroupExpandIcon);
}
};
BaseGuidedDecisionTreeShape.this.setControls(controls);
}
});
ctrlGroupExpandIcon = setupControl(GuidedDecisionTreeResources.INSTANCE.images().ctrlExpand(), new Command() {
@Override
public void execute() {
BaseGuidedDecisionTreeShape.this.expand(new Command() {
@Override
public void execute() {
// Nothing to do when the animation completes
}
});
final List<Group> controls = new ArrayList<Group>() {
{
add(ctrlGroupDeleteIcon);
add(ctrlGroupEditIcon);
add(ctrlGroupCollapseIcon);
}
};
BaseGuidedDecisionTreeShape.this.setControls(controls);
}
});
controls.add(ctrlGroupDeleteIcon);
controls.add(ctrlGroupEditIcon);
}
Aggregations