示例#1
0
        private static JarRunner CreateJarRunner(PlantUmlSettings settings)
        {
            IJavaLocator javaLocator      = CreateJavaLocator(settings);
            string       installationPath = javaLocator.GetJavaInstallationPath();

            return(new JarRunner(installationPath, settings.LocalPlantUmlPath));
        }
示例#2
0
 private static IJavaLocator CreateJavaLocator(PlantUmlSettings settings)
 {
     if (string.IsNullOrWhiteSpace(settings.JavaPath))
     {
         return(new EnvironmentJavaLocator());
     }
     else
     {
         return(new ExplicitJavaLocator(settings.JavaPath));
     }
 }
示例#3
0
        public IPlantUmlRenderer CreateRenderer(PlantUmlSettings settings)
        {
            switch (settings.RenderingMode)
            {
            case RenderingMode.Remote:

                UrlFormatMap urlFormatMap = new UrlFormatMap(settings.RemoteUrl);
                return(new RemotePlantUmlRenderer(urlFormatMap));

            case RenderingMode.Local:

                JarRunner            jarRunner       = CreateJarRunner(settings);
                LocalCommandProvider commandProvider = new LocalCommandProvider(settings.LocalGraphvizDotPath);
                return(new LocalPlantUmlRenderer(jarRunner, commandProvider));

            default:
                throw new ArgumentException("invalid rendering mode", nameof(settings.RenderingMode));
            }
        }