//
/* ----------------------------------------------------------------------------------------------
    dot_font.java	ドットフォント							ver. 1.00  (JDK 1.02)
    														ueyama@infonet.co.jp  2002.10.20
---------------------------------------------------------------------------------------------- */

import java.applet.Applet;
import java.awt.*;


public class dot_font extends Applet
{
	int			P[]={19,13};										// ドットピッチ
	int			N[]={16,24};										// ドット数
	int			R[]={10,6};											// ドット半径
	int			Fx=350, Fy=110;										// 原寸文字表示座標
	int			Bx=65, By=335;										// ボタン表示座標
	int			M=0;												// 0: 16×16  1: 24×24
	int			Q=0;												// 黒ドット数
	boolean		F=false;
	int			Bc;
	Graphics	gr;
	Image		Gif;
	boolean		Dd[][]= new boolean[24][24];
	int			i=0, j=0;
	
	public void init()
	{
		String	bg=getParameter("BgColor");
				Bc=Integer.valueOf(bg,16).intValue();
		setBackground(new Color(Bc));
		gr=getGraphics();
		
		MediaTracker mt=new MediaTracker(this);
		Gif=getImage(getCodeBase(), getParameter("gif"));
		mt.addImage(Gif, 0);
		try
		{
			mt.waitForID(0);
		}
		catch(InterruptedException e){};
	}
	
	public boolean inside(int n, int a, int b)
	{
		return (n<=Math.max(a,b) && n>=Math.min(a,b)) ? true:false;
	}

	public void clear_tbl()
	{
		for(i=0; i0))
			{
				dsp_g(Bx, By, 2, (M==0)?1:0);
				dsp_g(Bx+70, By, 3, (M==1)?1:0);
				if(inside(mx, Bx+150, Bx+176) && Q>0) dsp_g(Bx+150, By, 4, 1);
				clear_tbl(); dsp_tbl();
				dsp_dot();
			}
		}
		return true;
	}
	
	public boolean mouseUp(Event e, int mx, int my)
	{
		if(my>By) dsp_g(Bx+150, By, 4, (Q==0)?2:0);
		return true;
	}

	public boolean mouseDrag(Event e, int mx, int my)
	{
		if(inside(my, 0, 313) && inside(my, 0, 313)) mouse_chk(mx, my, false);
		return true;
	}
}
//
戻る