![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.descdiagram.DescriptionDiagram Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.descdiagram;
import java.util.Map;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.abel.Entity;
import net.sourceforge.plantuml.abel.LeafType;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.decoration.symbol.USymbol;
import net.sourceforge.plantuml.decoration.symbol.USymbols;
import net.sourceforge.plantuml.skin.UmlDiagramType;
public class DescriptionDiagram extends AbstractEntityDiagram {
public DescriptionDiagram(UmlSource source, Map skinParam) {
super(source, UmlDiagramType.DESCRIPTION, skinParam);
}
@Override
public String cleanId(String id) {
if (id == null)
return null;
if (id.startsWith("()"))
id = StringUtils.trin(id.substring(2));
if (id.startsWith(":") && id.endsWith(":/"))
return id.substring(1, id.length() - 2);
if (id.startsWith("(") && id.endsWith(")/"))
return id.substring(1, id.length() - 2);
return super.cleanId(id);
}
private boolean isUsecase() {
for (Entity leaf : getEntityFactory().leafs()) {
final LeafType type = leaf.getLeafType();
final USymbol usymbol = leaf.getUSymbol();
if (type == LeafType.USECASE || usymbol == getSkinParam().actorStyle().toUSymbol())
return true;
}
return false;
}
@Override
public void makeDiagramReady() {
super.makeDiagramReady();
final LeafType defaultType = LeafType.DESCRIPTION;
final USymbol defaultSymbol = isUsecase() ? getSkinParam().actorStyle().toUSymbol() : USymbols.INTERFACE;
for (Entity leaf : getEntityFactory().leafs())
if (leaf.getLeafType() == LeafType.STILL_UNKNOWN)
leaf.muteToType(defaultType, defaultSymbol);
}
@Override
public String checkFinalError() {
this.applySingleStrategy();
return super.checkFinalError();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy