本文整理了Java中org.jfree.chart.plot.Plot.resolveRangeAxisLocation()
方法的一些代码示例,展示了Plot.resolveRangeAxisLocation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plot.resolveRangeAxisLocation()
方法的具体详情如下:
包路径:org.jfree.chart.plot.Plot
类名称:Plot
方法名:resolveRangeAxisLocation
[英]Resolves a range axis location for a given plot orientation.
[中]解析给定打印方向的范围轴位置。
代码示例来源:origin: jfree/jfreechart
/**
* Returns the edge for the primary range axis.
*
* @return The range axis edge.
*
* @see #getRangeAxisLocation()
* @see #getOrientation()
*/
public RectangleEdge getRangeAxisEdge() {
return Plot.resolveRangeAxisLocation(getRangeAxisLocation(),
this.orientation);
}
代码示例来源:origin: jfree/jfreechart
/**
* Returns the edge for a range axis.
*
* @param index the axis index.
*
* @return The edge.
*/
public RectangleEdge getRangeAxisEdge(int index) {
AxisLocation location = getRangeAxisLocation(index);
return Plot.resolveRangeAxisLocation(location, this.orientation);
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Returns the edge for the primary range axis.
*
* @return The range axis edge.
*
* @see #getRangeAxisLocation()
* @see #getOrientation()
*/
public RectangleEdge getRangeAxisEdge() {
return Plot.resolveRangeAxisLocation(getRangeAxisLocation(),
this.orientation);
}
代码示例来源:origin: jfree/jfreechart
/**
* Returns the edge for a range axis.
*
* @param index the axis index.
*
* @return The edge.
*
* @see #getRangeAxisLocation(int)
* @see #getOrientation()
*/
public RectangleEdge getRangeAxisEdge(int index) {
AxisLocation location = getRangeAxisLocation(index);
return Plot.resolveRangeAxisLocation(location, this.orientation);
}
代码示例来源:origin: superad/pdf-kit
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info) {
PlotOrientation orientation = plot.getOrientation();
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(plot.getRangeAxisLocation(), orientation);
double j2DX = domainAxis.valueToJava2D(this.getX(), dataArea, domainEdge);
double j2DY = rangeAxis.valueToJava2D(this.getY(), dataArea, rangeEdge);
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Returns the edge for a range axis.
*
* @param index the axis index.
*
* @return The edge.
*/
public RectangleEdge getRangeAxisEdge(int index) {
AxisLocation location = getRangeAxisLocation(index);
RectangleEdge result = Plot.resolveRangeAxisLocation(location,
this.orientation);
if (result == null) {
result = RectangleEdge.opposite(getRangeAxisEdge(0));
}
return result;
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Returns the edge for a range axis.
*
* @param index the axis index.
*
* @return The edge.
*
* @see #getRangeAxisLocation(int)
* @see #getOrientation()
*/
public RectangleEdge getRangeAxisEdge(int index) {
AxisLocation location = getRangeAxisLocation(index);
RectangleEdge result = Plot.resolveRangeAxisLocation(location,
this.orientation);
if (result == null) {
result = RectangleEdge.opposite(getRangeAxisEdge());
}
return result;
}
代码示例来源:origin: bcdev/beam
private Shape createShape() {
XYPlot plot = chartPanel.getChart().getXYPlot();
Rectangle2D dataArea = chartPanel.getScreenDataArea();
PlotOrientation orientation = plot.getOrientation();
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(plot.getRangeAxisLocation(), orientation);
double vx1 = areaType == AreaType.Y_RANGE ? dataArea.getX() : point1.x;
double vy1 = areaType == AreaType.X_RANGE ? dataArea.getY() : point1.y;
double vx2 = areaType == AreaType.Y_RANGE ? dataArea.getX() + dataArea.getWidth() : point2.x;
double vy2 = areaType == AreaType.X_RANGE ? dataArea.getY() + dataArea.getHeight() : point2.y;
double x1 = plot.getDomainAxis().java2DToValue(vx1, dataArea, domainEdge);
double x2 = plot.getDomainAxis().java2DToValue(vx2, dataArea, domainEdge);
double y1 = plot.getRangeAxis().java2DToValue(vy1, dataArea, rangeEdge);
double y2 = plot.getRangeAxis().java2DToValue(vy2, dataArea, rangeEdge);
double dx = abs(x2 - x1);
double dy = abs(y2 - y1);
final Shape shape;
if (areaType == AreaType.ELLIPSE) {
shape = new Ellipse2D.Double(x1 - dx, y1 - dy, 2.0 * dx, 2.0 * dy);
} else if (areaType == AreaType.RECTANGLE) {
shape = new Rectangle2D.Double(x1 - dx, y1 - dy, 2.0 * dx, 2.0 * dy);
} else if (areaType == AreaType.X_RANGE || areaType == AreaType.Y_RANGE) {
shape = new Rectangle2D.Double(min(x1, x2), min(y1, y2), dx, dy);
} else {
throw new IllegalStateException("areaType = " + areaType);
}
return shape;
}
代码示例来源:origin: senbox-org/snap-desktop
private Shape createShape() {
XYPlot plot = chartPanel.getChart().getXYPlot();
Rectangle2D dataArea = chartPanel.getScreenDataArea();
PlotOrientation orientation = plot.getOrientation();
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(plot.getRangeAxisLocation(), orientation);
double vx1 = areaType == AreaType.Y_RANGE ? dataArea.getX() : point1.x;
double vy1 = areaType == AreaType.X_RANGE ? dataArea.getY() : point1.y;
double vx2 = areaType == AreaType.Y_RANGE ? dataArea.getX() + dataArea.getWidth() : point2.x;
double vy2 = areaType == AreaType.X_RANGE ? dataArea.getY() + dataArea.getHeight() : point2.y;
double x1 = plot.getDomainAxis().java2DToValue(vx1, dataArea, domainEdge);
double x2 = plot.getDomainAxis().java2DToValue(vx2, dataArea, domainEdge);
double y1 = plot.getRangeAxis().java2DToValue(vy1, dataArea, rangeEdge);
double y2 = plot.getRangeAxis().java2DToValue(vy2, dataArea, rangeEdge);
double dx = abs(x2 - x1);
double dy = abs(y2 - y1);
final Shape shape;
if (areaType == AreaType.ELLIPSE) {
shape = new Ellipse2D.Double(x1 - dx, y1 - dy, 2.0 * dx, 2.0 * dy);
} else if (areaType == AreaType.RECTANGLE) {
shape = new Rectangle2D.Double(x1 - dx, y1 - dy, 2.0 * dx, 2.0 * dy);
} else if (areaType == AreaType.X_RANGE || areaType == AreaType.Y_RANGE) {
shape = new Rectangle2D.Double(min(x1, x2), min(y1, y2), dx, dy);
} else {
throw new IllegalStateException("areaType = " + areaType);
}
return shape;
}
代码示例来源:origin: jfree/jfreechart
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
plot.getRangeAxisLocation(), orientation);
代码示例来源:origin: jfree/jfreechart
= Plot.resolveDomainAxisLocation(domainAxisLocation, orientation);
RectangleEdge rangeEdge
= Plot.resolveRangeAxisLocation(rangeAxisLocation, orientation);
float j2DX
= (float) domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
plot.getRangeAxisLocation(), orientation);
代码示例来源:origin: jfree/jfreechart
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
plot.getRangeAxisLocation(), orientation);
float j2DX = (float) domainAxis.valueToJava2D(this.x, dataArea,
代码示例来源:origin: jfree/jfreechart
/**
* Handles a 'click' on the plot by updating the anchor value.
*
* @param x x-coordinate of the click (in Java2D space).
* @param y y-coordinate of the click (in Java2D space).
* @param info information about the plot's dimensions.
*
*/
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {
Rectangle2D dataArea = info.getDataArea();
if (dataArea.contains(x, y)) {
// set the anchor value for the range axis...
double java2D = 0.0;
if (this.orientation == PlotOrientation.HORIZONTAL) {
java2D = x;
} else if (this.orientation == PlotOrientation.VERTICAL) {
java2D = y;
}
RectangleEdge edge = Plot.resolveRangeAxisLocation(
getRangeAxisLocation(), this.orientation);
double value = getRangeAxis().java2DToValue(
java2D, info.getDataArea(), edge);
setAnchorValue(value);
setRangeCrosshairValue(value);
}
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Handles a 'click' on the plot by updating the anchor value.
*
* @param x x-coordinate of the click (in Java2D space).
* @param y y-coordinate of the click (in Java2D space).
* @param info information about the plot's dimensions.
*
*/
public void handleClick(int x, int y, PlotRenderingInfo info) {
Rectangle2D dataArea = info.getDataArea();
if (dataArea.contains(x, y)) {
// set the anchor value for the range axis...
double java2D = 0.0;
if (this.orientation == PlotOrientation.HORIZONTAL) {
java2D = x;
}
else if (this.orientation == PlotOrientation.VERTICAL) {
java2D = y;
}
RectangleEdge edge = Plot.resolveRangeAxisLocation(
getRangeAxisLocation(), this.orientation);
double value = getRangeAxis().java2DToValue(
java2D, info.getDataArea(), edge);
setAnchorValue(value);
setRangeCrosshairValue(value);
}
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
plot.getRangeAxisLocation(), orientation);
代码示例来源:origin: jfree/jfreechart
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
plot.getRangeAxisLocation(), orientation);
代码示例来源:origin: jfree/jfreechart
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
plot.getRangeAxisLocation(), orientation);
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
plot.getRangeAxisLocation(), orientation);
代码示例来源:origin: bcdev/beam
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
plot.getDomainAxisLocation(), orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
plot.getRangeAxisLocation(), orientation);
内容来源于网络,如有侵权,请联系作者删除!