本文整理汇总了Java中org.netbeans.api.visual.action.MoveStrategy类的典型用法代码示例。如果您正苦于以下问题:Java MoveStrategy类的具体用法?Java MoveStrategy怎么用?Java MoveStrategy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MoveStrategy类属于org.netbeans.api.visual.action包,在下文中一共展示了MoveStrategy类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MoveAction
import org.netbeans.api.visual.action.MoveStrategy; //导入依赖的package包/类
public MoveAction(IWidget actionWidget, MoveStrategy strategy, MoveProvider provider, MoveStrategy alignStrategy, MoveProvider alignProvider) {
this.actionWidget = actionWidget;
this.moveStrategy = strategy;
this.moveProvider = provider;
this.alignStrategy = alignStrategy;
this.alignProvider = alignProvider;
}
开发者ID:jeddict,项目名称:NBModeler,代码行数:8,代码来源:MoveAction.java
示例2: EntryWidget
import org.netbeans.api.visual.action.MoveStrategy; //导入依赖的package包/类
public EntryWidget(Scene scene, Entry e, MoveProvider provider) {
super(scene);
setOpaque(true);
setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.JUSTIFY, 4));
TitleWidget nameWidget = new TitleWidget(this.getScene(), this, e.getRefArg().getName());
nameWidget.setBorder(BorderFactory.createEmptyBorder(5));
nameWidget.setAlignment(LabelWidget.Alignment.CENTER);
addChild(nameWidget);
addChild(new SeparatorWidget (scene, SeparatorWidget.Orientation.HORIZONTAL));
exitsField = new Widget(this.getScene());
exitsField.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
addChild(exitsField);
setBorder(VMDFactory.createVMDNodeBorder(new Color(2,82,30), 2, new Color(65,224,121),
new Color(105,255,158), new Color(65,224,121), new Color(65,224,121),
new Color(65,224,121)));
//setBorder(BorderFactory.createLineBorder (5));
nameWidget.getActions().addAction(ActionFactory.createMoveAction(new MoveStrategy() {
@Override
public Point locationSuggested(Widget widget, Point point, Point point1) {
Point pdif;
if (currentLoc == null) {
pdif = new Point(point1.x - point.x, point1.y - point.y);
} else {
pdif = new Point(point1.x - currentLoc.x, point1.y - currentLoc.y);
}
Point prevLoc = EntryWidget.this.getPreferredLocation();
Point suggLoc = new Point(prevLoc.x + pdif.x,
prevLoc.y + pdif.y);
EntryWidget.this.setPreferredLocation(suggLoc);
currentLoc = point1;
return point1;
}
// }, ActionFactory.createDefaultMoveProvider()));
}, provider));
}
开发者ID:vlarin,项目名称:visualakka,代码行数:39,代码来源:EntryWidget.java
示例3: ExitWidget
import org.netbeans.api.visual.action.MoveStrategy; //导入依赖的package包/类
public ExitWidget(Scene scene, Exit e, MoveProvider provider) {
super(scene);
setOpaque(true);
setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.JUSTIFY, 4));
TitleWidget nameWidget = new TitleWidget(this.getScene(), this, e.getRefRes().getName());
nameWidget.setBorder(BorderFactory.createEmptyBorder(5, 2));
nameWidget.setAlignment(LabelWidget.Alignment.CENTER);
addChild(nameWidget);
addChild(new SeparatorWidget (scene, SeparatorWidget.Orientation.HORIZONTAL));
parameterField = new Widget(this.getScene());
parameterField.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.LEFT_TOP, 4));
parameterField.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 10));
addChild(parameterField);
setBorder(VMDFactory.createVMDNodeBorder(new Color(122, 9, 9), 2, new Color(250, 63, 63),
new Color(250, 63, 63), new Color(250, 63, 63), new Color(250, 63, 63),
new Color(250, 63, 63)));
nameWidget.getActions().addAction(ActionFactory.createMoveAction(new MoveStrategy() {
@Override
public Point locationSuggested(Widget widget, Point point, Point point1) {
Point pdif;
if (currentLoc == null) {
pdif = new Point(point1.x - point.x, point1.y - point.y);
} else {
pdif = new Point(point1.x - currentLoc.x, point1.y - currentLoc.y);
}
Point prevLoc = ExitWidget.this.getPreferredLocation();
Point suggLoc = new Point(prevLoc.x + pdif.x,
prevLoc.y + pdif.y);
ExitWidget.this.setPreferredLocation(suggLoc);
currentLoc = point1;
return point1;
}
// }, ActionFactory.createDefaultMoveProvider()));
}, provider));
}
开发者ID:vlarin,项目名称:visualakka,代码行数:39,代码来源:ExitWidget.java
示例4: MoveAction
import org.netbeans.api.visual.action.MoveStrategy; //导入依赖的package包/类
public MoveAction (MoveStrategy strategy, MoveProvider provider) {
this.strategy = strategy;
this.provider = provider;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:MoveAction.java
示例5: MoveNodeKeyAction
import org.netbeans.api.visual.action.MoveStrategy; //导入依赖的package包/类
public MoveNodeKeyAction(MoveStrategy strategy, MoveProvider provider) {
this.strategy = strategy;
this.provider = provider;
}
开发者ID:jeddict,项目名称:NBModeler,代码行数:5,代码来源:MoveNodeKeyAction.java
示例6: UnitWidget
import org.netbeans.api.visual.action.MoveStrategy; //导入依赖的package包/类
public UnitWidget(Scene scene, ConcreticisedMethod m, MoveProvider provider) {
super(scene);
if (m instanceof UserCodeBlock) {
return;
}
setOpaque(false);
setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.JUSTIFY, 4)); // use vertical layout
// LabelWidget methodName = new LabelWidget(this.getScene(), m.getMethodName());
TitleWidget methodName = new TitleWidget(this.getScene(), this, m.getMethodName());
methodName.setAlignment(LabelWidget.Alignment.CENTER);
methodName.setBorder(BorderFactory.createEmptyBorder(5, 2));
addChild(methodName);
Widget pinsSeparator = new SeparatorWidget(scene, SeparatorWidget.Orientation.HORIZONTAL);
addChild(pinsSeparator);
addChild(new LabelWidget(this.getScene(), m.iType.name()));
if (m.router != null && m.iType==ConcreticisedMethod.InstancingType.Static) {
Widget routerWidget = new Widget(scene);
routerWidget.setLayout(LayoutFactory.createHorizontalFlowLayout(LayoutFactory.SerialAlignment.JUSTIFY, 4));
routerWidget.addChild(new LabelWidget(this.getScene(), m.router.getLogic().name()));
if (m.router.isIsStretched()) {
routerWidget.addChild(new LabelWidget(this.getScene(), "(" + m.router.getMinRoutes() + " .. "
+ m.router.getMaxRoutes() + ")"));
} else {
routerWidget.addChild(new LabelWidget(this.getScene(), "(" + m.router.getMinRoutes() + ")"));
}
addChild(routerWidget);
Widget pinsSeparator1 = new SeparatorWidget(scene, SeparatorWidget.Orientation.HORIZONTAL);
addChild(pinsSeparator1);
}
// else {
// LabelWidget noRouter = new LabelWidget(this.getScene(), "(no router)");
// noRouter.setAlignment(LabelWidget.Alignment.CENTER);
// addChild(noRouter);
// }
Widget methodField = new Widget(this.getScene());
methodField.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.JUSTIFY, 4)); // use vertical layout
parameterField = new Widget(this.getScene());
parameterField.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.LEFT_TOP, 2));
exitsField = new Widget(this.getScene());
exitsField.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.RIGHT_BOTTOM, 2));
parameterField.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
exitsField.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
methodField.addChild(parameterField);
methodField.addChild(new SeparatorWidget(scene, SeparatorWidget.Orientation.HORIZONTAL));
methodField.addChild(exitsField);
methodField.setBorder(BorderFactory.createEmptyBorder(5));
addChild(methodField);
setBorder(VMDFactory.createVMDNodeBorder());
setToolTipText("ID " + m.getCmID() + " Package " + m.getModuleID());
methodName.getActions().addAction(ActionFactory.createMoveAction(new MoveStrategy() {
@Override
public Point locationSuggested(Widget widget, Point point, Point point1) {
Point pdif;
if (currentLoc == null) {
pdif = new Point(point1.x - point.x, point1.y - point.y);
} else {
pdif = new Point(point1.x - currentLoc.x, point1.y - currentLoc.y);
}
Point prevLoc = UnitWidget.this.getPreferredLocation();
Point suggLoc = new Point(prevLoc.x + pdif.x,
prevLoc.y + pdif.y);
UnitWidget.this.setPreferredLocation(suggLoc);
currentLoc = point1;
return point1;
}
// }, ActionFactory.createDefaultMoveProvider()));
}, provider));
}
开发者ID:vlarin,项目名称:visualakka,代码行数:75,代码来源:UnitWidget.java
示例7: ExMoveAction
import org.netbeans.api.visual.action.MoveStrategy; //导入依赖的package包/类
public ExMoveAction (MoveStrategy strategy, MoveProvider provider) {
this.strategy = strategy;
this.provider = provider;
}
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:5,代码来源:ExMoveAction.java
注:本文中的org.netbeans.api.visual.action.MoveStrategy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论