home *** CD-ROM | disk | FTP | other *** search
Wrap
import java.applet.Applet; import java.applet.AppletContext; import java.applet.AudioClip; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.Event; import java.awt.Graphics; import java.awt.Image; import java.awt.Label; import java.awt.LayoutManager; import java.awt.MediaTracker; import java.awt.image.ImageObserver; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; public class afIconBar extends Applet { private Image offScreenImage; private Dimension offScreenSize; private Graphics offScreenGraphics; boolean fullb; boolean Sinkin; boolean Bolder; String Face = "Helvetica"; AudioClip clip; Label discription = new Label(""); private boolean m_boo; String bbb = "OK"; private String m_Image = "task.gif"; private String m_Frame = "_self"; private int m_Numbers; private Image m_BackImage; private int m_PixWid = 40; private String m_PixSpace = "10"; private String m_UserCode = "gdafggb"; private String m_Backsound = "gogo.au"; private String[] m_Url; private String[] m_Description; private String[] m_LinkName; afIcon2[] theButt; Image tempo; private final String PARAM_Image = "Image"; private final String PARAM_Frame = "Frame"; private final String PARAM_NoLinks = "NoLinks"; private final String PARAM_BackImage = "BackImage"; private final String PARAM_PixWid = "PixWid"; private final String PARAM_PixSpace = "PixSpace"; private final String PARAM_UserCode = "UserCode"; private final String PARAM_Backsound = "Backsound"; boolean vCvCv; Color nickCol2; boolean itrocks; Color nickCol; public afIconBar() { this.nickCol2 = Color.black; } public void stop() { } public boolean overthetop(int val) { if (this.vCvCv) { ((Applet)this).showStatus(this.m_Description[val]); } else { ((Applet)this).showStatus("This copy of IconBar is unlicensed please remove it from your page! go to http://silk.webware.co.nz"); } return true; } public boolean mouseEnter(Event evt, int x, int y) { return true; } boolean ftxx() { int fxtx = 1975; String hexstart = "f-"; String hexfin = "1I"; boolean xzxzvv = true; URL OoooOo = ((Applet)this).getDocumentBase(); String Oxo = OoooOo.getProtocol(); int pp = Oxo.compareTo("http"); if (pp != 0) { xzxzvv = false; return true; } else { xzxzvv = true; String xzxzv = ""; String param = ((Applet)this).getParameter("RegistrationID"); if (param == null) { return false; } else { if (param != null) { xzxzv = param; } xzxzv = xzxzv.trim(); String hexa4 = ""; int lengthh = xzxzv.length(); String bitof = ""; int iii = lengthh; if (lengthh <= 9) { return false; } else { try { for(int ii = 0; ii <= lengthh; ++ii) { --iii; if (iii <= 0) { iii = 0; } bitof = xzxzv.substring(iii, lengthh - ii); hexa4 = hexa4 + bitof; } } catch (Exception var31) { return false; } int hexa7 = hexa4.length(); String Licen = hexa4.substring(0, 2); String ProdnVers = hexa4.substring(hexa7 - 2, hexa7); String rawNum = hexa4.substring(2, hexa7 - 3); int moveto = rawNum.indexOf("-"); if (moveto < 0) { return false; } else { String bitup = rawNum.substring(0, moveto); String bitdn = rawNum.substring(moveto + 1, rawNum.length()); String Num = bitup + bitdn; (new StringBuffer()).append("Code:").append(xzxzv).append(" The Reverse:").append(hexa4).append(" licence:").append(Licen).append(" Version").append(ProdnVers).append("\n").append(rawNum).append(" ").append(Num).toString(); int original = 1; try { original = Integer.parseInt(Num); } catch (Exception var30) { Num = "0"; return false; } int Result = 0; Result = original % fxtx; boolean rtclassconvert = false; rtclassconvert = hexfin.equals(ProdnVers); boolean KeepCool = true; KeepCool = hexstart.equals(Licen); String fallornerd = "not Registered"; if (Result == 0 && rtclassconvert && KeepCool) { fallornerd = "Licenced"; return true; } else { return false; } } } } } } public boolean mouseExit(Event evt, int x, int y) { return true; } public void paint(Graphics g) { g.setColor(this.nickCol); g.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height); if (this.itrocks) { g.fill3DRect(0, 0, ((Component)this).size().width, ((Component)this).size().height, false); } } public boolean mouseUp(Event evt, int x, int y) { return true; } public void distroy() { this.offScreenGraphics.dispose(); } public final synchronized void update(Graphics g) { Dimension d = ((Component)this).size(); if (this.offScreenImage == null || d.width != this.offScreenSize.width || d.height != this.offScreenSize.height) { this.offScreenImage = ((Component)this).createImage(d.width, d.height); this.offScreenSize = d; this.offScreenGraphics = this.offScreenImage.getGraphics(); } this.paint(this.offScreenGraphics); g.drawImage(this.offScreenImage, 0, 0, (ImageObserver)null); } public void start() { ((Component)this).repaint(); } public String getAppletInfo() { return "Name: afIconBar\r\n" + "Author: Nick Harrow\r\n" + "Created with Microsoft Visual J++ Version 1.1"; } public boolean buttonclick(int val) { if (this.clip != null) { this.clip.play(); } AppletContext ac = ((Applet)this).getAppletContext(); try { URL yahoo = new URL(((Applet)this).getDocumentBase(), this.m_Url[val]); ((Applet)this).showStatus("Opening page:" + this.m_Url[val]); ac.showDocument(yahoo, this.m_Frame); return true; } catch (MalformedURLException var5) { ((Applet)this).showStatus("This has not been referenced correctly"); return false; } catch (IOException var6) { return false; } } public boolean mouseDown(Event evt, int x, int y) { return true; } public void init() { this.vCvCv = this.ftxx(); String Backgroundgraph = ((Applet)this).getParameter("IconImage"); if (Backgroundgraph != null) { MediaTracker mt = new MediaTracker(this); URL db = ((Applet)this).getDocumentBase(); this.tempo = ((Applet)this).getImage(db, Backgroundgraph); mt.addImage(this.tempo, 0); try { mt.waitForID(0); } catch (InterruptedException var8) { this.m_BackImage = null; } this.m_BackImage = null; } ((Container)this).setLayout((LayoutManager)null); String param = ((Applet)this).getParameter("LinkNameFont"); if (param != null) { this.Face = param; } param = ((Applet)this).getParameter("LinkNameCenter"); if (param != null) { this.m_boo = Boolean.valueOf(param); } param = ((Applet)this).getParameter("BarFramed"); if (param != null) { this.itrocks = Boolean.valueOf(param); } param = ((Applet)this).getParameter("AllUp"); if (param != null) { this.fullb = Boolean.valueOf(param); } param = ((Applet)this).getParameter("LinkNameSink"); if (param != null) { this.Sinkin = Boolean.valueOf(param); } param = ((Applet)this).getParameter("LinkNameBold"); if (param != null) { this.Bolder = Boolean.valueOf(param); } param = ((Applet)this).getParameter("NoLinks"); if (param != null) { this.m_Numbers = Integer.parseInt(param); } if (this.m_Numbers > 7) { this.m_Numbers = 7; } if (this.m_Numbers < 1) { this.m_Numbers = 1; } this.m_Url = new String[this.m_Numbers + 1]; for(int i = 0; i <= this.m_Numbers; ++i) { param = ((Applet)this).getParameter("Url" + i); if (param != null) { this.m_Url[i] = param; } else if (param == null) { this.m_Url[i] = "http://nothing"; } } this.m_Description = new String[this.m_Numbers + 1]; for(int i = 0; i <= this.m_Numbers; ++i) { param = ((Applet)this).getParameter("Description" + i); if (param != null) { this.m_Description[i] = param; } else { this.m_Description[i] = this.m_Url[i]; } } this.m_LinkName = new String[this.m_Numbers + 1]; for(int i = 0; i <= this.m_Numbers; ++i) { String itter = "LinkName" + i; param = ((Applet)this).getParameter(itter); if (param != null) { this.m_LinkName[i] = param; } else { this.m_LinkName[i] = "nothing"; } } this.theButt = new afIcon2[this.m_Numbers + 1]; boolean vertal = false; int heiver = ((Component)this).size().height; if (heiver > 60) { vertal = true; } for(int i = 0; i <= this.m_Numbers - 1; ++i) { this.theButt[i] = new afIcon2(i + 1, this, this.tempo, this.m_LinkName[i + 1], this.m_Description[i + 1], this.m_boo); this.theButt[i].resize(75, 50); if (!vertal) { this.theButt[i].move(1 + i * 75, 1); } else { this.theButt[i].move(1, 1 + i * 50); } ((Container)this).add(this.theButt[i]); } param = ((Applet)this).getParameter("PixWid"); if (param != null) { this.m_PixWid = Integer.parseInt(param); } param = ((Applet)this).getParameter("PixSpace"); if (param != null) { this.m_PixSpace = param; } param = ((Applet)this).getParameter("Image"); if (param != null) { this.m_Image = param; } param = ((Applet)this).getParameter("ClickSound"); if (param != null) { this.clip = ((Applet)this).getAudioClip(((Applet)this).getCodeBase(), param); } else { this.clip = null; } param = ((Applet)this).getParameter("Frame"); if (param != null) { this.m_Frame = param; } String colin = "c5c5c5"; param = ((Applet)this).getParameter("BackColor"); if (param != null) { colin = param; } String marvin = "000000"; param = ((Applet)this).getParameter("LinkNameColor"); if (param != null) { marvin = param; } param = ((Applet)this).getParameter("UserCode"); if (param != null) { this.m_UserCode = param; } param = ((Applet)this).getParameter("Backsound"); if (param != null) { this.m_Backsound = param; } this.nickCol = this.MaketheColor(colin); this.nickCol2 = this.MaketheColor(marvin); } public boolean handleEvent(Event evt) { ((Component)this).repaint(); return true; } Color MaketheColor(String col) { String parameterValue = col; if (col.startsWith("#")) { parameterValue = col.substring(1); } Color result; try { int intValue = Integer.parseInt(parameterValue, 16); result = new Color(intValue); } catch (NumberFormatException var7) { result = new Color(3); } return result; } }