1 6 7 package com.memoire.vainstall.xui; 8 9 import java.awt.*; 10 import javax.swing.*; 11 import javax.swing.border.*; 12 import com.memoire.vainstall.VAGlobals; 13 import com.memoire.vainstall.VAStats; 14 import com.memoire.vainstall.VAEndStep; 15 16 20 21 public class XuiEndPanel 22 extends XuiAbstractPanel 23 implements VAEndStep 24 { 25 JTextArea taReport_; 26 27 public XuiEndPanel() 28 { 29 super(); 30 31 setLayout(new BorderLayout(5,0)); 32 setBorder(new EmptyBorder(5,5,5,5)); 33 34 JPanel pnMain=new XuiPanel(); 35 pnMain.setLayout(new BorderLayout()); 36 pnMain.setOpaque(false); 37 38 XuiTitle lbTitle=new XuiTitle(VAGlobals.i18n("UI_End"),XuiTitle.LEFT); 39 lbTitle.setFont(new Font("SansSerif",Font.PLAIN,16)); 40 41 taReport_=new JTextArea(); 42 taReport_.setBackground(new Color(255,255,224)); 43 taReport_.setBorder(new EmptyBorder(5,5,5,5)); 44 taReport_.setFont(new Font("Monospaced",Font.PLAIN,12)); 45 taReport_.setEditable(false); 46 47 JScrollPane spReport=new JScrollPane(taReport_); 48 spReport.setBorder(new LineBorder(Color.black,2)); 49 spReport.getVerticalScrollBar().setBackground(Color.black); 50 spReport.getHorizontalScrollBar().setBackground(Color.black); 51 52 58 59 JPanel pnText=new XuiPanel(); 60 pnText.setOpaque(false); 61 pnText.setLayout(new BorderLayout()); 62 pnText.add(new XuiLabel(VAGlobals.i18n("UI_SoftwareHas")),BorderLayout.NORTH); 63 64 switch(VAGlobals.OPERATION) 65 { 66 case VAGlobals.INSTALL: 67 pnText.add(new XuiTitle(VAGlobals.i18n("UI_SuccessfullyInstalled")),BorderLayout.CENTER); 68 break; 69 case VAGlobals.UPDATE: 70 pnText.add(new XuiTitle(VAGlobals.i18n("UI_SuccessfullyUpdated")),BorderLayout.CENTER); 71 break; 72 case VAGlobals.UNINSTALL: 73 pnText.add(new XuiTitle(VAGlobals.i18n("UI_SuccessfullyUninstalled")),BorderLayout.CENTER); 74 break; 75 } 76 pnText.add(new XuiLabel(VAGlobals.i18n("UI_ClickFinishToExit")),BorderLayout.SOUTH); 77 78 pnMain.add(BorderLayout.NORTH, lbTitle); 79 pnMain.add(BorderLayout.CENTER,spReport); 80 pnMain.add(BorderLayout.SOUTH, pnText); 81 82 add(pnMain,BorderLayout.CENTER); 86 } 87 88 public void setStats(VAStats stats) 89 { 90 String text=""; 91 switch( VAGlobals.OPERATION ) { 92 case VAGlobals.INSTALL: { 93 text += VAGlobals.i18n("UI_InstallationReport") + "\n"; 94 text += "-------------------------------\n\n"; 95 break; 96 } 97 case VAGlobals.UPDATE: { 98 text += VAGlobals.i18n("UI_UpdateReport") + "\n"; 99 text += "-------------------------------\n\n"; 100 break; 101 } 102 case VAGlobals.UNINSTALL: { 103 text += VAGlobals.i18n("UI_UninstallationReport") + "\n"; 104 text += "-------------------------------\n\n"; 105 break; 106 } 107 } 108 text+=stats.getSuccessReport(); 109 text+="\n"; 110 text+=stats.getFailureReport(); 111 text+="\n"; 112 text+=stats.getExecutablesReport(); 113 taReport_.setText(text); 114 taReport_.setCaretPosition(0); 115 } 116 } 117 | Popular Tags |