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

net.sourceforge.plantuml.command.CommandAffineTransform Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.command;

import java.util.Collections;

import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf;
import net.sourceforge.plantuml.regex.RegexResult;
import net.sourceforge.plantuml.utils.LineLocation;

public class CommandAffineTransform extends SingleLineCommand2 {

	public static final CommandAffineTransform ME = new CommandAffineTransform();

	private CommandAffineTransform() {
		super(getRegexConcat());
	}

	static IRegex getRegexConcat() {
		return RegexConcat.build(CommandAffineTransform.class.getName(), RegexLeaf.start(), //
				new RegexLeaf("!transformation"), //
				RegexLeaf.spaceOneOrMore(), //
				new RegexLeaf("ANIMATION", "([^{}]*)"), RegexLeaf.end()); //
	}

	@Override
	protected CommandExecutionResult executeArg(UmlDiagram diagram, LineLocation location, RegexResult arg) {
		final CharSequence value = arg.get("ANIMATION", 0);
		// ::comment when __CORE__
		diagram.setAnimation(Collections.singletonList(value));
		return CommandExecutionResult.ok();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy