本文整理汇总了Java中org.netbeans.api.visual.action.RectangularSelectProvider类的典型用法代码示例。如果您正苦于以下问题:Java RectangularSelectProvider类的具体用法?Java RectangularSelectProvider怎么用?Java RectangularSelectProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RectangularSelectProvider类属于org.netbeans.api.visual.action包,在下文中一共展示了RectangularSelectProvider类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRectangularSelectProvider
import org.netbeans.api.visual.action.RectangularSelectProvider; //导入依赖的package包/类
private RectangularSelectProvider createRectangularSelectProvider() {
return new RectangularSelectProvider() {
public void performSelection(Rectangle rectangle) {
HashSet<CfgNode> set = new HashSet<>();
//change to a rectangle with (x,offsetY) at the top left
if (rectangle.width < 0) {
rectangle.x = rectangle.x + rectangle.width;
rectangle.width *= -1;
}
if (rectangle.height < 0) {
rectangle.y = rectangle.y + rectangle.height;
rectangle.height *= -1;
}
for (NodeWidget n : getNodeWidgets()) {
Point p = n.getLocation();
if (p != null && rectangle.contains(p)) {
set.add(n.getNodeModel());
}
}
setNodeSelection(set);
}
};
}
示例2: RectangularSelectAction
import org.netbeans.api.visual.action.RectangularSelectProvider; //导入依赖的package包/类
public RectangularSelectAction (RectangularSelectDecorator decorator, LayerWidget interractionLayer, RectangularSelectProvider provider) {
this.decorator = decorator;
this.interractionLayer = interractionLayer;
this.provider = provider;
}