All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.joinedworkz.common.DiagramCartridge Maven / Gradle / Ivy

package org.joinedworkz.common;

import org.eclipse.xtext.xbase.lib.Extension;
import org.joinedworkz.common.generator.CmnDiagramGenerator;
import org.joinedworkz.common.helper.CmnModelHelper;
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 {
  @Extension
  protected CmnModelHelper cmnModelHelper = new CmnModelHelper();

  @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) {
    new CmnDiagramGenerator(model, diagramOutlet).generateDiagram();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy