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


Java LayoutFactory.ConnectionWidgetLayoutAlignment方法代码示例

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

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

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

示例4: getDefaultAlignment

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
@Override
protected LayoutFactory.ConnectionWidgetLayoutAlignment getDefaultAlignment(String name,
        LabelType type) {
    return LayoutFactory.ConnectionWidgetLayoutAlignment.TOP_CENTER;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:6,代码来源:BasicLabelManager.java

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

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

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


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