本文整理匯總了Java中net.sourceforge.plantuml.cucadiagram.Link.getEntity2方法的典型用法代碼示例。如果您正苦於以下問題:Java Link.getEntity2方法的具體用法?Java Link.getEntity2怎麽用?Java Link.getEntity2使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.sourceforge.plantuml.cucadiagram.Link
的用法示例。
在下文中一共展示了Link.getEntity2方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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;
}
示例3: 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();
}
}