Package org.timepedia.chronoscope.client.util

Examples of org.timepedia.chronoscope.client.util.Interval


    /**
     *
     * @return range interval of tick labels, to get the underlying real range length when isCalcPercent use getAxisLength
     */
  public Interval getRangeInterval() {
    return new Interval(absRangeMin, absRangeMax);
  }
View Full Code Here


   *
   * @see Dataset#getPreferredRangeAxisInterval()
   */
  public Interval getPreferredRangeAxisInterval() {
    if (!(Double.isNaN(rangeBottom) || Double.isNaN(rangeTop))) {
      return new Interval(rangeBottom, rangeTop);
    }
   
    return null;
  }
View Full Code Here

      domains += Util.arrayToString(m.getDomain().toArray());
      ranges += Util.arrayToString(m.getRange(0).toArray());

    }
    ret += "domain: [" + domains + "],\nrange: [" + ranges + "],\n";
    Interval i = preferredRangeAxisInterval != null ? preferredRangeAxisInterval : getDomainExtrema();
    ret += "rangeTop: " + i.getEnd() ",\nrangeBottom: " + i.getStart() + "\n}";
    return ret;
  }
View Full Code Here

 
  public void testAggregateCalcs() {
    MutableDataset mds = newMutableDataset(new double[] {1.0, 2.0}, new double[] {10.0, 20.0});
    Datasets grp = new Datasets();
    grp.add(mds);
    assertEquals(new Interval(1.0, 2.0), grp.getDomainExtrema());
    assertEquals(1.0, grp.getMinInterval());
  }
View Full Code Here

    mds.mutate(Mutation.append(3.0, 30.0));
    mds.mutate(Mutation.append(4.0, 40.0));
    mds.mutate(Mutation.setY(0, -9.0));
    mds.mutate(Mutation.append(4.1, 0.1));
   
    assertEquals(new Interval(1.0, 4.1), grp.getDomainExtrema());
    assertEquals(0.1, grp.getMinInterval(), 0.000000000000001);
  }
View Full Code Here

    // verify the order of the remaining elements
    assertTrue(ds0 == grp.get(0));
    assertTrue(ds2 == grp.get(1));
   
    // make sure aggregate properties were updated
    assertEquals(new Interval(2.0, 7.0), grp.getDomainExtrema());
    assertEquals(3.0, grp.getMinInterval());
   
    // verify that the container de-registered itself as a listener
    // to the removed dataset.
    //removedDataset.mutate(Mutation.RangeMutation.setY(0, 999.0));
View Full Code Here

  public void testSinglePoint() {
    DatasetRequest request = dsMaker.newRequest(new double[] {1000}, new double[] {10});
    Dataset ds = dsFactory.create(request);

    assertEquals(1, ds.getNumSamples());
    assertEquals(new Interval(1000, 1000), ds.getDomainExtrema());
    assertEquals(new Interval(10, 10), ds.getRangeExtrema(0));
    assertEquals(0.0, ds.getMinDomainInterval());
  }
View Full Code Here

      dsMaker.newRequest(new double[] {100, 200, 250}, new double[] {1, 2, 3});
    MutableDataset ds = dsFactory.createMutable(request);
   

    assertEquals(50.0, ds.getMinDomainInterval());
    assertEquals(new Interval(1, 3), ds.getRangeExtrema(0));
   
    // Add a new point whose distance from the previous point is 25 ms.  This should
    // decrease the minimum interval reported by the Dataset.
    ds.mutate(Mutation.append(275, 4));
    assertEquals(25.0, ds.getMinDomainInterval());
    assertEquals(new Interval(1, 4), ds.getRangeExtrema(0));
  }
View Full Code Here

          for (Marker m : ms) {
            view.getChart().getPlot().addOverlay(m);
          }

          if (!Double.isNaN(domainOrigin) && !Double.isNaN(endDomain)) {
            Interval plotDomain = view.getChart().getPlot().getDomain();
            plotDomain.setEndpoints(domainOrigin, endDomain);
          }

          XYPlot plot = view.getChart().getPlot();
          plot.addPlotFocusHandler(new PlotFocusHandler() {
            public void onFocus(PlotFocusEvent event) {
View Full Code Here

    // "1d" and "5y" should drop out, but "max" should still hang around since it's
    // filter-exempt.
    double minInterval = z1d.getInterval() + 1;
    double timeStart = new Date().getTime();
    double timeEnd = timeStart + z5y.getInterval() - 1;
    z.applyFilter(new Interval(timeStart, timeEnd), minInterval);
    assertZoomEquals(z.iterator(), z1m, z1y, zMax);
   
    // Now clear the filter and make sure it goes back to initial state
    z.clearFilter();
    assertZoomEquals(z.iterator(), z1d, z1m, z1y, z5y, zMax);
View Full Code Here

TOP

Related Classes of org.timepedia.chronoscope.client.util.Interval

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.