001: /**
002: * $RCSfile: XuiUpgradePanel.java,v $
003: * @creation 13/05/00
004: * @modification $Date: 2004/02/02 20:57:58 $
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.VAUpgradeStep;
011: import com.memoire.vainstall.VAGlobals;
012:
013: /**
014: * @version $Id: XuiUpgradePanel.java,v 1.5 2004/02/02 20:57:58 deniger Exp $
015: * @author Guillaume Desnoix
016: */
017:
018: public class XuiUpgradePanel extends XuiAbstractPanel implements
019: VAUpgradeStep {
020: JLabel lbVersion_, lbStatus_;
021: JTextField tfDirectory_;
022: JRadioButton rdYes_, rdNo_;
023: JPanel pnChoice_;
024:
025: public XuiUpgradePanel() {
026: super ();
027:
028: setLayout(new BorderLayout());
029:
030: JPanel pnMain = new XuiPanel();
031: pnMain.setLayout(new BorderLayout());
032: pnMain.setBorder(new EmptyBorder(5, 5, 5, 5));
033: pnMain.setForeground(new Color(128, 255, 255));
034:
035: JPanel pnDetails = new XuiPanel();
036: pnDetails.setLayout(new GridLayout(4, 0));
037: pnDetails.setBorder(new CompoundBorder(new LineBorder(
038: Color.black, 2), new CompoundBorder(new EmptyBorder(5,
039: 5, 5, 5), new LineBorder(Color.black, 2))));
040:
041: JLabel lb1 = new XuiLabel(VAGlobals
042: .i18n("UI_PreviousVersionFound"));
043: lb1.setBackground(new Color(160, 224, 224));
044: lb1.setBorder(new EmptyBorder(0, 5, 0, 5));
045: lb1.setOpaque(true);
046: pnDetails.add(lb1);
047:
048: lbVersion_ = new XuiLabel(VAGlobals.i18n("UI_Invisible"));
049: lbVersion_.setBackground(new Color(255, 255, 224));
050: lbVersion_.setForeground(new Color(255, 255, 224));
051: // lbVersion_.setFont(new Font("SansSerif", Font.BOLD, 16));
052: lbVersion_.setBorder(new EmptyBorder(0, 5, 0, 5));
053: lbVersion_.setOpaque(true);
054: pnDetails.add(lbVersion_);
055:
056: JLabel lb2 = new XuiLabel(VAGlobals
057: .i18n("UI_InstallationDirectory"));
058: lb2.setBackground(new Color(160, 224, 224));
059: lb2.setBorder(new EmptyBorder(0, 5, 0, 5));
060: lb2.setOpaque(true);
061: pnDetails.add(lb2);
062:
063: tfDirectory_ = new JTextField();
064: tfDirectory_.setBackground(new Color(255, 255, 224));
065: tfDirectory_.setBorder(new EmptyBorder(0, 5, 0, 5));
066: tfDirectory_.setEditable(false);
067: tfDirectory_.setText("");
068: pnDetails.add(tfDirectory_);
069:
070: pnChoice_ = new XuiPanel();
071: pnChoice_.setLayout(new BorderLayout());
072: pnChoice_.add(BorderLayout.CENTER, new XuiLabel(VAGlobals
073: .i18n("UI_WantToUpgrade")));
074: JPanel pnRadios = new XuiPanel();
075: rdYes_ = new XuiRadioButton(VAGlobals.i18n("Common_Yes"));
076: rdYes_.setEnabled(true);
077: rdYes_.setSelected(false);
078: rdNo_ = new XuiRadioButton(VAGlobals.i18n("Common_No"));
079: rdNo_.setEnabled(true);
080: rdNo_.setSelected(true);
081: ButtonGroup bg = new ButtonGroup();
082: bg.add(rdYes_);
083: bg.add(rdNo_);
084: pnRadios.add(rdYes_);
085: pnRadios.add(rdNo_);
086: pnChoice_.add(BorderLayout.SOUTH, pnRadios);
087: pnChoice_.setVisible(false);
088:
089: lbStatus_ = new XuiLabel(VAGlobals
090: .i18n("UI_ClickNextToContinue"));
091:
092: XuiTitle lbTitle = new XuiTitle(VAGlobals.i18n("UI_Upgrade"),
093: XuiTitle.LEFT);
094: lbTitle.setFont(new Font("SansSerif", Font.PLAIN, 16));
095:
096: JPanel q = new JPanel();
097: q.setOpaque(false);
098: q.setBorder(null);
099: q.setLayout(new BorderLayout());
100: q.add(lbTitle, BorderLayout.NORTH);
101: q.add(pnDetails, BorderLayout.CENTER);
102:
103: pnMain.add(q, BorderLayout.NORTH);
104: pnMain.add(pnChoice_, BorderLayout.CENTER);
105: pnMain.add(lbStatus_, BorderLayout.SOUTH);
106:
107: JPanel pnImage = XuiImagePanel.IMAGE_PANEL;
108: add(pnImage, BorderLayout.WEST);
109: add(pnMain, BorderLayout.CENTER);
110: }
111:
112: public void version(String msg) {
113: lbVersion_.setForeground(Color.red);
114: lbVersion_.setText(msg);
115: //RepaintManager.currentManager(lbVersion_).paintDirtyRegions(); // OSX Repaint - see VAWizard.java
116: }
117:
118: public void setChoiceEnabled(boolean b) {
119: pnChoice_.setVisible(b);
120: }
121:
122: public void status(String msg) {
123: lbStatus_.setText(msg);
124: //RepaintManager.currentManager(lbStatus_).paintDirtyRegions(); // OSX Repaint - see VAWizard.java
125: }
126:
127: public void directory(String msg) {
128: tfDirectory_.setText(msg);
129: //RepaintManager.currentManager(tfDirectory_).paintDirtyRegions(); // OSX Repaint - see VAWizard.java
130: }
131:
132: public boolean isConfirmUpgrade() {
133: return rdYes_.isSelected();
134: }
135: }
|