private Range getRange(final XYSeriesCollection seriesCol) { if (this.boundingBox == null) return seriesCol.getRangeBounds(false); 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); }
/** * Returns the data range. * * @param axis the axis. * * @return The range of data displayed. */ @Override public Range getDataRange(ValueAxis axis) { return new Range(this.lowerBound, this.upperBound); }
/** * Returns the x-range for the annotation. * * @return The range. * * @since 1.0.13 */ @Override public Range getXRange() { return new Range(this.x, this.x + this.w); }
/** * Returns the range of the values in this dataset's range. * * @param includeInterval a flag that determines whether or not the * y-interval is taken into account. * * @return The range. */ @Override public Range getRangeBounds(boolean includeInterval) { return new Range(this.minValue, this.maxValue); }
/** * Returns the y-range for the annotation. * * @return The range. * * @since 1.0.13 */ @Override public Range getYRange() { return new Range(this.y, this.y + this.h); }
/** * Returns the x-range for the annotation. * * @return The range. * * @since 1.0.13 */ public Range getXRange() { return new Range(this.x, this.x + this.w); }
/** * Returns the range of the values in this dataset's range. * * @param includeInterval a flag that determines whether or not the * y-interval is taken into account. * * @return The range. */ @Override public Range getRangeBounds(boolean includeInterval) { return new Range(this.minimumRangeValue, this.maximumRangeValue); }
/** * Returns the range of the values in this dataset's range. * * @param includeInterval a flag that determines whether or not the * y-interval is taken into account. * * @return The range. */ public Range getRangeBounds(boolean includeInterval) { return new Range(this.minValue, this.maxValue); }
/** * Returns the data range. * * @param axis the axis. * * @return The range of data displayed. */ public Range getDataRange(ValueAxis axis) { return new Range(this.lowerBound, this.upperBound); }
private XYPlot createPlot(final XYSeriesCollection problem, XYSeriesCollection shipments, XYSeriesCollection solution) { XYPlot plot = new XYPlot(); plot.setBackgroundPaint(Color.LIGHT_GRAY); plot.setRangeGridlinePaint(Color.LIGHT_GRAY); plot.setDomainGridlinePaint(Color.LIGHT_GRAY); XYLineAndShapeRenderer problemRenderer = getProblemRenderer(problem); plot.setDataset(0, problem); plot.setRenderer(0, problemRenderer); XYItemRenderer shipmentsRenderer = getShipmentRenderer(shipments); plot.setDataset(1, shipments); plot.setRenderer(1, shipmentsRenderer); if (solution != null) { XYItemRenderer solutionRenderer = getRouteRenderer(solution); plot.setDataset(2, solution); plot.setRenderer(2, solutionRenderer); } NumberAxis xAxis = new NumberAxis(); NumberAxis yAxis = new NumberAxis(); 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); return plot; }
/** * Creates a new dataset. */ public DefaultMultiValueCategoryDataset() { this.data = new KeyedObjects2D(); this.minimumRangeValue = null; this.maximumRangeValue = null; this.rangeBounds = new Range(0.0, 0.0); }
/** * Sets the axis range, where the new range is 'size' in length, and * centered on 'value'. * * @param value the central value. * @param length the range length. */ public void setRangeAboutValue(double value, double length) { setRange(new Range(value - length / 2, value + length / 2)); }
/** * Sets the axis range (after first adding the current margins to the * range) and sends an {@link AxisChangeEvent} to all registered listeners. * As a side-effect, the auto-range flag is set to {@code false}. * * @param lower the lower axis limit. * @param upper the upper axis limit. */ public void setRangeWithMargins(double lower, double upper) { setRangeWithMargins(new Range(lower, upper)); }
@Override @OnAwt public void setRangeAxisRange(double lower, double upper) { this.rangeAxis = new Range(lower, upper); setAutoZoomRange(true); }
/** * Creates a new {@code LogAxis} with the given label. * * @param label the axis label ({@code null} permitted). */ public LogAxis(String label) { super(label, new NumberTickUnitSource()); setDefaultAutoRange(new Range(0.01, 1.0)); this.tickUnit = new NumberTickUnit(1.0, new DecimalFormat("0.#"), 10); }
/** * {@inheritDoc} */ @Override public NumberAxis getAxis() { NumberAxis rangeAxis = new NumberAxis("Boolean"); rangeAxis.setRange(new Range(-0.5, 1.5), true, false); rangeAxis.setTickUnit(new NumberTickUnit(1d, new DecimalFormat("0"))); rangeAxis.setNumberFormatOverride(numberFormat); return rangeAxis; }
/** * {@inheritDoc} */ @Override public NumberAxis getAxis() { NumberAxis rangeAxis = new NumberAxis("Percentage"); rangeAxis.setRange(new Range(0, 100), false, false); rangeAxis.setAutoRangeMinimumSize(50, false); rangeAxis.setTickUnit(new NumberTickUnit(10.0d, new DecimalFormat("0"))); rangeAxis.setNumberFormatOverride(numberFormat); return rangeAxis; }
/** * Centers the axis range about the specified value and sends an * {@link AxisChangeEvent} to all registered listeners. * * @param value the center value. */ public void centerRange(double value) { double central = this.range.getCentralValue(); Range adjusted = new Range(this.range.getLowerBound() + value - central, this.range.getUpperBound() + value - central); setRange(adjusted); }
/** * Centers the axis range about the specified value and sends an * {@link AxisChangeEvent} to all registered listeners. * * @param value the center value. */ public void centerRange(double value) { double central = this.range.getCentralValue(); Range adjusted = new Range(this.range.getLowerBound() + value - central, this.range.getUpperBound() + value - central); setRange(adjusted); }