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


Java DesignerTools类代码示例

本文整理汇总了Java中org.netbeans.modeler.tool.DesignerTools的典型用法代码示例。如果您正苦于以下问题:Java DesignerTools类的具体用法?Java DesignerTools怎么用?Java DesignerTools使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DesignerTools类属于org.netbeans.modeler.tool包,在下文中一共展示了DesignerTools类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AbstractPModelerScene

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
public AbstractPModelerScene() {
    setKeyEventProcessingType(EventProcessingType.FOCUSED_WIDGET_AND_ITS_CHILDREN);
    backgroundLayer = new LayerWidget(this);
    mainLayer = new LayerWidget(this);
    connectionLayer = new LayerWidget(this);
    interractionLayer = new LayerWidget(this);
    labelLayer = new LayerWidget(this);
    addChild(backgroundLayer);
    addChild(mainLayer);
    addChild(interractionLayer);
    addChild(connectionLayer);
    addChild(labelLayer);

    connectionLayer.bringToFront();
    labelLayer.bringToFront();

    router = new OrthogonalSearchRouter(new WidgetsCollisionCollector (mainLayer, connectionLayer));//RouterFactory.createFreeRouter();
    satelliteView = this.createSatelliteView();
    setActiveTool(DesignerTools.SELECT);
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:21,代码来源:AbstractPModelerScene.java

示例2: createSelectionWidget

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
public Widget createSelectionWidget() {

    ContextPaletteManager palette = scene.getLookup().lookup(ContextPaletteManager.class);
    if (palette != null) {
        palette.cancelPalette();
    }

    Widget widget = new Widget(scene);
    if (tool.equals(DesignerTools.SELECT)) {
        widget.setBorder(BorderFactory.createLineBorder(1, Color.BLUE));
    } else {
        widget.setBorder(BorderFactory.createLineBorder(1, Color.BLACK));
    }
    return widget;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:17,代码来源:DiagramRectangularSelectDecorator.java

示例3: mousePressedCore

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
protected State mousePressedCore(Widget widget, WidgetMouseEvent event) {
        if (event.getButton() == MouseEvent.BUTTON1 && event.getClickCount() == 1) {
            if (provider.isSourceWidget(widget)) {
                sourceWidget = widget;
                targetWidget = null;
                startingPoint = new Point(event.getPoint());
                connectionWidget = decorator.createConnectionWidget(interractionLayer.getScene());
//                connectionWidget.setTargetAnchorShape (standardShape);
                connectionWidget.setSourceAnchor(decorator.createSourceAnchor(widget));
                interractionLayer.addChild(connectionWidget);
                interractionLayer.bringToFront();
                return WidgetAction.State.createLocked(widget, this);
            } else {
                NBModelerUtil.showContextPalette(((INodeWidget) widget).getModelerScene(), (INodeWidget) widget);
                ((IModelerScene) widget.getScene()).setActiveTool(DesignerTools.SELECT);//??TBD is it always select before usage?, may it be restored in selectionChanged?
            }
        } else if (event.getButton() == MouseEvent.BUTTON3) {
            if (isLocked()) {
                cancel();//TBD check why don't work correctly
            }
            return State.CONSUMED;
        }
        return State.REJECTED;
    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:25,代码来源:ConnectAction.java

示例4: setNodeWidgetAction

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
    public void setNodeWidgetAction(final INodeWidget nodeWidget) {
        WidgetAction selectAction = ActionFactory.createSelectAction(NODE_WIDGET_SELECT_PROVIDER);
        WidgetAction moveAction = new MoveAction(nodeWidget, null, MOVE_PROVIDER_DEFAULT, ALIGNSTRATEGY_PROVIDER, ALIGNSTRATEGY_PROVIDER);
        WidgetAction popupMenuAction = ActionFactory.createPopupMenuAction(nodeWidget.getPopupMenuProvider());
        WidgetAction snapMoveAction = ActionFactory.createMoveAction(ActionFactory.createSnapToGridMoveStrategy(5, 5), null);
        WidgetAction acceptAction = ActionFactory.createAcceptAction(new PinWidgetAcceptProvider(file.getModelerScene()));
       
        WidgetAction.Chain selectActionTool = nodeWidget.createActions(DesignerTools.SELECT);
        selectActionTool.addAction(selectAction);
//        selectActionTool.addAction(NODE_DELETE_ACTION);
        selectActionTool.addAction(moveAction);
        selectActionTool.addAction(nodeWidget.getModelerScene().createWidgetHoverAction());
        selectActionTool.addAction(acceptAction);
        selectActionTool.addAction(popupMenuAction);
        selectActionTool.addAction(snapMoveAction);
    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:18,代码来源:ModelerDiagramEngine.java

示例5: sceneValidated

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
public void sceneValidated() {
    fireZoomEvent((int) Math.round(scene.getZoomFactor()* 100));
    if (scene.getZoomFactor() * 100 >= MAX_ZOOM_PERCENT
            || scene.getZoomFactor() * 100 <= MIN_ZOOM_PERCENT) {
        // disable marquee zoom
        if (scene.getActiveTool().equals(DesignerTools.MARQUEE_ZOOM)) {
            scene.setCursor(getMarqueeZoomStopCursor());
        }
    } else // reset marquee zoom cursor
     if (scene.getActiveTool().equals(DesignerTools.MARQUEE_ZOOM)) {
            scene.setCursor(getMarqueeZoomCursor());
        }

}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:16,代码来源:ZoomManager.java

示例6: setModelerSceneAction

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
    public void setModelerSceneAction() {
        file.getModelerScene().getActions().addAction(ActionFactory.createWheelPanAction());
        file.getModelerScene().getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.5));
        WidgetAction acceptAction = ActionFactory.createAcceptAction(new CustomAcceptProvider(file.getModelerScene()));
        WidgetAction.Chain selectTool = file.getModelerScene().createActions(DesignerTools.SELECT);
        selectTool.addAction(new LockSelectionAction());//12  sec
        selectTool.addAction(ActionFactory.createSelectAction(new ModelerSceneSelectProvider(), true));
        selectTool.addAction(ActionFactory.createRectangularSelectAction((ObjectScene) file.getModelerScene(), file.getModelerScene().getBackgroundLayer()));//2 sec
        selectTool.addAction(ActionFactory.createZoomAction());
        selectTool.addAction(file.getModelerScene().createWidgetHoverAction());//2 sec
        selectTool.addAction(acceptAction);
        selectTool.addAction(ActionFactory.createPopupMenuAction(file.getModelerScene().getPopupMenuProvider())); //2190 seec
        selectTool.addAction(new WidgetAction.Adapter() {
            @Override
            public WidgetAction.State mouseMoved(Widget widget, WidgetAction.WidgetMouseEvent event) {
//                if (positionLabel != null) {
//                    Point point = widget.convertLocalToScene(event.getPoint());
//                    positionLabel.setText("[" + point.x + "," + point.y + "]");
//                }
                return WidgetAction.State.REJECTED;
            }
        });
        WidgetAction.Chain panTool = file.getModelerScene().createActions(DesignerTools.PAN);
        panTool.addAction(new PanAction());
        panTool.addAction(ActionFactory.createZoomAction());
        WidgetAction.Chain interactiveZoomTool = file.getModelerScene().createActions(DesignerTools.INTERACTIVE_ZOOM);
        interactiveZoomTool.addAction(new InteractiveZoomAction());
        interactiveZoomTool.addAction(ActionFactory.createZoomAction());
        WidgetAction.Chain contextPalette = file.getModelerScene().createActions(DesignerTools.CONTEXT_PALETTE);
        contextPalette.addAction(acceptAction);

    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:34,代码来源:ModelerDiagramEngine.java

示例7: clearModelerSceneAction

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
public void clearModelerSceneAction() {
    cleanActions(file.getModelerScene().createActions(DesignerTools.SELECT));
    cleanActions(file.getModelerScene().createActions(DesignerTools.PAN));
    cleanActions(file.getModelerScene().createActions(DesignerTools.INTERACTIVE_ZOOM));
    cleanActions(file.getModelerScene().createActions(DesignerTools.CONTEXT_PALETTE));
    cleanActions(file.getModelerScene().getActions());
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:9,代码来源:ModelerDiagramEngine.java

示例8: setPinWidgetAction

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
    public void setPinWidgetAction(final IPinWidget pinWidget) {
        WidgetAction.Chain selectActionTool = pinWidget.createActions(DesignerTools.SELECT);
//        WidgetAction moveAction = new MoveAction(pinWidget, null, MOVE_PROVIDER_DEFAULT, ALIGNSTRATEGY_PROVIDER, ALIGNSTRATEGY_PROVIDER);
          selectActionTool.addAction(ActionFactory.createSelectAction(PIN_WIDGET_SELECT_PROVIDER, true));//(getScene().createSelectAction());
//        selectActionTool.addAction(moveAction);

        selectActionTool.addAction(file.getModelerScene().createObjectHoverAction());
        selectActionTool.addAction(ActionFactory.createPopupMenuAction(pinWidget.getPopupMenuProvider()));
        selectActionTool.addAction(new CyclePinFocusAction(new CyclePinFocusProvider()));
    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:12,代码来源:ModelerDiagramEngine.java

示例9: setNodeWidgetAction

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
    public void setNodeWidgetAction(final INodeWidget nodeWidget) {
//        IModelerScene modelerScene = nodeWidget.getModelerScene();
//        WidgetAction doubleClickAction = new DoubleClickAction(new DoubleClickProvider() {
//            @Override
//            public void onDoubleClick(Widget widget, Point point, boolean bln) {
//                nodeWidget.showProperties();
//                nodeWidget.getModelerScene().getModelerPanelTopComponent().changePersistenceState(false);
//            }
//        });
        WidgetAction selectAction = ActionFactory.createSelectAction(new NodeWidgetSelectProvider(nodeWidget.getModelerScene()));
//        WidgetAction moveAction = new MoveAction(nodeWidget,
//                null, new MultiMoveProvider(nodeWidget.getModelerScene()),
//                alignStrategyProvider, alignStrategyProvider);
        WidgetAction moveAction = new MoveAction(nodeWidget,
                null, MOVE_PROVIDER_DEFAULT,
                alignStrategyProvider, alignStrategyProvider);
        WidgetAction popupMenuAction = ActionFactory.createPopupMenuAction(nodeWidget.getPopupMenuProvider());
//        NodeWidgetResizeProvider nodeWidgetResizeProvider = new NodeWidgetResizeProvider();
//        WidgetAction resizeAction = ActionFactory.createResizeAction(nodeWidgetResizeProvider, nodeWidgetResizeProvider);
        WidgetAction snapMoveAction = ActionFactory.createMoveAction(ActionFactory.createSnapToGridMoveStrategy(5, 5), null);

        WidgetAction.Chain selectActionTool = nodeWidget.createActions(DesignerTools.SELECT);
//        selectActionTool.addAction(doubleClickAction);
        selectActionTool.addAction(selectAction);
        selectActionTool.addAction(moveAction);
//        selectActionTool.addAction(ActionFactory.createMoveAction());//BUG : above move interrupt gui view
        selectActionTool.addAction(getScene().createWidgetHoverAction());
        selectActionTool.addAction(popupMenuAction);
//        selectActionTool.addAction(resizeAction);
        selectActionTool.addAction(snapMoveAction);

    }
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:34,代码来源:JPADiagramEngine.java

示例10: setNodeWidgetAction

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
    public void setNodeWidgetAction(final INodeWidget nodeWidget) {
//            WidgetAction editorAction = ActionFactory.createInplaceEditorAction(new LabelTextFieldEditor());
//            WidgetAction deleteAction = new KeyEventLoggerAction();
        WidgetAction doubleClickAction = new DoubleClickAction(new DoubleClickProvider() {
            @Override
            public void onDoubleClick(Widget widget, Point point, boolean bln) {
                nodeWidget.showProperties();
                nodeWidget.getModelerScene().getModelerPanelTopComponent().changePersistenceState(false);
            }
        });
        WidgetAction selectAction = ActionFactory.createSelectAction(new NodeWidgetSelectProvider(nodeWidget.getModelerScene()));
//            WidgetAction alignWithMoveAction = ActionFactory.createAlignWithMoveAction(nodeWidget.getModelerScene().getMainLayer(), nodeWidget.getModelerScene().getInterractionLayer(), ActionFactory.createDefaultAlignWithMoveDecorator());
        WidgetAction moveAction = new MoveAction(nodeWidget,
                null, new MultiMoveProvider(nodeWidget.getModelerScene()),
                alignStrategyProvider, alignStrategyProvider);//ActionFactory.createMoveAction(null, new MultiMoveProvider(nodeWidget.getModelerScene()));
//            WidgetAction alignWithResizeAction = ActionFactory.createAlignWithResizeAction ( nodeWidget.getBPMNScene().getMainLayer(), nodeWidget.getBPMNScene().getInterractionLayer(), null, false);
        WidgetAction popupMenuAction = ActionFactory.createPopupMenuAction(nodeWidget.getPopupMenuProvider());
        NodeWidgetResizeProvider nodeWidgetResizeProvider = new NodeWidgetResizeProvider();
        WidgetAction resizeAction = ActionFactory.createResizeAction(nodeWidgetResizeProvider, nodeWidgetResizeProvider);
        WidgetAction snapMoveAction = ActionFactory.createMoveAction(ActionFactory.createSnapToGridMoveStrategy(5, 5), null);

        WidgetAction.Chain selectActionTool = nodeWidget.createActions(DesignerTools.SELECT);
//          if (nodeWidget instanceof ActivityWidget) {
//                selectActionTool.addAction(((ActivityWidget) nodeWidget).getBoundaryAcceptProvider());
//            }
//            if (nodeWidget instanceof SubProcessWidget) {
//                selectActionTool.addAction(((SubProcessWidget) nodeWidget).getAcceptProvider());
//            }

        selectActionTool.addAction(doubleClickAction);

//             selectActionTool.addAction(new MoveNodeKeyAction(moveStrategy, moveProvider));//Subprocesss Support
        selectActionTool.addAction(selectAction);
        //selectActionTool.addAction(deleteAction);
        //selectActionTool.addAction(((GraphScene) scene).createObjectHoverAction());
        //getLabelWidget().getActions().addAction(editorAction);
        //selectActionTool.addAction(ActionFactory.createExtendedConnectAction(connectionLayer, new SequenceFlowConnectionProvider(scene)));
        //selectActionTool.addAction (new NodeWidgetLockAction ());

//            if (!(nodeWidget instanceof LaneWidget) && !(nodeWidget instanceof LaneSetWidget) && !(nodeWidget instanceof LaneSetBodyWidget)  && !(nodeWidget instanceof LaneSetHeadWidget)) {
//                 selectActionTool.addAction(alignWithMoveAction);
        selectActionTool.addAction(moveAction);
        selectActionTool.addAction(super.getScene().createWidgetHoverAction());
        selectActionTool.addAction(popupMenuAction);
//            }

//             if(nodeWidget instanceof LaneSetHeadWidget){
//                  selectActionTool.addAction(ActionFactory.createMoveAction(null, new PoolMultiMoveProvider(nodeWidget.getBPMNScene())));
//             }
//            selectActionTool.addAction(new MoveAction(moveStrategy, moveProvider));//Subprocesss Support
        ((NodeWidget) nodeWidget).getActions().addAction(resizeAction);

//            if (!(nodeWidget instanceof LaneWidget) && !(nodeWidget instanceof LaneSetWidget) && !(nodeWidget instanceof LaneSetBodyWidget)  && !(nodeWidget instanceof LaneSetHeadWidget)) {
        selectActionTool.addAction(snapMoveAction);
//            }

//       WidgetAction.Chain paletteActionTool = this.createActions(DesignerTools.CONTEXT_PALETTE);
//          paletteActionTool.addAction (new NodeWidgetAction ());
//       paletteActionTool.addAction (new NodeWidgetLockAction ());
    }
 
开发者ID:jGauravGupta,项目名称:jBPMNSuite,代码行数:62,代码来源:BPMNConversationDiagramEngine.java

示例11: setNodeWidgetAction

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
    public void setNodeWidgetAction(final INodeWidget nodeWidget) {
//            WidgetAction editorAction = ActionFactory.createInplaceEditorAction(new LabelTextFieldEditor());
        WidgetAction doubleClickAction = new DoubleClickAction(new DoubleClickProvider() {
            @Override
            public void onDoubleClick(Widget widget, Point point, boolean bln) {
                nodeWidget.showProperties();
                nodeWidget.getModelerScene().getModelerPanelTopComponent().changePersistenceState(false);
            }
        });
//            WidgetAction deleteAction = new KeyEventLoggerAction();
        WidgetAction selectAction = ActionFactory.createSelectAction(new NodeWidgetSelectProvider(nodeWidget.getModelerScene()));
//            WidgetAction alignWithMoveAction = ActionFactory.createAlignWithMoveAction(nodeWidget.getModelerScene().getMainLayer(), nodeWidget.getModelerScene().getInterractionLayer(), ActionFactory.createDefaultAlignWithMoveDecorator());
        WidgetAction moveAction = new MoveAction(nodeWidget,
                null, new MultiMoveProvider(nodeWidget.getModelerScene()),
                alignStrategyProvider, alignStrategyProvider);//ActionFactory.createMoveAction(null, new MultiMoveProvider(nodeWidget.getModelerScene()));
//            WidgetAction alignWithResizeAction = ActionFactory.createAlignWithResizeAction ( nodeWidget.getBPMNScene().getMainLayer(), nodeWidget.getBPMNScene().getInterractionLayer(), null, false);
        WidgetAction popupMenuAction = ActionFactory.createPopupMenuAction(nodeWidget.getPopupMenuProvider());
        NodeWidgetResizeProvider nodeWidgetResizeProvider = new NodeWidgetResizeProvider();
        WidgetAction resizeAction = ActionFactory.createResizeAction(nodeWidgetResizeProvider, nodeWidgetResizeProvider);
        WidgetAction snapMoveAction = ActionFactory.createMoveAction(ActionFactory.createSnapToGridMoveStrategy(5, 5), null);

        WidgetAction.Chain selectActionTool = nodeWidget.createActions(DesignerTools.SELECT);
        if (nodeWidget instanceof ActivityWidget) { //commented in conversation
            selectActionTool.addAction(((ActivityWidget) nodeWidget).getBoundaryAcceptProvider());
        }
        if (nodeWidget instanceof SubProcessWidget) {//commented in conversation
            selectActionTool.addAction(((SubProcessWidget) nodeWidget).getAcceptProvider());
        }

        selectActionTool.addAction(doubleClickAction);

//             selectActionTool.addAction(new MoveNodeKeyAction(moveStrategy, moveProvider));//Subprocesss Support
        selectActionTool.addAction(selectAction);
        //selectActionTool.addAction(deleteAction);
        //selectActionTool.addAction(((GraphScene) scene).createObjectHoverAction());
        //getLabelWidget().getActions().addAction(editorAction);
        //selectActionTool.addAction(ActionFactory.createExtendedConnectAction(connectionLayer, new SequenceFlowConnectionProvider(scene)));
        //selectActionTool.addAction (new NodeWidgetLockAction ());

//            if (!(nodeWidget instanceof LaneWidget) && !(nodeWidget instanceof LaneSetWidget) && !(nodeWidget instanceof LaneSetBodyWidget)  && !(nodeWidget instanceof LaneSetHeadWidget)) {
//                 selectActionTool.addAction(alignWithMoveAction);
        selectActionTool.addAction(moveAction);
        selectActionTool.addAction(getScene().createWidgetHoverAction());
        selectActionTool.addAction(popupMenuAction);
//            }

//             if(nodeWidget instanceof LaneSetHeadWidget){
//                  selectActionTool.addAction(ActionFactory.createMoveAction(null, new PoolMultiMoveProvider(nodeWidget.getBPMNScene())));
//             }
//            selectActionTool.addAction(new MoveAction(moveStrategy, moveProvider));//Subprocesss Support
        ((NodeWidget) nodeWidget).getActions().addAction(resizeAction);

//            if (!(nodeWidget instanceof LaneWidget) && !(nodeWidget instanceof LaneSetWidget) && !(nodeWidget instanceof LaneSetBodyWidget)  && !(nodeWidget instanceof LaneSetHeadWidget)) {
        selectActionTool.addAction(snapMoveAction);
//            }

//       WidgetAction.Chain paletteActionTool = this.createActions(DesignerTools.CONTEXT_PALETTE);
//          paletteActionTool.addAction (new NodeWidgetAction ());
//       paletteActionTool.addAction (new NodeWidgetLockAction ());
    }
 
开发者ID:jGauravGupta,项目名称:jBPMNSuite,代码行数:62,代码来源:BPMNProcessDiagramEngine.java

示例12: AbstractModelerScene

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
public AbstractModelerScene() {

        setKeyEventProcessingType(EventProcessingType.FOCUSED_WIDGET_AND_ITS_CHILDREN);

        backgroundLayer = new LayerWidget(this);
        mainLayer = new LayerWidget(this);
        connectionLayer = new LayerWidget(this);
        interractionLayer = new LayerWidget(this);
        boundaryWidgetLayer = new LayerWidget(this);
        labelLayer = new LayerWidget(this);
        addChild(backgroundLayer);
        addChild(mainLayer);
        addChild(interractionLayer);
        addChild(connectionLayer);
        addChild(boundaryWidgetLayer);
        addChild(labelLayer);

        boundaryWidgetLayer.bringToFront();
        connectionLayer.bringToFront();
        labelLayer.bringToFront();

        router = RouterFactory.createFreeRouter();
//          router = RouterFactory.createOrthogonalSearchRouter(mainLayer);

        satelliteView = this.createSatelliteView();
        //  idGenerator = new UltraSimpleIdGenerator();
        setActiveTool(DesignerTools.SELECT);
// Zoom Action
//        getActions ().addAction (ActionFactory.createZoomAction (1.05, true));
//        getActions ().addAction (ActionFactory.createPanAction ());
        //multi move rectangular selection of widgets
        // getActions ().addAction (ActionFactory.createRectangularSelectAction (this, backgroundLayer));

//     getPriorActions().addAction(new WidgetAction.Adapter () {
//            @Override
//            public State mousePressed(Widget widget, WidgetMouseEvent event) {
//                getView().requestFocus();
//                return State.REJECTED;
//            }
//        });
        this.setContextPaletteManager(new SwingPaletteManager((IModelerScene) this));

    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:44,代码来源:AbstractModelerScene.java

示例13: init

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
public void init(final String name) {
    ObjectScene scene = (ObjectScene) getConnector().getScene();

    labelConnectionWidget = new LabelConnectionWidget(scene, name);
    labelMoveSupport = new EdgeLabelMoveSupport(connector);

    //Action for LabelWidget
    WidgetAction.Chain chain = getLabelConnectionWidget().createActions(DesignerTools.SELECT);
    chain.addAction(scene.createSelectAction());
    chain.addAction(ActionFactory.createMoveAction(labelMoveSupport, labelMoveSupport));
    chain.addAction(new MoveNodeKeyAction(labelMoveSupport, labelMoveSupport));
    chain.addAction(new WidgetAction.Adapter() {
        @Override
        public WidgetAction.State keyPressed(Widget widget,
                WidgetAction.WidgetKeyEvent event) {
            WidgetAction.State retVal = WidgetAction.State.REJECTED;

            if (widget.getState().isSelected() && (event.getKeyCode() == KeyEvent.VK_DELETE || event.getKeyCode() == KeyEvent.VK_BACK_SPACE)) {
                hideLabel();
                retVal = WidgetAction.State.CONSUMED;
            }

            return retVal;
        }
    });

    label.setVisible(true);

    if (connector instanceof IEdgeWidget) {
        IEdgeWidget edgeWidget = (IEdgeWidget) connector;
        edgeWidget.addChild((Widget) getLabelConnectionWidget());
        edgeWidget.setConstraint((Widget) getLabelConnectionWidget(),
                getDefaultAlignment(name, LabelType.EDGE),
                0.5f);

    } else if (connector instanceof INodeWidget) {
        INodeWidget nodeWidget = (INodeWidget) connector;
        nodeWidget.getModelerScene().getLabelLayer().addChild((Widget) getLabelConnectionWidget());
    }

    scene.validate();
    setDefaultPosition();
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:44,代码来源:AbstractLabelManager.java

示例14: clearActions

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
public void clearActions() {
    cleanActions(getLabelConnectionWidget().createActions(DesignerTools.SELECT));
    cleanActions(labelWidget.createActions(DesignerTools.SELECT));
    cleanActions(this.createActions(DesignerTools.SELECT));
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:6,代码来源:AbstractLabelManager.java

示例15: clearNodeWidgetAction

import org.netbeans.modeler.tool.DesignerTools; //导入依赖的package包/类
@Override
public void clearNodeWidgetAction(final INodeWidget nodeWidget) {
    cleanActions(nodeWidget.createActions(DesignerTools.SELECT));
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:5,代码来源:ModelerDiagramEngine.java


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