Hallo,
ich hab eigentlich überhaupt keine Ahnung von Java und alles was damit zu tun hat. Ich habe mir aber für meine HP ein Freeware Java-Applet runtergeladen . Dann habe ich mir ein Prog zum decompilieren besorgt. Damit kann ich mir jetzt den Text ansehen und den Laufschrifttext verändern. Was mir nicht gelingen will, ist die Veränderung der Hintergrundfarbe. Im Moment ist sie "dark grey", ich würde sie aber gerne in#D6D6D6 bzw. wenn diese nicht möglich ist eine andere haben. Wer kann mir dabei helfen? Den Text füge ich bei.
Schöne Grüße
Roland
ich hab eigentlich überhaupt keine Ahnung von Java und alles was damit zu tun hat. Ich habe mir aber für meine HP ein Freeware Java-Applet runtergeladen . Dann habe ich mir ein Prog zum decompilieren besorgt. Damit kann ich mir jetzt den Text ansehen und den Laufschrifttext verändern. Was mir nicht gelingen will, ist die Veränderung der Hintergrundfarbe. Im Moment ist sie "dark grey", ich würde sie aber gerne in#D6D6D6 bzw. wenn diese nicht möglich ist eine andere haben. Wer kann mir dabei helfen? Den Text füge ich bei.
Schöne Grüße
Roland
Code:
// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov Date: 31.03.2006 14:20:55
// Home Page : [url]http://members.fortunecity.com/neshkov/dj.html[/url] - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: Neonsign_16.java
import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.StringTokenizer;
public class Neonsign_16 extends Applet
implements Runnable
{
public Neonsign_16()
{
seqnum = 0;
colornum = 0;
chrnum = 0;
}
public void init()
{
appwidth = size().width;
appheight = size().height;
String s3 = null;
s3 = getParameter("string");
String s;
if(s3 == null)
s = "K\366nigsgruppe 2005/2006";
else
s = s3;
s3 = getParameter("sleeptime");
if(s3 == null)
stime = 50;
else
stime = Integer.valueOf(s3).intValue();
s3 = getParameter("fontname");
String s1;
if(s3 == null)
s1 = "TimesRoman";
else
s1 = s3;
s3 = getParameter("fontstyle");
byte byte0;
if(s3 == null)
byte0 = 1;
else
if(s3.equals("PLAIN"))
byte0 = 0;
else
if(s3.equals("BOLD"))
byte0 = 1;
else
if(s3.equals("ITALIC"))
byte0 = 2;
else
byte0 = 3;
s3 = getParameter("fontsize");
int i;
if(s3 == null)
i = 24;
else
i = Integer.valueOf(s3).intValue();
bgclr = Color.blue;
s3 = getParameter("bgcolor");
if(s3 != null)
bgclr = new Color(Integer.valueOf(s3, 16).intValue());
offclr = Color.black;
s3 = getParameter("offcolor");
if(s3 != null)
offclr = new Color(Integer.valueOf(s3, 16).intValue());
shx = 0;
shy = 0;
shclr = Color.gray;
s3 = getParameter("shadow");
if(s3 != null)
{
StringTokenizer stringtokenizer = new StringTokenizer(s3, ",");
if(stringtokenizer.hasMoreTokens())
shx = Integer.valueOf(stringtokenizer.nextToken()).intValue();
if(stringtokenizer.hasMoreTokens())
shy = Integer.valueOf(stringtokenizer.nextToken()).intValue();
if(stringtokenizer.hasMoreTokens())
shclr = new Color(Integer.valueOf(stringtokenizer.nextToken(), 16).intValue());
}
s3 = getParameter("backimg");
if(s3 == null)
{
backimg = null;
} else
{
backimg = getImage(getDocumentBase(), s3);
mt = new MediaTracker(this);
mt.addImage(backimg, 0);
imgflag = false;
}
s3 = getParameter("pattern");
if(s3 == null)
pattern = "aoo d boo c ghgh o eoo fo eoo fooo";
else
pattern = s3;
s3 = getParameter("jumpto");
if(s3 == null)
jumpto = null;
else
jumpto = s3;
s3 = getParameter("direction");
String s2;
if(s3 == null)
s2 = "H";
else
s2 = s3;
chr = s.toCharArray();
chr_length = s.length();
font = new Font(s1, byte0, i);
fm = getFontMetrics(font);
xp = new int[chr_length];
yp = new int[chr_length];
if(s2.equals("H"))
{
int j = 0;
for(int l = 0; l < chr_length; l++)
j += fm.charWidth(chr[l]);
xp[0] = (appwidth - j) / 2;
for(int j1 = 1; j1 < chr_length; j1++)
xp[j1] = xp[j1 - 1] + fm.charWidth(chr[j1 - 1]);
int l1 = fm.getAscent() + fm.getDescent();
for(int j2 = 0; j2 < chr_length; j2++)
yp[j2] = (appheight - l1) / 2 + fm.getAscent();
} else
{
for(int k = 0; k < chr_length; k++)
xp[k] = (appwidth - fm.charWidth(chr[k])) / 2;
int i1 = 0;
for(int k1 = 0; k1 < chr_length; k1++)
i1 += fm.getAscent() + fm.getDescent();
yp[0] = (appheight - i1) / 2 + fm.getAscent();
for(int i2 = 1; i2 < chr_length; i2++)
yp[i2] = yp[i2 - 1] + fm.getAscent() + fm.getDescent();
}
setBackground(bgclr);
}
public void start()
{
neon = new Thread(this);
neon.start();
}
public void stop()
{
neon.stop();
neon = null;
}
public void run()
{
if(backimg != null)
try
{
mt.waitForID(0);
}
catch(InterruptedException interruptedexception) { }
do
{
try
{
Thread.currentThread();
Thread.sleep(stime);
}
catch(InterruptedException interruptedexception1) { }
repaint();
} while(true);
}
public void paint(Graphics g)
{
if(backimg != null)
{
g.drawImage(backimg, 0, 0, appwidth, appheight, this);
if(mt.checkID(0))
imgflag = true;
} else
{
g.clearRect(0, 0, appwidth, appheight);
}
g.setColor(shclr);
g.setFont(font);
for(int i = 0; i < chr_length; i++)
g.drawChars(chr, i, 1, xp[i] + shx, yp[i] + shy);
g.setColor(offclr);
g.setFont(font);
for(int j = 0; j < chr_length; j++)
g.drawChars(chr, j, 1, xp[j], yp[j]);
}
public void update(Graphics g)
{
if(backimg != null && !imgflag)
{
paint(g);
return;
}
texclr = textcolor(colornum);
switch(pattern.charAt(seqnum))
{
case 97: // 'a'
stepon_r(g);
break;
case 98: // 'b'
stepon_l(g);
break;
case 99: // 'c'
stepoff_r(g);
break;
case 100: // 'd'
stepoff_l(g);
break;
case 101: // 'e'
allon(g);
break;
case 102: // 'f'
alloff(g);
break;
case 103: // 'g'
flow_r(g, offclr, texclr);
break;
case 104: // 'h'
flow_l(g, offclr, texclr);
break;
case 105: // 'i'
flow_r(g, texclr, offclr);
break;
case 106: // 'j'
flow_l(g, texclr, offclr);
break;
case 107: // 'k'
gradon(g);
break;
case 108: // 'l'
gradoff(g);
break;
case 109: // 'm'
rndc_r(g);
break;
case 110: // 'n'
rndc_l(g);
break;
case 111: // 'o'
waitwait();
break;
default:
seqnum++;
break;
}
if(seqnum >= pattern.length())
{
colornum++;
if(colornum >= 7)
colornum = 0;
seqnum = 0;
}
}
public boolean mouseEnter(Event event, int i, int j)
{
if(jumpto == null)
showStatus("Neonsign ver1.6");
else
showStatus("Neonsign ver1.6 [Jump to " + jumpto + "]");
return true;
}
public boolean mouseUp(Event event, int i, int j)
{
if(jumpto == null)
return false;
URL url;
try
{
url = new URL(getDocumentBase(), jumpto);
}
catch(MalformedURLException malformedurlexception)
{
url = null;
}
if(url != null)
{
showStatus("Neonsign ver1.6 [OK! Jump to " + jumpto + "]");
getAppletContext().showDocument(url);
}
return true;
}
public boolean mouseExit(Event event, int i, int j)
{
showStatus("");
return true;
}
void stepon_r(Graphics g)
{
g.setColor(texclr);
g.setFont(font);
for(int i = 0; i <= chrnum; i++)
g.drawChars(chr, i, 1, xp[i], yp[i]);
chrnum++;
if(chrnum >= chr_length)
{
chrnum = 0;
seqnum++;
}
}
void stepon_l(Graphics g)
{
int i = chr_length - 1 - chrnum;
g.setColor(texclr);
g.setFont(font);
for(int j = chr_length - 1; j >= i; j--)
g.drawChars(chr, j, 1, xp[j], yp[j]);
chrnum++;
if(chrnum >= chr_length)
{
chrnum = 0;
seqnum++;
}
}
void stepoff_r(Graphics g)
{
g.setColor(offclr);
g.setFont(font);
for(int i = 0; i <= chrnum; i++)
g.drawChars(chr, i, 1, xp[i], yp[i]);
chrnum++;
if(chrnum >= chr_length)
{
chrnum = 0;
seqnum++;
}
}
void stepoff_l(Graphics g)
{
int i = chr_length - 1 - chrnum;
g.setColor(offclr);
g.setFont(font);
for(int j = chr_length - 1; j >= i; j--)
g.drawChars(chr, j, 1, xp[j], yp[j]);
chrnum++;
if(chrnum >= chr_length)
{
chrnum = 0;
seqnum++;
}
}
void allon(Graphics g)
{
g.setColor(texclr);
g.setFont(font);
for(int i = 0; i < chr_length; i++)
g.drawChars(chr, i, 1, xp[i], yp[i]);
chrnum = 0;
seqnum++;
}
void alloff(Graphics g)
{
g.setColor(offclr);
g.setFont(font);
for(int i = 0; i < chr_length; i++)
g.drawChars(chr, i, 1, xp[i], yp[i]);
chrnum = 0;
seqnum++;
}
void flow_r(Graphics g, Color color, Color color1)
{
g.setFont(font);
g.setColor(color);
for(int i = 0; i <= chrnum; i++)
g.drawChars(chr, i, 1, xp[i], yp[i]);
g.setColor(color1);
if(chrnum < chr_length)
{
g.drawChars(chr, chrnum + 0, 1, xp[chrnum + 0], yp[chrnum + 0]);
if(chrnum + 1 < chr_length)
{
g.drawChars(chr, chrnum + 1, 1, xp[chrnum + 1], yp[chrnum + 1]);
if(chrnum + 2 < chr_length)
g.drawChars(chr, chrnum + 2, 1, xp[chrnum + 2], yp[chrnum + 2]);
}
chrnum++;
if(chrnum >= chr_length)
{
g.setColor(color);
for(int j = 0; j < chr_length; j++)
g.drawChars(chr, j, 1, xp[j], yp[j]);
chrnum = 0;
seqnum++;
}
}
}
void flow_l(Graphics g, Color color, Color color1)
{
int i = chr_length - 1 - chrnum;
g.setFont(font);
g.setColor(color);
for(int j = chr_length - 1; j >= i; j--)
g.drawChars(chr, j, 1, xp[j], yp[j]);
g.setColor(color1);
if(chrnum < chr_length)
{
g.drawChars(chr, i - 0, 1, xp[i - 0], yp[i - 0]);
if(chrnum + 1 < chr_length)
{
g.drawChars(chr, i - 1, 1, xp[i - 1], yp[i - 1]);
if(chrnum + 2 < chr_length)
g.drawChars(chr, i - 2, 1, xp[i - 2], yp[i - 2]);
}
chrnum++;
if(chrnum >= chr_length)
{
g.setColor(color);
for(int k = 0; k < chr_length; k++)
g.drawChars(chr, k, 1, xp[k], yp[k]);
chrnum = 0;
seqnum++;
}
}
}
void gradon(Graphics g)
{
g.setColor(gradcolor((float)chrnum / 20F));
g.setFont(font);
for(int i = 0; i < chr_length; i++)
g.drawChars(chr, i, 1, xp[i], yp[i]);
chrnum++;
if(chrnum >= 20)
{
chrnum = 0;
seqnum++;
}
}
void gradoff(Graphics g)
{
g.setColor(gradcolor((float)(20 - chrnum) / 20F));
g.setFont(font);
for(int i = 0; i < chr_length; i++)
g.drawChars(chr, i, 1, xp[i], yp[i]);
chrnum++;
if(chrnum >= 20)
{
chrnum = 0;
seqnum++;
}
}
void rndc_r(Graphics g)
{
g.setFont(font);
for(int i = 0; i <= chrnum; i++)
{
g.setColor(textcolor((int)(Math.random() * 8D)));
g.drawChars(chr, i, 1, xp[i], yp[i]);
}
chrnum++;
if(chrnum >= chr_length)
{
chrnum = 0;
seqnum++;
}
}
void rndc_l(Graphics g)
{
int i = chr_length - 1 - chrnum;
g.setFont(font);
for(int j = chr_length - 1; j >= i; j--)
{
g.setColor(textcolor((int)(Math.random() * 8D)));
g.drawChars(chr, j, 1, xp[j], yp[j]);
}
chrnum++;
if(chrnum >= chr_length)
{
chrnum = 0;
seqnum++;
}
}
void waitwait()
{
chrnum++;
if(chrnum >= 5)
{
chrnum = 0;
seqnum++;
}
}
Color textcolor(int i)
{
Color color = Color.red;
switch(i)
{
case 0: // '\0'
color = Color.red;
break;
case 1: // '\001'
color = Color.yellow;
break;
case 2: // '\002'
color = Color.green;
break;
case 3: // '\003'
color = Color.cyan;
break;
case 4: // '\004'
color = Color.blue;
break;
case 5: // '\005'
color = Color.magenta;
break;
case 6: // '\006'
color = Color.white;
break;
}
return color;
}
Color gradcolor(float f)
{
float af[] = new float[3];
af = Color.RGBtoHSB(texclr.getRed(), texclr.getGreen(), texclr.getBlue(), null);
Color color = new Color(Color.HSBtoRGB(af[0], af[1], af[2] * f));
return color;
}
Thread neon;
int appwidth;
int appheight;
int stime;
int seqnum;
int colornum;
int chrnum;
char chr[];
int chr_length;
int xp[];
int yp[];
Color texclr;
Font font;
FontMetrics fm;
Color bgclr;
Color offclr;
int shx;
int shy;
Color shclr;
Image backimg;
String pattern;
String jumpto;
MediaTracker mt;
boolean imgflag;
final String STATUSTEXT = "Neonsign ver1.6";
}