001: /**
002: * $RCSfile: VAEndPanel.java,v $
003: * @creation 02/04/00
004: * @modification $Date: 2001/06/08 10:03:04 $
005: */package com.memoire.vainstall.gui;
006:
007: import java.awt.*;
008: import javax.swing.*;
009: import javax.swing.border.*;
010: import com.memoire.vainstall.VAGlobals;
011: import com.memoire.vainstall.VAStats;
012: import com.memoire.vainstall.VAEndStep;
013:
014: /**
015: * @version $Id: VAEndPanel.java,v 1.3 2001/06/08 10:03:04 vonarnim Exp $
016: * @author Axel von Arnim
017: */
018:
019: public class VAEndPanel extends VAPanel implements VAEndStep {
020: JTextArea taReport_;
021:
022: public VAEndPanel() {
023: super ();
024:
025: setLayout(new BoxLayout(this , BoxLayout.X_AXIS));
026:
027: JPanel pnMain = new JPanel();
028: pnMain.setBorder(new CompoundBorder(new EtchedBorder(),
029: new EmptyBorder(new Insets(5, 5, 5, 5))));
030: pnMain.setLayout(new BorderLayout());
031:
032: JLabel lbTitle = new JLabel(VAGlobals.i18n("UI_End"));
033: lbTitle.setFont(lbTitle.getFont().deriveFont(Font.BOLD, 20));
034: lbTitle.setOpaque(true);
035: lbTitle.setBorder(new EmptyBorder(new Insets(5, 0, 5, 0)));
036: lbTitle.setBackground(pnMain.getBackground().darker());
037: lbTitle.setForeground(Color.white);
038:
039: taReport_ = new JTextArea();
040: taReport_.setEditable(false);
041: taReport_.setBackground(pnMain.getBackground());
042: JScrollPane spReport = new JScrollPane(taReport_);
043:
044: JPanel pnBas = new JPanel();
045: pnBas.setLayout(new BorderLayout());
046: JPanel pnText = new JPanel();
047: pnText.setLayout(new BoxLayout(pnText, BoxLayout.Y_AXIS));
048: JLabel lb = new JLabel(VAGlobals.i18n("UI_SoftwareHas"));
049: Font f = lb.getFont().deriveFont(Font.BOLD,
050: lb.getFont().getSize() + 2);
051: lb.setFont(f);
052: pnText.add(lb);
053: switch (VAGlobals.OPERATION) {
054: case VAGlobals.INSTALL: {
055: lb = new JLabel(VAGlobals.i18n("UI_SuccessfullyInstalled"));
056: lb.setFont(f);
057: pnText.add(lb);
058: break;
059: }
060: case VAGlobals.UPDATE: {
061: lb = new JLabel(VAGlobals.i18n("UI_SuccessfullyUpdated"));
062: lb.setFont(f);
063: pnText.add(lb);
064: break;
065: }
066: case VAGlobals.UNINSTALL: {
067: lb = new JLabel(VAGlobals
068: .i18n("UI_SuccessfullyUninstalled"));
069: lb.setFont(f);
070: pnText.add(lb);
071: break;
072: }
073: }
074: pnText.add(new JLabel(" "));
075: pnBas.add(BorderLayout.NORTH, pnText);
076: JLabel lbStatus = new JLabel(VAGlobals
077: .i18n("UI_ClickFinishToExit"));
078: lbStatus.setOpaque(true);
079: lbStatus.setBackground(pnMain.getBackground().brighter());
080: pnBas.add(BorderLayout.SOUTH, lbStatus);
081:
082: pnMain.add(BorderLayout.NORTH, lbTitle);
083: pnMain.add(BorderLayout.CENTER, spReport);
084: pnMain.add(BorderLayout.SOUTH, pnBas);
085:
086: JComponent pnImage = VAImagePanel.IMAGE_PANEL;
087: add(pnImage);
088: add(pnMain);
089: }
090:
091: public void setStats(VAStats stats) {
092: String text = "";
093: switch (VAGlobals.OPERATION) {
094: case VAGlobals.INSTALL: {
095: text += VAGlobals.i18n("UI_InstallationReport") + "\n";
096: text += "-------------------------------\n\n";
097: break;
098: }
099: case VAGlobals.UPDATE: {
100: text += VAGlobals.i18n("UI_UpdateReport") + "\n";
101: text += "-------------------------------\n\n";
102: break;
103: }
104: case VAGlobals.UNINSTALL: {
105: text += VAGlobals.i18n("UI_UninstallationReport") + "\n";
106: text += "-------------------------------\n\n";
107: break;
108: }
109: }
110: text += stats.getSuccessReport();
111: text += "\n";
112: text += stats.getFailureReport();
113: text += "\n";
114: text += stats.getExecutablesReport();
115: taReport_.setText(text);
116: taReport_.setCaretPosition(0);
117: }
118: }
|