org.jfree.data.Range.combine()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中org.jfree.data.Range.combine方法的一些代码示例,展示了Range.combine的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.combine方法的具体详情如下:
包路径:org.jfree.data.Range
类名称:Range
方法名:combine

Range.combine介绍

[英]Creates a new range by combining two existing ranges.

Note that:

  • either range can be null, in which case the other range is returned;
  • if both ranges are null the return value is null.
    [中]通过组合两个现有范围来创建新范围。
    请注意:
    *任何一个范围都可以为空,在这种情况下,返回另一个范围;
    *如果两个范围都为空,则返回值为空。

代码示例

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the range for the specified axis.
 *
 * @param axis  the axis.
 *
 * @return The range.
 */
public Range getDataRange(ValueAxis axis) {
  Range result = null;
  if (this.dataset != null) {
    result = Range.combine(result,
        DatasetUtilities.findRangeBounds(this.dataset));
  }
  return result;
}

代码示例来源:origin: jfree/jfreechart

/**
 * Returns a range representing the extent of the data values in this plot
 * (obtained from the subplots) that will be rendered against the specified
 * axis.  NOTE: This method is intended for internal JFreeChart use, and
 * is public only so that code in the axis classes can call it.  Since
 * only the range axis is shared between subplots, the JFreeChart code
 * will only call this method for the range values (although this is not
 * checked/enforced).
 *
 * @param axis  the axis.
 *
 * @return The range.
 */
@Override
public Range getDataRange(ValueAxis axis) {
  Range result = null;
  if (this.subplots != null) {
    Iterator iterator = this.subplots.iterator();
    while (iterator.hasNext()) {
      XYPlot subplot = (XYPlot) iterator.next();
      result = Range.combine(result, subplot.getDataRange(axis));
    }
  }
  return result;
}

代码示例来源:origin: jfree/jfreechart

/**
 * Returns a range representing the extent of the data values in this plot
 * (obtained from the subplots) that will be rendered against the specified
 * axis.  NOTE: This method is intended for internal JFreeChart use, and
 * is public only so that code in the axis classes can call it.  Since
 * only the range axis is shared between subplots, the JFreeChart code
 * will only call this method for the range values (although this is not
 * checked/enforced).
 *
 * @param axis  the axis.
 *
 * @return The range.
 */
@Override
 public Range getDataRange(ValueAxis axis) {
   Range result = null;
   if (this.subplots != null) {
     Iterator iterator = this.subplots.iterator();
     while (iterator.hasNext()) {
       CategoryPlot subplot = (CategoryPlot) iterator.next();
       result = Range.combine(result, subplot.getDataRange(axis));
     }
   }
   return result;
 }

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns a range representing the extent of the data values in this plot
 * (obtained from the subplots) that will be rendered against the specified
 * axis.  NOTE: This method is intended for internal JFreeChart use, and
 * is public only so that code in the axis classes can call it.  Since
 * only the domain axis is shared between subplots, the JFreeChart code
 * will only call this method for the domain values (although this is not
 * checked/enforced).
 *
 * @param axis  the axis.
 *
 * @return The range (possibly <code>null</code>).
 */
