Package org.netbeans.api.visual.widget

Examples of org.netbeans.api.visual.widget.LabelWidget


            for (String id: edges) {
                ConnectionWidget cw = (ConnectionWidget) scene.findWidget(id);
                boolean isSourceIn;
                boolean isTargetIn;

                LabelWidget source = (LabelWidget) scene.findWidget(scene
                        .getEdgeSource(id));
                Rectangle rect = source.getPreferredBounds();
                Point location = source.getPreferredLocation();
                Point pa = new Point(location.x + rect.x, location.y + rect.y);
                Point pb = new Point(location.x + rect.x + rect.width,
                        location.y + rect.y + rect.height);
                isSourceIn = isInSelectedArea(pa) && isInSelectedArea(pb);

                LabelWidget target = (LabelWidget) scene.findWidget(scene
                        .getEdgeTarget(id));
                rect = target.getPreferredBounds();
                location = target.getPreferredLocation();
                pa = new Point(location.x + rect.x, location.y + rect.y);
                pb = new Point(location.x + rect.x + rect.width, location.y
                        + rect.y + rect.height);
                isTargetIn = isInSelectedArea(pa) && isInSelectedArea(pb);
View Full Code Here


            // �����ɾ��
            // editor.getActions().addAction(ActionFactory.createPopupMenuAction(nodeMenu));
            editor.setForeground(foregroundColor);
            return editor;
        } else {
            LabelWidget label = new LabelWidget(this, node);
            // label.setToolTipText("�����:'Ctrl'+������");
            // �����ɾ�� label.getActions().addAction(connectAction);
            // �����ɾ�� label.getActions().addAction(moveAction);
            // �����ɾ�� label.getActions ().addAction (editorAction);
            mainLayer.addChild(label);
            // �����ɾ��
            // label.getActions().addAction(ActionFactory.createPopupMenuAction(nodeMenu));
            label.setForeground(foregroundColor);
            return label;
        }
    }
View Full Code Here

        for (String cur : strings) {

            String displayString = cur;

            LabelWidget lw = new LabelWidget(s);
            labelWidgets.add(lw);
            middleWidget.addChild(lw);
            lw.setLabel(displayString);

            lw.setFont(font);
            lw.setForeground(Color.BLACK);
            lw.setAlignment(LabelWidget.Alignment.CENTER);
            lw.setVerticalAlignment(LabelWidget.VerticalAlignment.CENTER);
            lw.setMaximumSize(new Dimension(f.getWidth(), 20000));
            lw.setMinimumSize(new Dimension(f.getWidth(), 20));
        }

        rightWidget = new Widget(s);
        this.addChild(rightWidget);
        rightWidget.setLayout(new SlotLayout(SlotLayout.HorizontalAlignment.Left, VERTICAL_LAYOUT));//LayoutFactory.createVerticalLayout(LayoutFactory.SerialAlignment.JUSTIFY, 0));
View Full Code Here

        startLayer = new LayerWidget(this);
        this.addChild(startLayer);
        // TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections...";
        String startLabelString = "";
        LabelWidget w = new LabelWidget(this, startLabelString);
        scrollChangeListener.register(w, new Point(10, 10));
        w.setAlignment(LabelWidget.Alignment.CENTER);
        startLabel = w;
        startLayer.addChild(w);

        mainLayer = new LayerWidget(this);
        this.addChild(mainLayer);
View Full Code Here

TOP

Related Classes of org.netbeans.api.visual.widget.LabelWidget

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.