当前位置: 首页>>代码示例>>Java>>正文


Java Link.getInv方法代码示例

本文整理汇总了Java中net.sourceforge.plantuml.cucadiagram.Link.getInv方法的典型用法代码示例。如果您正苦于以下问题:Java Link.getInv方法的具体用法?Java Link.getInv怎么用?Java Link.getInv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sourceforge.plantuml.cucadiagram.Link的用法示例。


在下文中一共展示了Link.getInv方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executePackageLink

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
private CommandExecutionResult executePackageLink(DescriptionDiagram diagram, RegexResult arg) {
	final IEntity cl1 = diagram.getGroup(Code.of(arg.get("ENT1", 0)));
	final IEntity cl2 = diagram.getGroup(Code.of(arg.get("ENT2", 0)));

	final LinkType linkType = getLinkType(arg);
	final Direction dir = getDirection(arg);
	final String queue;
	if (dir == Direction.LEFT || dir == Direction.RIGHT) {
		queue = "-";
	} else {
		queue = getQueue(arg);
	}

	Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(arg.get("LABEL_LINK", 0)), queue.length());
	if (dir == Direction.LEFT || dir == Direction.UP) {
		link = link.getInv();
	}
	CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
	diagram.addLink(link);
	return CommandExecutionResult.ok();
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:22,代码来源:CommandLinkElement.java

示例2: executePackageLink

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
private CommandExecutionResult executePackageLink(DescriptionDiagram diagram, RegexResult arg) {
	final IEntity cl1 = diagram.getGroup(Code.of(arg.get("ENT1", 0)));
	final IEntity cl2 = diagram.getGroup(Code.of(arg.get("ENT2", 0)));

	final LinkType linkType = getLinkType(arg);
	final Direction dir = getDirection(arg);
	final String queue;
	if (dir == Direction.LEFT || dir == Direction.RIGHT) {
		queue = "-";
	} else {
		queue = getQueue(arg);
	}

	Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(arg.get("LABEL_LINK", 0)), queue.length());
	if (dir == Direction.LEFT || dir == Direction.UP) {
		link = link.getInv();
	}
	diagram.addLink(link);
	return CommandExecutionResult.ok();
}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:21,代码来源:CommandLinkElement.java

示例3: executeArg

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
@Override
protected CommandExecutionResult executeArg(DescriptionDiagram diagram, RegexResult arg) {
	final Code ent1 = Code.of(arg.get("ENT1", 0));
	final Code ent2 = Code.of(arg.get("ENT2", 0));

	if (diagram.isGroup(ent1) && diagram.isGroup(ent2)) {
		return executePackageLink(diagram, arg);
	}

	final IEntity cl1 = diagram.isGroup(ent1) ? diagram.getGroup(Code.of(arg.get("ENT1", 0))) : getOrCreateLeaf(
			diagram, ent1);
	final IEntity cl2 = diagram.isGroup(ent2) ? diagram.getGroup(Code.of(arg.get("ENT2", 0))) : getOrCreateLeaf(
			diagram, ent2);

	// if (arg.get("ENT1", 1) != null) {
	// cl1.setStereotype(new Stereotype(arg.get("ENT1", 1)));
	// }
	// if (arg.get("ENT2", 1) != null) {
	// cl2.setStereotype(new Stereotype(arg.get("ENT2", 1)));
	// }

	final LinkType linkType = getLinkType(arg);
	final Direction dir = getDirection(arg);
	final String queue;
	if (dir == Direction.LEFT || dir == Direction.RIGHT) {
		queue = "-";
	} else {
		queue = getQueue(arg);
	}

	final Labels labels = new Labels(arg);

	Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(labels.labelLink), queue.length(),
			labels.firstLabel, labels.secondLabel, diagram.getLabeldistance(), diagram.getLabelangle());

	if (dir == Direction.LEFT || dir == Direction.UP) {
		link = link.getInv();
	}
	Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
	colors = CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors);
	if (arg.get("STEREOTYPE", 0) != null) {
		final Stereotype stereotype = new Stereotype(arg.get("STEREOTYPE", 0));
		colors = colors.applyStereotype(stereotype, diagram.getSkinParam(), ColorParam.componentArrow);
	}

	link.setColors(colors);
	diagram.addLink(link);
	return CommandExecutionResult.ok();
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:50,代码来源:CommandLinkElement.java

