Java Graphics Draw drawGatter(Graphics g, int xDist, int yDist)

Here you can find the source of drawGatter(Graphics g, int xDist, int yDist)

Description

draw Gatter

License

Apache License

Declaration

public static void drawGatter(Graphics g, int xDist, int yDist) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.BasicStroke;
import java.awt.Color;

import java.awt.Graphics;
import java.awt.Graphics2D;

public class Main {
    public final static BasicStroke gatterStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
            BasicStroke.JOIN_ROUND, 1.0f, null, 0.0f);

    public static void drawGatter(Graphics g, int xDist, int yDist) {
        Graphics2D g2 = (Graphics2D) g;
        g2.setStroke(gatterStroke);/*  w ww  .  j ava  2  s  .  c o m*/
        g2.setPaint(new Color(230, 230, 230));
        for (int x = 0; x < g2.getClipBounds().x + g2.getClipBounds().width; x += xDist) {
            g2.drawLine(x, 0, x, g2.getClipBounds().y + g2.getClipBounds().height);
        }

        for (int y = 0; y < g2.getClipBounds().y + g2.getClipBounds().height; y += yDist) {
            g2.drawLine(0, y, g2.getClipBounds().x + g2.getClipBounds().width, y);
        }
    }
}

Related

  1. drawFilter(Graphics g, Color c, double transparency, int midx, int midy, int rx, int ry)
  2. drawFleche1(Graphics g, double x, double y, double x1, double y1, int L)
  3. drawFocus(Graphics g, int x, int y, int w, int h)
  4. drawFocus(Graphics2D g2, int iX, int iY, int iWidth, int iHeight)
  5. drawFrank(Graphics g, int x, int y)
  6. drawGlow(Graphics2D g2, Area area, double width, Color color)
  7. drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)
  8. drawGroove(Graphics g, int x, int y, int width, int height, Color shadow, Color highlight)
  9. drawHandles(final Graphics g, final int[] x, final int[] y)