Package org.gephi.graph.api

Examples of org.gephi.graph.api.Attributes


            return findNext(result);//Go to next search result
        }
        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        Object value;
        String str;
        Attributes attributes;
        AttributeColumn column;

        if (!result.getSearchOptions().isUseRegexReplaceMode()) {
            replacement = Matcher.quoteReplacement(replacement);//Avoid using groups and other regex aspects in the replacement
        }

        try {
            //Get value to re-match and replace:
            if (result.getFoundNode() != null) {
                attributes = result.getFoundNode().getNodeData().getAttributes();
                column = ac.getModel().getNodeTable().getColumn(result.getFoundColumnIndex());
            } else {
                attributes = result.getFoundEdge().getEdgeData().getAttributes();
                column = ac.getModel().getEdgeTable().getColumn(result.getFoundColumnIndex());
            }
            value = attributes.getValue(result.getFoundColumnIndex());
            str = value != null ? value.toString() : "";
            StringBuffer sb = new StringBuffer();

            //Match and replace the result:
            Matcher matcher = result.getSearchOptions().getRegexPattern().matcher(str.substring(result.getStart()));
View Full Code Here


    @Override
    public Object[] getAttributesValues(Node node, Interval interval, Estimator[] estimators) {
        checkEstimators(node, estimators);

        Attributes attributes = node.getNodeData().getAttributes();
        Object[] values = new Object[attributes.countValues()];

        for (int i = 0; i < attributes.countValues(); ++i) {
            values[i] = attributes.getValue(i);
            if (values[i] instanceof DynamicType) {
                values[i] = ((DynamicType) values[i]).getValue(estimators[i]);
            }
        }
View Full Code Here

    @Override
    public Object[] getAttributesValues(Edge edge, Interval interval, Estimator[] estimators) {
        checkEstimators(edge, estimators);

        Attributes attributes = edge.getEdgeData().getAttributes();
        Object[] values = new Object[attributes.countValues()];

        for (int i = 0; i < attributes.countValues(); ++i) {
            values[i] = attributes.getValue(i);
            if (values[i] instanceof DynamicType) {
                values[i] = ((DynamicType) values[i]).getValue(estimators[i]);
            }
        }
View Full Code Here

        public Object getValueFor(ImmutableTreeNode node) {
            Node graphNode = node.getNode();
            if (graphNode.getId() == -1) {
                return null;
            }
            Attributes row = graphNode.getNodeData().getAttributes();
            Object value = row.getValue(column.getIndex());

            if (useSparklines && (attributeUtils.isNumberListColumn(column) || attributeUtils.isDynamicNumberColumn(column))) {
                return value;
            } else if (column.getType() == AttributeType.TIME_INTERVAL) {
                return value;
View Full Code Here

TOP

Related Classes of org.gephi.graph.api.Attributes

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.