use of org.uberfire.ext.wires.core.api.events.ClearEvent in project drools-wb by kiegroup.
the class GuidedDecisionTreeWidget method setModel.
public void setModel(final GuidedDecisionTree model, final boolean isReadOnly) {
this.uiRoot = null;
this.model = model;
// Clear existing state
super.clear();
clearEvent.fire(new ClearEvent());
// Walk model creating UIModel
final TypeNode root = model.getRoot();
if (root != null) {
final WiresBaseTreeNode uiRoot = typeNodeFactory.getShape(root, isReadOnly);
this.uiRoot = uiRoot;
processChildren(root, uiRoot, isReadOnly);
final Map<WiresBaseShape, Point2D> layout = layoutManager.getLayoutInformation(uiRoot);
final Rectangle2D canvasBounds = WiresLayoutUtilities.alignLayoutInCanvas(layout);
for (Map.Entry<WiresBaseShape, Point2D> e : layout.entrySet()) {
final Point2D destination = new Point2D(e.getValue().getX(), e.getValue().getY());
e.getKey().setLocation(destination);
}
WiresLayoutUtilities.resizeViewPort(canvasBounds, canvasLayer.getViewport());
}
if (shapesInCanvas.isEmpty()) {
showGettingStartedHint();
}
canvasLayer.batch();
}
use of org.uberfire.ext.wires.core.api.events.ClearEvent in project drools-wb by kiegroup.
the class GuidedDecisionTreeWidget method clear.
@Override
public void clear() {
if (Window.confirm(GuidedDecisionTreeConstants.INSTANCE.confirmDeleteDecisionTree())) {
super.clear();
clearEvent.fire(new ClearEvent());
uiRoot = null;
}
}
Aggregations