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


Java AnchorShape类代码示例

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


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

示例1: ConnectionWidget

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
/**
 * Creates a connection widget.
 * @param scene the scene
 */
public ConnectionWidget (Scene scene) {
    super (scene);
    sourceAnchorShape = AnchorShape.NONE;
    targetAnchorShape = AnchorShape.NONE;
    controlPointShape = PointShape.NONE;
    endPointShape = PointShape.NONE;
    router = RouterFactory.createDirectRouter ();
    routingRequired = true;
    connectionWidgetLayout = new ConnectionWidgetLayout ();
    setLayout (connectionWidgetLayout);
    stroke = STROKE_DEFAULT;
    paintControlPoints = false;
    controlPointCutDistance = 0;
    sourceEntry = new ConnectionEntry (true);
    targetEntry = new ConnectionEntry (false);

    routingPolicy = RoutingPolicy.ALWAYS_ROUTE;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:ConnectionWidget.java

示例2: EdgeWidget

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
public EdgeWidget(CfgScene scene, CfgEdge edge) {
    super(scene);       
    Color lineColor;
    CfgPreferences prefs = CfgPreferences.getInstance();
    
    if(edge.isBackEdge()) 
        lineColor = prefs.getBackedgeColor();       
    else if (edge.isXhandler())
        lineColor = prefs.getExceptionEdgeColor();
    else    
        lineColor = prefs.getEdgeColor();
    
    setLineColor(lineColor);
    AnchorShape as;
    if(edge.isReflexive())//small Arrow
        as = AnchorShapeFactory.createTriangleAnchorShape(6, true, false, 5);
    else
        as =AnchorShapeFactory.createTriangleAnchorShape(10, true, false, 9);

    setTargetAnchorShape(as);  
    setToolTipText(edge.toString());              
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:23,代码来源:EdgeWidget.java

示例3: attachEdgeWidget

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
@Override
protected Widget attachEdgeWidget(Edge edge){
    EdgeWidget connection = new EdgeWidget(this);
    connection.setStroke(Util.STROKE_2);
    connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);

    LabelWidget label = createEdgeLabel(edge);
    connection.setConstraint(label, LayoutFactory.ConnectionWidgetLayoutAlignment.TOP_CENTER, 0.5f);

    connection.addChild(label);
    connections.addChild(connection);

    connection.setRouter(router);
    connection.highLight(false);
    
    connection.getActions().addAction(hoverAction);
    connection.getActions().addAction(editAction);
    connection.getActions().addAction(edgePopupAction);
    return connection;
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:21,代码来源:RuleScene.java

示例4: creaCandidateCorrespondence

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
private void creaCandidateCorrespondence(ValueCorrespondence valueCorrespondence, MappingTask mappingTask) {
    INode iNodeSource = finder.findNodeInSchema(valueCorrespondence.getSourcePaths().get(0), mappingTask.getSourceProxy());
    VMDPinWidgetSource sourceWidget = (VMDPinWidgetSource) iNodeSource.getAnnotation(Costanti.PIN_WIDGET_TREE_SPICY);
    INode iNodeTarget = finder.findNodeInSchema(valueCorrespondence.getTargetPath(), mappingTask.getTargetProxy());
    VMDPinWidgetTarget targetWidget = (VMDPinWidgetTarget) iNodeTarget.getAnnotation(Costanti.PIN_WIDGET_TREE_SPICY);

    ConnectionWidget connection = new ConnectionWidget(glassPane.getScene());
    connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
    connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
    connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
    Stroke stroke = Costanti.DASHED_STROKE;
    connection.setStroke(stroke);
    ConnectionInfo connectionInfo = new ConnectionInfo();
    connectionInfo.setConnectionWidget(connection);
    connectionInfo.setValueCorrespondence(valueCorrespondence);
    connection.setToolTipText(connectionInfo.getValueCorrespondence().toString());
    setColorOnConfidence(connectionInfo, connection);
    glassPane.getConnectionLayer().addChild(connection, connectionInfo);
    connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionSpicy(glassPane.getScene())));
    connection.getActions().addAction(ActionFactory.createSelectAction(new MySelectConnectionActionProvider(glassPane.getConnectionLayer())));
    glassPane.getScene().validate();
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:23,代码来源:CreaWidgetCorrespondencesSpicy.java

示例5: creaConnection

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
private MyConnectionWidget creaConnection(Widget sourceWidget, Widget targetWidget, boolean direzionale, Stroke stroke) {
    MyConnectionWidget connection = new MyConnectionWidget(scene);
    connection.setTargetAnchorShape(AnchorShape.NONE);
    if (direzionale) {
        AnchorShape anchorShape = AnchorShapeFactory.createTriangleAnchorShape(5, false, false);
        connection.setTargetAnchorShape(anchorShape/*AnchorShape.TRIANGLE_HOLLOW*/);
    }

    connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
    connection.setTargetAnchor(AnchorFactory.createCenterAnchor(targetWidget));
    connection.setLineColor(Costanti.COLOR_CONNECTION_CONSTRAINT_DEFAULT);
    connection.setStroke(stroke);
    connection.setKey(true);

    constraintsLayer.addChild(connection);

    return connection;
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:19,代码来源:CreaWidgetAlberi.java

示例6: creaConnection

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
private MyConnectionWidget creaConnection(Widget sourceWidget, Widget targetWidget, boolean direzionale, Stroke stroke, JoinConstraint joinConstraint) {
        MyConnectionWidget connection = new MyConnectionWidget(scene);
        connection.setDirezionale(direzionale);
        connection.setTargetAnchorShape(AnchorShape.NONE);
        if (direzionale) {
            AnchorShape anchorShape = Costanti.ANCHOR_SHAPE;
            connection.setTargetAnchorShape(anchorShape/*AnchorShape.TRIANGLE_HOLLOW*/);
        }
        connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
        connection.setTargetAnchor(AnchorFactory.createCenterAnchor(targetWidget));
        connection.setLineColor(Costanti.COLOR_CONNECTION_CONSTRAINT_DEFAULT);
        connection.setStroke(stroke);
        constraintsLayer.addChild(connection, joinConstraint);
        constraintsLayer.revalidate();
//        connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderJoinCondition(scene, constraintsLayer, joinConstraint)));
        return connection;
    }
 
开发者ID:dbunibas,项目名称:spicy,代码行数:18,代码来源:CreaWidgetAlberiLogic.java

示例7: creaCorrespondence

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
private void creaCorrespondence(VariableCorrespondence variableCorrespondence, ValueCorrespondence valueCorrespondence, MappingTask mappingTask) {
        INode iNodeSource = finder.findNodeInSchema(valueCorrespondence.getSourcePaths().get(0), mappingTask.getSourceProxy());
        VMDPinWidgetSource sourceWidget = (VMDPinWidgetSource) iNodeSource.getAnnotation(Costanti.PIN_WIDGET_TREE);
        INode iNodeTarget = finder.findNodeInSchema(valueCorrespondence.getTargetPath(), mappingTask.getTargetProxy());
        VMDPinWidgetTarget targetWidget = (VMDPinWidgetTarget) iNodeTarget.getAnnotation(Costanti.PIN_WIDGET_TREE);

        ConnectionWidget connection = new ConnectionWidget(glassPane.getScene());
        connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
        connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
        connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
        Stroke stroke = Costanti.BASIC_STROKE;
        connection.setStroke(stroke);
        ConnectionInfo connectionInfo = new ConnectionInfo();
        connectionInfo.setConnectionWidget(connection);
        connectionInfo.setValueCorrespondence(valueCorrespondence);
        connection.setToolTipText(connectionInfo.getValueCorrespondence().toString());
        glassPane.getConnectionLayer().addChild(connection, connectionInfo);
        connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionMappingTask(glassPane.getScene())));
        connection.getActions().addAction(ActionFactory.createSelectAction(new MySelectConnectionActionProvider(glassPane.getConnectionLayer())));
//        analisiFiltro.creaWidgetEsisteFiltro(connection, connectionInfo);
        glassPane.getScene().validate();
    }
 