public Range getDataRange(ValueAxis axis) {
  Range result = null;
  if (this.subplots != null) {
    Iterator iterator = this.subplots.iterator();
    while (iterator.hasNext()) {
      XYPlot subplot = (XYPlot) iterator.next();
      result = Range.combine(result, subplot.getDataRange(axis));
    }
  }
  return result;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns a range representing the extent of the data values in this plot
 * (obtained from the subplots) that will be rendered against the specified
 * axis.  NOTE: This method is intended for internal JFreeChart use, and
 * is public only so that code in the axis classes can call it.  Since
 * only the range axis is shared between subplots, the JFreeChart code
 * will only call this method for the range values (although this is not
 * checked/enforced).
 *
 * @param axis  the axis.
 *
 * @return The range.
 */
 public Range getDataRange(ValueAxis axis) {
   Range result = null;
   if (this.subplots != null) {
     Iterator iterator = this.subplots.iterator();
     while (iterator.hasNext()) {
       CategoryPlot subplot = (CategoryPlot) iterator.next();
       result = Range.combine(result, subplot.getDataRange(axis));
     }
   }
   return result;
 }

代码示例来源:origin: jfree/jfreechart

/**
 * Returns a range representing the extent of the data values in this plot
 * (obtained from the subplots) that will be rendered against the specified
 * axis.  NOTE: This method is intended for internal JFreeChart use, and
 * is public only so that code in the axis classes can call it.  Since
 * only the domain axis is shared between subplots, the JFreeChart code
 * will only call this method for the domain values (although this is not
 * checked/enforced).
 *
 * @param axis  the axis.
 *
 * @return The range (possibly {@code null}).
 */
@Override
public Range getDataRange(ValueAxis axis) {
  if (this.subplots == null) {
    return null;
  }
  Range result = null;
  for (XYPlot p : this.subplots) {
    result = Range.combine(result, p.getDataRange(axis));
  }
  return result;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns a range representing the extent of the data values in this plot
 * (obtained from the subplots) that will be rendered against the specified
 * axis.  NOTE: This method is intended for internal JFreeChart use, and
 * is public only so that code in the axis classes can call it.  Since
 * only the range axis is shared between subplots, the JFreeChart code
 * will only call this method for the range values (although this is not
 * checked/enforced).
 *
 * @param axis  the axis.
 *
 * @return The range.
 */
public Range getDataRange(ValueAxis axis) {
  Range result = null;
  if (this.subplots != null) {
    Iterator iterator = this.subplots.iterator();
    while (iterator.hasNext()) {
      XYPlot subplot = (XYPlot) iterator.next();
      result = Range.combine(result, subplot.getDataRange(axis));
    }
  }
  return result;
}

代码示例来源:origin: jfree/jfreechart

/**
 * Returns the range for the specified axis.
 *
 * @param axis  the axis.
 *
 * @return The range.
 */
@Override
public Range getDataRange(ValueAxis axis) {
  Range result = null;
  int axisIdx = getAxisIndex(axis);
  List mappedDatasets = new ArrayList();
  if (axisIdx >= 0) {
    mappedDatasets = getDatasetsMappedToAxis(new Integer(axisIdx));
  }
  // iterate through the datasets that map to the axis and get the union
  // of the ranges.
  Iterator iterator = mappedDatasets.iterator();
  int datasetIdx = -1;
  while (iterator.hasNext()) {
    datasetIdx++;
    XYDataset d = (XYDataset) iterator.next();
    if (d != null) {
      // FIXME better ask the renderer instead of DatasetUtilities
      result = Range.combine(result,
          DatasetUtils.findRangeBounds(d));
    }
  }
  return result;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the bounds for the y-values in the dataset.
 *
 * @param visibleSeriesKeys  the visible series keys.
 * @param xRange  the x-range (<code>null</code> not permitted).
 * @param includeInterval  ignored.
 *
 * @return The bounds.
 *
 * @since 1.0.14
 */
public Range getRangeBounds(List visibleSeriesKeys, Range xRange,
    boolean includeInterval) {
  Range result = null;
  Iterator iterator = visibleSeriesKeys.iterator();
  while (iterator.hasNext()) {
    Comparable seriesKey = (Comparable) iterator.next();
    TimeSeries series = getSeries(seriesKey);
    Range r = null;
    r = new Range(series.getMinY(), series.getMaxY());
    // FIXME: Here we are ignoring the xRange
    result = Range.combine(result, r);
  }
  return result;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

CategoryItemRenderer r = getRendererForDataset(d);
if (r != null) {
  result = Range.combine(result, r.findRangeBounds(d));

代码示例来源:origin: jfree/jfreechart

/**
 * Returns the range of data values that will be plotted against the range
 * axis.  If the dataset is {@code null}, this method returns
 * {@code null}.
 *
 * @param axis  the axis.
 *
 * @return The data range.
 */
@Override
public Range getDataRange(ValueAxis axis) {
  Range result = null;
  List<CategoryDataset> mappedDatasets = new ArrayList<CategoryDataset>();
  int rangeIndex = findRangeAxisIndex(axis);
  if (rangeIndex >= 0) {
    mappedDatasets.addAll(datasetsMappedToRangeAxis(rangeIndex));
  }
  else if (axis == getRangeAxis()) {
    mappedDatasets.addAll(datasetsMappedToRangeAxis(0));
  }
  // iterate through the datasets that map to the axis and get the union
  // of the ranges.
  for (CategoryDataset d : mappedDatasets) {
    CategoryItemRenderer r = getRendererForDataset(d);
    if (r != null) {
      result = Range.combine(result, r.findRangeBounds(d));
    }
  }
  return result;
}

代码示例来源:origin: jfree/jfreechart

end.getLastMillisecond(this.workingCalendar));
result = Range.combine(result, temp);

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

end.getLastMillisecond(this.workingCalendar));
result = Range.combine(result, temp);

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

end.getLastMillisecond(this.workingCalendar));
result = Range.combine(result, temp);

代码示例来源:origin: jfree/jfreechart

end.getLastMillisecond(this.workingCalendar));
result = Range.combine(result, temp);

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

result = Range.combine(result, new Range(minimum[j],
    maximum[j]));

代码示例来源:origin: jfree/jfreechart

end.getEnd().getTime());
result = Range.combine(result, temp);

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

end.getEnd().getTime());
result = Range.combine(result, temp);

代码示例来源:origin: jfree/jfreechart

result = Range.combine(result, new Range(minimum[j],
    maximum[j]));

代码示例来源:origin: bcdev/beam

void updateAnnotation(RasterDataNode raster) {
  removeAnnotation();
  final AbstractTimeSeries timeSeries = getTimeSeries();
  TimeCoding timeCoding = timeSeries.getRasterTimeMap().get(raster);
  if (timeCoding != null) {
    final ProductData.UTC startTime = timeCoding.getStartTime();
    final Millisecond timePeriod = new Millisecond(startTime.getAsDate(),
        ProductData.UTC.UTC_TIME_ZONE,
        Locale.getDefault());
    double millisecond = timePeriod.getFirstMillisecond();
    Range valueRange = null;
    for (int i = 0; i < timeSeriesPlot.getRangeAxisCount(); i++) {
      valueRange = Range.combine(valueRange, timeSeriesPlot.getRangeAxis(i).getRange());
    }
    if (valueRange != null) {
      XYAnnotation annotation = new XYLineAnnotation(millisecond, valueRange.getLowerBound(), millisecond,
          valueRange.getUpperBound());
      timeSeriesPlot.addAnnotation(annotation, true);
    }
  }
}

相关文章