Package org.gephi.data.attributes.api

Examples of org.gephi.data.attributes.api.Estimator


    }

    public static Object getDynamicValue(Object value, double low, double high) {
        if (value != null && value instanceof DynamicType) {
            DynamicType dynamicType = (DynamicType) value;
            Estimator estimator = Estimator.FIRST;
            if (Number.class.isAssignableFrom(dynamicType.getUnderlyingType())) {
                estimator = Estimator.AVERAGE;
            }
            return dynamicType.getValue(low, high, estimator);
        }
View Full Code Here


    }

    public Object getDynamicValue(Object attributeValue) {
        if (attributeValue != null && attributeValue instanceof DynamicType) {
            DynamicType dynamicValue = (DynamicType) attributeValue;
            Estimator estimator = dynamicModel == null ? Estimator.FIRST : dynamicModel.getEstimator();
            if (Number.class.isAssignableFrom(dynamicValue.getUnderlyingType())) {
                estimator = dynamicModel == null ? Estimator.AVERAGE : dynamicModel.getNumberEstimator();
            }
            TimeInterval timeInterval = new TimeInterval(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
            if (dynamic) {
View Full Code Here

                    str += " - ";
                }
                Object val = nodeData.getAttributes().getValue(c.getIndex());
                if (val instanceof DynamicType) {
                    DynamicType dynamicType = (DynamicType) val;
                    Estimator estimator = defaultEstimator;
                    if (Number.class.isAssignableFrom(dynamicType.getUnderlyingType())) {
                        estimator = numberEstimator;
                    }
                    if (timeInterval != null) {
                        val = dynamicType.getValue(timeInterval.getLow(), timeInterval.getHigh(), estimator);
View Full Code Here

                    str += " - ";
                }
                Object val = edgeData.getAttributes().getValue(c.getIndex());
                if (val instanceof DynamicType) {
                    DynamicType dynamicType = (DynamicType) val;
                    Estimator estimator = defaultEstimator;
                    if (Number.class.isAssignableFrom(dynamicType.getUnderlyingType())) {
                        estimator = numberEstimator;
                    }
                    if (timeInterval != null) {
                        val = dynamicType.getValue(timeInterval.getLow(), timeInterval.getHigh(), estimator);
View Full Code Here

                    if (partition != null) {
                        GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();

                        DynamicModel dynamicModel = model.getDynamicModel();
                        TimeInterval timeInterval = dynamicModel != null ? dynamicModel.getVisibleInterval() : null;
                        Estimator estimator = AttributeUtils.getDefault().isDynamicNumberColumn(partition.getColumn()) ? model.getNumberEstimator() : model.getEstimator();
                        PartitionFactory.buildNodePartition((NodePartition) partition, graphModel.getGraphVisible(), timeInterval, estimator);
                    }
                    model.setNodePartition(partition);
                    if (model.getNodeTransformerBuilder() == null) {
                        //Select the first transformer
                        TransformerBuilder[] builders = Lookup.getDefault().lookupAll(TransformerBuilder.class).toArray(new TransformerBuilder[0]);
                        for (int i = 0; i < builders.length; i++) {
                            TransformerBuilder t = builders[i];
                            if (t instanceof TransformerBuilder.Node) {
                                model.setNodeBuilder(t);
                                break;
                            }
                        }
                    }
                    model.setWaiting(false);
                }
            }, "Partition Model refresh");
            t.start();
        } else {
            Thread t = new Thread(new Runnable() {

                public void run() {
                    if (partition != null) {
                        GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();

                        DynamicModel dynamicModel = model.getDynamicModel();
                        TimeInterval timeInterval = dynamicModel != null ? dynamicModel.getVisibleInterval() : null;
                        Estimator estimator = AttributeUtils.getDefault().isDynamicNumberColumn(partition.getColumn()) ? model.getNumberEstimator() : model.getEstimator();
                        PartitionFactory.buildEdgePartition((EdgePartition) partition, graphModel.getGraphVisible(), timeInterval, estimator);
                    }
                    model.setEdgePartition(partition);
                    if (model.getEdgeTransformerBuilder() == null) {
                        //Select the first transformer
View Full Code Here

        DynamicModel dynamicModel = model.getDynamicModel();
        TimeInterval timeInterval = dynamicModel != null ? dynamicModel.getVisibleInterval() : null;

        if (AttributeUtils.getDefault().isNodeColumn(column)) {
            NodePartition partition = PartitionFactory.createNodePartition(column);
            Estimator estimator = AttributeUtils.getDefault().isDynamicNumberColumn(column) ? model.getNumberEstimator() : model.getEstimator();
            PartitionFactory.buildNodePartition(partition, graph, timeInterval, estimator);
            return partition;
        } else {
            EdgePartition partition = PartitionFactory.createEdgePartition(column);
            Estimator estimator = AttributeUtils.getDefault().isDynamicNumberColumn(column) ? model.getNumberEstimator() : model.getEstimator();
            PartitionFactory.buildEdgePartition(partition, graph, timeInterval, estimator);
            return partition;
        }
    }
View Full Code Here

                if (PartitionFactory.isPartitionColumn(column) && PartitionFactory.isNodePartitionColumn(column, graph)) {
                    nodePartitions.add(PartitionFactory.createNodePartition(column));
                } else if (PartitionFactory.isDynamicPartitionColumn(column)) {
                    DynamicModel dynamicModel = model.getDynamicModel();
                    TimeInterval timeInterval = dynamicModel != null ? dynamicModel.getVisibleInterval() : null;
                    Estimator estimator = AttributeUtils.getDefault().isDynamicNumberColumn(column) ? model.getNumberEstimator() : model.getEstimator();
                    if (PartitionFactory.isDynamicNodePartitionColumn(column, graph, timeInterval, estimator)) {
                        nodePartitions.add(PartitionFactory.createNodePartition(column));
                    }
                }
            }
            model.setNodePartitions(nodePartitions.toArray(new NodePartition[0]));

            //Edges
            List<EdgePartition> edgePartitions = new ArrayList<EdgePartition>();
            AttributeTable edgeClass = ac.getModel().getEdgeTable();
            for (AttributeColumn column : edgeClass.getColumns()) {
                if (PartitionFactory.isPartitionColumn(column) && PartitionFactory.isEdgePartitionColumn(column, graph)) {
                    edgePartitions.add(PartitionFactory.createEdgePartition(column));
                } else if (PartitionFactory.isDynamicPartitionColumn(column)) {
                    DynamicModel dynamicModel = model.getDynamicModel();
                    TimeInterval timeInterval = dynamicModel != null ? dynamicModel.getVisibleInterval() : null;
                    Estimator estimator = AttributeUtils.getDefault().isDynamicNumberColumn(column) ? model.getNumberEstimator() : model.getEstimator();
                    if (PartitionFactory.isDynamicEdgePartitionColumn(column, graph, timeInterval, estimator)) {
                        edgePartitions.add(PartitionFactory.createEdgePartition(column));
                    }
                }
            }
View Full Code Here

    }

    public Object getDynamicValue(Object attributeValue) {
        if (attributeValue != null && attributeValue instanceof DynamicType) {
            DynamicType dynamicValue = (DynamicType) attributeValue;
            Estimator estimator = dynamicModel == null ? Estimator.FIRST : dynamicModel.getEstimator();
            if (Number.class.isAssignableFrom(dynamicValue.getUnderlyingType())) {
                estimator = dynamicModel == null ? Estimator.AVERAGE : dynamicModel.getNumberEstimator();
            }
            TimeInterval timeInterval = new TimeInterval(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
            if (dynamic) {
View Full Code Here

TOP

Related Classes of org.gephi.data.attributes.api.Estimator

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.