⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dotdashbrush.java

📁 画图程序
💻 JAVA
字号:
package LYD.Draw;

import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.Graphics2D;
import java.awt.BasicStroke;
import java.awt.Color;

public class DotDashBrush implements IBasicBrush
{
	protected Graphics g;
	protected BasicStroke _BasicStroke=new BasicStroke(1);
	protected Color c=Color.BLACK;

	public void setWidth(float width)
	{
		if(width>0&&width!=_BasicStroke.getLineWidth())
			this._BasicStroke=new BasicStroke(width);
	}
	
	public void setColor(Color color)
	{
		c=color;
	}
	
	public Color getColor()
	{
		return c;
	}
	
	public DotDashBrush(){}
	
	public DotDashBrush(Graphics gg)
	{
		this.g=(Graphics2D)gg;
	}
	
	public void setGraphics(Graphics gg)
	{
		this.g=(Graphics2D)gg;
	}
	
	public void paintLine(int x1,int y1,int x2,int y2)
	{
		g.drawLine(x1,y1,x2,y2);
	}
	
	public void paintCircle(int x,int y,int r)
	{
		g.drawOval(x,y,r,r);
	}
	
	public void paintOval(int x,int y,int width,int weight)
	{
		g.drawOval(x,y,width,weight);
	}
}

⌨️ 快捷键说明

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