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


Java ConnectorState.ACCEPT属性代码示例

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


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

示例1: resolveTargetWidgetCoreDive

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,代码行数:25,代码来源:ConnectAction.java

示例2: isTargetWidget

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,代码行数:20,代码来源:ActionSceneConnection.java

示例3: isTargetWidget

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,代码行数:21,代码来源:ActionUndefinedChainConnection.java

示例4: dragEnter

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,代码行数:12,代码来源:AcceptAction.java

示例5: dragOver

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,代码行数:12,代码来源:AcceptAction.java

示例6: dropActionChanged

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,代码行数:12,代码来源:AcceptAction.java

示例7: drop

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,代码行数:13,代码来源:AcceptAction.java

示例8: isTargetWidget

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,代码行数:8,代码来源:Utils.java

示例9: isReplacementWidget

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,代码行数:8,代码来源:Utils.java

示例10: isAcceptable

/**
 * 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,代码行数:14,代码来源:AbstractAcceptAction.java

示例11: isAcceptable

@Override
public final ConnectorState isAcceptable(Widget arg0, Point arg1, Transferable transferable) {
    if (transferable.isDataFlavorSupported(dataFlavor)) {
        return ConnectorState.ACCEPT;
    }
    return ConnectorState.REJECT;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:7,代码来源:AbstractAcceptAction.java

示例12: isAcceptable

@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,代码行数:36,代码来源:CustomAcceptProvider.java

示例13: isAcceptable

@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,代码行数:38,代码来源:PinWidgetAcceptProvider.java

示例14: isReplacementWidget

@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,代码行数:9,代码来源:SequenceFlowReconnectProvider.java

示例15: isTargetWidget

@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,代码行数:8,代码来源:SequenceFlowConnectionProvider.java


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