示例4: executeArg

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
@Override
protected CommandExecutionResult executeArg(ActivityDiagram system, RegexResult arg) {
	final IEntity entity1 = CommandLinkActivity.getEntity(system, arg, true);
	if (entity1 == null) {
		return CommandExecutionResult.error("No if possible at this point");
	}

	final String ifCode;
	final String ifLabel;
	if (arg.get("IF2", 0) == null) {
		ifCode = arg.get("IF1", 1);
		ifLabel = arg.get("IF1", 0);
	} else {
		ifCode = null;
		ifLabel = arg.get("IF2", 0);
	}
	system.startIf(Code.of(ifCode));

	int lenght = 2;

	if (arg.get("ARROW", 0) != null) {
		final String arrow = StringUtils.manageArrowForCuca(arg.get("ARROW", 0));
		lenght = arrow.length() - 1;
	}

	final IEntity branch = system.getCurrentContext().getBranch();

	Link link = new Link(entity1, branch, new LinkType(LinkDecor.ARROW, LinkDecor.NONE),
			Display.getWithNewlines(arg.get("BRACKET", 0)), lenght, null, ifLabel, system.getLabeldistance(),
			system.getLabelangle());
	if (arg.get("ARROW", 0) != null) {
		final Direction direction = StringUtils.getArrowDirection(arg.get("ARROW", 0));
		if (direction == Direction.LEFT || direction == Direction.UP) {
			link = link.getInv();
		}
	}

	system.addLink(link);

	return CommandExecutionResult.ok();
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:42,代码来源:CommandIf.java

示例5: executeArg

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
@Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, RegexResult arg) {
	final IEntity entity1 = getEntity(diagram, arg, true);
	if (entity1 == null) {
		return CommandExecutionResult.error("No such activity");
	}
	if (arg.get("STEREOTYPE", 0) != null) {
		entity1.setStereotype(new Stereotype(arg.get("STEREOTYPE", 0)));
	}
	if (arg.get("BACKCOLOR", 0) != null) {
		entity1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet()
				.getColorIfValid(arg.get("BACKCOLOR", 0)));
	}

	final IEntity entity2 = getEntity(diagram, arg, false);
	if (entity2 == null) {
		return CommandExecutionResult.error("No such activity");
	}
	if (arg.get("BACKCOLOR2", 0) != null) {
		entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet()
				.getColorIfValid(arg.get("BACKCOLOR2", 0)));
	}
	if (arg.get("STEREOTYPE2", 0) != null) {
		entity2.setStereotype(new Stereotype(arg.get("STEREOTYPE2", 0)));
	}

	final Display linkLabel = Display.getWithNewlines(arg.get("BRACKET", 0));

	final String arrowBody1 = CommandLinkClass.notNull(arg.get("ARROW_BODY1", 0));
	final String arrowBody2 = CommandLinkClass.notNull(arg.get("ARROW_BODY2", 0));
	final String arrowDirection = CommandLinkClass.notNull(arg.get("ARROW_DIRECTION", 0));

	final String arrow = StringUtils.manageArrowForCuca(arrowBody1 + arrowDirection + arrowBody2 + ">");
	int lenght = arrow.length() - 1;
	if (arrowDirection.contains("*")) {
		lenght = 2;
	}

	LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE);
	if ((arrowBody1 + arrowBody2).contains(".")) {
		type = type.getDotted();
	}

	Link link = new Link(entity1, entity2, type, linkLabel, lenght);
	if (arrowDirection.contains("*")) {
		link.setConstraint(false);
	}
	final Direction direction = StringUtils.getArrowDirection(arrowBody1 + arrowDirection + arrowBody2 + ">");
	if (direction == Direction.LEFT || direction == Direction.UP) {
		link = link.getInv();
	}
	if (arg.get("URL", 0) != null) {
		final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
		final Url urlLink = urlBuilder.getUrl(arg.get("URL", 0));
		link.setUrl(urlLink);
	}

	CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
	diagram.addLink(link);

	return CommandExecutionResult.ok();

}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:64,代码来源:CommandLinkActivity.java

示例6: executeArg

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
@Override
protected CommandExecutionResult executeArg(StateDiagram diagram, RegexResult arg) {
	final String ent1 = arg.get("ENT1", 0);
	final String ent2 = arg.get("ENT2", 0);

	final IEntity cl1 = getEntityStart(diagram, ent1);
	if (cl1 == null) {
		return CommandExecutionResult.error("The state " + ent1
				+ " has been created in a concurrent state : it cannot be used here.");
	}
	final IEntity cl2 = getEntityEnd(diagram, ent2);
	if (cl2 == null) {
		return CommandExecutionResult.error("The state " + ent2
				+ " has been created in a concurrent state : it cannot be used here.");
	}

	if (arg.get("ENT1", 1) != null) {
		cl1.setStereotype(new Stereotype(arg.get("ENT1", 1)));
	}
	if (arg.get("ENT1", 2) != null) {
		cl1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT1", 2)));
	}
	if (arg.get("ENT2", 1) != null) {
		cl2.setStereotype(new Stereotype(arg.get("ENT2", 1)));
	}
	if (arg.get("ENT2", 2) != null) {
		cl2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT2", 2)));
	}

	String queue = arg.get("ARROW_BODY1", 0) + arg.get("ARROW_BODY2", 0);
	final Direction dir = getDirection(arg);

	if (dir == Direction.LEFT || dir == Direction.RIGHT) {
		queue = "-";
	}

	final int lenght = queue.length();

	final boolean crossStart = arg.get("ARROW_CROSS_START", 0) != null;
	final boolean circleEnd = arg.get("ARROW_CIRCLE_END", 0) != null;
	final LinkType linkType = new LinkType(circleEnd ? LinkDecor.ARROW_AND_CIRCLE : LinkDecor.ARROW,
			crossStart ? LinkDecor.CIRCLE_CROSS : LinkDecor.NONE);

	Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(arg.get("LABEL", 0)), lenght);
	if (dir == Direction.LEFT || dir == Direction.UP) {
		link = link.getInv();
	}
	CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
	diagram.addLink(link);

	return CommandExecutionResult.ok();
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:53,代码来源:CommandLinkState.java

