當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。