/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import java.lang.*; public class Scripto extends Applet { void textField1_EnterHit(Event event) { // to do: place event handler code here. clearOutstring(); convertToScript(); } void button1_Clicked(Event event) { //{{CONNECTION // Append string in TextArea... //}} clearOutstring(); convertToScript(); } void button2_Clicked(Event event) { //{{CONNECTION // Clear the text for TextField textField1.setText(""); //}} //{{CONNECTION // Clear the text for TextArea textArea1.setText(""); //}} clearOutstring(); } public void init() { super.init(); // Take out this line if you don't use symantec.itools.net.RelativeURL // symantec.itools.lang.Context.setDocumentBase(getDocumentBase()); //{{INIT_CONTROLS setLayout(null); addNotify(); resize(644,396); setFont(new Font("TimesRoman", Font.PLAIN, 16)); setBackground(new Color(8421504)); button1 = new java.awt.Button("Scripto!"); button1.reshape(343,98,72,40); add(button1); button2 = new java.awt.Button("Clear"); button2.reshape(427,98,76,38); add(button2); label1 = new java.awt.Label("Enter Name:"); label1.reshape(238,45,91,17); add(label1); textArea1 = new java.awt.TextArea(); textArea1.reshape(21,173,602,200); textArea1.setFont(new Font("Courier", Font.PLAIN, 12)); add(textArea1); textField1 = new java.awt.TextField(); textField1.setText("Cyber Surfer"); textField1.reshape(343,38,276,34); textField1.setFont(new Font("Dialog", Font.PLAIN, 20)); add(textField1); label2 = new java.awt.Label("Scripto"); label2.reshape(21,30,210,60); label2.setFont(new Font("TimesRoman", Font.PLAIN, 48)); add(label2); label3 = new java.awt.Label("Sig Maker"); label3.reshape(28,90,224,34); label3.setFont(new Font("Dialog", Font.PLAIN, 24)); add(label3); label4 = new java.awt.Label("by Manny Juan"); label4.reshape(28,120,203,19); add(label4); //}} for (k=0;k=0 && fonttabl[k][3][j]==' ');j--) ; wd[k]=j+1; if (fonttabl[k][3][j]=='@') { fonttabl[k][3][j]=' '; wd[k]=wd[k]-1; } } validCharString=validchars.toString(); clearOutstring(); } public boolean handleEvent(Event event) { if (event.target == button2 && event.id == Event.ACTION_EVENT) { button2_Clicked(event); return true; } if (event.target == button1 && event.id == Event.ACTION_EVENT) { button1_Clicked(event); return true; } if (event.target == textField1 && event.id == Event.ACTION_EVENT) { textField1_EnterHit(event); } return super.handleEvent(event); } public void convertToScript () { cvtToScript(textField1.getText()); wstr=getScript(); for(i=0;i<6;i++) { out_S.setLength(0); for(j=0;j<79;j++) { out_S.append(wstr[i][j]); } textArea1.appendText(out_S.toString()+"\n"); } } public static void clearOutstring () { // clear output area for(i=0;i<6;i++) { for(j=0;j<79;j++) { outString[i][j]=' '; } } } public static char[][] getScript () { char wstr[][]=new char[6][79]; for(i=0;i<6;i++) { for(j=0;j<79;j++) { wstr[i][j]=outString[i][j]; } } return wstr; } static char[][] cvtToScript(String inputField) { nxtc=0; for (int nc=0;nc=0) { for(i=0;i<6;i++) { fontChar[i]=fonttabl[ic][i]; for(j=0;j<10;j++) { if(outString[i][mod(nxtc+j,tw)]==' ') { outString[i][mod(nxtc+j,tw)]=fontChar[i][j]; } } } nxtc=nxtc+wd[ic]; } else { nxtc=nxtc+5; // unknown - advance ptr by 5 (ie. leave space) } } return outString; } static int mod(int a, int b) { return (int)(a-b * Math.floor(a/b)); } static int tw=79; static String inputField="Manny Juan"; static int i,j,k,ic,nxtc; static byte cc; static char ch; static StringBuffer validchars = new StringBuffer(80); static StringBuffer out_S = new StringBuffer(80); static String validCharString; static char fontChar[][]= new char[6][10]; static int wd[]=new int[80]; // "font" width (at base line) static char outString[][] = new char[6][79]; static char fonttabl[][][] = new char[80][6][10]; static char wstr[][] = new char[6][79]; static String fontdefs[]={ "A"+ " .--. "+ "( / : "+ " /--+ "+ "/ | "+ " "+ " ", "B"+ " .--. "+ "( / ) "+ " /-< "+ "/___) "+ " "+ " ", "C"+ " .-. "+ " / : "+ " / "+ "(__./ @ "+ " "+ " ", "D"+ " .---. "+ "( / | "+ " / | "+ "/__,/ "+ " "+ " ", "E"+ " .---- "+ "( /__ "+ " / "+ "/___ @ "+ " "+ " ", "F"+ " .---- "+ "( /__ "+ " / "+ "/ @ "+ " "+ " ", "G"+ " .-. "+ " / ' "+ " / -+ "+ "(__.: "+ " "+ " ", "H"+ " .-- -- "+ "( /_ / "+ " / / "+ "/ (_ @ "+ " "+ " ", "I"+ " .--- "+ " ( / "+ " / "+ "__/__ @ "+ " "+ " ", "J"+ " .--- "+ " ( / "+ "_ / "+ "(___/ @ "+ " "+ " ", "K"+ " .-- , "+ "( / . ' "+ " /-< "+ "/ \\_ @ "+ " "+ " ", "L"+ " .-. "+ " / "+ " / "+ "./____. "+ " "+ " ", "M"+ " .--..-. "+ "( / | | "+ " / | | "+ "/ : | @"+ " "+ " ", "N"+ " .--. -- "+ "( / | / "+ " / | / "+ "/ :/ @ "+ " "+ " ", "O"+ " .---. "+ "( / : "+ " / | "+ " :__ / "+ " "+ " ", "P"+ " .---. "+ "( / ) "+ " /---' "+ "/ @ "+ " "+ " ", "Q"+ " .---. "+ "( / : "+ " / | "+ " :_(><_ "+ " "+ " ", "R"+ " .--. "+ "( / ) "+ " /--< "+ "/ \\ "+ " "+ " ", "S"+ " .-. "+ " ( ' "+ " >. "+ "(___) @ "+ " "+ " ", "T"+ " .----- "+ "( / "+ " / "+ " / @ "+ " "+ " ", "U"+ " .-- -- "+ "( / / "+ " / / "+ "(_./ @ "+ " "+ " ", "V"+ " .-- -- "+ "( | / "+ " | / "+ " :_/ @ "+ " "+ " ", "W"+ " .-- -- "+ "( | / "+ " | : / "+ " :/:/ @ "+ " "+ " ", "X"+ " .-. ,- "+ "( |/ "+ " ./| "+ " / :__ "+ " "+ " ", "Y"+ " .-- -- "+ "( | / "+ " :_./ "+ " / @ "+ " ._/ "+ " ", "Z"+ " .----.- "+ "( .' "+ " ,' "+ ".'____/ "+ " "+ " ", "a"+ " "+ " __ "+ " __ ) "+ "(__(_ "+ " "+ " ", "b"+ " / "+ " /_ "+ " / ) "+ "(__/ "+ " "+ " ", "c"+ " "+ " ___ "+ " / "+ "(___ "+ " "+ " ", "d"+ " / "+ " __ / "+ " / / "+ "(__(_ @ "+ " "+ " ", "e"+ " "+ " __ "+ " /__) "+ "(___ "+ " "+ " ", "f"+ " .- "+ " / "+ " / "+ "__/_ @ "+ " / "+ "/ ", "g"+ " "+ " __ , "+ " / / "+ " (__/_ @ "+ " / "+ "(_/ ", "h"+ " / "+ " /_ "+ " / ) "+ "/ (_ "+ " "+ " ", "i"+ " "+ " * "+ " / "+ "(_ "+ " "+ " ", "j"+ " "+ " * "+ " / "+ " / @ "+ "(_/ "+ " ", "k"+ " / "+ " /__ "+ " /< "+ "/ \\_ "+ " "+ " ", "l"+ " /) "+ " // "+ " / "+ "_(_ @ "+ " "+ " ", "m"+ " "+ " _ _ "+ " )' |' ) "+ "/ : (_ "+ " "+ " ", "n"+ " "+ " _ "+ " )' ) "+ "/ (_ "+ " "+ " ", "o"+ " "+ " __ "+ " / ) "+ "(__/ "+ " "+ " ", "p"+ " "+ " __ "+ " / ) "+ " /_./ "+ " / "+ "/ ", "q"+ " "+ " __ "+ " / / "+ "(_./ @ "+ " / "+ " (_ ", "r"+ " "+ " ,_. "+ " / : "+ "/ :_ "+ " "+ " ", "s"+ " "+ " __ "+ " (_ "+ "___) "+ " "+ " ", "t"+ " "+ " __/_ "+ " / "+ " (__ "+ " "+ " ", "u"+ " "+ " . . "+ " / / "+ "(_.(_ "+ " "+ " ", "v"+ " "+ " . _ "+ " | ) "+ " :_/ "+ " "+ " ", "w"+ " "+ " . _ "+ " | . ) "+ " :_/|_/ "+ " "+ " ", "x"+ " "+ " : / "+ " .+' "+ "/ :__ "+ " "+ " ", "y"+ " "+ " . . "+ " | / "+ " :_/ @ "+ " / "+ "-' ", "z"+ " "+ " __ "+ " ./ "+ " /__ "+ " "+ " ", "."+ " "+ " "+ " "+ "@ @ "+ " "+ " ", ","+ " "+ " "+ " "+ "@ @ "+ "' "+ " ", "("+ " / "+ ",' "+ ": "+ " \\ @ "+ " "+ " ", ")"+ " \\ "+ " : "+ " ,' "+ " / @ "+ " "+ " ", "-"+ " "+ "____ "+ " "+ " @ "+ " "+ " ", "&"+ " |) "+ " /| "+ " / |) "+ "(___/\\ "+ " "+ " ", "!"+ " / "+ " / "+ " / "+ "@ @ "+ " "+ " ", "/"+ " / "+ " / "+ " / "+ "/ @ "+ " "+ " ", "?"+ " .-. "+ " ( ) "+ " / "+ " . @ "+ " "+ " ", "'"+ " @ "+ " ' "+ " "+ " @ "+ " "+ " ", ":"+ " "+ " @ "+ " "+ " @ @ "+ " "+ " ", ";"+ " "+ " @ "+ " "+ " @ @ "+ " ' "+ " ", "%"+ "() / "+ " / "+ " / "+ "/ () "+ " "+ " ", "*"+ " "+ "_\\|/_ "+ " /|\\ "+ " @ "+ " "+ " ", "$"+ " .-/- "+ " (_/_ "+ " / ) "+ "-/--' "+ " "+ " ", "0"+ " __ "+ " / : "+ " / / "+ ":__/ "+ " "+ " ", "1"+ " _ "+ " / "+ " / "+ "_/_ "+ " "+ " ", "2"+ " __ "+ " ) "+ " .--' "+ "(___ "+ " "+ " ", "3"+ " __ "+ " ) "+ " -< "+ ".___) "+ " "+ " ", "4"+ " . . "+ " / / "+ "'-/- "+ " / @ "+ " "+ " ", "5"+ " __ "+ " / "+ "'--. "+ "___) "+ " "+ " ", "6"+ " __ "+ " / "+ " /-. "+ "(__) "+ " "+ " ", "7"+ " ___ "+ " / "+ " / "+ " : @ "+ " "+ " ", "8"+ " __ "+ " ( ) "+ " /-< "+ "(___) "+ " "+ " ", "9"+ " __ "+ " / ) "+ " '-/ "+ "_./ @ "+ " "+ " " }; //{{DECLARE_CONTROLS java.awt.Button button1; java.awt.Button button2; java.awt.Label label1; java.awt.TextArea textArea1; java.awt.TextField textField1; java.awt.Label label2; java.awt.Label label3; java.awt.Label label4; //}} }