本文整理汇总了Java中org.jfree.chart.plot.XYPlot.getRangeAxisLocation方法的典型用法代码示例。如果您正苦于以下问题:Java XYPlot.getRangeAxisLocation方法的具体用法?Java XYPlot.getRangeAxisLocation怎么用?Java XYPlot.getRangeAxisLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.plot.XYPlot
的用法示例。
在下文中一共展示了XYPlot.getRangeAxisLocation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: draw
import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
* Draws the annotation. This method is called by the drawing code in the {@link XYPlot} class,
* you don't normally need to call this method directly.
*
* @param g2 the graphics device.
* @param plot the plot.
* @param dataArea the data area.
* @param domainAxis the domain axis.
* @param rangeAxis the range axis.
*/
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
ValueAxis domainAxis, ValueAxis rangeAxis) {
PlotOrientation orientation = plot.getOrientation();
AxisLocation domainAxisLocation = plot.getDomainAxisLocation();
AxisLocation rangeAxisLocation = plot.getRangeAxisLocation();
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(domainAxisLocation, orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(rangeAxisLocation, orientation);
float j2DX = (float) domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
float j2DY = (float) rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge);
float xx = 0.0f;
float yy = 0.0f;
if (orientation == PlotOrientation.HORIZONTAL) {
xx = j2DY;
yy = j2DX;
}
else if (orientation == PlotOrientation.VERTICAL) {
xx = j2DX;
yy = j2DY;
}
xx = xx - this.image.getWidth(null) / 2.0f;
yy = yy - this.image.getHeight(null) / 2.0f;
g2.drawImage(this.image, (int) xx, (int) yy, null);
}
示例2: draw
import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
* Draws the annotation. This method is called by the drawing code in the
* {@link XYPlot} class, you don't normally need to call this method
* directly.
*
* @param g2 the graphics device.
* @param plot the plot.
* @param dataArea the data area.
* @param domainAxis the domain axis.
* @param rangeAxis the range axis.
* @param rendererIndex the renderer index.
* @param info if supplied, this info object will be populated with
* entity information.
*/
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
ValueAxis domainAxis, ValueAxis rangeAxis,
int rendererIndex,
PlotRenderingInfo info) {
PlotOrientation orientation = plot.getOrientation();
AxisLocation domainAxisLocation = plot.getDomainAxisLocation();
AxisLocation rangeAxisLocation = plot.getRangeAxisLocation();
RectangleEdge domainEdge
= Plot.resolveDomainAxisLocation(domainAxisLocation, orientation);
RectangleEdge rangeEdge
= Plot.resolveRangeAxisLocation(rangeAxisLocation, orientation);
float j2DX
= (float) domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
float j2DY
= (float) rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge);
float xx = 0.0f;
float yy = 0.0f;
if (orientation == PlotOrientation.HORIZONTAL) {
xx = j2DY;
yy = j2DX;
}
else if (orientation == PlotOrientation.VERTICAL) {
xx = j2DX;
yy = j2DY;
}
int w = this.image.getWidth(null);
int h = this.image.getHeight(null);
Rectangle2D imageRect = new Rectangle2D.Double(0, 0, w, h);
Point2D anchorPoint = (Point2D) RectangleAnchor.coordinates(imageRect,
this.anchor);
xx = xx - (float) anchorPoint.getX();
yy = yy - (float) anchorPoint.getY();
g2.drawImage(this.image, (int) xx, (int) yy, null);
String toolTip = getToolTipText();
String url = getURL();
if (toolTip != null || url != null) {
addEntity(info, new Rectangle2D.Float(xx, yy, w, h), rendererIndex,
toolTip, url);
}
}