Package org.jfree.data

Examples of org.jfree.data.Range


    else return new Range(boundingBox.minY, boundingBox.maxY);
  }

  private Range getDomainRange(final XYSeriesCollection seriesCol) {
    if(this.boundingBox == null) return seriesCol.getDomainBounds(true);
    else return new Range(boundingBox.minX, boundingBox.maxX);
  }
View Full Code Here


    if(boundingBox == null){
      xAxis.setRangeWithMargins(getDomainRange(problem));
      yAxis.setRangeWithMargins(getRange(problem));
    }
    else{
      xAxis.setRangeWithMargins(new Range(boundingBox.minX, boundingBox.maxX));
      yAxis.setRangeWithMargins(new Range(boundingBox.minY, boundingBox.maxY));
    }
   
    plot.setDomainAxis(xAxis);
    plot.setRangeAxis(yAxis);
   
View Full Code Here

    public Range findRangeBounds(final CategoryDataset dataset) {
        if (dataset == null) {
            return null;
        }
        if (this.renderAsPercentages) {
            return new Range(0.0, 1.0);
        }
        else {
            return DatasetUtilities.findStackedRangeBounds(dataset);
        }
    }
View Full Code Here

  public void autoAdjustRange()
  {
    super.autoAdjustRange();
    if (getPlot() instanceof ValueAxisPlot)
    {
      final Range range = this.getRange();
      setRange(new Range(range.getLowerBound() * 10.0, range.getUpperBound() * 10.0), false, false);
      setupSmallLogFlag();
    }
  }
View Full Code Here

   * @return The minimum value.
   */
  public double getDomainLowerBound(final boolean includeInterval)
  {
    double result = Double.NaN;
    final Range r = getDomainBounds(includeInterval);
    if (r != null)
    {
      result = r.getLowerBound();
    }
    return result;
  }
View Full Code Here

   * @return The maximum value.
   */
  public double getDomainUpperBound(final boolean includeInterval)
  {
    double result = Double.NaN;
    final Range r = getDomainBounds(includeInterval);
    if (r != null)
    {
      result = r.getUpperBound();
    }
    return result;
  }
View Full Code Here

    final TimePeriod first = (TimePeriod) keys.get(0);
    final TimePeriod last = (TimePeriod) keys.get(keys.size() - 1);

    if (!includeInterval || this.domainIsPointsInTime)
    {
      return new Range(getXValue(first), getXValue(last));
    }
    else
    {
      return new Range(first.getStart().getTime(),
          last.getEnd().getTime());
    }
  }
View Full Code Here

         rangeDefaultUpperBound /= GfrUnits.DBL_K_METER_FOOT;
         rangeDefaultLowerbound /= GfrUnits.DBL_K_METER_FOOT;
      }

      super.setDefaultAutoRange(
              new Range(rangeDefaultLowerbound, rangeDefaultUpperBound));

      super.setRange(
              new Range(rangeLowerbound, rangeUpperBound));

   }
View Full Code Here

        AxisLocation rangeAxisLocation = plot.getRangeAxisLocation();
        RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
                domainAxisLocation, orientation);
        RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
                rangeAxisLocation, orientation);
        Range xRange = domainAxis.getRange();
        Range yRange = rangeAxis.getRange();
        double anchorX = 0.0;
        double anchorY = 0.0;
        if (this.coordinateType == XYCoordinateType.RELATIVE) {
            anchorX = xRange.getLowerBound() + (this.x * xRange.getLength());
            anchorY = yRange.getLowerBound() + (this.y * yRange.getLength());
        }
        else {
            anchorX = domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
            anchorY = rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge);
        }

        float j2DX = (float) domainAxis.valueToJava2D(anchorX, dataArea,
                domainEdge);
        float j2DY = (float) rangeAxis.valueToJava2D(anchorY, dataArea,
                rangeEdge);
        float xx = 0.0f;
        float yy = 0.0f;
        if (orientation == PlotOrientation.HORIZONTAL) {
            xx = j2DY;
            yy = j2DX;
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            xx = j2DX;
            yy = j2DY;
        }

        double maxW = dataArea.getWidth();
        double maxH = dataArea.getHeight();
        if (this.coordinateType == XYCoordinateType.RELATIVE) {
            if (this.maxWidth > 0.0) {
                maxW = maxW * this.maxWidth;
            }
            if (this.maxHeight > 0.0) {
                maxH = maxH * this.maxHeight;
            }
        }
        if (this.coordinateType == XYCoordinateType.DATA) {
            maxW = this.maxWidth;
            maxH = this.maxHeight;
        }
        RectangleConstraint rc = new RectangleConstraint(
                new Range(0, maxW), new Range(0, maxH));

        Size2D size = this.title.arrange(g2, rc);
        Rectangle2D titleRect = new Rectangle2D.Double(0, 0, size.width,
                size.height);
        Point2D anchorPoint = RectangleAnchor.coordinates(titleRect,
View Full Code Here

        }
        if (c.equals(RectangleConstraint.NONE)) {
            return c;
        }
        double w = c.getWidth();
        Range wr = c.getWidthRange();
        double h = c.getHeight();
        Range hr = c.getHeightRange();
        double ww = trimToContentWidth(w);
        double hh = trimToContentHeight(h);
        Range wwr = trimToContentWidth(wr);
        Range hhr = trimToContentHeight(hr);
        return new RectangleConstraint(
            ww, wwr, c.getWidthConstraintType(),
            hh, hhr, c.getHeightConstraintType()
        );
    }
View Full Code Here

TOP

Related Classes of org.jfree.data.Range

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.