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


Java Link类代码示例

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


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

示例1: addExtension

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
private void addExtension(Link link, String assId) {
    final Element association = document.createElement("UML:Generalization");
    association.setAttribute("xmi.id", assId);
    association.setAttribute("namespace", "model1");
    if (link.getLabel() != null) {
        association.setAttribute("name", forXMI(link.getLabel()));
    }
    if (link.getType().getDecor1() == LinkDecor.EXTENDS) {
        association.setAttribute("child", link.getEntity1().getUid());
        association.setAttribute("parent", link.getEntity2().getUid());
    } else if (link.getType().getDecor2() == LinkDecor.EXTENDS) {
        association.setAttribute("child", link.getEntity2().getUid());
        association.setAttribute("parent", link.getEntity1().getUid());
    } else {
        throw new IllegalStateException();
    }
    ownedElement.appendChild(association);

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

示例2: computeLayers

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
public void computeLayers() {
    if (hasCycle()) {
        throw new UnsupportedOperationException();
    }
    for (IEntity ent : entities) {
        ent.setHectorLayer(0);
    }
    boolean changed;
    do {
        changed = false;
        for (Link link : links) {
            if (ensureLayer(link)) {
                changed = true;
            }
        }
    } while (changed);
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:18,代码来源:Skeleton.java

示例3: ensureLayer

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
private boolean ensureLayer(Link link) {
    final int lenght = link.getLength();
    final int l1 = link.getEntity1().getHectorLayer();
    final int l2 = link.getEntity2().getHectorLayer();
    if (lenght == 1) {
        if (l1 < l2) {
            link.getEntity1().setHectorLayer(l2);
            return true;
        } else if (l2 < l1) {
            link.getEntity2().setHectorLayer(l1);
            return true;
        }
    } else {
        final int l2theoric = l1 + lenght - 1;
        if (l2 < l2theoric) {
            link.getEntity2().setHectorLayer(l2theoric);
            return true;
        }
    }
    return false;
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:22,代码来源:Skeleton.java

示例4: executeArg

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
@Override
protected CommandExecutionResult executeArg(CompositeDiagram diagram, List<String> arg) {
    final IEntity cl1 = diagram.getOrCreateLeaf(Code.of(arg.get(0)), null, null);
    final IEntity cl2 = diagram.getOrCreateLeaf(Code.of(arg.get(4)), null, null);

    final String deco1 = arg.get(1);
    final String deco2 = arg.get(3);
    LinkType linkType = new LinkType(getLinkDecor(deco1), getLinkDecor(deco2));
    
    if ("*)".equals(deco1)) {
        linkType = linkType.getInterfaceProvider();
    } else if ("(*".equals(deco2)) {
        linkType = linkType.getInterfaceUser();
    }

    final String queue = arg.get(2);

    final Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(arg.get(5)), queue.length());
    diagram.addLink(link);
    return CommandExecutionResult.ok();
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:22,代码来源:CommandLinkBlock.java

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

示例6: addLinkNew

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
private void addLinkNew(List<Link> result, Link link) {
    for (int i = 0; i < result.size(); i++) {
        final Link other = result.get(i);
        if (other.sameConnections(link)) {
            while (i < result.size() && result.get(i).sameConnections(link)) {
                i++;
            }
            if (i == result.size()) {
                result.add(link);
            } else {
                result.add(i, link);
            }
            return;
        }
    }
    result.add(link);
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:18,代码来源:CucaDiagramFileMakerSvek.java

示例7: overideImage

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
public void overideImage(IEntityImage img, LeafType leafType) {
    checkGroup();
    this.svekImage = img;
    this.url = null;

    for (final Link link : new ArrayList<Link>(entityFactory.getLinks())) {
        if (EntityUtils.isPureInnerLink12(this, link)) {
            entityFactory.removeLink(link);
        }
    }

    entityFactory.removeGroup(this.getCode());
    for (ILeaf ent : new ArrayList<ILeaf>(entityFactory.getLeafs().values())) {
        if (this != ent && this == ent.getParentContainer()) {
            entityFactory.removeLeaf(ent.getCode());
        }
    }

    entityFactory.addLeaf(this);
    this.groupType = null;
    this.leafType = leafType;
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:23,代码来源:EntityImpl.java

示例8: DotData

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
public DotData(IGroup topParent, List<Link> links, Collection<ILeaf> leafs, UmlDiagramType umlDiagramType,
        ISkinParam skinParam, GroupHierarchy groupHierarchy, PortionShower portionShower, ColorMapper colorMapper,
        EntityFactory entityFactory, boolean isHideEmptyDescriptionForState, DotMode dotMode,
        String namespaceSeparator, Pragma pragma) {
    this.namespaceSeparator = namespaceSeparator;
    this.pragma = pragma;
    this.topParent = topParent;
    if (topParent == null) {
        throw new IllegalArgumentException();
    }
    this.dotMode = dotMode;
    this.isHideEmptyDescriptionForState = isHideEmptyDescriptionForState;
    this.colorMapper = colorMapper;
    this.links = links;
    this.leafs = leafs;
    this.umlDiagramType = umlDiagramType;
    this.skinParam = skinParam;
    // this.rankdir = rankdir;
    this.groupHierarchy = groupHierarchy;
    this.portionShower = portionShower;
    this.entityFactory = entityFactory;
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:23,代码来源:DotData.java

示例9: manageExtends

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
public static void manageExtends(String keyword, ClassDiagram system, RegexResult arg, final IEntity entity) {
    if (arg.get(keyword, 1) != null) {
        final Mode mode = arg.get(keyword, 1).equalsIgnoreCase("extends") ? Mode.EXTENDS : Mode.IMPLEMENTS;
        LeafType type2 = LeafType.CLASS;
        if (mode == Mode.IMPLEMENTS) {
            type2 = LeafType.INTERFACE;
        }
        if (mode == Mode.EXTENDS && entity.getEntityType() == LeafType.INTERFACE) {
            type2 = LeafType.INTERFACE;
        }
        final String codes = arg.get(keyword, 2);
        for (String s : codes.split(",")) {
            final Code other = Code.of(StringUtils.trin(s));
            final IEntity cl2 = system.getOrCreateLeaf(other, type2, null);
            LinkType typeLink = new LinkType(LinkDecor.NONE, LinkDecor.EXTENDS);
            if (type2 == LeafType.INTERFACE && entity.getEntityType() != LeafType.INTERFACE) {
                typeLink = typeLink.getDashed();
            }
            final Link link = new Link(cl2, entity, typeLink, Display.NULL, 2, null, null,
                    system.getLabeldistance(), system.getLabelangle());
            system.addLink(link);
        }
    }
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:25,代码来源:CommandCreateClassMultilines.java

示例10: addLink

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
private void addLink(AbstractClassOrObjectDiagram diagram, Link link, String weight) {
    diagram.addLink(link);
    if (weight == null) {
        // final LinkType type = link.getType();
        // --|> highest
        // --*, -->, --o normal
        // ..*, ..>, ..o lowest
        // if (type.isDashed() == false) {
        // if (type.contains(LinkDecor.EXTENDS)) {
        // link.setWeight(3);
        // }
        // if (type.contains(LinkDecor.ARROW) ||
        // type.contains(LinkDecor.COMPOSITION)
        // || type.contains(LinkDecor.AGREGATION)) {
        // link.setWeight(2);
        // }
        // }
    } else {
        link.setWeight(Double.parseDouble(weight));
    }
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:22,代码来源:CommandLinkLollipop.java

示例11: executeInternal

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
private CommandExecutionResult executeInternal(CucaDiagram diagram, BlocLines note, final RegexResult arg) {
    final Link link = diagram.getLastLink();
    if (link == null) {
        return CommandExecutionResult.error("No link defined");
    }
    Position position = Position.BOTTOM;
    if (arg.get("POSITION", 0) != null) {
        position = Position.valueOf(StringUtils.goUpperCase(arg.get("POSITION", 0)));
    }
    Url url = null;
    if (note.size() > 0) {
        final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
        url = urlBuilder.getUrl(note.getFirst499().toString());
    }
    if (url != null) {
        note = note.subExtract(1, 0);
    }
    final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
    link.addNote(note.toDisplay(), position, colors);
    return CommandExecutionResult.ok();
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:22,代码来源:FactoryNoteOnLinkCommand.java

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

示例13: manageExtends

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
public static void manageExtends(String keyword, ClassDiagram system, RegexResult arg, final IEntity entity) {
    if (arg.get(keyword, 1) != null) {
        final Mode mode = arg.get(keyword, 1).equalsIgnoreCase("extends") ? Mode.EXTENDS : Mode.IMPLEMENTS;
        LeafType type2 = LeafType.CLASS;
        if (mode == Mode.IMPLEMENTS) {
            type2 = LeafType.INTERFACE;
        }
        if (mode == Mode.EXTENDS && entity.getEntityType() == LeafType.INTERFACE) {
            type2 = LeafType.INTERFACE;
        }
        final String codes = arg.get(keyword, 2);
        for (String s : codes.split(",")) {
            final Code other = Code.of(s.trim());
            final IEntity cl2 = system.getOrCreateLeaf(other, type2, null);
            LinkType typeLink = new LinkType(LinkDecor.NONE, LinkDecor.EXTENDS);
            if (type2 == LeafType.INTERFACE && entity.getEntityType() != LeafType.INTERFACE) {
                typeLink = typeLink.getDashed();
            }
            final Link link = new Link(cl2, entity, typeLink, null, 2, null, null, system.getLabeldistance(),
                    system.getLabelangle());
            system.addLink(link);
        }
    }
}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:25,代码来源:CommandCreateClassMultilines.java

示例14: executePackageLink

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

    final LinkType linkType = getLinkType(arg);
    final Direction dir = getDirection(arg);
    final int queue;
    if (dir == Direction.LEFT || dir == Direction.RIGHT) {
        queue = 1;
    } else {
        queue = getQueueLength(arg);
    }

    final Display labelLink = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
    final String firstLabel = arg.get("FIRST_LABEL", 0);
    final String secondLabel = arg.get("SECOND_LABEL", 0);
    final Link link = new Link(cl1, cl2, linkType, labelLink, queue, firstLabel, secondLabel,
            diagram.getLabeldistance(), diagram.getLabelangle());

    diagram.resetPragmaLabel();
    addLink(diagram, link, arg.get("HEADER", 0));
    return CommandExecutionResult.ok();
}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:26,代码来源:CommandLinkClass.java

示例15: applyStyle

import net.sourceforge.plantuml.cucadiagram.Link; //导入依赖的package包/类
public static void applyStyle(String arrowStyle, Link link) {
    if (arrowStyle == null) {
        return;
    }
    final StringTokenizer st = new StringTokenizer(arrowStyle, ",");
    while (st.hasMoreTokens()) {
        final String s = st.nextToken();
        if (s.equalsIgnoreCase("dashed")) {
            link.goDashed();
        } else if (s.equalsIgnoreCase("bold")) {
            link.goBold();
        } else if (s.equalsIgnoreCase("dotted")) {
            link.goDotted();
        } else if (s.equalsIgnoreCase("hidden")) {
            link.goHidden();
        } else {
            link.setSpecificColor(s);
        }
    }
}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:21,代码来源:CommandLinkClass.java


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