当前位置: 技术问答>java相关
Win2000菜单的淡入淡出效果真是太好看了,你会吗?
来源: 互联网 发布时间:2015-05-14
本文导语: 大家都看过Win2000菜单的淡入淡出效果吧,我想问问大家Java的Swing中支持这种效果么,或者是在什么地方能够下载到支持这种效果的控件,或者如果真要自己手写代码的话,我想就要自己扩展Jmenu类了吧,知道的大侠能...
大家都看过Win2000菜单的淡入淡出效果吧,我想问问大家Java的Swing中支持这种效果么,或者是在什么地方能够下载到支持这种效果的控件,或者如果真要自己手写代码的话,我想就要自己扩展Jmenu类了吧,知道的大侠能提供一点思路么,谢谢!
|
richard_hu(华仔)and all,http://162.105.80.16/one.htm里的那个class文件,我反编译了,与大家共享:
import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.*;
import java.awt.image.MemoryImageSource;
import java.util.Random;
public class jhanabi extends Applet
implements Runnable
{
public jhanabi()
{
m_mouseX = 0;
m_mouseY = 0;
m_sleepTime = 5;
isError = false;
isInitialized = false;
rand = new Random();
bits = 10000;
bit_px = new double[bits];
bit_py = new double[bits];
bit_vx = new double[bits];
bit_vy = new double[bits];
bit_sx = new int[bits];
bit_sy = new int[bits];
bit_l = new int[bits];
bit_f = new int[bits];
bit_p = new int[bits];
bit_c = new int[bits];
ru = 50;
rv = 50;
}
public void init()
{
String s = getParameter("para_bits");
if(s != null)
bits = Integer.parseInt(s);
s = getParameter("para_max");
if(s != null)
bit_max = Integer.parseInt(s);
s = getParameter("para_blendx");
if(s != null)
ru = Integer.parseInt(s);
s = getParameter("para_blendy");
if(s != null)
rv = Integer.parseInt(s);
s = getParameter("para_sound");
if(s != null)
bit_sound = Integer.parseInt(s);
m_nAppX = size().width;
m_nAppY = size().height;
m_centerX = m_nAppX / 2;
m_centerY = m_nAppY / 2;
m_mouseX = m_centerX;
m_mouseY = m_centerY;
resize(m_nAppX, m_nAppY);
pixls = m_nAppX * m_nAppY;
pixls2 = pixls - m_nAppX * 2;
pix0 = new int[pixls];
offImage = new MemoryImageSource(m_nAppX, m_nAppY, pix0, 0, m_nAppX);
offImage.setAnimated(true);
dbImg = createImage(offImage);
for(int i = 0; i > 16) - i) * ru >> 8) + i;
i = (k & 0xff00) >> 8;
int l1 = ((((l & 0xff00) >> 8) - i) * ru >> 8) + i;
i = k & 0xff;
int i2 = (((l & 0xff) - i) * ru >> 8) + i;
i = (i1 & 0xff0000) >> 16;
int j2 = ((((j1 & 0xff0000) >> 16) - i) * ru >> 8) + i;
i = (i1 & 0xff00) >> 8;
int k2 = ((((j1 & 0xff00) >> 8) - i) * ru >> 8) + i;
i = i1 & 0xff;
int l2 = (((j1 & 0xff) - i) * ru >> 8) + i;
int i3 = ((j2 - k1) * rv >> 8) + k1;
int j3 = ((k2 - l1) * rv >> 8) + l1;
int k3 = ((l2 - i2) * rv >> 8) + i2;
pix0[j] = i3
import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.*;
import java.awt.image.MemoryImageSource;
import java.util.Random;
public class jhanabi extends Applet
implements Runnable
{
public jhanabi()
{
m_mouseX = 0;
m_mouseY = 0;
m_sleepTime = 5;
isError = false;
isInitialized = false;
rand = new Random();
bits = 10000;
bit_px = new double[bits];
bit_py = new double[bits];
bit_vx = new double[bits];
bit_vy = new double[bits];
bit_sx = new int[bits];
bit_sy = new int[bits];
bit_l = new int[bits];
bit_f = new int[bits];
bit_p = new int[bits];
bit_c = new int[bits];
ru = 50;
rv = 50;
}
public void init()
{
String s = getParameter("para_bits");
if(s != null)
bits = Integer.parseInt(s);
s = getParameter("para_max");
if(s != null)
bit_max = Integer.parseInt(s);
s = getParameter("para_blendx");
if(s != null)
ru = Integer.parseInt(s);
s = getParameter("para_blendy");
if(s != null)
rv = Integer.parseInt(s);
s = getParameter("para_sound");
if(s != null)
bit_sound = Integer.parseInt(s);
m_nAppX = size().width;
m_nAppY = size().height;
m_centerX = m_nAppX / 2;
m_centerY = m_nAppY / 2;
m_mouseX = m_centerX;
m_mouseY = m_centerY;
resize(m_nAppX, m_nAppY);
pixls = m_nAppX * m_nAppY;
pixls2 = pixls - m_nAppX * 2;
pix0 = new int[pixls];
offImage = new MemoryImageSource(m_nAppX, m_nAppY, pix0, 0, m_nAppX);
offImage.setAnimated(true);
dbImg = createImage(offImage);
for(int i = 0; i > 16) - i) * ru >> 8) + i;
i = (k & 0xff00) >> 8;
int l1 = ((((l & 0xff00) >> 8) - i) * ru >> 8) + i;
i = k & 0xff;
int i2 = (((l & 0xff) - i) * ru >> 8) + i;
i = (i1 & 0xff0000) >> 16;
int j2 = ((((j1 & 0xff0000) >> 16) - i) * ru >> 8) + i;
i = (i1 & 0xff00) >> 8;
int k2 = ((((j1 & 0xff00) >> 8) - i) * ru >> 8) + i;
i = i1 & 0xff;
int l2 = (((j1 & 0xff) - i) * ru >> 8) + i;
int i3 = ((j2 - k1) * rv >> 8) + k1;
int j3 = ((k2 - l1) * rv >> 8) + l1;
int k3 = ((l2 - i2) * rv >> 8) + i2;
pix0[j] = i3
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。