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


Java Link.setUrl方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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


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