001: /**
002: * $RCSfile: XuiEndPanel.java,v $
003: * @creation 02/04/00
004: * @modification $Date: 2001/06/08 10:03:04 $
005: */package com.memoire.vainstall.xui;
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: XuiEndPanel.java,v 1.4 2001/06/08 10:03:04 vonarnim Exp $
016: * @author Guillaume Desnoix
017: */
018:
019: public class XuiEndPanel extends XuiAbstractPanel implements VAEndStep {
020: JTextArea taReport_;
021:
022: public XuiEndPanel() {
023: super ();
024:
025: setLayout(new BorderLayout(5, 0));
026: setBorder(new EmptyBorder(5, 5, 5, 5));
027:
028: JPanel pnMain = new XuiPanel();
029: pnMain.setLayout(new BorderLayout());
030: pnMain.setOpaque(false);
031:
032: XuiTitle lbTitle = new XuiTitle(VAGlobals.i18n("UI_End"),
033: XuiTitle.LEFT);
034: lbTitle.setFont(new Font("SansSerif", Font.PLAIN, 16));
035:
036: taReport_ = new JTextArea();
037: taReport_.setBackground(new Color(255, 255, 224));
038: taReport_.setBorder(new EmptyBorder(5, 5, 5, 5));
039: taReport_.setFont(new Font("Monospaced", Font.PLAIN, 12));
040: taReport_.setEditable(false);
041:
042: JScrollPane spReport = new JScrollPane(taReport_);
043: spReport.setBorder(new LineBorder(Color.black, 2));
044: spReport.getVerticalScrollBar().setBackground(Color.black);
045: spReport.getHorizontalScrollBar().setBackground(Color.black);
046:
047: /*
048: taReport_=new JTextArea();
049: taReport_.setEditable(false);
050: taReport_.setBackground(pnMain.getBackground());
051: JScrollPane spReport=new JScrollPane(taReport_);
052: */
053:
054: JPanel pnText = new XuiPanel();
055: pnText.setOpaque(false);
056: pnText.setLayout(new BorderLayout());
057: pnText.add(new XuiLabel(VAGlobals.i18n("UI_SoftwareHas")),
058: BorderLayout.NORTH);
059:
060: switch (VAGlobals.OPERATION) {
061: case VAGlobals.INSTALL:
062: pnText.add(new XuiTitle(VAGlobals
063: .i18n("UI_SuccessfullyInstalled")),
064: BorderLayout.CENTER);
065: break;
066: case VAGlobals.UPDATE:
067: pnText.add(new XuiTitle(VAGlobals
068: .i18n("UI_SuccessfullyUpdated")),
069: BorderLayout.CENTER);
070: break;
071: case VAGlobals.UNINSTALL:
072: pnText.add(new XuiTitle(VAGlobals
073: .i18n("UI_SuccessfullyUninstalled")),
074: BorderLayout.CENTER);
075: break;
076: }
077: pnText.add(
078: new XuiLabel(VAGlobals.i18n("UI_ClickFinishToExit")),
079: BorderLayout.SOUTH);
080:
081: pnMain.add(BorderLayout.NORTH, lbTitle);
082: pnMain.add(BorderLayout.CENTER, spReport);
083: pnMain.add(BorderLayout.SOUTH, pnText);
084:
085: // JPanel pnImage=XuiImagePanel.IMAGE_PANEL;
086: // pnMain.setPreferredSize(new Dimension(200, pnImage.getPreferredSize().height));
087: // add(pnImage);
088: add(pnMain, BorderLayout.CENTER);
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: }
|