本文整理汇总了Java中org.netbeans.api.visual.anchor.AnchorFactory.createCenterAnchor方法的典型用法代码示例。如果您正苦于以下问题:Java AnchorFactory.createCenterAnchor方法的具体用法?Java AnchorFactory.createCenterAnchor怎么用?Java AnchorFactory.createCenterAnchor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.visual.anchor.AnchorFactory
的用法示例。
在下文中一共展示了AnchorFactory.createCenterAnchor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachEdgeSourceAnchor
import org.netbeans.api.visual.anchor.AnchorFactory; //导入方法依赖的package包/类
@Override
protected void attachEdgeSourceAnchor(E edge, N oldSourceNode, N sourceNode) {
Widget w = findWidget(edge);
// Not the case by default, but could be overridden
if (w instanceof ConnectionWidget) {
Widget sourceNodeWidget = findWidget(sourceNode);
Anchor sourceAnchor = AnchorFactory.createCenterAnchor(sourceNodeWidget);
ConnectionWidget edgeWidget = (ConnectionWidget) w;
edgeWidget.setSourceAnchor(sourceAnchor);
}
}
示例2: attachEdgeTargetAnchor
import org.netbeans.api.visual.anchor.AnchorFactory; //导入方法依赖的package包/类
@Override
protected void attachEdgeTargetAnchor(E edge, N oldTargetNode, N targetNode) {
Widget w = findWidget(edge);
// Not the case by default, but could be overridden
if (w instanceof ConnectionWidget) {
Widget targetNodeWidget = findWidget(targetNode);
Anchor targetAnchor = AnchorFactory.createCenterAnchor(targetNodeWidget);
ConnectionWidget edgeWidget = (ConnectionWidget) findWidget(edge);
edgeWidget.setTargetAnchor(targetAnchor);
}
}
示例3: createSourceAnchor
import org.netbeans.api.visual.anchor.AnchorFactory; //导入方法依赖的package包/类
public Anchor createSourceAnchor (Widget sourceWidget) {
return AnchorFactory.createCenterAnchor (sourceWidget);
}
示例4: createTargetAnchor
import org.netbeans.api.visual.anchor.AnchorFactory; //导入方法依赖的package包/类
public Anchor createTargetAnchor (Widget targetWidget) {
return AnchorFactory.createCenterAnchor (targetWidget);
}
示例5: createReplacementWidgetAnchor
import org.netbeans.api.visual.anchor.AnchorFactory; //导入方法依赖的package包/类
public Anchor createReplacementWidgetAnchor (Widget replacementWidget) {
return AnchorFactory.createCenterAnchor (replacementWidget);
}