⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 venetianpane.java

📁 oraily的Swing hacks code
💻 JAVA
字号:
import java.awt.*;public class VenetianPane extends TransitionTabbedPane {    public VenetianPane() {        super();        this.setAnimationLength(20);    }    public void paintTransition(Graphics2D g2, int step,            Rectangle size, Image prev) {                int length = getAnimationLength();        int half = length/2;                // create a blind        Rectangle blind = new Rectangle();                // calculate the fade out part        if(step >= 0 && step < half) {            // draw the saved version of the old tab component            if(prev != null) {                g2.drawImage(prev,(int)size.getX(),(int)size.getY(),null);            }            // calculate the growing blind            blind = new Rectangle(                (int)size.getX(),                (int)size.getY(),                step,                (int)size.getHeight());        }                        // calculate the fade in part        if(step >= half && step < length) {            // calculate the shrinking blind            blind = new Rectangle(                (int)size.getX(),                (int)size.getY(),                length-step,                (int)size.getHeight());            blind.translate(step-half,0);        }                            // draw the blinds        for(int i=0; i<size.getWidth()/half; i++) {            g2.setColor(Color.white);            g2.fill(blind);            blind.translate(half,0);        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -