home *** CD-ROM | disk | FTP | other *** search
- package reminderplugin;
-
- import devplugin.Program;
- import java.awt.BorderLayout;
- import java.awt.FlowLayout;
- import java.awt.Font;
- import java.awt.Frame;
- import java.awt.GridLayout;
- import java.util.Properties;
- import javax.swing.BorderFactory;
- import javax.swing.BoxLayout;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JComboBox;
- import javax.swing.JDialog;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import util.ui.Localizer;
-
- public class ReminderDialog extends JDialog {
- private static final Localizer mLocalizer;
- public static final String[] SMALL_REMIND_MSG_ARR;
- private static final int[] SMALL_REMIND_VALUE_ARR;
- private boolean mOkPressed = false;
- private JComboBox mList;
- private JCheckBox mRememberSettingsCb;
- // $FF: synthetic field
- static Class class$reminderplugin$ReminderDialog;
-
- public ReminderDialog(Frame parent, Program program, Properties settings) {
- super(parent, true);
- this.setTitle(mLocalizer.msg("title", "New reminder"));
- JPanel contentPane = (JPanel)this.getContentPane();
- contentPane.setLayout(new BorderLayout());
- contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
- JPanel northPn = new JPanel();
- northPn.setLayout(new BoxLayout(northPn, 1));
- JLabel titleLabel = new JLabel(program.getChannel().getName() + ": " + program.getTitle());
- JPanel infoPanel = new JPanel(new GridLayout(2, 1));
- Font font = titleLabel.getFont();
- titleLabel.setFont(new Font(font.getName(), 1, font.getSize() + 4));
- infoPanel.add(new JLabel(program.getDateString()));
- infoPanel.add(new JLabel(program.getTimeString()));
- JPanel headerPanel = new JPanel(new BorderLayout(20, 0));
- headerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
- headerPanel.add(titleLabel, "West");
- headerPanel.add(infoPanel, "East");
- northPn.add(headerPanel);
- this.mList = new JComboBox(SMALL_REMIND_MSG_ARR);
- String s = settings.getProperty("defaultReminderEntry");
- int reminderTime = 5;
- if (s != null) {
- try {
- reminderTime = Integer.parseInt(s);
- } catch (NumberFormatException var16) {
- }
- }
-
- if (reminderTime >= 0 && reminderTime < SMALL_REMIND_MSG_ARR.length) {
- this.mList.setSelectedIndex(reminderTime);
- } else {
- this.mList.setSelectedIndex(5);
- }
-
- northPn.add(this.mList);
- this.mRememberSettingsCb = new JCheckBox(mLocalizer.msg("rememberSetting", "Remember setting"));
- JPanel pn1 = new JPanel(new BorderLayout());
- pn1.add(this.mRememberSettingsCb, "West");
- northPn.add(pn1);
- JPanel btnPn = new JPanel(new FlowLayout(4));
- btnPn.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
- JButton okBtn = new JButton(mLocalizer.msg("ok", "OK"));
- okBtn.addActionListener(new 1(this, settings));
- btnPn.add(okBtn);
- this.getRootPane().setDefaultButton(okBtn);
- JButton cancelBtn = new JButton(mLocalizer.msg("cancel", "Cancel"));
- cancelBtn.addActionListener(new 2(this));
- btnPn.add(cancelBtn);
- contentPane.add(northPn, "North");
- contentPane.add(btnPn, "South");
- this.pack();
- }
-
- public int getReminderMinutes() {
- int idx = this.mList.getSelectedIndex();
- return SMALL_REMIND_VALUE_ARR[idx];
- }
-
- public boolean getOkPressed() {
- return this.mOkPressed;
- }
-
- // $FF: synthetic method
- static Class class$(String x0) {
- try {
- return Class.forName(x0);
- } catch (ClassNotFoundException x1) {
- throw new NoClassDefFoundError(x1.getMessage());
- }
- }
-
- // $FF: synthetic method
- static boolean access$002(ReminderDialog x0, boolean x1) {
- return x0.mOkPressed = x1;
- }
-
- // $FF: synthetic method
- static JCheckBox access$100(ReminderDialog x0) {
- return x0.mRememberSettingsCb;
- }
-
- // $FF: synthetic method
- static JComboBox access$200(ReminderDialog x0) {
- return x0.mList;
- }
-
- static {
- mLocalizer = Localizer.getLocalizerFor(class$reminderplugin$ReminderDialog == null ? (class$reminderplugin$ReminderDialog = class$("reminderplugin.ReminderDialog")) : class$reminderplugin$ReminderDialog);
- SMALL_REMIND_MSG_ARR = new String[ReminderFrame.REMIND_MSG_ARR.length - 1];
- SMALL_REMIND_VALUE_ARR = new int[ReminderFrame.REMIND_VALUE_ARR.length - 1];
- System.arraycopy(ReminderFrame.REMIND_MSG_ARR, 1, SMALL_REMIND_MSG_ARR, 0, SMALL_REMIND_MSG_ARR.length);
- System.arraycopy(ReminderFrame.REMIND_VALUE_ARR, 1, SMALL_REMIND_VALUE_ARR, 0, SMALL_REMIND_VALUE_ARR.length);
- }
- }
-