Package org.timepedia.chronoscope.client.util

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


        d = maxDomain - destDomainLength;
      }
    }

    final double fencedDomainOrigin = d;
    return new Interval(fencedDomainOrigin,
        fencedDomainOrigin + fencedDomainLength);
  }
View Full Code Here


     // plotBounds = layoutAll();
    innerBounds = new Bounds(0, 0, plotBounds.width, plotBounds.height);
    // innerBounds = new Bounds(plotBounds);

    clearDrawCaches();
    lastVisDomain = new Interval(0, 0);

    initLayers(plotBounds);
    ArgChecker.isNotNull(view.getCanvas().getLayer(Layer.BACKGROUND), "view.canvas.backgroundLayer");
    background = new GssBackground(view);
View Full Code Here

      int lastIdx = mipmappedDomain.size() - 1;
      double xLast = mipmappedDomain.get(lastIdx);
      double lastInterval = xLast - mipmappedDomain.get(lastIdx - 1);
      double maxDomain = xLast + (lastInterval / 2.0);
     
      return new Interval(minDomain, maxDomain);
    }
  }
View Full Code Here

   * {@link DrawableDataset}.  This is sometimes necessary depending on how each
   * datapoint is rendered (e.g. barchart requires domain padding to avoid
   * cropping of the end point bars).
   */
  protected Interval getDrawableDomain(Array1D mipmappedDomain) {
    return new Interval(mipmappedDomain.get(0), mipmappedDomain.getLast());
  }
View Full Code Here

  }

  private void initZoomPanel() {
    ZoomIntervals zoomIntervals = createDefaultZoomIntervals(plot);
    final double minInterval = Math.max(0, plot.getDatasets().getMinInterval());
    Interval domainExtrema = plot.getDatasets().getDomainExtrema();
    zoomIntervals.applyFilter(domainExtrema, minInterval);
    if (null == zoomPanel) {
      zoomPanel = new ZoomPanel();
    }
    if (null == zoomPanel.getLayer()) {
View Full Code Here

      zooms.add(new ZoomInterval("10y", TimeUnit.DECADE.ms()));
      zooms.add(new ZoomInterval("100y", TimeUnit.CENTURY.ms()));
      zooms.add(new ZoomInterval("1000y", TimeUnit.MILLENIUM.ms()));
      zooms.add(new ZoomInterval("max", Double.MAX_VALUE).filterExempt(true));
    } else {
      Interval domainExtrema = plot.getDatasets().getDomainExtrema();
      double startPower = MathUtil.roundToNearestPowerOfTen(domainExtrema.getStart());
      double endPower = MathUtil.roundToNearestPowerOfTen(domainExtrema.getEnd());
      while (startPower <= endPower) {
        zooms.add(new ZoomInterval("" + startPower / 2, startPower / 2));
        zooms.add(new ZoomInterval("" + startPower, startPower));
        startPower *= 10;
      }
View Full Code Here

  private TickFormatter<?> getTickFormatter() {
    return DomainAxisPanel.getTickFormatterFactory().findBestFormatter(plot.getDomain().length());
  }
 
  public void resizeToMinimalWidth() {
    Interval i = plot.getDomain();
    if (dateFormatter != null) {
      dateRangeActive = dateFormatterCompact.format(i.getStart()) + dateDelimCompact + dateFormatter.format(i.getEnd());
    } else {
      dateRangeActive = getTickFormatter().getRangeLabelCompact(plot.getDomain());
    }
    bounds.width = StringSizer.getWidth(layer, dateRangeActive, labelProperties);
    bounds.width += PADDING;
View Full Code Here

    bounds.x = view.getWidth() - bounds.width;
    layer.setBounds(bounds);
  }

  public void resizeToIdealWidth() {
    Interval i = plot.getDomain();
    if (dateFormatter != null) {
      dateRangeActive = dateFormatter.format(i.getStart()) + dateDelim + dateFormatter.format(i.getEnd());
    } else {
      dateRangeActive = getTickFormatter().getRangeLabel(i);
    }
    bounds.width = StringSizer.getWidth(layer, dateRangeActive, labelProperties);
    bounds.height = StringSizer.getHeight(layer, dateRangeActive, labelProperties);
View Full Code Here

      while (m != null) {
        if (m.getLevel() > 1 && m.size() < plot.getMaxDrawableDataPoints()) {
          break;
        }
        Interval rangeExtrema = dr.getRangeExtrema(m);
        double rangeMin = rangeExtrema.getStart();
        double rangeMax = rangeExtrema.getEnd();
        // rangeLength = rangeExtrema.length();
        setAbsLength(rangeMin, rangeMax);

        if (calcRangeAsPercent) {
          final double refY = dr.getRange(ds.getFlyweightTuple(0));
          double rmin = rangeOveriddenLow ? absRangeMin : rangeMin;
          double rmax = rangeOveriddenHigh ? absRangeMax : rangeMax;
          double normalizedMin = rangeExtrema.getPercentChange(refY, rmin);
          double normalizedMax = rangeExtrema.getPercentChange(refY, rmax);
          setAbsRange( normalizedMin, normalizedMax);
        } else {
          setAbsRange(
            Math.min(absRangeMin, rangeOveriddenLow ? absRangeMin : rangeMin),
            Math.max(absRangeMax, rangeOveriddenHigh ? absRangeMax : rangeMax));
View Full Code Here

  public RangeAxisPanel getAxisPanel() {
    return this.rangeAxisPanel;
  }

  public Interval getExtrema() {
    return new Interval(adjustedRangeMin, adjustedRangeMax);
  }
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.