开发者ID:dbunibas,项目名称:spicy,代码行数:23,代码来源:CreaWidgetCorrespondencesMappingTask.java

示例8: createConnection

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
    ConnectionWidget connection = new ConnectionWidget(scene);
    connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
    connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
    connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
    Stroke stroke = creator.getStroke();
    connection.setStroke(stroke);
    if (targetWidget instanceof FunctionalDependencyWidget) {
        setWidgetFunctionalDependency(sourceWidget, targetWidget, connection);
        connectionLayer.addChild(connection);
    }
    if (targetWidget instanceof VMDPinWidgetTarget) {
        if (createJoinCondition(sourceWidget, targetWidget)) {
            return;
        }
    }

}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:19,代码来源:ActionSceneConnectionTarget.java

示例9: createConnection

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
    try {
        ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
        connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
        connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
        connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
        Stroke stroke = Costanti.BASIC_STROKE;
        connection.setStroke(stroke);

        connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionConst(sourceWidget.getScene(), caratteristicheWidget)));
        ConnectionInfo connectionInfo = new ConnectionInfo();
        connectionInfo.setTargetWidget(targetWidget);
        connectionInfo.setConnectionWidget(connection);
        caratteristicheWidget.setFormValidation(new FormValidation(false));
        creator.createCorrespondenceWithSourceValue(mainLayer, sourceWidget, targetWidget, connectionInfo);
        caratteristicheWidget.addConnectionInfo(connectionInfo);
        connectionLayer.addChild(connection, connectionInfo);

    } catch (ExpressionSyntaxException ese) {
        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + ese, DialogDescriptor.WARNING_MESSAGE));
        StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING));
    }

}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:25,代码来源:ActionConstantConnection.java

