Methods Summary |
---|
public int | getAnimationLength()
return this.animation_length;
|
public static void | p(java.lang.String s)
System.out.println(s);
|
public void | paintChildren(java.awt.Graphics g)
super.paintChildren(g);
if(step != -1) {
Rectangle size = this.getComponentAt(0).getBounds();
Graphics2D g2 = (Graphics2D)g;
paintTransition(g2, step, size, buf);
}
|
public void | paintTransition(java.awt.Graphics2D g2, int step, java.awt.Rectangle size, java.awt.Image prev)
|
public void | run()
step = 0;
// save the previous tab
if(previous_tab != -1) {
Component comp = this.getComponentAt(previous_tab);
buf = new BufferedImage(comp.getWidth(),
comp.getHeight(),
BufferedImage.TYPE_4BYTE_ABGR);
comp.paint(buf.getGraphics());
}
for(int i=0; i<animation_length; i++) {
step = i;
repaint();
try {
Thread.currentThread().sleep(100);
} catch (Exception ex) {
p("ex: " + ex);
}
}
step = -1;
previous_tab = this.getSelectedIndex();
repaint();
|
public void | setAnimationLength(int length)
this.animation_length = length;
|
public void | stateChanged(javax.swing.event.ChangeEvent evt)
new Thread(this).start();
|