net.sourceforge.plantuml.project.command.CommandNoteBottom 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.project.command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.klimt.creole.Display;
import net.sourceforge.plantuml.project.GanttDiagram;
import net.sourceforge.plantuml.utils.BlocLines;
public class CommandNoteBottom extends CommandMultilines {
public CommandNoteBottom() {
super("^note[%s]*bottom$");
}
@Override
public String getPatternEnd() {
return "^end[%s]*note$";
}
public CommandExecutionResult execute(GanttDiagram diagram, BlocLines lines) throws NoSuchColorException {
lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns();
final Display strings = lines.toDisplay();
if (strings.size() > 0) {
return diagram.addNote(strings);
}
return CommandExecutionResult.error("No note defined");
}
}