Examples of TimeInterval


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

        }
    }

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

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

        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

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

        addTimeInterval(dateFrom, dateTo, false, false);
    }

    public void addTimeInterval(String dateFrom, String dateTo, boolean startOpen, boolean endOpen) throws IllegalArgumentException {
        if (timeInterval == null) {
            timeInterval = new TimeInterval();
        }
        Double start = null;
        Double end = null;
        if (dateFrom != null && !dateFrom.isEmpty()) {
            try {
                if (container.getTimeFormat().equals(TimeFormat.DATE) ||
                        container.getTimeFormat().equals(TimeFormat.DATETIME)) {
                    start = DynamicUtilities.getDoubleFromXMLDateString(dateFrom);
                } else {
                    start = Double.parseDouble(dateFrom);
                }

            } catch (Exception ex) {
                throw new IllegalArgumentException(NbBundle.getMessage(NodeDraftImpl.class, "ImportContainerException_TimeInterval_ParseError", dateFrom));
            }
        }
        if (dateTo != null && !dateTo.isEmpty()) {
            try {
                if (container.getTimeFormat().equals(TimeFormat.DATE) ||
                        container.getTimeFormat().equals(TimeFormat.DATETIME)) {
                    end = DynamicUtilities.getDoubleFromXMLDateString(dateTo);
                } else {
                    end = Double.parseDouble(dateTo);
                }
            } catch (Exception ex) {
                throw new IllegalArgumentException(NbBundle.getMessage(NodeDraftImpl.class, "ImportContainerException_TimeInterval_ParseError", dateTo));
            }
        }
        if (start == null && end == null) {
            throw new IllegalArgumentException(NbBundle.getMessage(EdgeDraftImpl.class, "ImportContainerException_TimeInterval_Empty"));
        }
        timeInterval = new TimeInterval(timeInterval, start != null ? start : Double.NEGATIVE_INFINITY, end != null ? end : Double.POSITIVE_INFINITY, startOpen, endOpen);
    }
View Full Code Here

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

    this.high = high;

    if (low != Double.NEGATIVE_INFINITY || high != Double.POSITIVE_INFINITY) {
      Graph vgraph = model.getGraph(currentView);
      for (Node n : vgraph.getNodes().toArray()) {
        TimeInterval ti = (TimeInterval)n.getNodeData().getAttributes().getValue(
            DynamicModel.TIMEINTERVAL_COLUMN);
        if (!ti.isInRange(low, high))
          vgraph.removeNode(n);
      }
      for (Edge e : vgraph.getEdges().toArray()) {
        TimeInterval ti = (TimeInterval)e.getEdgeData().getAttributes().getValue(
            DynamicModel.TIMEINTERVAL_COLUMN);
        if (!ti.isInRange(low, high))
          vgraph.removeEdge(e);
      }
    }
  }
View Full Code Here

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

  @Override
  public Graph getSnapshotGraph(Interval interval, Estimator estimator) {
    Graph graph  = model.getGraph(sourceView);
    Graph vgraph = model.getGraph(currentView);
    for (Node n : graph.getNodes().toArray()) {
      TimeInterval ti = (TimeInterval)n.getNodeData().getAttributes().getValue(DynamicModel.TIMEINTERVAL_COLUMN);
                        if(ti == null && !vgraph.contains(n))
                                vgraph.addNode(n);
                        else if(ti != null && ti.getValue(interval, estimator) == null && vgraph.contains(n))
        vgraph.removeNode(n);
      else if (ti != null && ti.getValue(interval, estimator) != null && !vgraph.contains(n))
        vgraph.addNode(n);
    }
    for (Edge e : graph.getEdges().toArray()) {
      TimeInterval ti = (TimeInterval)e.getEdgeData().getAttributes().getValue(DynamicModel.TIMEINTERVAL_COLUMN);
                        if(ti == null && !vgraph.contains(e) &&
          vgraph.contains(e.getSource()) && vgraph.contains(e.getTarget()))
                                vgraph.addEdge(e);
                        else if(ti != null && ti.getValue(interval, estimator) == null && vgraph.contains(e))
        vgraph.removeEdge(e);
      else if (ti != null && ti.getValue(interval, estimator) != null && !vgraph.contains(e) &&
          vgraph.contains(e.getSource()) && vgraph.contains(e.getTarget()))
        vgraph.addEdge(e);
    }
    return vgraph;
  }
View Full Code Here

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

  @Override
  public Graph getStrongSnapshotGraph(Interval interval) {
    Graph graph  = model.getGraph(sourceView);
    Graph vgraph = model.getGraph(currentView);
    for (Node n : graph.getNodes().toArray()) {
      TimeInterval ti = (TimeInterval)n.getNodeData().getAttributes().getValue(DynamicModel.TIMEINTERVAL_COLUMN);
      if (ti.getValues(interval).size() < ti.getValues().size() && vgraph.contains(n))
        vgraph.removeNode(n);
      else if (ti.getValues(interval).size() == ti.getValues().size() && !vgraph.contains(n))
        vgraph.addNode(n);
    }
    for (Edge e : graph.getEdges().toArray()) {
      TimeInterval ti = (TimeInterval)e.getEdgeData().getAttributes().getValue(DynamicModel.TIMEINTERVAL_COLUMN);
      if (ti.getValues(interval).size() < ti.getValues().size() && vgraph.contains(e))
        vgraph.removeEdge(e);
      else if (ti.getValues(interval).size() == ti.getValues().size() && !vgraph.contains(e) &&
          vgraph.contains(e.getSource()) && vgraph.contains(e.getTarget()))
        vgraph.addEdge(e);
    }
    return vgraph;
  }
View Full Code Here

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

    return model.getGraph();
  }

  @Override
  public TimeInterval getInterval() {
    return new TimeInterval(low, high);
  }
View Full Code Here

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

                    for (Interval interval : out) {
                        lout.add(new Interval(interval.getLow(), interval.getHigh(),
                                interval.isLowExcluded(), interval.isHighExcluded()));
                    }
                }
                return new TimeInterval((TimeInterval) source, lin, lout);
            }
            default:
                return null;
        }
    }
View Full Code Here

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

     *
     * @return the valid visible interval, or <code>null</code>.
     */
    public static TimeInterval getVisibleInterval(DynamicModel dynamicModel) {
        if (dynamicModel != null) {
            TimeInterval ti = dynamicModel.getVisibleInterval();
            if (ti != null && !(Double.isInfinite(ti.getLow()) && Double.isInfinite(ti.getHigh()))) {
                return ti;
            }
        }
        return null;
    }
View Full Code Here

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

        begin += ":" + (beginSecond < 10 ? "0" + beginSecond : beginSecond);
        end += "T" + (endHour < 10 ? "0" + endHour : endHour);
        end += ":" + (endMinute < 10 ? "0" + endMinute : endMinute);
        end += ":" + (endSecond < 10 ? "0" + endSecond : endSecond);

        return new TimeInterval(
                DynamicUtilities.getDoubleFromXMLDateString(begin),
                DynamicUtilities.getDoubleFromXMLDateString(end));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.