本文整理汇总了Java中net.sourceforge.plantuml.cucadiagram.Link.getEntity1方法的典型用法代码示例。如果您正苦于以下问题:Java Link.getEntity1方法的具体用法?Java Link.getEntity1怎么用?Java Link.getEntity1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sourceforge.plantuml.cucadiagram.Link
的用法示例。
在下文中一共展示了Link.getEntity1方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLength
import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
private double getLength(Link link) {
final IEntity ent1 = link.getEntity1();
final IEntity ent2 = link.getEntity2();
final int y1 = ent1.getHectorLayer();
final int x1 = layers.get(y1).getLongitude(ent1);
final int y2 = ent2.getHectorLayer();
final int x2 = layers.get(y2).getLongitude(ent2);
final int dx = x2 - x1;
final int dy = y2 - y1;
return Math.sqrt(dx * dx + dy * dy);
}
示例2: getDirectChildren
import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
private Set<IEntity> getDirectChildren(IEntity parent) {
final Set<IEntity> result = new HashSet<IEntity>();
for (Link link : links) {
if (link.isAutolink()) {
continue;
}
if (link.getEntity1() == parent) {
result.add(link.getEntity2());
}
}
return Collections.unmodifiableSet(result);
}
示例3: getPureInnerLinks
import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
private List<Link> getPureInnerLinks() {
final List<Link> result = new ArrayList<Link>();
for (Link link : diagram.getLinks()) {
final IEntity e1 = (IEntity) link.getEntity1();
final IEntity e2 = (IEntity) link.getEntity2();
if (e1.getParentContainer() == group && e1.isGroup() == false && e2.getParentContainer() == group
&& e2.isGroup() == false) {
result.add(link);
}
}
return result;
}
示例4: createState
import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
private Element createState(IEntity entity) {
final Element state = document.createElement("state");
state.setAttribute("id", getId(entity));
for (final Link link : diagram.getLinks()) {
if (link.getEntity1() == entity) {
addLink(state, link);
}
}
return state;
}
示例5: LinkHtmlPrinter
import net.sourceforge.plantuml.cucadiagram.Link; //导入方法依赖的package包/类
public LinkHtmlPrinter(Link link, IEntity entity) {
this.link = link;
if (link.getEntity1() == entity) {
this.chiral = false;
} else if (link.getEntity2() == entity) {
this.chiral = true;
} else {
throw new IllegalArgumentException();
}
}