import java.awt.Point; //導入方法依賴的package包/類
/** Draw the grid even if not marked visible */
public void forceDraw(Graphics g, Rectangle bounds, Rectangle visibleRect, double scale, boolean reversed) {
if (!bounds.intersects(visibleRect) || color == null) {
return;
}
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
Rectangle region = bounds.intersection(visibleRect);
Shape oldClip = g2d.getClip();
if (oldClip != null) {
Area clipArea = new Area(oldClip);
clipArea.intersect(new Area(region));
g2d.setClip(clipArea);
}
double deltaX = scale * dx;
double deltaY = scale * dy;
double xmin = reversed ? bounds.x + scale * origin.x + bounds.width - deltaX * ro