Package org.gephi.preview.plugin.items

Examples of org.gephi.preview.plugin.items.NodeLabelItem


        VisualizationController vizController = Lookup.getDefault().lookup(VisualizationController.class);
        Column[] nodeColumns = vizController != null ? vizController.getNodeTextColumns() : null;

        List<Item> items = new ArrayList<Item>();
        for (Node n : graph.getNodes()) {
            NodeLabelItem labelItem = new NodeLabelItem(n);
            String label = getLabel(n, nodeColumns, graph.getView());
            labelItem.setData(NodeLabelItem.LABEL, label);
            TextProperties textData = n.getTextProperties();
            if (textData != null && useTextData) {
                if (textData.getR() != -1) {
                    labelItem.setData(NodeLabelItem.COLOR, new Color((int) (textData.getR() * 255),
                            (int) (textData.getG() * 255),
                            (int) (textData.getB() * 255),
                            (int) (textData.getAlpha() * 255)));
                }
//                labelItem.setData(NodeLabelItem.WIDTH, textData.getWidth());
//                labelItem.setData(NodeLabelItem.HEIGHT, textData.getHeight());
                labelItem.setData(NodeLabelItem.SIZE, textData.getSize());
                labelItem.setData(NodeLabelItem.VISIBLE, textData.isVisible());
                labelItem.setData(NodeLabelItem.LABEL, textData.getText());
                if (textData.isVisible() && label != null && !label.isEmpty()) {
                    items.add(labelItem);
                }
            } else if (label != null && !label.isEmpty()) {
                items.add(labelItem);
View Full Code Here

TOP

Related Classes of org.gephi.preview.plugin.items.NodeLabelItem

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.