1 25 26 package net.yagga.miniinstaller.gui; 27 28 import java.awt.*; 29 import javax.swing.*; 30 31 36 public class UnzipPanel extends JPanel implements InstallPanel{ 37 JLabel lbTitle = new JLabel(); 38 JLabel lbZipFile = new JLabel(); 39 JLabel lbDest = new JLabel(); 40 JProgressBar pbProgress = new JProgressBar(); 41 42 43 String descr, zipFile, destDir; 44 CanFwdListener canFwdListener; 45 GridBagLayout gridBagLayout1 = new GridBagLayout(); 46 47 public UnzipPanel(String descr, String zipFile, String destDir, CanFwdListener cfl) { 48 this.canFwdListener=cfl; 49 this.descr=descr; 50 this.zipFile=zipFile; 51 this.destDir=destDir; 52 try { 53 jbInit(); 54 } 55 catch (Exception ex) { 56 ex.printStackTrace(); 57 } 58 } 59 60 void jbInit() throws Exception { 61 this.setBackground(SystemColor.control); 62 this.setLayout(gridBagLayout1); 63 lbTitle.setOpaque(false); 65 lbTitle.setFont(GuiProperties.smallTitleFont); 66 lbTitle.setText("titlt"); 67 lbTitle.setForeground(InstallFrame.FG_COL); 68 lbZipFile.setOpaque(false); 70 lbZipFile.setText("zipfile"); 71 lbZipFile.setForeground(InstallFrame.FG_COL); 72 lbZipFile.setFont(GuiProperties.makeItalic(GuiProperties.textFont)); 73 lbDest.setOpaque(false); 75 lbDest.setText("dest"); 76 lbDest.setForeground(InstallFrame.FG_COL); 77 lbDest.setFont(GuiProperties.makeItalic(GuiProperties.textFont)); 78 pbProgress.setForeground(SystemColor.controlLtHighlight); 79 pbProgress.setDoubleBuffered(true); 80 pbProgress.setOpaque(false); 81 this.add(lbTitle, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0 82 ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 0, 10), 358, 3)); 83 84 this.add(lbZipFile, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0 85 ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(32, 10, 0, 10), 250, 0)); this.add(lbDest, new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0 87 ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(14, 10, 0, 10), 250, 0)); this.add(pbProgress, new GridBagConstraints(0, 3, 1, 1, 1.0, 0.0 89 ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 10, 10), 250, 1)); refresh(); 91 } 92 93 public void refresh(){ 94 this.setMaximumSize(InstallFrame.panelDim); 95 this.setPreferredSize(InstallFrame.panelDim); 96 this.setMinimumSize(InstallFrame.panelDim); 97 98 lbTitle.setText(descr); 99 lbZipFile.setText(zipFile); 100 lbDest.setText(destDir); 101 pbProgress.setValue(0); 102 this.setBackground(InstallFrame.BK_COL); 103 lbTitle.setForeground(InstallFrame.TIT_COL); 104 lbZipFile.setForeground(InstallFrame.FG_COL); 105 lbDest.setForeground(InstallFrame.FG_COL); 106 this.invalidate(); 107 } 108 109 void setProgress(int i){ 110 pbProgress.setValue(i); 111 if(i==net.yagga.miniinstaller.MiniInstaller.UNZIP_DONE) 112 canFwdListener.canFwd(); 113 } 114 115 116 } 117 118 119 | Popular Tags |