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


Java IPinWidget类代码示例

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


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

示例1: attachEdgeTargetAnchor

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
/**
 * Called by the setEdgeTarget method to notify about the changing the edge
 * target in the graph model. The method is responsible for attaching a new
 * target pin to the edge in the visual representation.
 * <p>
 * Usually it is implemented as:
 * <pre>
 * Widget targetPinWidget = findWidget (targetPin);
 * Anchor targetAnchor = AnchorFactory.createRectangularAnchor (targetPinWidget)
 * ConnectionWidget edgeWidget = (ConnectionWidget) findWidget (edge);
 * edgeWidget.setTargetAnchor (targetAnchor);
 * </pre>
 *
 * @param edge the edge which target is changed in graph model
 * @param oldTargetPin the old target pin
 * @param targetPin the new target pin
 */
@Override
protected void attachEdgeTargetAnchor(EdgeWidgetInfo edgeWidgetInfo, PinWidgetInfo oldTargetPin, PinWidgetInfo targetPinInfo) {
    IEdgeWidget edgeWidget = (IEdgeWidget) findWidget(edgeWidgetInfo);
    if (targetPinInfo == null) {//called in case of edge remove
        edgeWidget.setTargetAnchor(null);
        return;
    }
    IPinWidget targetPinWidget = (IPinWidget) findWidget(targetPinInfo);
    if (targetPinWidget != null) {
        NBModelerUtil.attachEdgeTargetAnchor((IModelerScene) this, edgeWidget, targetPinWidget);
    } else {
        INodeWidget targetNodeWidget = (INodeWidget) findWidget(getPinNode(targetPinInfo));
        NBModelerUtil.attachEdgeTargetAnchor((IModelerScene) this, edgeWidget, targetNodeWidget);
    }
    if (edgeWidget instanceof IBaseElementWidget) {
        ((IBaseElementWidget) edgeWidget).init();
    }
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:36,代码来源:AbstractPModelerScene.java

示例2: createPinWidget

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public IPinWidget createPinWidget(NodeWidgetInfo node, PinWidgetInfo pin) {
    IPinWidget pinWidget = (IPinWidget) this.addPin(node, pin);

    if (pinWidget instanceof IBaseElementWidget) {
        if (pin.getBaseElementSpec() != null) {
            ((IBaseElementWidget) pinWidget).setBaseElementSpec(pin.getBaseElementSpec());
        }
        ((IBaseElementWidget) pinWidget).init();
    }
    if (pinWidget != null) {
        pinWidget.getModelerScene().getModelerFile().getModelerDiagramEngine().setPinWidgetAction(pinWidget);
    }

    return pinWidget;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:17,代码来源:AbstractPModelerScene.java

示例3: setText

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public void setText(Widget widget, String text) {
    if (connector instanceof INodeWidget) {
        ((INodeWidget) connector).setLabel(text);
        if (connector instanceof IFlowNodeWidget) {
            ((IFlowNodeWidget) connector).setName(text);
        }

        ((INodeWidget) connector).getModelerScene().getModelerPanelTopComponent().changePersistenceState(false);

    } else if (connector instanceof IEdgeWidget) {
        ((IEdgeWidget) connector).setLabel(text);
        if (connector instanceof IFlowEdgeWidget) {
            ((IFlowEdgeWidget) connector).setName(text);
        }
        ((IEdgeWidget) connector).getModelerScene().getModelerPanelTopComponent().changePersistenceState(false);

    } else if (connector instanceof IPinWidget) {
        ((IPinWidget) connector).setLabel(text);
        if (connector instanceof IFlowPinWidget) {
            ((IFlowPinWidget) connector).setName(text);
        }
        ((IPinWidget) connector).getModelerScene().getModelerPanelTopComponent().changePersistenceState(false);

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

示例4: select

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public void select(Widget widget, Point localLocation, boolean invertSelection) {
    IPinWidget pinWidget = (IPinWidget) widget;
    IModelerScene modelerScene = pinWidget.getModelerScene();
    Object object = modelerScene.findObject(widget);
    modelerScene.setFocusedObject(object);
    if (object != null) {
        if (!invertSelection && modelerScene.getSelectedObjects().contains(object)) {
            return;
        }
        modelerScene.userSelectionSuggested(Collections.singleton(object), invertSelection);
    } else {
        modelerScene.userSelectionSuggested(Collections.emptySet(), invertSelection);
    }
    NBModelerUtil.showContextPalette(pinWidget.getModelerScene(), pinWidget);

    pinWidget.exploreProperties();

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

示例5: cleanReference

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
private void cleanReference(List<Widget> children) { //PinWidget children lost after NodeWidget remove method called
    if (this.getPropertyManager() != null) {
        this.getPropertyManager().getElementPropertySet().clearGroups();//clear ElementSupportGroup
    }
    for (Widget childWidget : children) {
        if (childWidget instanceof IPinWidget) {
            ((IPinWidget) childWidget).cleanReference();
        }
    }
    this.getModelerScene().getModelerFile().getModelerDiagramEngine().clearNodeWidgetAction(this);
    cleanActions(getNodeNameWidget().getActions());
    cleanActions(getHeader().getActions());
    cleanActions(getMinimizeButton().getActions());
    cleanActions(getImageWidget().getActions());

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

示例6: addMoveModel

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
private static void addMoveModel(ContextPaletteModel contextPaletteModel, IPinWidget pinWidget) {
    ContextPaletteButtonModel upModel = new DefaultPaletteButtonModel();
    upModel.setImage(UP_ICON);
    upModel.setTooltip("Move Up");
    upModel.setPaletteModel(contextPaletteModel);
    upModel.setMouseListener(getMoveWidgetAction(pinWidget, -1));
    upModel.checkVisibility(() -> checkMoveWidgetVisibility(pinWidget, -1));
    contextPaletteModel.getChildren().add(upModel);

    ContextPaletteButtonModel downModel = new DefaultPaletteButtonModel();
    downModel.setImage(DOWN_ICON);
    downModel.setTooltip("Move Down");
    downModel.setPaletteModel(contextPaletteModel);
    downModel.setMouseListener(getMoveWidgetAction(pinWidget, 1));
    downModel.checkVisibility(() -> checkMoveWidgetVisibility(pinWidget, 1));
    contextPaletteModel.getChildren().add(downModel);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:18,代码来源:NodeContextModel.java

示例7: print

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
public void print() {
    StringBuilder message = new StringBuilder();
    signalList.keySet().stream().forEach((signalKey) -> {
        message.append(signalList.get(signalKey)).append(". ").append('\n');
    });
    IWidgetStateHandler handler = widget instanceof INodeWidget ? ((IPNodeWidget) widget).getWidgetStateHandler() : (widget instanceof IPinWidget ? ((IPinWidget) widget).getWidgetStateHandler() : null);
    ImageWidget imageWidget = widget instanceof INodeWidget ? ((IPNodeWidget) widget).getImageWidget() : (widget instanceof IPinWidget ? ((IPinWidget) widget).getImageWidget() : null);

    if (message.length() != 0) {
        if (imageWidget != null) {
            imageWidget.setToolTipText(message.toString());
        }
        if (handler != null) {
            handler.applyState(getStateType());
        }
    } else {
            if (imageWidget != null) {
                imageWidget.setToolTipText(null);
            }
            if (handler != null) {
                handler.clearState(getStateType());
            }
        manager.signalNext();
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:26,代码来源:SignalHandler.java

示例8: deletePinWidget

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public void deletePinWidget(IPinWidget pinWidget) {
    if (this.isPin(pinWidget.getPinWidgetInfo())) {
        this.removePin(pinWidget.getPinWidgetInfo());
        if (pinWidget instanceof IBaseElementWidget) {
            ((IBaseElementWidget) pinWidget).destroy();
        }
    } else {
        LOG.warning("pin not found");
    }

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

示例9: getPinAnchor

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public Anchor getPinAnchor(IPinWidget pin) {
    if (pin == null) {
        return null;//nodeWidget.getNodeAnchor();
    }
    IPNodeWidget nodeWidget = pin.getPNodeWidget();
    Anchor anchor;
    anchor = AnchorFactory.createDirectionalAnchor((Widget) pin, AnchorFactory.DirectionalAnchorKind.HORIZONTAL, 8);
    anchor = nodeWidget.createAnchorPin(anchor);
    return anchor;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:12,代码来源:AbstractPModelerScene.java

示例10: isAcceptable

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的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

示例11: installUI

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public void installUI(IPinWidget widget) {
    widget.setBorder(OPAQUE_BORDER);
    Rectangle bound = widget.getBounds();
    if (bound != null) {
        GradientPaint gp = new GradientPaint(bound.x, bound.y, PIN_WIDGET_BACKGROUND, bound.x, bound.height, PIN_WIDGET_LBACKGROUND);
        widget.setBackground(gp);
    }
    widget.getPinNameWidget().setForeground(widget.getTextDesign().getColor()!=null?widget.getTextDesign().getColor():PIN_WIDGET_TEXT_COLOR);
    Font font = widget.getPinNameWidget().getFont()!=null?widget.getPinNameWidget().getFont():widget.getScene().getDefaultFont();
    widget.getPinNameWidget().setFont(font.deriveFont(widget.getTextDesign().getStyle(), widget.getTextDesign().getSize()));
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:13,代码来源:PMacColorScheme.java

示例12: installUI

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public void installUI(IPinWidget widget) {
    widget.setBorder(BORDER_PIN);
    widget.setBackground(COLOR60_HOVER_BACKGROUND);
    widget.getPinNameWidget().setForeground(widget.getTextDesign().getColor()!=null?widget.getTextDesign().getColor():Color.BLACK);
    Font font = widget.getPinNameWidget().getFont()!=null?widget.getPinNameWidget().getFont():widget.getScene().getDefaultFont();
    widget.getPinNameWidget().setFont(font.deriveFont(widget.getTextDesign().getStyle(), widget.getTextDesign().getSize()));

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

示例13: updateUI

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public void updateUI(IPinWidget widget, ObjectState previousState, ObjectState state) {
    widget.setOpaque(state.isHovered() || state.isFocused());
    if (state.isSelected()) {
        widget.setBorder(BORDER60_PIN_SELECT);
    } else {
        widget.setBorder(BORDER_PIN);
    }
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:10,代码来源:PNBColorScheme.java

示例14: installUI

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public void installUI(IPinWidget widget) {
    widget.setBorder(OPAQUE_BORDER);
    widget.setBackground(PIN_WIDGET_BACKGROUND);
    widget.getPinNameWidget().setForeground(widget.getTextDesign().getColor()!=null?widget.getTextDesign().getColor():PIN_WIDGET_TEXT_COLOR);
    Font font = widget.getPinNameWidget().getFont()!=null?widget.getPinNameWidget().getFont():widget.getScene().getDefaultFont();
    widget.getPinNameWidget().setFont(font.deriveFont(widget.getTextDesign().getStyle(), widget.getTextDesign().getSize()));

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

示例15: installUI

import org.netbeans.modeler.widget.pin.IPinWidget; //导入依赖的package包/类
@Override
public void installUI(IPinWidget widget) {
    widget.setBorder(BORDER_PIN);
    widget.setBackground(PIN_WIDGET_HOVER_BACKGROUND);
    widget.getPinNameWidget().setForeground(widget.getTextDesign().getColor()!=null?widget.getTextDesign().getColor():WIDGET_HOVER_BACKGROUND);
    Font font = widget.getPinNameWidget().getFont()!=null?widget.getPinNameWidget().getFont():widget.getScene().getDefaultFont();
    widget.getPinNameWidget().setFont(font.deriveFont(widget.getTextDesign().getStyle(), widget.getTextDesign().getSize()));

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


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