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

Java ImageWidget类代码示例

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

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



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

示例1: IconNodeWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
/**
 * Creates an icon node widget with a specified orientation.
 * @param scene the scene
 * @param orientation the text orientation
 */
public IconNodeWidget (Scene scene, TextOrientation orientation) {
    super (scene);
    LookFeel lookFeel = getScene ().getLookFeel ();

    switch (orientation) {
        case BOTTOM_CENTER:
            setLayout (LayoutFactory.createVerticalFlowLayout (LayoutFactory.SerialAlignment.CENTER, - lookFeel.getMargin () + 1));
            break;
        case RIGHT_CENTER:
            setLayout (LayoutFactory.createHorizontalFlowLayout (LayoutFactory.SerialAlignment.CENTER, - lookFeel.getMargin () + 1));
            break;
    }

    imageWidget = new ImageWidget (scene);
    addChild (imageWidget);

    labelWidget = new LabelWidget (scene);
    labelWidget.setFont (scene.getDefaultFont ().deriveFont (14.0f));
    addChild (labelWidget);

    setState (ObjectState.createNormal ());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:IconNodeWidget.java


示例2: RapidButton

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
public RapidButton(INodeWidget target, ContextPaletteButtonModel descriptor) {
        super(target.getScene());
        associatedWidget = target;

        IModelerScene scene = target.getModelerScene();

        this.descriptor = descriptor;

        WidgetAction[] actions = descriptor.getWidgetActions();
        for (WidgetAction curAction : actions) {
            getActions().addAction(curAction);
        }

        getActions().addAction(getScene().createWidgetHoverAction());

        ImageWidget image = new ImageWidget((Scene) scene, descriptor.getImage());
//        setBorder(BorderFactory.createLineBorder(Color.BLACK));
        addChild(image);

        setBorder(NO_HOVER_BORDER);
        setBackground(UIManager.getColor("List.selectionBackground"));

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


示例3: print

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的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


示例4: creaWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
private void creaWidget(Scene scene, Point point) {

        this.setLayout(LayoutFactory.createHorizontalFlowLayout());
        MyGradientLabelWidget gradientWidget = creaHeaderWidget(scene);
        ImageWidget imageWidget = new ImageWidget(scene, ImageUtilities.loadImage(Costanti.ICONA_CONSTANT));
        gradientWidget.addChild(imageWidget);
        LabelWidget constantWidget = new LabelWidget(scene, "");
        constantWidget.setVerticalAlignment(LabelWidget.VerticalAlignment.CENTER);
        this.addChild(gradientWidget);
        this.addChild(constantWidget);
        this.setPreferredLocation(new Point(point.x - 1, point.y - 1));
        settaBordoConstant();

        Binding bindingConst = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, caratteristicheWidget, ELProperty.create("${costante}"), constantWidget, BeanProperty.create("label"));
        bindingConst.bind();
        
        this.setOpaque(true);

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


示例5: creaWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
private void creaWidget(Scene scene) {
    creaRootWidget(scene);
    MyGradientLabelWidget gradientHeaderWidget = creaGradientHeader(scene);

    ImageWidget imageWidget = new ImageWidget(scene, ImageUtilities.loadImage(Costanti.ICONA_INFORMATION));
    gradientHeaderWidget.addChild(imageWidget);


    LabelWidget footerWidgetConfidence = new LabelWidget(scene);
    footerWidgetConfidence.setLayout(LayoutFactory.createHorizontalFlowLayout());
    LabelWidget labelTypeConfidenceWidget = new LabelWidget(scene, "Cnf: ");
    labelValueConfidenceWidget = new LabelWidget(scene);
    footerWidgetConfidence.addChild(labelTypeConfidenceWidget);
    footerWidgetConfidence.addChild(labelValueConfidenceWidget);

    rootWidget.addChild(gradientHeaderWidget);
    rootWidget.addChild(footerWidgetConfidence);

    //this.setLayout(LayoutFactory.createOverlayLayout());
    this.addChild(rootWidget);
    this.setOpaque(true);

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


示例6: createHeaderWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
private Widget createHeaderWidget(Scene scene) {
    header = new Widget(scene);
    header.setLayout (LayoutFactory.createHorizontalFlowLayout(LayoutFactory.SerialAlignment.CENTER, 8));
    
    if(node.hasInput())
        header.addChild(new AnchorWidget(scene, true, ui), 0);
    
    imageWidget = new ImageWidget(super.getScene(), node.getImage());
    header.addChild(imageWidget, 0);

    titleWidget = new LabelWidget(scene, node.getTitle());
    titleWidget.setFont (ui.getHeaderFont(scene));
    titleWidget.setForeground(ui.getHeaderTitleColor());
    header.addChild(titleWidget, 1);

    if(node.hasOutput())
        header.addChild(new AnchorWidget(scene, false, ui), 0);
    
    return header;

}
 
开发者ID:Depter,项目名称:JRLib,代码行数:22,代码来源:JRLibNodeWidget.java


示例7: CheckboxWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
public CheckboxWidget(JRLibScene scene, String label, boolean rightAlign) {
    super(scene);
    setLayout(LayoutFactory.createHorizontalFlowLayout (LayoutFactory.SerialAlignment.CENTER, 5));
    
    image = new ImageWidget(scene, getImage());
    this.label = new LabelWidget(scene, label);
    
    if(rightAlign) {
        addChild(image, 0);
        addChild(this.label, 1);
    } else {
        addChild(this.label, 1);
        addChild(image, 0);
    }
    setBorder(new ImgBorder(this));
    
    getActions().addAction(ActionFactory.createSelectAction(this));
    getActions().addAction(scene.createWidgetHoverAction());
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:20,代码来源:CheckboxWidget.java


示例8: setGlyphs

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
/**
 * Sets glyphs as a list of images.
 * @param glyphs the list of images used as glyphs
 */
public void setGlyphs (List<Image> glyphs) {
    List<Widget> children = new ArrayList<Widget> (getChildren ());
    for (Widget widget : children)
        removeChild (widget);
    if (glyphs != null)
        for (Image glyph : glyphs) {
            ImageWidget imageWidget = new ImageWidget (getScene ());
            imageWidget.setImage (glyph);
            addChild (imageWidget);
        }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:VMDGlyphSetWidget.java


示例9: creaWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
private void creaWidget(Scene scene, Point point, Image image) {
    creaRoot(scene);
    MyGradientLabelWidget gradientHeaderWidget = creaHeaderWidget(scene);
    imageWidget = new ImageWidget(scene, image);
    gradientHeaderWidget.addChild(imageWidget);
    rootWidget.addChild(gradientHeaderWidget);
    this.setPreferredLocation(new Point(point.x - 1, point.y - 1));
    this.addChild(rootWidget);
    settaBordoFunction();
    this.setOpaque(true);

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


示例10: creaWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
private void creaWidget(Scene scene, Point point) {
    creaRoot(scene);
    MyGradientLabelWidget gradientHeaderWidget = creaHeaderWidget(scene);
    ImageWidget imageWidget = new ImageWidget(scene, ImageUtilities.loadImage(Costanti.ICONA_FUNCTIONAL_DEPENDENCY));
    gradientHeaderWidget.addChild(imageWidget);
    rootWidget.addChild(gradientHeaderWidget);
    this.setPreferredLocation(new Point(point.x - 1, point.y - 1));
    this.addChild(rootWidget);
    settaBordoFunction();
    this.setOpaque(true);

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


示例11: creaWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
private void creaWidget(Scene scene, Point point) {
    creaRoot(scene);
    MyGradientLabelWidget gradientHeaderWidget = creaHeaderWidget(scene);
    ImageWidget imageWidget = new ImageWidget(scene, ImageUtilities.loadImage(Costanti.ICONA_FUNCTION));
    gradientHeaderWidget.addChild(imageWidget);
    rootWidget.addChild(gradientHeaderWidget);
    this.setPreferredLocation(new Point(point.x - 1, point.y - 1));
    this.addChild(rootWidget);
    settaBordoFunction();
    this.setOpaque(true);

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


示例12: creaWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
private void creaWidget(Scene scene, Point point) {
    creaRoot(scene);
    MyGradientLabelWidget gradientHeaderWidget = creaHeaderWidget(scene);
    ImageWidget imageWidget = new ImageWidget(scene, ImageUtilities.loadImage(Costanti.ICONA_MERGE_WIDGET));
    gradientHeaderWidget.addChild(imageWidget);
    rootWidget.addChild(gradientHeaderWidget);
    this.setPreferredLocation(new Point(point.x - 1, point.y - 1));
    this.addChild(rootWidget);
    settaBordoFunction();
    this.setOpaque(true);

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


示例13: creaWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
private void creaWidget(Scene scene, Point point) {
    creaRoot(scene);
    MyGradientLabelWidget gradientHeaderWidget = creaHeaderWidget(scene);
    ImageWidget imageWidget = new ImageWidget(scene, ImageUtilities.loadImage(Costanti.ICONA_ATTRIBUTE_GROUP));
    gradientHeaderWidget.addChild(imageWidget);
    rootWidget.addChild(gradientHeaderWidget);
    this.setPreferredLocation(new Point(point.x - 1, point.y - 1));
    this.addChild(rootWidget);
    settaBordoFunction();
    this.setOpaque(true);

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


示例14: initContent

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
@Messages("ACT_FixVersionConflict=Fix Version Conflict...")
private void initContent (DependencyGraphScene scene, GraphNodeImplementation impl, Icon icon) {
    contentW = new LevelOfDetailsWidget(scene, 0.05, 0.1, Double.MAX_VALUE, Double.MAX_VALUE);
    contentW.setBorder(BorderFactory.createLineBorder(10));
    contentW.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.JUSTIFY, 1));

    //Artifact name (with optional project icon on the left)
    nodeW = new IconNodeWidget(scene, TextOrientation.RIGHT_CENTER);
    nodeW.setLabel(node.getImpl().getQualifiedName() + "  ");

    if (null != icon) {
        nodeW.setImage(ImageUtilities.icon2Image(icon));
    }

    nodeW.getLabelWidget().setUseGlyphVector(true);

    if (node.isRoot()) {
        Font defF = scene.getDefaultFont();
        nodeW.getLabelWidget().setFont(defF.deriveFont(Font.BOLD, defF.getSize() + 3f));
    }
    contentW.addChild(nodeW);
    
    if(getDependencyGraphScene().supportsVersions()) {
        Widget versionDetW = new LevelOfDetailsWidget(scene, 0.5, 0.7, Double.MAX_VALUE, Double.MAX_VALUE);
        versionDetW.setLayout(LayoutFactory.createHorizontalFlowLayout(LayoutFactory.SerialAlignment.CENTER, 2));
        contentW.addChild(versionDetW);
        versionW = new LabelWidget(scene);
        versionW.setLabel(scene.getVersion(node.getImpl()));
        versionW.setUseGlyphVector(true);
        int mngState = node.getManagedState();
        if (mngState != GraphNode.UNMANAGED) { 
             lockW = new ImageWidget(scene,
                    mngState == GraphNode.MANAGED ? ImageUtilities.loadImage(LOCK_ICON) : ImageUtilities.loadImage(LOCK_BROKEN_ICON));
        }
        versionDetW.addChild(versionW);
        if (lockW != null) {
            versionDetW.addChild(lockW);
        }
    }

    // fix hint
    if (fixConflictAction != null) {
        Widget rootW = new Widget(scene);
        rootW.setLayout(LayoutFactory.createOverlayLayout());
        fixHintW = new ImageWidget(scene, ImageUtilities.loadImage(BULB_ICON));
        fixHintW.setVisible(false);
        fixHintW.setToolTipText(ACT_FixVersionConflict());
        fixHintW.getActions().addAction(sceneHoverActionAction);
        fixHintW.getActions().addAction(fixConflictAction);
        Widget panelW = new Widget(scene);
        panelW.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.LEFT_TOP, 0));
        panelW.setBorder(BorderFactory.createEmptyBorder(0, 3));
        panelW.addChild(fixHintW);
        rootW.addChild(panelW);
        rootW.addChild(contentW);
        addChild(rootW);
    } else {
        addChild(contentW);
    }

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:62,代码来源:NodeWidget.java


示例15: AbstractPNodeWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
/**
     * Creates a node widget with a specific color scheme.
     *
     * @param scene the scene
     * @param colorScheme the color scheme
     * @param textDesign
     */
    public AbstractPNodeWidget(Scene scene, IColorScheme colorScheme, ITextDesign textDesign) {
        super(scene);

        this.colorScheme = colorScheme;
        this.textDesign = textDesign;
        nodeAnchor = new PNodeAnchor(this, true);

        setLayout(LayoutFactory.createVerticalFlowLayout());
        setMinimumSize(new Dimension(128, 8));

        header = new Widget(scene);
        header.setLayout(LayoutFactory.createHorizontalFlowLayout(LayoutFactory.SerialAlignment.CENTER, 8));
        addChild(header);

        boolean right = colorScheme.isNodeMinimizeButtonOnRight(this);

        minimizeWidget = new ImageWidget(scene, colorScheme.getMinimizeWidgetImage(this));
        minimizeWidget.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        minimizeWidget.getActions().addAction(new ToggleMinimizedAction());
        if (!right) {
            header.addChild(minimizeWidget);
        }

        imageWidget = new AdvanceImageWidget(scene);
        stateHandler = new WidgetStateHandler(imageWidget);
        header.addChild(imageWidget);

        nameWidget = new LabelWidget(scene);
        header.addChild(nameWidget);

        typeWidget = new LabelWidget(scene);
        typeWidget.setForeground(Color.BLACK);
        header.addChild(typeWidget);

        if (right) {
            Widget widget = new Widget(scene);
//            widget.setOpaque(false);
            header.addChild(widget, 1000);
            header.addChild(minimizeWidget);
        }

        pinsSeparator = new SeparatorWidget(scene, SeparatorWidget.Orientation.HORIZONTAL);
        addChild(pinsSeparator);

        Widget topLayer = new Widget(scene);
        addChild(topLayer);

        stateModel = new StateModel();
        stateModel.addListener(this);

        if(!((AbstractPModelerScene)this.getScene()).isSceneGenerating()){
          colorScheme.installUI(this);  
        }
        notifyStateChanged(ObjectState.createNormal(), ObjectState.createNormal());
    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:63,代码来源:AbstractPNodeWidget.java


示例16: initContent

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
@Messages("ACT_FixVersionConflict=Fix Version Conflict...")
private void initContent (DependencyGraphScene scene, Artifact artifact) {
    contentW = new LevelOfDetailsWidget(scene, 0.05, 0.1, Double.MAX_VALUE, Double.MAX_VALUE);
    contentW.setBorder(BorderFactory.createLineBorder(10));
    contentW.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.JUSTIFY, 1));
    artifactW = new LabelWidget(scene);
    artifactW.setLabel(artifact.getArtifactId() + "  ");
    if (node.isRoot()) {
        Font defF = scene.getDefaultFont();
        artifactW.setFont(defF.deriveFont(Font.BOLD, defF.getSize() + 3f));
    }
    contentW.addChild(artifactW);
    Widget versionDetW = new LevelOfDetailsWidget(scene, 0.5, 0.7, Double.MAX_VALUE, Double.MAX_VALUE);
    versionDetW.setLayout(LayoutFactory.createHorizontalFlowLayout(LayoutFactory.SerialAlignment.CENTER, 2));
    contentW.addChild(versionDetW);
    versionW = new LabelWidget(scene);
    versionW.setLabel(artifact.getVersion());
    int mngState = node.getManagedState();
    if (mngState != ArtifactGraphNode.UNMANAGED) {
         lockW = new ImageWidget(scene,
                mngState == ArtifactGraphNode.MANAGED ? ImageUtilities.loadImage(LOCK_ICON) : ImageUtilities.loadImage(LOCK_BROKEN_ICON));
    }
    versionDetW.addChild(versionW);
    if (lockW != null) {
        versionDetW.addChild(lockW);
    }

    // fix hint
    if (scene.isEditable() && DependencyGraphScene.isFixCandidate(node)) {
        Widget rootW = new Widget(scene);
        rootW.setLayout(LayoutFactory.createOverlayLayout());
        fixHintW = new ImageWidget(scene, ImageUtilities.loadImage(BULB_ICON));
        fixHintW.setVisible(false);
        fixHintW.setToolTipText(ACT_FixVersionConflict());
        fixHintW.getActions().addAction(scene.hoverAction);
        fixHintW.getActions().addAction(ActionFactory.createSelectAction(this));
        Widget panelW = new Widget(scene);
        panelW.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.LEFT_TOP, 0));
        panelW.setBorder(BorderFactory.createEmptyBorder(0, 3));
        panelW.addChild(fixHintW);
        rootW.addChild(panelW);
        rootW.addChild(contentW);
        addChild(rootW);
    } else {
        addChild(contentW);
    }

}
 
开发者ID:timboudreau,项目名称:vl-jung,代码行数:49,代码来源:ArtifactWidget.java


示例17: getImageWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
/**
 * Returns the image widget part of the icon node widget.
 * @return the image widget
 */
public final ImageWidget getImageWidget () {
    return imageWidget;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:IconNodeWidget.java


示例18: getMinimizeButton

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
/**
 * Returns a minimize button widget.
 *
 * @return the miminize button widget
 */
ImageWidget getMinimizeButton();
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:7,代码来源:IParentPNodeWidget.java


示例19: getMinimizeButton

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
/**
 * Returns a minimize button widget.
 *
 * @return the miminize button widget
 */
@Override
public ImageWidget getMinimizeButton() {
    return minimizeWidget;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:10,代码来源:AbstractPNodeWidget.java


示例20: getImageWidget

import org.netbeans.api.visual.widget.ImageWidget; //导入依赖的package包/类
ImageWidget getImageWidget(); 
开发者ID:jeddict,项目名称:NBModeler,代码行数:2,代码来源:IPinWidget.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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