Java Graphics Draw drawTankISPip(Graphics2D g2d, int width, int height)

Here you can find the source of drawTankISPip(Graphics2D g2d, int width, int height)

Description

draw Tank IS Pip

License

Open Source License

Declaration

public static void drawTankISPip(Graphics2D g2d, int width, int height) 

Method Source Code


//package com.java2s;
/*//from  ww  w. j  a v  a  2  s  .c  o  m
 * MegaMekLab - Copyright (C) 2010
 *
 * Original author - jtighe (torren@users.sourceforge.net)
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 */

import java.awt.Color;
import java.awt.Dimension;

import java.awt.Graphics2D;

import java.awt.geom.Ellipse2D;

public class Main {
    public static void drawTankISPip(Graphics2D g2d, int width, int height) {
        Dimension circle = new Dimension(7, 7);
        Dimension fillCircle = new Dimension(5, 5);
        g2d.setColor(Color.black);
        g2d.fillOval(width, height, circle.width, circle.height);
        g2d.setColor(Color.white);
        g2d.fillOval(width + 1, height + 1, fillCircle.width, fillCircle.height);
    }

    public static void drawTankISPip(Graphics2D g2d, float width, float height) {
        g2d.setColor(Color.black);
        Ellipse2D.Float circle = new Ellipse2D.Float(width, height, 6f, 6f);
        g2d.fill(circle);
        g2d.setColor(Color.white);
        circle = new Ellipse2D.Float(width + 1, height + 1, 4, 4);
        g2d.fill(circle);
    }
}

Related

  1. drawSpline(Graphics graphics, int x1, int y1, int x2, int y2, int x3, int y3)
  2. drawSquarePoint(Graphics2D g2, Point2D.Double pt, int ptSize, Color color)
  3. drawStackTrace(Graphics gr, int x, int y, Throwable ex)
  4. drawStage(Graphics g, int x, int y)
  5. drawStar(Graphics g, int x, int y)
  6. drawTransparent(Graphics g, int x, int y, int width, int height)
  7. drawUp(Graphics g, int x, int y, int w, int h)
  8. drawWeightBox(Graphics2D g2d, int ycentre, int xcentre, int width)
  9. drawWinUpperLeft(Graphics g, int which, Color fill, int x, int y, int fmWidth, int fmHeight)