本文整理匯總了Java中org.jfree.chart.axis.ValueAxis.getUpperBound方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueAxis.getUpperBound方法的具體用法?Java ValueAxis.getUpperBound怎麽用?Java ValueAxis.getUpperBound使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.axis.ValueAxis
的用法示例。
在下文中一共展示了ValueAxis.getUpperBound方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shrinkSelectionYAxis
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
private void shrinkSelectionYAxis(double x, double y, Selection selectionObject, ValueAxis axis, int axisIndex,
double zoomFactor) {
Rectangle2D scaledDataArea = getScreenDataArea((int) x, (int) y);
double minY = scaledDataArea.getMinY();
double maxY = scaledDataArea.getMaxY();
double partToTop = (y - minY) / (maxY - minY);
double lowerDomain = axis.getLowerBound();
double upperDomain = axis.getUpperBound();
double middlePointTop = lowerDomain + (upperDomain - lowerDomain) * (1d - partToTop);
double width = (upperDomain - lowerDomain) * zoomFactor;
Range axisRange = new Range(middlePointTop - width / 2d, middlePointTop + width / 2d);
for (String axisName : axisNameResolver.resolveYAxis(axisIndex)) {
selectionObject.addDelimiter(axisName, axisRange);
}
}
示例2: shrinkSelectionXAxis
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
private void shrinkSelectionXAxis(double x, double y, Selection selectionObject, ValueAxis axis, int axisIndex,
double zoomFactor) {
Rectangle2D scaledDataArea = getScreenDataArea((int) x, (int) y);
double minX = scaledDataArea.getMinX();
double maxX = scaledDataArea.getMaxX();
double partToLeft = (x - minX) / (maxX - minX);
double lowerDomain = axis.getLowerBound();
double upperDomain = axis.getUpperBound();
double middlePointLeft = lowerDomain + (upperDomain - lowerDomain) * partToLeft;
double width = (upperDomain - lowerDomain) * zoomFactor;
Range domainRange = new Range(middlePointLeft - width / 2d, middlePointLeft + width / 2d);
for (String axisName : axisNameResolver.resolveXAxis(axisIndex)) {
selectionObject.addDelimiter(axisName, domainRange);
}
}
示例3: drawDomainTickBands
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Draws the domain tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*/
public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks) {
// draw the domain tick bands, if any...
Paint bandPaint = getDomainTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
final ValueAxis xAxis = getDomainAxis();
double previous = xAxis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = xAxis.getUpperBound();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, end);
}
}
}
示例4: drawRangeTickBands
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Draws the range tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*/
public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks) {
// draw the range tick bands, if any...
Paint bandPaint = getRangeTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
final ValueAxis axis = getRangeAxis();
double previous = axis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = axis.getUpperBound();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, end);
}
}
}
示例5: selectCompleteDomainBounds
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Restores the auto-range calculation on the domain axis.
*/
public void selectCompleteDomainBounds() {
Plot plot = this.chart.getPlot();
if (plot instanceof Zoomable) {
Zoomable z = (Zoomable) plot;
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
// we need to guard against this.zoomPoint being null
Point2D zp = this.zoomPoint != null ? this.zoomPoint : new Point();
z.zoomDomainAxes(0.0, this.info.getPlotInfo(), zp);
plot.setNotify(savedNotify);
if (plot instanceof XYPlot) {
XYPlot xyPlot = (XYPlot) plot;
Selection selectionObject = new Selection();
for (int i = 0; i < xyPlot.getDomainAxisCount(); i++) {
ValueAxis domain = xyPlot.getDomainAxis(i);
Range axisRange = new Range(domain.getLowerBound(), domain.getUpperBound());
for (String axisName : axisNameResolver.resolveXAxis(i)) {
selectionObject.addDelimiter(axisName, axisRange);
}
}
informSelectionListener(selectionObject, null);
}
}
}
示例6: selectCompleteRangeBounds
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Restores the auto-range calculation on the range axis.
*/
public void selectCompleteRangeBounds() {
Plot plot = this.chart.getPlot();
if (plot instanceof Zoomable) {
Zoomable z = (Zoomable) plot;
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
// we need to guard against this.zoomPoint being null
Point2D zp = this.zoomPoint != null ? this.zoomPoint : new Point();
z.zoomRangeAxes(0.0, this.info.getPlotInfo(), zp);
plot.setNotify(savedNotify);
if (plot instanceof XYPlot) {
XYPlot xyPlot = (XYPlot) plot;
Selection selectionObject = new Selection();
for (int i = 0; i < xyPlot.getRangeAxisCount(); i++) {
ValueAxis range = xyPlot.getRangeAxis(i);
Range axisRange = new Range(range.getLowerBound(), range.getUpperBound());
for (String axisName : axisNameResolver.resolveYAxis(i)) {
selectionObject.addDelimiter(axisName, axisRange);
}
}
informSelectionListener(selectionObject, null);
}
}
}
示例7: drawDomainTickBands
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Draws the domain tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*
* @see #setDomainTickBandPaint(Paint)
*/
public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea,
List ticks) {
// draw the domain tick bands, if any...
Paint bandPaint = getDomainTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
ValueAxis xAxis = getDomainAxis();
double previous = xAxis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,
previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = xAxis.getUpperBound();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,
previous, end);
}
}
}
示例8: drawRangeTickBands
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Draws the range tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*
* @see #setRangeTickBandPaint(Paint)
*/
public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea,
List ticks) {
// draw the range tick bands, if any...
Paint bandPaint = getRangeTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
ValueAxis axis = getRangeAxis();
double previous = axis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea,
previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = axis.getUpperBound();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea,
previous, end);
}
}
}