|
文本编辑器源文件(java语言)(1)
/版权所有helj import Java.awt.*; import java.io.*; import java.util.*; //W_color;C_str;C_file;C_back;W_find;W_fond
interface I_Method { public void setQuit(); public void setfont(Font f); public void setcolor(Color c); public void Find(String find,int dire); }
class D_color extends Dialog { private Button OK,Cancel; private I_Method mp; private Rectangle test;
private Color current= Color.black; private Color []colors; private Color []colors1; private Color []colors2; private int strlen= 250;
public D_color(Frame fr,I_Method mp,int x,int y) { super(fr,"调色板",true); this.mp= mp; colors= new Color[strlen]; colors1= new Color[strlen]; colors2= new Color[strlen]; for (int i = 0; i < strlen; i++) { float h = ((float)i)/((float)strlen); colors[i] = new Color(Color.HSBtoRGB(h,1.0f,1.0f)); } for (int i = 0; i < strlen; i++) { float h = ((float)i)/((float)strlen); colors1[i] = new Color(Color.HSBtoRGB(1.0f,h,1.0f)); }
|