use of org.talend.designer.core.ui.editor.subjobcontainer.sparkstreaming.SparkStreamingSubjobContainerFigure in project tdi-studio-se by Talend.
the class SubjobContainerPart method createFigure.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
*/
@Override
protected IFigure createFigure() {
SubjobContainer container = (SubjobContainer) this.getModel();
Boolean isDisplaySubjobs = (container).isDisplayed();
if (!isDisplaySubjobs) {
Figure figure = new FreeformLayer();
figure.setLayoutManager(new FreeformLayout());
return figure;
}
IProcess2 process = container.getProcess();
//$NON-NLS-1$
Object obj = process.getAdditionalProperties().get("FRAMEWORK");
SubjobContainerFigure subjobContainer = null;
if ("Spark Streaming".equals(obj) && !(process.getProperty().getItem() instanceof JobletProcessItem)) {
//$NON-NLS-1$
subjobContainer = new SparkStreamingSubjobContainerFigure(container);
} else {
subjobContainer = new SubjobContainerFigure(container);
}
return subjobContainer;
}
use of org.talend.designer.core.ui.editor.subjobcontainer.sparkstreaming.SparkStreamingSubjobContainerFigure in project tdi-studio-se by Talend.
the class SubjobContainerPart method propertyChange.
/*
* (non-Javadoc)
*
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/
@Override
public void propertyChange(PropertyChangeEvent evt) {
String prop = evt.getPropertyName();
if (SubjobContainer.UPDATE_SUBJOB_CONTENT.equals(prop)) {
refresh();
List<AbstractGraphicalEditPart> childrens = getChildren();
for (AbstractGraphicalEditPart part : childrens) {
part.refresh();
}
} else if (SubjobContainer.UPDATE_SUBJOB_CONNECTIONS.equals(prop)) {
refreshSourceConnections();
} else if (SubjobContainer.UPDATE_SUBJOB_TITLE_COLOR.equals(prop)) {
if (getFigure() instanceof SubjobContainerFigure) {
((SubjobContainerFigure) getFigure()).updateSubJobTitleColor();
refreshVisuals();
}
} else if (SubjobContainer.UPDATE_SUBJOB_DISPLAY.equals(prop)) {
List<NodeContainer> tmpList = new ArrayList<NodeContainer>(((SubjobContainer) getModel()).getNodeContainers());
((SubjobContainer) getModel()).getNodeContainers().clear();
refreshChildren();
List elems = ((Process) getParent().getModel()).getElements();
elems.remove(getModel());
EditPart parent = getParent();
parent.refresh();
((SubjobContainer) getModel()).getNodeContainers().addAll(tmpList);
elems.add(getModel());
parent.refresh();
} else if ("UPDATE_SPARKSTREAMING_STATUS".equals(prop)) {
if (getFigure() instanceof SparkStreamingSubjobContainerFigure) {
((SparkStreamingSubjobContainerFigure) getFigure()).updateData();
refreshVisuals();
}
} else {
// can only be UPDATE_SUBJOB_DATA, need to modify if some others are added
if (getFigure() instanceof SubjobContainerFigure) {
((SubjobContainerFigure) getFigure()).updateData();
refreshVisuals();
}
}
}
Aggregations