本文整理汇总了Java中org.netbeans.api.visual.layout.LayoutFactory.ConnectionWidgetLayoutAlignment方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutFactory.ConnectionWidgetLayoutAlignment方法的具体用法?Java LayoutFactory.ConnectionWidgetLayoutAlignment怎么用?Java LayoutFactory.ConnectionWidgetLayoutAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.visual.layout.LayoutFactory
的用法示例。
在下文中一共展示了LayoutFactory.ConnectionWidgetLayoutAlignment方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateBestCenterAlignment
import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
private LayoutFactory.ConnectionWidgetLayoutAlignment calculateBestCenterAlignment(Point point, Rectangle bounds) {
LayoutFactory.ConnectionWidgetLayoutAlignment retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.NONE;
if(bounds != null) {
if(point.x <= bounds.x) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.CENTER_LEFT;
} else if(point.x >= (bounds.x + bounds.width)) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.CENTER_RIGHT;
} else if(point.y <= bounds.y) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.TOP_CENTER;
} else if(point.y >= (bounds.y + bounds.height)) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.BOTTOM_CENTER;
}
}
return retVal;
}
示例2: calculateBestBottomAlignment
import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
private LayoutFactory.ConnectionWidgetLayoutAlignment calculateBestBottomAlignment(Point point, Rectangle bounds) {
LayoutFactory.ConnectionWidgetLayoutAlignment retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.NONE;
if(point.x <= bounds.x) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.BOTTOM_LEFT;
} else if(point.x >= (bounds.x + bounds.width)) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.BOTTOM_RIGHT;
} else if(point.y <= bounds.y) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.TOP_RIGHT;
} else if(point.y >= (bounds.y + bounds.height)) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.BOTTOM_LEFT;
}
return retVal;
}
示例3: calculateBestTopAlignment
import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
private LayoutFactory.ConnectionWidgetLayoutAlignment calculateBestTopAlignment(Point point, Rectangle bounds) {
LayoutFactory.ConnectionWidgetLayoutAlignment retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.NONE;
if(point.x <= bounds.x) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.TOP_LEFT;
} else if(point.x >= (bounds.x + bounds.width)) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.TOP_RIGHT;
} else if(point.y <= bounds.y) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.TOP_LEFT;
} else if(point.y >= (bounds.y + bounds.height)) {
retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.BOTTOM_RIGHT;
}
return retVal;
}
示例4: getDefaultAlignment
import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
@Override
protected LayoutFactory.ConnectionWidgetLayoutAlignment getDefaultAlignment(String name,
LabelType type) {
return LayoutFactory.ConnectionWidgetLayoutAlignment.TOP_CENTER;
}
示例5: setConstraint
import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
/**
* Sets a constraint for a child widget when ConnectionWidgetLayout (by default) is used.
* @param childWidget the child widget for which the constraint is set
* @param alignment the alignment specified relatively to the origin point
* @param placementInPercentage the placement on a path in percentage of the path length
*/
public void setConstraint (Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, float placementInPercentage) {
connectionWidgetLayout.setConstraint (childWidget, alignment, placementInPercentage);
}
示例6: setConstraint
import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
/**
* Sets a constraint for a child widget when ConnectionWidgetLayout (by
* default) is used.
*
* @param childWidget the child widget for which the constraint is set
* @param alignment the alignment specified relatively to the origin point
* @param placementInPercentage the placement on a path in percentage of the
* path length
*/
void setConstraint(Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, float placementInPercentage);
示例7: getDefaultAlignment
import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
/**
* Specifies the alignment along the edge.
*
* @param name the name of the label.
* @param type the type of the label
* @return the alignment of the label.
*/
protected abstract LayoutFactory.ConnectionWidgetLayoutAlignment getDefaultAlignment(String name,
LabelType type);