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

📄 f022ccbe9f2e001d10a59aac3a8c1dab

📁 java画图板
💻
字号:
package d;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Stroke;
import java.io.Serializable;
public class shapline implements shap,Serializable{
	Point pb=new Point();
	Point pe=new Point();
	Point mpb=new Point();
	Point mpe=new Point();
	Point b=new Point();
	Point e=new Point();
	boolean sec=false;
	boolean col=false;
	Color c=Color.BLACK;
	public shapline(Point pb,Point pe){
		this.pb=pb;
		this.pe=pe;
	}
	public void draw(Graphics g) {
		if(sec&&!col)
		{
			Stroke st = new BasicStroke(3.0f);
			Graphics2D g2d = (Graphics2D)g;
			Stroke temp = g2d.getStroke();
			g2d.setStroke(st);
			g2d.setColor(Color.BLACK);
			g2d.drawLine(pb.x, pb.y, pe.x, pe.y);
			g2d.setStroke(temp);
		}
		else {
			  g.setColor(c);
			  g.drawLine(pb.x, pb.y, pe.x, pe.y);		 
			  }
		
	}
	public void getshapecolor(Color c) {
		   this.c=c;
	}
	public void setPe(Point pe) {
		this.pe=pe;
	}
	public void getmou(Point sb, Point se) {
		this.mpb=sb;
		this.mpe=se;
		
	}
	public boolean isseclect(int m) {
		if(m==0)
		{
			if(pb.x>mpb.x&&pb.y>mpb.y&&pe.x<mpe.x&&pe.y<mpe.y)
	    	sec=true;
		}
		if(m==1)
		{
			sec=false;
		}
		   return sec;
	}
	public void xzmove(int m, int n) {
		this.pb.x=this.b.x+m;
		this.pb.y=this.b.y+n;
		this.pe.x=this.e.x+m;
		this.pe.y=this.e.y+n;
	}
	public void baocunp(Point b, Point e) {
		this.b=b;
		this.e=e;
	}
	public boolean ischangcolor(int n) {
		if(n==0)
      	  col=true;
        if(n==1)
        	col=false;
        return col;
	}
	public void alremove() {
		// TODO Auto-generated method stub
		
	}
}

⌨️ 快捷键说明

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