FileDocCategorySizeDatePackage
SplashScreen.javaAPI DocApache Ant 1.703933Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.taskdefs.optional.splash

SplashScreen

public class SplashScreen extends JWindow implements org.apache.tools.ant.BuildListener, ActionListener

Fields Summary
private JLabel
text
private JProgressBar
pb
private int
total
private static final int
MIN
private static final int
MAX
Constructors Summary
public SplashScreen(String msg)


       
        init(null);
        setText(msg);
    
public SplashScreen(ImageIcon img)

        init(img);
    
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent a)

        if (total < MAX) {
            total++;
        } else {
            total = MIN;
        }
        pb.setValue(total);
    
public voidbuildFinished(org.apache.tools.ant.BuildEvent event)

        pb.setValue(MAX);
        setVisible(false);
        dispose();
    
public voidbuildStarted(org.apache.tools.ant.BuildEvent event)

        actionPerformed(null);
    
protected voidinit(javax.swing.ImageIcon img)


        JPanel pan = (JPanel) getContentPane();
        JLabel piccy;
        if (img == null) {
            piccy = new JLabel();
        } else {
            piccy = new JLabel(img);
        }

        piccy.setBorder(BorderFactory.createLineBorder(Color.black, 1));
        text = new JLabel("Building....", JLabel.CENTER);
        text.setFont(new Font("Sans-Serif", Font.BOLD, 12));
        text.setBorder(BorderFactory.createEtchedBorder());

        pb = new JProgressBar(MIN, MAX);
        pb.setBorder(BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        JPanel pan2 = new JPanel();
        pan2.setLayout(new BorderLayout());

        pan2.add(text, BorderLayout.NORTH);
        pan2.add(pb, BorderLayout.SOUTH);

        pan.setLayout(new BorderLayout());
        pan.add(piccy, BorderLayout.CENTER);
        pan.add(pan2, BorderLayout.SOUTH);

        pan.setBorder(BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        pack();

        Dimension size = getSize();
        Dimension scr = Toolkit.getDefaultToolkit().getScreenSize();
        int x = (scr.width - size.width) / 2;
        int y = (scr.height - size.height) / 2;
        setBounds(x, y, size.width, size.height);
    
public voidmessageLogged(org.apache.tools.ant.BuildEvent event)

        actionPerformed(null);
    
public voidsetText(java.lang.String txt)

        text.setText(txt);
    
public voidtargetFinished(org.apache.tools.ant.BuildEvent event)

        actionPerformed(null);
    
public voidtargetStarted(org.apache.tools.ant.BuildEvent event)

        actionPerformed(null);
    
public voidtaskFinished(org.apache.tools.ant.BuildEvent event)

        actionPerformed(null);
    
public voidtaskStarted(org.apache.tools.ant.BuildEvent event)

        actionPerformed(null);