示例7: executeArg

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
@Override
protected CommandExecutionResult executeArg(DescriptionDiagram diagram, RegexResult arg) {
	final Code ent1 = Code.of(arg.get("ENT1", 0));
	final Code ent2 = Code.of(arg.get("ENT2", 0));

	if (diagram.isGroup(ent1) && diagram.isGroup(ent2)) {
		return executePackageLink(diagram, arg);
	}
	// if (diagram.isGroup(ent1) || diagram.isGroup(ent2)) {
	// return CommandExecutionResult.error("Package can be only linked to other package");
	// }

	final IEntity cl1 = diagram.isGroup(ent1) ? diagram.getGroup(Code.of(arg.get("ENT1", 0))) : getOrCreateLeaf(
			diagram, ent1);
	final IEntity cl2 = diagram.isGroup(ent2) ? diagram.getGroup(Code.of(arg.get("ENT2", 0))) : getOrCreateLeaf(
			diagram, ent2);

	if (arg.get("ENT1", 1) != null) {
		cl1.setStereotype(new Stereotype(arg.get("ENT1", 1)));
	}
	if (arg.get("ENT2", 1) != null) {
		cl2.setStereotype(new Stereotype(arg.get("ENT2", 1)));
	}

	final LinkType linkType = getLinkType(arg);
	final Direction dir = getDirection(arg);
	final String queue;
	if (dir == Direction.LEFT || dir == Direction.RIGHT) {
		queue = "-";
	} else {
		queue = getQueue(arg);
	}

	final Labels labels = new Labels(arg);

	Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(labels.labelLink), queue.length(),
			labels.firstLabel, labels.secondLabel, diagram.getLabeldistance(), diagram.getLabelangle());

	if (dir == Direction.LEFT || dir == Direction.UP) {
		link = link.getInv();
	}
	CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);

	diagram.addLink(link);
	return CommandExecutionResult.ok();
}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:47,代码来源:CommandLinkElement.java

示例8: executeArg

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
@Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, RegexResult arg) {
	final IEntity entity1 = getEntity(diagram, arg, true);
	if (entity1 == null) {
		return CommandExecutionResult.error("No such activity");
	}
	if (arg.get("STEREOTYPE", 0) != null) {
		entity1.setStereotype(new Stereotype(arg.get("STEREOTYPE", 0)));
	}
	if (arg.get("BACKCOLOR", 0) != null) {
		entity1.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("BACKCOLOR", 0)));
	}

	final IEntity entity2 = getEntity(diagram, arg, false);
	if (entity2 == null) {
		return CommandExecutionResult.error("No such activity");
	}
	if (arg.get("BACKCOLOR2", 0) != null) {
		entity2.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("BACKCOLOR2", 0)));
	}
	if (arg.get("STEREOTYPE2", 0) != null) {
		entity2.setStereotype(new Stereotype(arg.get("STEREOTYPE2", 0)));
	}

	final Display linkLabel = Display.getWithNewlines(arg.get("BRACKET", 0));

	final String arrowBody1 = CommandLinkClass.notNull(arg.get("ARROW_BODY1", 0));
	final String arrowBody2 = CommandLinkClass.notNull(arg.get("ARROW_BODY2", 0));
	final String arrowDirection = CommandLinkClass.notNull(arg.get("ARROW_DIRECTION", 0));

	final String arrow = StringUtils.manageArrowForCuca(arrowBody1 + arrowDirection + arrowBody2 + ">");
	int lenght = arrow.length() - 1;
	if (arrowDirection.contains("*")) {
		lenght = 2;
	}

	LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE);
	if ((arrowBody1 + arrowBody2).contains(".")) {
		type = type.getDotted();
	}

	Link link = new Link(entity1, entity2, type, linkLabel, lenght);
	if (arrowDirection.contains("*")) {
		link.setConstraint(false);
	}
	final Direction direction = StringUtils.getArrowDirection(arrowBody1 + arrowDirection + arrowBody2 + ">");
	if (direction == Direction.LEFT || direction == Direction.UP) {
		link = link.getInv();
	}
	if (arg.get("URL", 0) != null) {
		final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
		final Url urlLink = urlBuilder.getUrl(arg.get("URL", 0));
		link.setUrl(urlLink);
	}

	CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
	diagram.addLink(link);

	return CommandExecutionResult.ok();

}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:62,代码来源:CommandLinkActivity2.java

