本文整理汇总了Java中org.jfree.data.Range.getLowerBound方法的典型用法代码示例。如果您正苦于以下问题:Java Range.getLowerBound方法的具体用法?Java Range.getLowerBound怎么用?Java Range.getLowerBound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.Range
的用法示例。
在下文中一共展示了Range.getLowerBound方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getZValueRange
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Returns the maximum z-value within visible region of plot.
*
* @param x the x range.
* @param y the y range.
*
* @return The z range.
*/
public Range getZValueRange(Range x, Range y) {
double minX = x.getLowerBound();
double minY = y.getLowerBound();
double maxX = x.getUpperBound();
double maxY = y.getUpperBound();
double zMin = 1.e20;
double zMax = -1.e20;
for (int k = 0; k < this.zValues.length; k++) {
if (this.xValues[k].doubleValue() >= minX
&& this.xValues[k].doubleValue() <= maxX
&& this.yValues[k].doubleValue() >= minY
&& this.yValues[k].doubleValue() <= maxY) {
if (this.zValues[k] != null) {
zMin = Math.min(zMin, this.zValues[k].doubleValue());
zMax = Math.max(zMax, this.zValues[k].doubleValue());
}
}
}
return new Range(zMin, zMax);
}
示例2: java2DToValue
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Converts a coordinate in Java2D space to the corresponding data value,
* assuming that the axis runs along one edge of the specified dataArea.
*
* @param java2DValue the coordinate in Java2D space.
* @param area the area in which the data is plotted.
* @param edge the location.
*
* @return The data value.
*/
public double java2DToValue(double java2DValue, Rectangle2D area, RectangleEdge edge) {
Range range = getRange();
double axisMin = range.getLowerBound();
double axisMax = range.getUpperBound();
double min = 0.0;
double max = 0.0;
if (RectangleEdge.isTopOrBottom(edge)) {
min = area.getX();
max = area.getMaxX();
}
else if (RectangleEdge.isLeftOrRight(edge)) {
min = area.getMaxY();
max = area.getY();
}
if (isInverted()) {
return axisMax - (java2DValue - min) / (max - min) * (axisMax - axisMin);
}
else {
return axisMin + (java2DValue - min) / (max - min) * (axisMax - axisMin);
}
}
示例3: getZValueRange
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Returns the maximum z-value within visible region of plot.
*
* @param x the x range.
* @param y the y range.
*
* @return The z range.
*/
public Range getZValueRange(final Range x, final Range y) {
final double minX = x.getLowerBound();
final double minY = y.getLowerBound();
final double maxX = x.getUpperBound();
final double maxY = y.getUpperBound();
double zMin = 1.e20;
double zMax = -1.e20;
for (int k = 0; k < this.zValues.length; k++) {
if (this.xValues[k].doubleValue() >= minX
&& this.xValues[k].doubleValue() <= maxX
&& this.yValues[k].doubleValue() >= minY
&& this.yValues[k].doubleValue() <= maxY) {
if (this.zValues[k] != null) {
zMin = Math.min(zMin, this.zValues[k].doubleValue());
zMax = Math.max(zMax, this.zValues[k].doubleValue());
}
}
}
return new Range(zMin, zMax);
}
示例4: getDomainLowerBound
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Returns the minimum x-value in the dataset.
*
* @param includeInterval a flag that determines whether or not the
* x-interval is taken into account.
*
* @return The minimum value.
*/
public double getDomainLowerBound(boolean includeInterval) {
double result = Double.NaN;
Range r = getDomainBounds(includeInterval);
if (r != null) {
result = r.getLowerBound();
}
return result;
}
示例5: getDomainLowerBound
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Returns the minimum x-value in the dataset.
*
* @param includeInterval a flag that determines whether or not the
* x-interval is taken into account.
*
* @return The minimum value.
*/
public double getDomainLowerBound(boolean includeInterval) {
double result = Double.NaN;
Range r = getDomainBounds(includeInterval);
if (r != null) {
result = r.getLowerBound();
}
return result;
}
示例6: estimateMaximumTickLabelWidth
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Estimates the maximum width of the tick labels, assuming the specified tick unit is used.
* <P>
* Rather than computing the string bounds of every tick on the axis, we just look at two
* values: the lower bound and the upper bound for the axis. These two values will usually
* be representative.
*
* @param g2 the graphics device.
* @param tickUnit the tick unit to use for calculation.
*
* @return the estimated maximum width of the tick labels.
*/
protected double estimateMaximumTickLabelWidth(Graphics2D g2, TickUnit tickUnit) {
Insets tickLabelInsets = getTickLabelInsets();
double result = tickLabelInsets.left + tickLabelInsets.right;
if (isVerticalTickLabels()) {
// all tick labels have the same width (equal to the height of the font)...
FontRenderContext frc = g2.getFontRenderContext();
LineMetrics lm = getTickLabelFont().getLineMetrics("0", frc);
result += lm.getHeight();
}
else {
// look at lower and upper bounds...
FontMetrics fm = g2.getFontMetrics(getTickLabelFont());
Range range = getRange();
double lower = range.getLowerBound();
double upper = range.getUpperBound();
String lowerStr = tickUnit.valueToString(lower);
String upperStr = tickUnit.valueToString(upper);
double w1 = fm.stringWidth(lowerStr);
double w2 = fm.stringWidth(upperStr);
result += Math.max(w1, w2);
}
return result;
}
示例7: findDomainBounds
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Returns the lower and upper bounds (range) of the x-values in the
* specified dataset.
*
* @param dataset the dataset (<code>null</code> permitted).
*
* @return The range (<code>null</code> if the dataset is <code>null</code>
* or empty).
*/
public Range findDomainBounds(XYDataset dataset) {
if (dataset != null) {
Range r = DatasetUtilities.findDomainBounds(dataset, false);
return new Range(r.getLowerBound() + this.xOffset,
r.getUpperBound() + this.blockWidth + this.xOffset);
}
else {
return null;
}
}
示例8: findRangeBounds
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Returns the range of values the renderer requires to display all the
* items from the specified dataset.
*
* @param dataset the dataset (<code>null</code> permitted).
*
* @return The range (<code>null</code> if the dataset is <code>null</code>
* or empty).
*/
public Range findRangeBounds(XYDataset dataset) {
if (dataset != null) {
Range r = DatasetUtilities.findRangeBounds(dataset, false);
return new Range(r.getLowerBound() + this.yOffset,
r.getUpperBound() + this.blockHeight + this.yOffset);
}
else {
return null;
}
}
示例9: trimToContentWidth
import org.jfree.data.Range; //导入方法依赖的package包/类
private Range trimToContentWidth(Range r) {
if (r == null) {
return null;
}
double lowerBound = 0.0;
double upperBound = Double.POSITIVE_INFINITY;
if (r.getLowerBound() > 0.0) {
lowerBound = trimToContentWidth(r.getLowerBound());
}
if (r.getUpperBound() < Double.POSITIVE_INFINITY) {
upperBound = trimToContentWidth(r.getUpperBound());
}
return new Range(lowerBound, upperBound);
}
示例10: trimToContentHeight
import org.jfree.data.Range; //导入方法依赖的package包/类
private Range trimToContentHeight(Range r) {
if (r == null) {
return null;
}
double lowerBound = 0.0;
double upperBound = Double.POSITIVE_INFINITY;
if (r.getLowerBound() > 0.0) {
lowerBound = trimToContentHeight(r.getLowerBound());
}
if (r.getUpperBound() < Double.POSITIVE_INFINITY) {
upperBound = trimToContentHeight(r.getUpperBound());
}
return new Range(lowerBound, upperBound);
}
示例11: valueToJava2D
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Converts a data value to a coordinate in Java2D space, assuming that the
* axis runs along one edge of the specified dataArea.
* <p>
* Note that it is possible for the coordinate to fall outside the plotArea.
*
* @param value the data value.
* @param area the area for plotting the data.
* @param edge the axis location.
*
* @return The Java2D coordinate.
*
* @see #java2DToValue(double, Rectangle2D, RectangleEdge)
*/
public double valueToJava2D(double value, Rectangle2D area,
RectangleEdge edge) {
Range range = getRange();
double axisMin = range.getLowerBound();
double axisMax = range.getUpperBound();
double min = 0.0;
double max = 0.0;
if (RectangleEdge.isTopOrBottom(edge)) {
min = area.getX();
max = area.getMaxX();
}
else if (RectangleEdge.isLeftOrRight(edge)) {
max = area.getMinY();
min = area.getMaxY();
}
if (isInverted()) {
return max
- ((value - axisMin) / (axisMax - axisMin)) * (max - min);
}
else {
return min
+ ((value - axisMin) / (axisMax - axisMin)) * (max - min);
}
}
示例12: java2DToValue
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Converts a coordinate in Java2D space to the corresponding data value,
* assuming that the axis runs along one edge of the specified dataArea.
*
* @param java2DValue the coordinate in Java2D space.
* @param area the area in which the data is plotted.
* @param edge the location.
*
* @return The data value.
*
* @see #valueToJava2D(double, Rectangle2D, RectangleEdge)
*/
public double java2DToValue(double java2DValue, Rectangle2D area,
RectangleEdge edge) {
Range range = getRange();
double axisMin = range.getLowerBound();
double axisMax = range.getUpperBound();
double min = 0.0;
double max = 0.0;
if (RectangleEdge.isTopOrBottom(edge)) {
min = area.getX();
max = area.getMaxX();
}
else if (RectangleEdge.isLeftOrRight(edge)) {
min = area.getMaxY();
max = area.getY();
}
if (isInverted()) {
return axisMax
- (java2DValue - min) / (max - min) * (axisMax - axisMin);
}
else {
return axisMin
+ (java2DValue - min) / (max - min) * (axisMax - axisMin);
}
}
示例13: estimateMaximumTickLabelWidth
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Estimates the maximum width of the tick labels, assuming the specified
* tick unit is used.
* <P>
* Rather than computing the string bounds of every tick on the axis, we
* just look at two values: the lower bound and the upper bound for the
* axis. These two values will usually be representative.
*
* @param g2 the graphics device.
* @param unit the tick unit to use for calculation.
*
* @return The estimated maximum width of the tick labels.
*/
protected double estimateMaximumTickLabelWidth(Graphics2D g2,
TickUnit unit) {
RectangleInsets tickLabelInsets = getTickLabelInsets();
double result = tickLabelInsets.getLeft() + tickLabelInsets.getRight();
if (isVerticalTickLabels()) {
// all tick labels have the same width (equal to the height of the
// font)...
FontRenderContext frc = g2.getFontRenderContext();
LineMetrics lm = getTickLabelFont().getLineMetrics("0", frc);
result += lm.getHeight();
}
else {
// look at lower and upper bounds...
FontMetrics fm = g2.getFontMetrics(getTickLabelFont());
Range range = getRange();
double lower = range.getLowerBound();
double upper = range.getUpperBound();
String lowerStr = "";
String upperStr = "";
NumberFormat formatter = getNumberFormatOverride();
if (formatter != null) {
lowerStr = formatter.format(lower);
upperStr = formatter.format(upper);
}
else {
lowerStr = unit.valueToString(lower);
upperStr = unit.valueToString(upper);
}
double w1 = fm.stringWidth(lowerStr);
double w2 = fm.stringWidth(upperStr);
result += Math.max(w1, w2);
}
return result;
}
示例14: valueToJava2D
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Translates a value from data space to Java 2D space.
*
* @param value the data value.
* @param dataArea the data area.
* @param edge the edge.
*
* @return the Java 2D value.
*/
public double valueToJava2D(double value, Rectangle2D dataArea, RectangleEdge edge) {
Range range = getRange();
double vmin = range.getLowerBound();
double vmax = range.getUpperBound();
double vp = getCycleBound();
if ((value < vmin) || (value > vmax)) {
return Double.NaN;
}
double jmin = 0.0;
double jmax = 0.0;
if (RectangleEdge.isTopOrBottom(edge)) {
jmin = dataArea.getMinX();
jmax = dataArea.getMaxX();
}
else if (RectangleEdge.isLeftOrRight(edge)) {
jmax = dataArea.getMinY();
jmin = dataArea.getMaxY();
}
if (isInverted()) {
if (value == vp) {
return this.boundMappedToLastCycle ? jmin : jmax;
}
else if (value > vp) {
return jmax - (value - vp) * (jmax - jmin) / this.period;
}
else {
return jmin + (vp - value) * (jmax - jmin) / this.period;
}
}
else {
if (value == vp) {
return this.boundMappedToLastCycle ? jmax : jmin;
}
else if (value >= vp) {
return jmin + (value - vp) * (jmax - jmin) / this.period;
}
else {
return jmax - (vp - value) * (jmax - jmin) / this.period;
}
}
}
示例15: autoAdjustRange
import org.jfree.data.Range; //导入方法依赖的package包/类
/**
* Adjusts the axis range to match the data range that the axis is
* required to display.
*/
protected void autoAdjustRange() {
Plot plot = getPlot();
if (plot == null) {
return; // no plot, no data
}
if (plot instanceof ValueAxisPlot) {
ValueAxisPlot vap = (ValueAxisPlot) plot;
Range r = vap.getDataRange(this);
if (r == null) {
r = getDefaultAutoRange();
}
double upper = r.getUpperBound();
double lower = r.getLowerBound();
double range = upper - lower;
// if fixed auto range, then derive lower bound...
double fixedAutoRange = getFixedAutoRange();
if (fixedAutoRange > 0.0) {
lower = Math.max(upper - fixedAutoRange, this.smallestValue);
}
else {
// ensure the autorange is at least <minRange> in size...
double minRange = getAutoRangeMinimumSize();
if (range < minRange) {
double expand = (minRange - range) / 2;
upper = upper + expand;
lower = lower - expand;
}
// apply the margins - these should apply to the exponent range
// upper = upper + getUpperMargin() * range;
// lower = lower - getLowerMargin() * range;
}
setRange(new Range(lower, upper), false, false);
}
}