示例10: createConnection

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
    try {
        ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
        connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
        connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
        connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
        Stroke stroke = Costanti.BASIC_STROKE;
        connection.setStroke(stroke);
        connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunctionalDep(sourceWidget.getScene(), mainLayer, caratteristiche)));
        ConnectionInfo connectionInfo = new ConnectionInfo();
        connectionInfo.setTargetWidget(targetWidget);
        connectionInfo.setConnectionWidget(connection);
        if (!caratteristiche.getTargetList().isEmpty()) {
            review.removeFunctionalDependency(caratteristiche.getFunctionalDependency(), caratteristiche.isSource());
        }
        caratteristiche.addTargetWidget((VMDPinWidget) targetWidget);
        creator.createCorrespondenceWithFunctionalDep(mainLayer, caratteristiche, connectionInfo);
        caratteristiche.setConnectionInfo(connectionInfo);
        connectionLayer.addChild(connection, connectionInfo);

    } catch (ExpressionSyntaxException e) {
        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + e.getMessage(), DialogDescriptor.WARNING_MESSAGE));
    }

}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:26,代码来源:ActionFunctionalDepConnection.java

示例11: createConnection

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
    try {
        ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
        connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
        connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
        connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
        Stroke stroke = Costanti.BASIC_STROKE;
        connection.setStroke(stroke);
        connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunc(sourceWidget.getScene(), mainLayer, caratteristiche)));
        ConnectionInfo connectionInfo = new ConnectionInfo();
        connectionInfo.setTargetWidget(targetWidget);
        connectionInfo.setConnectionWidget(connection);
        caratteristiche.setTargetWidget((VMDPinWidgetTarget) targetWidget);
        creator.createCorrespondenceWithFunction(mainLayer, targetWidget, caratteristiche, connectionInfo);
        caratteristiche.setConnectionInfo(connectionInfo);
        connectionLayer.addChild(connection, connectionInfo);
    } catch (ExpressionSyntaxException e) {
        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + e.getMessage(), DialogDescriptor.WARNING_MESSAGE));
    }

}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:22,代码来源:ActionFunctionConnection.java