示例9: executeArg

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
@Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, RegexResult arg) {
	final IEntity entity1 = getEntity(diagram, arg, true);
	if (entity1 == null) {
		return CommandExecutionResult.error("No such activity");
	}
	if (arg.get("STEREOTYPE", 0) != null) {
		entity1.setStereotype(new Stereotype(arg.get("STEREOTYPE", 0)));
	}
	if (arg.get("BACKCOLOR", 0) != null) {
		entity1.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("BACKCOLOR", 0)));
	}

	final IEntity entity2 = getEntity(diagram, arg, false);
	if (entity2 == null) {
		return CommandExecutionResult.error("No such activity");
	}
	if (arg.get("BACKCOLOR2", 0) != null) {
		entity2.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("BACKCOLOR2", 0)));
	}
	if (arg.get("STEREOTYPE2", 0) != null) {
		entity2.setStereotype(new Stereotype(arg.get("STEREOTYPE2", 0)));
	}

	final Display linkLabel = Display.getWithNewlines(arg.get("BRACKET", 0));

	final String arrow = StringUtils.manageArrowForCuca(arg.get("ARROW", 0));
	int lenght = arrow.length() - 1;
	if (arg.get("ARROW", 0).contains("*")) {
		lenght = 2;
	}

	LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE);
	if (arg.get("ARROW", 0).contains(".")) {
		type = type.getDotted();
	}

	Link link = new Link(entity1, entity2, type, linkLabel, lenght);
	if (arg.get("ARROW", 0).contains("*")) {
		link.setConstraint(false);
	}
	final Direction direction = StringUtils.getArrowDirection(arg.get("ARROW", 0));
	if (direction == Direction.LEFT || direction == Direction.UP) {
		link = link.getInv();
	}
	if (arg.get("URL", 0) != null) {
		final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
		final Url urlLink = urlBuilder.getUrl(arg.get("URL", 0));
		link.setUrl(urlLink);
	}

	diagram.addLink(link);

	return CommandExecutionResult.ok();

}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:57,代码来源:CommandLinkActivity.java

示例10: executeArg

import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
@Override
protected CommandExecutionResult executeArg(StateDiagram diagram, RegexResult arg) {
	final String ent1 = arg.get("ENT1", 0);
	final String ent2 = arg.get("ENT2", 0);

	final IEntity cl1 = getEntityStart(diagram, ent1);
	if (cl1 == null) {
		return CommandExecutionResult.error("The state " + ent1
				+ " has been created in a concurrent state : it cannot be used here.");
	}
	final IEntity cl2 = getEntityEnd(diagram, ent2);
	if (cl2 == null) {
		return CommandExecutionResult.error("The state " + ent2
				+ " has been created in a concurrent state : it cannot be used here.");
	}

	if (arg.get("ENT1", 1) != null) {
		cl1.setStereotype(new Stereotype(arg.get("ENT1", 1)));
	}
	if (arg.get("ENT1", 2) != null) {
		cl1.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT1", 2)));
	}
	if (arg.get("ENT2", 1) != null) {
		cl2.setStereotype(new Stereotype(arg.get("ENT2", 1)));
	}
	if (arg.get("ENT2", 2) != null) {
		cl2.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT2", 2)));
	}

	String queue = arg.get("ARROW_BODY1", 0) + arg.get("ARROW_BODY2", 0);
	final Direction dir = getDirection(arg);

	if (dir == Direction.LEFT || dir == Direction.RIGHT) {
		queue = "-";
	}

	final int lenght = queue.length();

	final boolean crossStart = arg.get("ARROW_CROSS_START", 0) != null;
	final boolean circleEnd = arg.get("ARROW_CIRCLE_END", 0) != null;
	final LinkType linkType = new LinkType(circleEnd ? LinkDecor.ARROW_AND_CIRCLE : LinkDecor.ARROW,
			crossStart ? LinkDecor.CIRCLE_CROSS : LinkDecor.NONE);

	Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(arg.get("LABEL", 0)), lenght);
	if (dir == Direction.LEFT || dir == Direction.UP) {
		link = link.getInv();
	}
	CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
	diagram.addLink(link);

	return CommandExecutionResult.ok();
}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:53,代码来源:CommandLinkState.java


注:本文中的net.sourceforge.plantuml.cucadiagram.Link.getInv方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。