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

Java ConnectorState类代码示例

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

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



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

示例1: resolveTargetWidgetCoreDive

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
private boolean resolveTargetWidgetCoreDive (Widget[] result, Widget widget, Point parentLocation) {
    if (interractionLayer.equals (widget))
        return false;
    Point widgetLocation = widget.getLocation ();
    Point location = new Point (parentLocation.x - widgetLocation.x, parentLocation.y - widgetLocation.y);

    if (! widget.getBounds ().contains (location))
        return false;

    java.util.List<Widget> children = widget.getChildren ();
    for (int i = children.size () - 1; i >= 0; i --) {
        if (resolveTargetWidgetCoreDive (result, children.get (i), location))
            return true;
    }

    if (! widget.isHitAt (location))
        return false;

    ConnectorState state = provider.isTargetWidget (sourceWidget, widget);
    if (state == ConnectorState.REJECT)
        return false;
    if (state == ConnectorState.ACCEPT)
        result[0] = widget;
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ConnectAction.java


示例2: isTargetWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public ConnectorState isTargetWidget(Widget source, Widget target) {
    //TODO implementare acnhe la condizione verso una funzione
    if ((source instanceof VMDPinWidgetSource && target instanceof VMDPinWidgetTarget) && (source != target) && (target.isEnabled())) {
        return ConnectorState.ACCEPT;
    }
    if ((source instanceof VMDPinWidgetSource && target instanceof FunctionWidget) && (source != target)) {
        return ConnectorState.ACCEPT;
    }
    if ((source instanceof VMDPinWidgetSource && target instanceof VMDPinWidgetSource) && (source != target) && (target.isEnabled())) {
        return ConnectorState.ACCEPT;
    }
    if ((source instanceof VMDPinWidgetSource && target instanceof FunctionalDependencyWidget) && (source != target) && (target.isEnabled())) {
        CaratteristicheWidgetInterFunctionalDep caratteristiche = (CaratteristicheWidgetInterFunctionalDep) target.getParentWidget().getChildConstraint(target);
        if (caratteristiche.isSource() == null || caratteristiche.isSource()) {
             caratteristiche.setSource(Boolean.TRUE);
            return ConnectorState.ACCEPT;
        }
    }
    return ConnectorState.REJECT_AND_STOP;
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:21,代码来源:ActionSceneConnection.java


示例3: isTargetWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public ConnectorState isTargetWidget(Widget sourceWidget, Widget targetWidget) {
        if ((sourceWidget instanceof ChainWidget && targetWidget instanceof ChainWidget) && (sourceWidget != targetWidget)) {
            CaratteristicheWidgetChainComposition caratteristicheWidgetChainCompositionSource = (CaratteristicheWidgetChainComposition) mainLayer.getChildConstraint(sourceWidget);
            CaratteristicheWidgetChainComposition caratteristicheWidgetChainCompositionTarget = (CaratteristicheWidgetChainComposition) mainLayer.getChildConstraint(targetWidget);
            MutableMappingTask mutableMappingTaskSource = caratteristicheWidgetChainCompositionSource.getMutableMappingTask();
            MutableMappingTask mutableMappingTaskTarget = caratteristicheWidgetChainCompositionTarget.getMutableMappingTask();

            if ((caratteristicheWidgetChainCompositionTarget.getSourceScenario() == null) && !mutableMappingTaskTarget.mutableMappingTasksContains(mutableMappingTaskSource) && !mutableMappingTaskSource.mutableMappingTasksContains(mutableMappingTaskTarget)) {
                return ConnectorState.ACCEPT;
            }
        } else if ((sourceWidget instanceof ChainWidget && targetWidget instanceof MergeWidget) && (sourceWidget != targetWidget)) {
//            CaratteristicheWidgetComposition caratteristicheWidgetCompositionSource = (CaratteristicheWidgetComposition) mainLayer.getChildConstraint(sourceWidget);
//            CaratteristicheWidgetMergeComposition CaratteristicheWidgetMergeCompositionTarget = (CaratteristicheWidgetMergeComposition) mainLayer.getChildConstraint(targetWidget);
//            MutableMappingTask mutableMappingTaskSource = caratteristicheWidgetCompositionSource.getMutableMappingTask();
//            MutableMappingTask mutableMappingTaskTarget = CaratteristicheWidgetMergeCompositionTarget.getMutableMappingTask();
//            if (||!mutableMappingTaskTarget.mutableMappingTasksContains(mutableMappingTaskSource) && !mutableMappingTaskSource.mutableMappingTasksContains(mutableMappingTaskTarget)) {
            return ConnectorState.ACCEPT;
//            }
        }
        return ConnectorState.REJECT_AND_STOP;
    }
 
开发者ID:dbunibas,项目名称:spicy,代码行数:22,代码来源:ActionUndefinedChainConnection.java


示例4: dragEnter

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public State dragEnter (Widget widget, WidgetDropTargetDragEvent event) {
    ConnectorState acceptable = provider.isAcceptable (widget, event.getPoint (), event.getTransferable ());

    if (acceptable == ConnectorState.ACCEPT) {
        event.acceptDrag (DnDConstants.ACTION_COPY_OR_MOVE);
        return State.CONSUMED;
    } else if (acceptable == ConnectorState.REJECT_AND_STOP) {
        event.rejectDrag ();
        return State.CONSUMED;
    }
    return State.REJECTED;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:AcceptAction.java


示例5: dragOver

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public State dragOver (Widget widget, WidgetDropTargetDragEvent event) {
    ConnectorState acceptable = provider.isAcceptable (widget, event.getPoint (), event.getTransferable ());

    if (acceptable == ConnectorState.ACCEPT) {
        event.acceptDrag (DnDConstants.ACTION_COPY_OR_MOVE);
        return State.CONSUMED;
    } else if (acceptable == ConnectorState.REJECT_AND_STOP) {
        event.rejectDrag ();
        return State.CONSUMED;
    }
    return State.REJECTED;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:AcceptAction.java


示例6: dropActionChanged

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public State dropActionChanged (Widget widget, WidgetDropTargetDragEvent event) {
    ConnectorState acceptable = provider.isAcceptable (widget, event.getPoint (), event.getTransferable ());

    if (acceptable == ConnectorState.ACCEPT) {
        event.acceptDrag (DnDConstants.ACTION_COPY_OR_MOVE);
        return State.CONSUMED;
    } else if (acceptable == ConnectorState.REJECT_AND_STOP) {
        event.rejectDrag ();
        return State.CONSUMED;
    }
    return State.REJECTED;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:AcceptAction.java


示例7: drop

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public State drop (Widget widget, WidgetDropTargetDropEvent event) {
    ConnectorState acceptable = provider.isAcceptable (widget, event.getPoint (), event.getTransferable ());

    if (acceptable == ConnectorState.ACCEPT) {
        event.acceptDrop (DnDConstants.ACTION_COPY_OR_MOVE);
        provider.accept (widget, event.getPoint (), event.getTransferable ());
        return State.CONSUMED;
    } else if (acceptable == ConnectorState.REJECT_AND_STOP) {
        event.rejectDrop ();
        return State.CONSUMED;
    }
    return State.REJECTED;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:AcceptAction.java


示例8: isTargetWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public ConnectorState isTargetWidget(Widget sourceWidget, Widget targetWidget) {
    Object object = findObject(targetWidget);
    target = isNode(object) ? (String) object : null;
    if (target != null) {
        return !source.equals(target) ? ConnectorState.ACCEPT : ConnectorState.REJECT_AND_STOP;
    }
    return object != null ? ConnectorState.REJECT_AND_STOP : ConnectorState.REJECT;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:Utils.java


示例9: isReplacementWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public ConnectorState isReplacementWidget(ConnectionWidget connectionWidget, Widget replacementWidget, boolean reconnectingSource) {
    Object object = findObject(replacementWidget);
    replacementNode = isNode(object) ? (String) object : null;
    if (replacementNode != null) {
        return ConnectorState.ACCEPT;
    }
    return object != null ? ConnectorState.REJECT_AND_STOP : ConnectorState.REJECT;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:Utils.java


示例10: isAcceptable

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
/**
 * Does @transferable support {@link #dataFlavor}?
 *
 * @param transferable Transferable that is being tested if it supports the
 * data flavor that is accepted by this action.
 * @return True if transferable can be dropped on this.
 */
@Override
public final ConnectorState isAcceptable(Widget arg0, Point arg1, Transferable transferable) {
    if (transferable.isDataFlavorSupported(dataFlavor)) {
        return ConnectorState.ACCEPT;
    }
    return ConnectorState.REJECT;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:15,代码来源:AbstractAcceptAction.java


示例11: isAcceptable

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
@Override
public final ConnectorState isAcceptable(Widget arg0, Point arg1, Transferable transferable) {
    if (transferable.isDataFlavorSupported(dataFlavor)) {
        return ConnectorState.ACCEPT;
    }
    return ConnectorState.REJECT;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:8,代码来源:AbstractAcceptAction.java


示例12: isAcceptable

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
@Override
public ConnectorState isAcceptable(Widget widget, Point point, Transferable transferable) {
    ConnectorState retVal = ConnectorState.ACCEPT;
    if (isWidgetMove(transferable)) {
        Widget[] target = new Widget[]{getWidget(transferable)};
        for (Widget curWidget : target) {
            if (curWidget instanceof NodeWidget) {
                NodeWidget nodeWidget = (NodeWidget) curWidget;
                if (nodeWidget.getNodeWidgetInfo().getModelerDocument().getFlowDimension() == FlowDimensionType.BOUNDARY) {
                    retVal = ConnectorState.REJECT;
                    return retVal;
                }
            }
        }
    } else if (isPaletteItem(transferable)) {
        SubCategoryNodeConfig subCategoryInfo = getSubCategory(transferable);
        Image dragImage = subCategoryInfo.getImage();
        JComponent view = scene.getView();
        
        Graphics2D g2 = (Graphics2D) view.getGraphics();
        Rectangle visRect = scene.getBounds();//view.getVisibleRect();//
        view.paintImmediately(0, 0, visRect.width - visRect.x, visRect.height - visRect.y);//(visRect.x, visRect.y, visRect.width, visRect.height);
        g2.drawImage(dragImage,
                AffineTransform.getTranslateInstance(point.getLocation().getX() - visRect.x,
                        point.getLocation().getY() - visRect.y),
                null);

        if (subCategoryInfo.getModelerDocument().getFlowDimension() == FlowDimensionType.BOUNDARY
                || IPinWidget.class.isAssignableFrom(subCategoryInfo.getModelerDocument().getWidget())) {
            scene.repaint();
            return ConnectorState.REJECT;
        }
    }
    return retVal;

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


示例13: isAcceptable

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
@Override
public ConnectorState isAcceptable(Widget widget, Point point, Transferable transferable) {
    ConnectorState retVal = ConnectorState.ACCEPT;
    if (isWidgetMove(transferable)) {
        Widget[] target = new Widget[]{getWidget(transferable)};
        for (Widget curWidget : target) {
            if (curWidget instanceof NodeWidget) {
                NodeWidget nodeWidget = (NodeWidget) curWidget;
                if (nodeWidget.getNodeWidgetInfo().getModelerDocument().getFlowDimension() == FlowDimensionType.BOUNDARY) {
                    retVal = ConnectorState.REJECT;
                    return retVal;
                }
            }
        }
    } else if (isPaletteItem(transferable)) {
        SubCategoryNodeConfig subCategoryInfo = getSubCategory(transferable);
        Image dragImage = subCategoryInfo.getImage();
        JComponent view = scene.getView();

        Graphics2D g2 = (Graphics2D) view.getGraphics();
        Rectangle visRect = scene.getBounds();
        view.paintImmediately(0, 0, visRect.width - visRect.x, visRect.height - visRect.y);
        point = scene.convertSceneToView(point);
        g2.drawImage(dragImage,
                AffineTransform.getTranslateInstance(widget.getLocation().x + point.getLocation().getX(),
                        widget.getLocation().y + point.getLocation().getY()),
                null);

        if (subCategoryInfo.getModelerDocument().getFlowDimension() == FlowDimensionType.BOUNDARY
                || INodeWidget.class.isAssignableFrom(subCategoryInfo.getModelerDocument().getWidget())//INodeWidget item skipped
                || !((IPNodeWidget) widget).isValidPinWidget(subCategoryInfo)) {
            return ConnectorState.REJECT;
        }
    }

    return retVal;

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


示例14: isReplacementWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
@Override
public ConnectorState isReplacementWidget(ConnectionWidget connectionWidget, Widget replacementWidget, boolean reconnectingSource) {
    Object object = scene.findObject(replacementWidget);
    replacementNode = scene.isNode(object) ? (NodeWidgetInfo) object : null;
    if (replacementNode != null) {
        return ConnectorState.ACCEPT;
    }
    return object != null ? ConnectorState.REJECT_AND_STOP : ConnectorState.REJECT;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:10,代码来源:SequenceFlowReconnectProvider.java


示例15: isTargetWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
@Override
public ConnectorState isTargetWidget(Widget src, Widget trg) {
    if (trg instanceof IStartFlowNodeWidget || src instanceof IEndFlowNodeWidget) {
        return ConnectorState.REJECT;
    } else {
        return src != trg && trg instanceof AbstractNodeWidget ? ConnectorState.ACCEPT : ConnectorState.REJECT;
    }
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:9,代码来源:SequenceFlowConnectionProvider.java


示例16: resolveTargetWidgetCoreDive

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
private boolean resolveTargetWidgetCoreDive(Widget[] result, Widget widget, Point parentLocation) {
    Point widgetLocation = widget.getLocation();
    Point location = new Point(parentLocation.x - widgetLocation.x, parentLocation.y - widgetLocation.y);

    if (!widget.getBounds().contains(location)) {
        return false;
    }

    java.util.List<Widget> children = widget.getChildren();

    for (int i = children.size() - 1; i >= 0; i--) {
        if (!(children.get(i) instanceof LabelWidget) && !(children.get(i) instanceof ConnectionWidget)) {
            if (resolveTargetWidgetCoreDive(result, children.get(i), location)) {
                return true;
            }
        }
    }

    if (!widget.isHitAt(location)) {
        return false;
    }

    ConnectorState state = provider.isTargetWidget(sourceWidget, widget);
    if (state == ConnectorState.REJECT) {
        return false;
    }
    if (state == ConnectorState.ACCEPT) {
        result[0] = widget;
    }
    return true;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:32,代码来源:ConnectAction.java


示例17: isTargetWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public ConnectorState isTargetWidget(Widget source, Widget target) {
    if ((source instanceof VMDPinWidgetTarget && target instanceof VMDPinWidgetTarget)) {
        return ConnectorState.ACCEPT;
    }
    if ((source instanceof VMDPinWidgetTarget && target instanceof FunctionalDependencyWidget) && (source != target) && (target.isEnabled())) {
        CaratteristicheWidgetInterFunctionalDep caratteristiche = (CaratteristicheWidgetInterFunctionalDep) target.getParentWidget().getChildConstraint(target);
        if (caratteristiche.isSource() == null || !caratteristiche.isSource()) {
            caratteristiche.setSource(Boolean.FALSE);
            return ConnectorState.ACCEPT;
        }
    }
    return ConnectorState.REJECT_AND_STOP;
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:14,代码来源:ActionSceneConnectionTarget.java


示例18: isTargetWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public ConnectorState isTargetWidget(Widget source, Widget target) {
    if (caratteristiche.isSource()) {
        if ((source instanceof FunctionalDependencyWidget && target instanceof VMDPinWidgetSource) && (source != target) && target.isEnabled()) {
            return ConnectorState.ACCEPT;
        }
    } else {
        if ((source instanceof FunctionalDependencyWidget && target instanceof VMDPinWidgetTarget) && (source != target) && target.isEnabled()) {
            return ConnectorState.ACCEPT;
        }
    }
    return ConnectorState.REJECT_AND_STOP;
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:13,代码来源:ActionFunctionalDepConnection.java


示例19: isTargetWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
public ConnectorState isTargetWidget(Widget sourceWidget, Widget targetWidget) {
    if ((sourceWidget instanceof MergeWidget && targetWidget instanceof ChainWidget) && (sourceWidget != targetWidget)) {
        CaratteristicheWidgetMergeComposition caratteristicheWidgetMergeCompositionSource = (CaratteristicheWidgetMergeComposition) mainLayer.getChildConstraint(sourceWidget);
        CaratteristicheWidgetChainComposition caratteristicheWidgetChainCompositionTarget = (CaratteristicheWidgetChainComposition) mainLayer.getChildConstraint(targetWidget);
        if (controllaContenimento(caratteristicheWidgetMergeCompositionSource, caratteristicheWidgetChainCompositionTarget)) {
            return ConnectorState.ACCEPT;
        }
    }
    return ConnectorState.REJECT_AND_STOP;
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:11,代码来源:ActionMergeConnection.java


示例20: isTargetWidget

import org.netbeans.api.visual.action.ConnectorState; //导入依赖的package包/类
@Override
public ConnectorState isTargetWidget(Widget source, Widget target) {
    return(source instanceof JRLibNodeWidget) &&
           (target instanceof JRLibNodeWidget) &&
           source != target?
            ConnectorState.ACCEPT : ConnectorState.REJECT;
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:8,代码来源:JRLibConnectionProvider.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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