示例12: createConnection

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
    ConnectionWidget connection = new ConnectionWidget(scene);
    connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
    connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
    connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
    Stroke stroke = creator.getStroke();
    connection.setStroke(stroke);
    if (targetWidget instanceof FunctionWidget) {
        setWidget(sourceWidget, targetWidget, connection);
        connectionLayer.addChild(connection);
    }
    if (targetWidget instanceof FunctionalDependencyWidget) {
        setWidgetFunctionalDependency(sourceWidget, targetWidget, connection);
        connectionLayer.addChild(connection);
    }
    if (targetWidget instanceof VMDPinWidgetTarget) {
        createCorrespondence(connection, sourceWidget, targetWidget);
    }
    if (targetWidget instanceof VMDPinWidgetSource) {
        if (createJoinCondition(sourceWidget, targetWidget)) {
            return;
        }
    }

}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:26,代码来源:ActionSceneConnection.java

示例13: createConnectionToTargetImpl

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
private ConnectionInfo createConnectionToTargetImpl(Widget sourceWidget, Widget targetWidget, LayerWidget mainLayer, LayerWidget connectionLayer, Stroke stroke) {

        ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
        connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
        connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
        connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
        connection.setStroke(stroke);

        CaratteristicheWidgetInterConst caratteristicheWidget = (CaratteristicheWidgetInterConst) mainLayer.getChildConstraint(sourceWidget);

        connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionConst(sourceWidget.getScene(), caratteristicheWidget)));
        ConnectionInfo connectionInfo = new ConnectionInfo();
        connectionInfo.setTargetWidget(targetWidget);
        connectionInfo.setConnectionWidget(connection);
        caratteristicheWidget.addConnectionInfo(connectionInfo);

        connectionLayer.addChild(connection, connectionInfo);
        return connectionInfo;
    }
 
开发者ID:dbunibas,项目名称:spicy,代码行数:20,代码来源:ConnectionCreator.java

示例14: createConnectionFromFunctionalDependecyImpl

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
private ConnectionInfo createConnectionFromFunctionalDependecyImpl(Widget functionalDepWidget, Widget targetWidget, LayerWidget mainLayer, LayerWidget connectionLayer, Stroke stroke) {
        ConnectionWidget connection = new ConnectionWidget(functionalDepWidget.getScene());
        connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
        connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(functionalDepWidget));
        connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
        connection.setStroke(stroke);
        connection.setVisible(true);


        CaratteristicheWidgetInterFunctionalDep caratteristicheWidget = (CaratteristicheWidgetInterFunctionalDep) mainLayer.getChildConstraint(functionalDepWidget);

        connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunctionalDep(functionalDepWidget.getScene(), mainLayer, caratteristicheWidget)));
        caratteristicheWidget.addTargetWidget((VMDPinWidget) targetWidget);

        ConnectionInfo connectionInfo = new ConnectionInfo();
//        connectionInfo.setTargetWidget(targetWidget);
//        connectionInfo.setConnectionWidget(connection);
        connectionLayer.addChild(connection, connectionInfo);
        return connectionInfo;
    }
 
开发者ID:dbunibas,项目名称:spicy,代码行数:21,代码来源:ConnectionCreator.java

示例15: createConnectionFromFunctionImpl

import org.netbeans.api.visual.anchor.AnchorShape; //导入依赖的package包/类
private ConnectionInfo createConnectionFromFunctionImpl(Widget functionWidget, Widget targetWidget, LayerWidget mainLayer, LayerWidget connectionLayer, Stroke stroke) {
    ConnectionWidget connection = new ConnectionWidget(functionWidget.getScene());
    connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
    connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(functionWidget));
    connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
    connection.setStroke(stroke);

    CaratteristicheWidgetInterFunction caratteristicheWidget = (CaratteristicheWidgetInterFunction) mainLayer.getChildConstraint(functionWidget);

    connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunc(functionWidget.getScene(), mainLayer, caratteristicheWidget)));
    ConnectionInfo connectionInfo = new ConnectionInfo();
    connectionInfo.setTargetWidget(targetWidget);
    connectionInfo.setConnectionWidget(connection);
    connectionLayer.addChild(connection, connectionInfo);
    return connectionInfo;
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:17,代码来源:ConnectionCreator.java


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