Java Graphics Draw drawSquarePoint(Graphics2D g2, Point2D.Double pt, int ptSize, Color color)

Here you can find the source of drawSquarePoint(Graphics2D g2, Point2D.Double pt, int ptSize, Color color)

Description

draw Square Point

License

Apache License

Declaration

public static void drawSquarePoint(Graphics2D g2, Point2D.Double pt, int ptSize, Color color) 

Method Source Code


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

import java.awt.*;

import java.awt.geom.*;

public class Main {
    public static void drawSquarePoint(Graphics2D g2, Point2D.Double pt, int ptSize, Color color) {
        Color origColor = g2.getColor();
        g2.setColor(color);/*from  ww w.  j  av  a2 s  .  co m*/
        Rectangle2D.Double ptRect = new Rectangle2D.Double(pt.x - 4 * ptSize, pt.y - 4 * ptSize, 8 * ptSize,
                8 * ptSize);
        g2.fill(ptRect);
        g2.draw(ptRect);
        g2.setColor(origColor);
    }
}

Related

  1. drawScaleTick(Graphics g, int x, int y, boolean yAxisP, int length)
  2. drawScrollBar(Graphics g, int which, int direction, int x, int y, int fmWidth, int fmHeight, Color fg, Color bg)
  3. drawSelectionBox(Graphics g)
  4. drawSelectionPoint(Graphics g, Point p)
  5. drawSpline(Graphics graphics, int x1, int y1, int x2, int y2, int x3, int y3)
  6. drawStackTrace(Graphics gr, int x, int y, Throwable ex)
  7. drawStage(Graphics g, int x, int y)
  8. drawStar(Graphics g, int x, int y)
  9. drawTankISPip(Graphics2D g2d, int width, int height)