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

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

There is a newer version: 1.3.46
Show newest version
package org.joinedworkz.common;

import java.util.Properties;
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 cmnObj, final Outlets outlets) {
    this.apply(cmnObj, outlets, null);
  }

  @Override
  public void apply(final CmnObject obj, final Outlets outlets, final Properties properties) {
    final Outlet diagramOutlet = outlets.get("generatedDiagram");
    if ((obj instanceof CmnModel)) {
      this.generateDiagram(((CmnModel)obj), diagramOutlet, properties);
    }
  }

  public void generateDiagram(final CmnModel model, final Outlet diagramOutlet, final Properties properties) {
    this.diagramGenerator.generateDiagram(model, diagramOutlet, properties);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy