本文整理汇总了Java中org.netbeans.api.visual.anchor.Anchor.Entry方法的典型用法代码示例。如果您正苦于以下问题:Java Anchor.Entry方法的具体用法?Java Anchor.Entry怎么用?Java Anchor.Entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.visual.anchor.Anchor
的用法示例。
在下文中一共展示了Anchor.Entry方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compute
import org.netbeans.api.visual.anchor.Anchor; //导入方法依赖的package包/类
public Anchor.Result compute (Anchor.Entry entry) {
return anchors[index].compute (entry);
}
示例2: compute
import org.netbeans.api.visual.anchor.Anchor; //导入方法依赖的package包/类
@Override
public Anchor.Result compute(Anchor.Entry entry) {
// NodeWidget nodeWidget = (NodeWidget) getRelatedWidget().getParentWidget();
Point relatedLocation = getRelatedSceneLocation();
Point oppositeLocation = null;
List<Point> points = entry.getAttachedConnectionWidget().getControlPoints();
if (entry.getAttachedConnectionWidget() instanceof IFlowEdgeWidget) {
IFlowEdgeWidget flowEdgeWidget = (IFlowEdgeWidget) entry.getAttachedConnectionWidget();
INodeWidget sourceNodeWidget = (INodeWidget) flowEdgeWidget.getSourceWidget();
INodeWidget targetNodeWidget = (INodeWidget) flowEdgeWidget.getTargetWidget();
if (!sourceNodeWidget.isAnchorEnable() && !targetNodeWidget.isAnchorEnable() && !points.isEmpty()) { //if edge both nodes anchor not enabled (if any one is allowed then calculated[means this if condition failed])
if (entry.isAttachedToConnectionSource()) {
return new Anchor.Result(points.get(0), Anchor.DIRECTION_ANY); //return current
} else {
return new Anchor.Result(points.get(points.size() - 1), Anchor.DIRECTION_ANY); //return current
}
}
}
if (points.size() > 2) {
if (entry.isAttachedToConnectionSource()) {
oppositeLocation = points.get(1);
type = "SOURCE";
} else {
oppositeLocation = points.get(points.size() - 2);
type = "TARGET";
}
} else {
oppositeLocation = getOppositeSceneLocation(entry);
type = "NONE";
}
Anchor.Result boundaryIntersection
= computeBoundaryIntersectionPoint(relatedLocation, oppositeLocation);
if (boundaryIntersection == null) {
return new Anchor.Result(relatedLocation, Anchor.DIRECTION_ANY);
}
return boundaryIntersection;
}
示例3: getSourceAnchorEntry
import org.netbeans.api.visual.anchor.Anchor; //导入方法依赖的package包/类
/**
* Returns an anchor entry representing the source of the connection widget.
* @return the anchor entry representing the source of the connection widget
*/
public Anchor.Entry getSourceAnchorEntry () {
return sourceEntry;
}
示例4: getTargetAnchorEntry
import org.netbeans.api.visual.anchor.Anchor; //导入方法依赖的package包/类
/**
* Returns an anchor entry representing the target of the connection widget.
* @return the anchor entry representing the target of the connection widget
*/
public Anchor.Entry getTargetAnchorEntry () {
return targetEntry;
}
示例5: getSourceAnchorEntry
import org.netbeans.api.visual.anchor.Anchor; //导入方法依赖的package包/类
/**
* Returns an anchor entry representing the source of the connection widget.
*
* @return the anchor entry representing the source of the connection widget
*/
Anchor.Entry getSourceAnchorEntry();
示例6: getTargetAnchorEntry
import org.netbeans.api.visual.anchor.Anchor; //导入方法依赖的package包/类
/**
* Returns an anchor entry representing the target of the connection widget.
*
* @return the anchor entry representing the target of the connection widget
*/
Anchor.Entry getTargetAnchorEntry();