org.joinedworkz.common.DiagramCartridge Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-base Show documentation
Show all versions of common-base Show documentation
DSL based modeling framework - facilities common base
package org.joinedworkz.common;
import javax.inject.Inject;
import org.joinedworkz.common.generator.CmnDiagramGenerator;
import org.joinedworkz.common.helper.ScenarioHelper;
import org.joinedworkz.core.facility.AbstractCartridge;
import org.joinedworkz.core.facility.Outlet;
import org.joinedworkz.core.facility.Outlets;
import org.joinedworkz.core.model.CmnModel;
import org.joinedworkz.core.model.CmnObject;
@SuppressWarnings("all")
public class DiagramCartridge extends AbstractCartridge {
@Inject
protected ScenarioHelper scenarioHelper;
@Inject
protected CmnDiagramGenerator diagramGenerator;
@Override
public void apply(final CmnObject obj, final Outlets osa) {
final Outlet diagramOutlet = osa.get("generatedDiagram");
if ((obj instanceof CmnModel)) {
this.generateDiagram(((CmnModel)obj), diagramOutlet);
}
}
public void generateDiagram(final CmnModel model, final Outlet diagramOutlet) {
this.diagramGenerator.generateDiagram(model, diagramOutlet);
}
}