• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MoveStrategy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EPSDocumentGraphics2D类代码示例发布时间:2022-05-23
下一篇:
Java ImplStructureStrategy类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap