本文整理匯總了Java中org.jfree.chart.plot.CategoryPlot.getDomainGridlinePaint方法的典型用法代碼示例。如果您正苦於以下問題:Java CategoryPlot.getDomainGridlinePaint方法的具體用法?Java CategoryPlot.getDomainGridlinePaint怎麽用?Java CategoryPlot.getDomainGridlinePaint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.plot.CategoryPlot
的用法示例。
在下文中一共展示了CategoryPlot.getDomainGridlinePaint方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawDomainGridline
import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
* Draws a grid line against the domain axis.
* <P>
* Note that this default implementation assumes that the horizontal axis is the domain axis.
* If this is not the case, you will need to override this method.
*
* @param g2 the graphics device.
* @param plot the plot.
* @param dataArea the area for plotting data (not yet adjusted for any 3D effect).
* @param value the Java2D value at which the grid line should be drawn.
*/
public void drawDomainGridline(Graphics2D g2,
CategoryPlot plot,
Rectangle2D dataArea,
double value) {
Line2D line = null;
PlotOrientation orientation = plot.getOrientation();
if (orientation == PlotOrientation.HORIZONTAL) {
line = new Line2D.Double(dataArea.getMinX(), value, dataArea.getMaxX(), value);
}
else if (orientation == PlotOrientation.VERTICAL) {
line = new Line2D.Double(value, dataArea.getMinY(), value, dataArea.getMaxY());
}
Paint paint = plot.getDomainGridlinePaint();
if (paint == null) {
paint = CategoryPlot.DEFAULT_GRIDLINE_PAINT;
}
g2.setPaint(paint);
Stroke stroke = plot.getDomainGridlineStroke();
if (stroke == null) {
stroke = CategoryPlot.DEFAULT_GRIDLINE_STROKE;
}
g2.setStroke(stroke);
g2.draw(line);
}
示例2: drawDomainGridline
import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
* Draws a grid line against the domain axis.
* <P>
* Note that this default implementation assumes that the horizontal axis
* is the domain axis. If this is not the case, you will need to override
* this method.
*
* @param g2 the graphics device.
* @param plot the plot.
* @param dataArea the area for plotting data (not yet adjusted for any
* 3D effect).
* @param value the Java2D value at which the grid line should be drawn.
*
* @see #drawRangeGridline(Graphics2D, CategoryPlot, ValueAxis,
* Rectangle2D, double)
*/
public void drawDomainGridline(Graphics2D g2,
CategoryPlot plot,
Rectangle2D dataArea,
double value) {
Line2D line = null;
PlotOrientation orientation = plot.getOrientation();
if (orientation == PlotOrientation.HORIZONTAL) {
line = new Line2D.Double(dataArea.getMinX(), value,
dataArea.getMaxX(), value);
}
else if (orientation == PlotOrientation.VERTICAL) {
line = new Line2D.Double(value, dataArea.getMinY(), value,
dataArea.getMaxY());
}
Paint paint = plot.getDomainGridlinePaint();
if (paint == null) {
paint = CategoryPlot.DEFAULT_GRIDLINE_PAINT;
}
g2.setPaint(paint);
Stroke stroke = plot.getDomainGridlineStroke();
if (stroke == null) {
stroke = CategoryPlot.DEFAULT_GRIDLINE_STROKE;
}
g2.setStroke(stroke);
g2.draw(line);
}