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


Java Anchor.Entry方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ProxyAnchor.java

示例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;
    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:42,代码来源:CustomPathAnchor.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:ConnectionWidget.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:ConnectionWidget.java

示例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();
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:7,代码来源:IConnectionWidget.java

示例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();
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:7,代码来源:IConnectionWidget.java


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