Package org.netbeans.api.visual.widget.general

Examples of org.netbeans.api.visual.widget.general.IconNodeWidget


                    farMostX = levelNodes.get(levelNodes.size() - 1).location.x;
            }

            // Ӿ�7ָ���
            for (int i = 0; i < 2 * order + 2; ++i) {
                IconNodeWidget sp = new IconNodeWidget(scene);
                sp.setImage(scene.separatorIcon);
                // sp.setLabel("xxx");
                scene.addChild(sp);
                sp.setPreferredLocation(new Point(farMostX + deltaX / 2
                        + deltaChannel / 2, i * deltaY / 2 + 10));
                scene.separator.add(sp);
            }

            // ����editor��λ�ã�ʹ����ʾ�ڿ���Ӿ�7ָ��ߵĵط�
View Full Code Here


                    farMostY = levelNodes.get(levelNodes.size() - 1).location.y;
            }

            // ??7????
            for (int i = 0; i < 6 * order + 6; ++i) {
                IconNodeWidget sp = new IconNodeWidget(scene);
                sp.setImage(scene.separatorIcon);
                // sp.setLabel("xxx");
                scene.addChild(sp);
                sp.setPreferredLocation(new Point(i * deltaX / 6 + 5, farMostY
                        + deltaY / 2 + deltaChannel / 2));
                scene.separator.add(sp);
            }

            // ????editor??λ????????????????7???????
            rootSet.get(ch).location.y = adjustY + deltaY;
        }

        for (Node cur: node) {
            Widget w = scene.addNode(cur.name, cur.type);
            if (w instanceof LabelWidget)
                ((LabelWidget) w).setLabel(cur.label);
            else if (w instanceof EditorWidget)
                ((EditorWidget) w).setLabel(cur.label);
            w.setToolTipText(cur.fullText);
            w.setPreferredLocation(cur.location);
        }

        for (int i = 0; i < (farMostY + deltaChannel / 2 + 10) / 10; ++i) {
            IconNodeWidget sp = new IconNodeWidget(scene);
            sp.setImage(scene.separatorIcon2);
            scene.addChild(sp);
            sp.setPreferredLocation(new Point(deltaX + 5, i * 10));
            scene.separator.add(sp);
        }

        scene.validate();

View Full Code Here

            }

            // Ӿ�7ָ���
            if (ch != rootSet.size() - 1) {
                for (int i = 0; i < 4; ++i) {
                    IconNodeWidget sp = new IconNodeWidget(editorScene);
                    sp.setImage(editorScene.separatorIcon);
                    editorScene.addChild(sp);
                    sp.setPreferredLocation(new Point(i * deltaX / 7 + 5,
                            farMostY + deltaChannel / 2 + 1));
                    editorScene.separator.add(sp);
                }

                for (int i = 0; i < 6 * order + 6; ++i) {
                    IconNodeWidget sp = new IconNodeWidget(scene);
                    sp.setImage(scene.separatorIcon);
                    // sp.setLabel("xxx");
                    scene.addChild(sp);
                    sp.setPreferredLocation(new Point(i * deltaX / 6, farMostY
                            + deltaChannel / 2));
                    scene.separator.add(sp);
                }
            } else {
                for (int i = 0; i < 8; ++i) {
                    IconNodeWidget sp = new IconNodeWidget(editorScene);
                    sp.setImage(editorScene.separatorIcon);
                    editorScene.addChild(sp);
                    sp.setPreferredLocation(new Point(i * deltaX / 14, farMostY
                            + deltaChannel / 2 + 9));
                    editorScene.separator.add(sp);
                }
                IconNodeWidget sp = new IconNodeWidget(editorScene);
                sp.setImage(editorScene.separatorIcon);
                editorScene.addChild(sp);
                sp.setPreferredLocation(new Point(71, farMostY + deltaChannel
                        / 2 + 9));
                editorScene.separator.add(sp);
            }

            // ����editor��λ�ã�ʹ����ʾ�ڿ���Ӿ�7ָ��ߵĵط�
View Full Code Here

        Widget blockNode = addNewNode("Block1", new Point(200, 100));
    }

    @Override
    protected Widget attachNodeWidget(String arg0) {
        IconNodeWidget widget = new IconNodeWidget(this);

        widget.getActions().addAction(
            ActionFactory.createExtendedConnectAction(
            connectionLayer, connectProvider));

        widget.getActions().addAction(
            ActionFactory.createAlignWithMoveAction(
            mainLayer, interactionLayer,
            ActionFactory.createDefaultAlignWithMoveDecorator()));

        widget.getLabelWidget().getActions().addAction(
                ActionFactory.createInplaceEditorAction(new LabelTextFieldEditor()));

        widget.getActions().addAction(ActionFactory.createMoveAction());

        widget.setImage(resourceMap.getImageIcon("blockIcon").getImage());
//        widget.setLabel((String) arg0);
        widget.setBorder(new EtchedBorder());
//        widget.setPreferredSize(new Dimension(50,50));

        mainLayer.addChild(widget);
        return widget;
    }
View Full Code Here

TOP

Related Classes of org.netbeans.api.visual.widget.general.IconNodeWidget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.