home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 June / PCpro_2005_06.ISO / files / opensource / tvbrowser / TvBrowser_1.0.exe / plugins / ProgramInfo.jar / programinfo / ProgramInfoSettingsTab.class (.txt) < prev    next >
Encoding:
Java Class File  |  2004-09-19  |  4.3 KB  |  87 lines

  1. package programinfo;
  2.  
  3. import devplugin.SettingsTab;
  4. import java.awt.BorderLayout;
  5. import java.awt.Font;
  6. import java.awt.GridLayout;
  7. import java.awt.Point;
  8. import java.util.Properties;
  9. import javax.swing.BorderFactory;
  10. import javax.swing.Icon;
  11. import javax.swing.JButton;
  12. import javax.swing.JPanel;
  13. import javax.swing.JScrollPane;
  14. import javax.swing.JTextArea;
  15. import util.ui.Localizer;
  16.  
  17. public class ProgramInfoSettingsTab implements SettingsTab {
  18.    private static final Localizer mLocalizer;
  19.    private JTextArea mStyleSheetTa;
  20.    private Properties mSettings;
  21.    // $FF: synthetic field
  22.    static Class class$programinfo$ProgramInfoSettingsTab;
  23.  
  24.    public ProgramInfoSettingsTab(Properties settings) {
  25.       this.mSettings = settings;
  26.    }
  27.  
  28.    public JPanel createSettingsPanel() {
  29.       JPanel content = new JPanel(new BorderLayout(0, 4));
  30.       content.setBorder(BorderFactory.createTitledBorder(mLocalizer.msg("stylesheet", "Stylesheet for program information window")));
  31.       this.mStyleSheetTa = new JTextArea();
  32.       String styleSheet = this.mSettings.getProperty("stylesheet_v1");
  33.       if (styleSheet == null) {
  34.          styleSheet = "#title {\n  font-size:15px;\n  font-family:Dialog;\n  text-align:center;\n  font-weight:bold;\n}\n\n#time {\n  font-size:9px;\n  font-family:Dialog;\n  text-align:center;\n}\n\n#maininfo {\n  font-size:9px;\n  font-family:Dialog;\n  text-align:right;\n  font-weight:bold;\n}\n\n#info {\n  font-size:9px;\n  font-family:Dialog;\n}\n\n#text {\n  font-size:11px;\n  font-family:Dialog;\n}\n\n#small {\n  font-size:9px;\n  font-family:Dialog;\n}\n";
  35.       }
  36.  
  37.       this.mStyleSheetTa.setText(styleSheet);
  38.       this.mStyleSheetTa.setRows(10);
  39.       this.mStyleSheetTa.setFont(new Font("Monospaced", 0, 12));
  40.       JButton previewBtn = new JButton(mLocalizer.msg("preview", "Preview"));
  41.       JButton defaultBtn = new JButton(mLocalizer.msg("default", "Default"));
  42.       previewBtn.addActionListener(new 1(this));
  43.       defaultBtn.addActionListener(new 2(this));
  44.       JPanel eastPn = new JPanel(new BorderLayout());
  45.       eastPn.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0));
  46.       JPanel btnPn = new JPanel(new GridLayout(2, 1, 3, 0));
  47.       btnPn.add(previewBtn);
  48.       btnPn.add(defaultBtn);
  49.       eastPn.add(btnPn, "North");
  50.       JScrollPane sp = new JScrollPane(this.mStyleSheetTa);
  51.       sp.getViewport().setViewPosition(new Point(0, 0));
  52.       content.add(sp, "Center");
  53.       content.add(eastPn, "East");
  54.       return content;
  55.    }
  56.  
  57.    public void saveSettings() {
  58.       this.mSettings.setProperty("stylesheet_v1", this.mStyleSheetTa.getText());
  59.    }
  60.  
  61.    public Icon getIcon() {
  62.       return null;
  63.    }
  64.  
  65.    public String getTitle() {
  66.       return null;
  67.    }
  68.  
  69.    // $FF: synthetic method
  70.    static Class class$(String x0) {
  71.       try {
  72.          return Class.forName(x0);
  73.       } catch (ClassNotFoundException x1) {
  74.          throw new NoClassDefFoundError(x1.getMessage());
  75.       }
  76.    }
  77.  
  78.    // $FF: synthetic method
  79.    static JTextArea access$000(ProgramInfoSettingsTab x0) {
  80.       return x0.mStyleSheetTa;
  81.    }
  82.  
  83.    static {
  84.       mLocalizer = Localizer.getLocalizerFor(class$programinfo$ProgramInfoSettingsTab == null ? (class$programinfo$ProgramInfoSettingsTab = class$("programinfo.ProgramInfoSettingsTab")) : class$programinfo$ProgramInfoSettingsTab);
  85.    }
  86. }
  87.