本文整理匯總了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();
}
示例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();
}
示例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();
}