Package org.gephi.data.attributes.type

Examples of org.gephi.data.attributes.type.TimeInterval


            for (AttributeColumn column : nodeTable.getColumns()) {
                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


            graph = graphModel.getGraphVisible();
        } else {
            graph = graphModel.getGraph();
        }
        DynamicModel dynamicModel = workspace.getLookup().lookup(DynamicModel.class);
        visibleInterval = dynamicModel != null && exportVisible ? dynamicModel.getVisibleInterval() : new TimeInterval();
        try {
            exportData(graph, attributeModel);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    System.out.println("getInterval()");
    double low  = 1.0;
    double high = 3.0;
    DynamicGraphImpl instance = new DynamicGraphImpl(graphModel.getGraph());
    instance.setInterval(low, high);
    TimeInterval t1 = instance.getInterval();
    TimeInterval t2 = new TimeInterval(1.0, 3.0);
    assertEquals(t1, t2);
    System.out.println();
  }
View Full Code Here

        DynamicController dynamicController = Lookup.getDefault().lookup(DynamicController.class);
        if (dynamicController != null) {
            timeInterval = DynamicUtilities.getVisibleInterval(dynamicController.getModel(sourceGraph.getGraphModel().getWorkspace()));
        }
        if (timeInterval == null) {
            timeInterval = new TimeInterval();
        }

        //Min/Max weight
        float minWeight = Float.POSITIVE_INFINITY;
        float maxWeight = Float.NEGATIVE_INFINITY;
View Full Code Here

            n.getNodeData().setY(random.nextInt(2000) - 1000);

            //Create a new random time interval and set it to the node
            double min = random.nextInt(2000) + 100;//Min value is 100
            double max = random.nextInt(2000) + 100;//Max value is 2099
            TimeInterval timeInterval = new TimeInterval(min < max ? min : max, max > min ? max : min);
            n.getNodeData().getAttributes().setValue(col.getIndex(), timeInterval);

            //Add the node to the graph
            graph.addNode(n);
View Full Code Here

                || event.getEventType().equals(DynamicModelEvent.EventType.MAX_CHANGED)) {
            double newMax = event.getSource().getMax();
            double newMin = event.getSource().getMin();
            setMinMax(newMin, newMax);
        } else if (event.getEventType().equals(DynamicModelEvent.EventType.VISIBLE_INTERVAL)) {
            TimeInterval timeInterval = (TimeInterval) event.getData();
            double min = timeInterval.getLow();
            double max = timeInterval.getHigh();
            fireTimelineModelEvent(new TimelineModelEvent(TimelineModelEvent.EventType.INTERVAL, model, new double[]{min, max}));
        } else if (event.getEventType().equals(DynamicModelEvent.EventType.TIME_FORMAT)) {
            fireTimelineModelEvent(new TimelineModelEvent(TimelineModelEvent.EventType.MODEL, model, null)); //refresh display
        }
    }
View Full Code Here

                model.setEnabled(enabled);
                fireTimelineModelEvent(new TimelineModelEvent(TimelineModelEvent.EventType.ENABLED, model, enabled));
            }
            if (!enabled) {
                //Disable filtering
                dynamicController.setVisibleInterval(new TimeInterval());
            }
        }
    }
View Full Code Here

        }
    }
   
    @Override
    public void setVisibleInterval(double low, double high) {
        setVisibleInterval(new TimeInterval(low, high));
    }
View Full Code Here

        }
       
        @Override
        public void run() {
            while (!stop) {
                TimeInterval interval;
                if ((interval = lastInterval.getAndSet(null)) != null) {
                    model.setVisibleTimeInterval(interval);
                }
               
                while (lastInterval.get() == null) {
View Full Code Here

        edgeDynamicColumns = Collections.synchronizedList(new ArrayList<AttributeColumn>());

        refresh();

        //Visible interval
        visibleTimeInterval = new TimeInterval(timeIntervalIndex.getMin(), timeIntervalIndex.getMax());

        //AttUtils
        final AttributeUtils attUtils = AttributeUtils.getDefault();

        //Listen columns
View Full Code Here

TOP

Related Classes of org.gephi.data.attributes.type.TimeInterval

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.