attgraph.java

来自「GUI Ant-Miner is a tool for extracting c」· Java 代码 · 共 44 行

JAVA
44
字号
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;

/*
 * Created on 06/04/2005
 */

/**
 * @author Fernando Meyer
 */
class AttGraph extends Canvas {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public AttGraph(){
		
	}
    // This method is called whenever the contents needs to be painted
	public void paint(Graphics g) {
        // Retrieve the graphics context; this object is used to paint shapes
        Graphics2D g2d = (Graphics2D)g;
        int width = getSize().width-1;
        int height = getSize().height-1;
        int x = 0;
        int y = 0;
        g.setClip(x,y,width+1,height+1);
        
        g2d.setPaint(Color.white);
        g2d.fill(new Rectangle2D.Double(x, y,
                width, height));
        
        //g2d.setColor(Color.white);

        // Draw an oval that fills the window
        
        g2d.setPaint(Color.black);
        //g2d.drawOval(x, y, width, height);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?