Package java.awt.event

Examples of java.awt.event.ItemListener


    pb.addLabel(mLocalizer.msg("channelsPerPage","Channels per page")+":", cc.xy(2,3));
    pb.add(mChannelsPerPageCB = new JComboBox(createIntegerArray(2,22)), cc.xy(4,3));
    pb.addLabel(mLocalizer.msg("columnsPerPage","columns")+":", cc.xy(2,5));
    pb.add(mLayoutCB = new JComboBox(mLayoutCBModel), cc.xy(4,5));

    mChannelsPerPageCB.addItemListener(new ItemListener(){
      public void itemStateChanged(ItemEvent e) {
        int val = ((Integer)mChannelsPerPageCB.getSelectedItem()).intValue();
        updateLayoutCombobox(val);
      }
    });
View Full Code Here


    pb.add(mShowOnlyNameInProgramTable = new JRadioButton(mLocalizer.msg("showOnlyName","Show channel name"), Settings.propShowChannelNamesInProgramTable.getBoolean() && !Settings.propShowChannelIconsInProgramTable.getBoolean()), cc.xy(2,5));
    pb.add(mShowTooltipInProgramTable = new JCheckBox(mLocalizer.msg("showToolTip","Show large channel icons in tooltip"), Settings.propShowChannelTooltipInProgramTable.getBoolean()), cc.xy(2,7));

    mShowTooltipInProgramTable.setEnabled(!mShowOnlyNameInProgramTable.isSelected());
   
    mShowOnlyNameInProgramTable.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        mShowTooltipInProgramTable.setEnabled(e.getStateChange() == ItemEvent.DESELECTED);
      }
    });
   
View Full Code Here

      // Create offline label and check box bound to controller OFFLINE_FURNITURE_LIBRARY property
      this.offlineFurnitureLibraryLabel = new JLabel(preferences.getLocalizedString(
          FurnitureLibraryUserPreferencesPanel.class, "offlineFurnitureLibraryLabel.text"));
      this.offlineFurnitureLibraryCheckBox = new JCheckBox(SwingTools.getLocalizedLabelText(preferences,
          FurnitureLibraryUserPreferencesPanel.class, "offlineFurnitureLibraryCheckBox.text"), controller.isFurnitureLibraryOffline());
      this.offlineFurnitureLibraryCheckBox.addItemListener(new ItemListener() {
          public void itemStateChanged(ItemEvent ev) {
            controller.setFurnitureLibraryOffline(offlineFurnitureLibraryCheckBox.isSelected());
          }
        });
      controller.addPropertyChangeListener(FurnitureLibraryUserPreferencesController.Property.OFFLINE_FURNITURE_LIBRARY,
View Full Code Here

      mStartLanguageIndex = mLanguageCB.getSelectedIndex();
      mStartTimeZoneIndex = mTimezoneCB.getSelectedIndex();
      mTwelveHourFormatIsSelected = mTwelveHourFormat.isSelected();
    }

    ItemListener itemListener= new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        mInfoArea.setVisible(mLanguageCB.getSelectedIndex() != mStartLanguageIndex ||
            mTimezoneCB.getSelectedIndex() != mStartTimeZoneIndex ||
            (mTwelveHourFormatIsSelected && !mTwelveHourFormat.isSelected() ||
                !mTwelveHourFormatIsSelected && !mTwentyfourHourFormat.isSelected()));
View Full Code Here

    mStartFullscreen = new JCheckBox(mLocalizer.msg(
        "startFullscreen","Start in fullscreen mode"),
        Settings.propIsUsingFullscreen.getBoolean());
    mSettingsPn.add(mStartFullscreen, cc.xy(2,++y));

    mMinimizeAfterStartUpChB.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if(e.getStateChange() == ItemEvent.SELECTED) {
          mStartFullscreen.setSelected(false);
        }
      }
    });

    mStartFullscreen.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if(e.getStateChange() == ItemEvent.SELECTED) {
          mMinimizeAfterStartUpChB.setSelected(false);
        }
      }
View Full Code Here

    mAutoDownloadWaitingTime = new JCheckBox(mLocalizer.msg("autoDownload.waiting","Delay auto update for"),Settings.propAutoDownloadWaitingEnabled.getBoolean());
    mAutoDownloadWaitingTimeSp = new JSpinner(new SpinnerNumberModel(
        Settings.propAutoDownloadWaitingTime.getShort(), 1, 60, 1));
    mSecondsLabel = new JLabel(mLocalizer.msg("autoDownload.seconds","seconds"));

    mAutoDownload.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        setAutoDownloadEnabled(e.getStateChange() == ItemEvent.SELECTED);
      }
    });

    mAskBeforeDownloadRadio.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        setAutoDownloadEnabled(mAutoDownload.isSelected());
      }
    });

    mAskTimeRadio.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        setAutoDownloadEnabled(mAskTimeRadio.isSelected());
      };
    });

    mAutoDownloadWaitingTime.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        mAutoDownloadWaitingTimeSp.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
      }
    });
View Full Code Here

          mSettings.setFilterName(Plugin.getPluginManager().getFilterManager().getAllFilter().getName());
        }

        fillFilterBox();

        mFilterBox.addItemListener(new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            mFilter = (ProgramFilter) mFilterBox.getSelectedItem();
            if (mFilter != mRecieveFilter) {
              mSettings.setFilterName(mFilter.getName());
            }
            mBox.getItemListeners()[0].itemStateChanged(null);
          }
        });

        mBox.addItemListener(new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            fillProgramList();
            mSettings.setIndex(mBox.getSelectedIndex());
          }
        });

        CellConstraints cc = new CellConstraints();

        JPanel panel = new JPanel(new FormLayout("1dlu,default,3dlu,default:grow", "pref,2dlu,pref,2dlu"));
        panel.add(new JLabel(Localizer.getLocalization(Localizer.I18N_CHANNELS) + ":"), cc.xy(2, 1));
        panel.add(mBox, cc.xy(4, 1));
        panel.add(new JLabel(mLocalizer.msg("filter", "Filter:")), cc.xy(2, 3));
        panel.add(mFilterBox, cc.xy(4, 3));

        mSendBtn = new JButton(TVBrowserIcons.copy(TVBrowserIcons.SIZE_SMALL));
        mSendBtn.setToolTipText(mLocalizer.msg("send", "Send to other Plugins"));
        mSendBtn.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Program[] programs = mList.getSelectedPrograms();
            if (programs == null || programs.length == 0) {
              programs = mPrograms.toArray(new Program[mPrograms.size()]);
            }
            if (programs != null && programs.length > 0) {
              SendToPluginDialog sendDialog = new SendToPluginDialog(ProgramListPlugin.getInstance(), (Window) mDialog,
                  programs);
              sendDialog.setVisible(true);
            }
          }
        });

        mShowDescription = new JCheckBox(mLocalizer.msg("showProgramDescription", "Show program description"),
            showDescription);
        mShowDescription.addItemListener(new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            int topRow = mList.getFirstVisibleIndex();
            mProgramPanelSettings.setShowOnlyDateAndTitle(e.getStateChange() == ItemEvent.DESELECTED);
            mSettings.setShowDescription(e.getStateChange() == ItemEvent.SELECTED);
            mList.updateUI();
View Full Code Here

        public void focusLost(FocusEvent e) {
          mData.setPassword(new String(mUserPwd.getPassword()));
        }
      });
   
      mTimeZones.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          mData.setTimeZone(TimeZone.getTimeZone((String)mTimeZones.getSelectedItem()));
        }
      });
    }
View Full Code Here

    private ArrayList<Object> mFilteredList = new ArrayList<Object>();
   
    protected void setComboBox(JComboBox filterBox) {
      mFilterBox = filterBox;
     
      mFilterBox.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          if(e.getStateChange() == ItemEvent.SELECTED) {
            mFilteredList.clear();
           
            Object filter = mFilterBox.getSelectedItem();
View Full Code Here

    pb.add(mShowRemovedDlg, cc.xyw(2,27,7));
   
    pb.addSeparator(DefaultMarkingPrioritySelectionPanel.getTitle(), cc.xyw(1,29,10));
    pb.add(mMarkingsPanel = DefaultMarkingPrioritySelectionPanel.createPanel(ReminderPlugin.getInstance().getMarkPriority(),false,false),cc.xyw(2,31,9));
   
    mReminderWindowChB.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        mShowAlwaysOnTop.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
        c.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
        secondsLabel.setEnabled(e.getStateChange() == ItemEvent.SELECTED && mCloseOnTime.isSelected());
        mCloseOnEnd.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
        mCloseNever.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
        mCloseOnTime.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
        mShowTimeCounter.setEnabled(e.getStateChange() == ItemEvent.SELECTED && !mCloseNever.isSelected());
        mAutoCloseReminderTimeSp.setEnabled(e.getStateChange() == ItemEvent.SELECTED && mCloseOnTime.isSelected());
      }
    });
   
    soundTestBt.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        if(evt.getActionCommand().compareTo(mLocalizer.msg("test", "Test")) == 0) {
          mTestSound = ReminderPlugin.playSound(mSoundFileChB.getTextField().getText());
          if(mTestSound != null) {
            soundTestBt.setText(mLocalizer.msg("stop", "Stop"));
          }
          if(mTestSound != null) {
            if(mTestSound instanceof SourceDataLine) {
              ((SourceDataLine)mTestSound).addLineListener(new LineListener() {
                public void update(LineEvent event) {
                  if(event.getType() == Type.CLOSE) {
                    soundTestBt.setText(mLocalizer.msg("test", "Test"));
                  }
                }
              });
            }
            else if(mTestSound instanceof Sequencer) {
              new Thread("Test MIDI sound") {
                public void run() {
                  setPriority(Thread.MIN_PRIORITY);
                  while(((Sequencer)mTestSound).isRunning()) {
                    try {
                      Thread.sleep(100);
                    }catch(Exception ee) {}
                  }
                 
                  soundTestBt.setText(mLocalizer.msg("test", "Test"));
                }
              }.start();
            }
          }
        }
        else if(mTestSound != null) {
          if(mTestSound instanceof SourceDataLine && ((SourceDataLine)mTestSound).isRunning()) {
            ((SourceDataLine)mTestSound).stop();
          } else if(mTestSound instanceof Sequencer && ((Sequencer)mTestSound).isRunning()) {
            ((Sequencer)mTestSound).stop();
          }
        }
      }
    });
   
    mSoundFileChB.getCheckBox().addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        soundTestBt.setEnabled(mSoundFileChB.isSelected());
      }
    });
   
    mSoundFileChB.getTextField().addKeyListener(new KeyAdapter() {
      public void keyReleased(KeyEvent e) {
        String text = mSoundFileChB.getTextField().getText();
        if((new File(text)).isFile()) {
          boolean notFound = true;
          for (String extension : extArr) {
            if(text.toLowerCase().endsWith(extension)) {
              notFound = false;
              break;
            }
          }
         
          if(notFound) {
            soundTestBt.setEnabled(false);
          } else {
            soundTestBt.setEnabled(true);
          }
        } else {
          soundTestBt.setEnabled(false);
        }
      }
    });
    mSoundFileChB.getTextField().getKeyListeners()[0].keyReleased(null);
   
    mExecChB.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        mExecFileDialogBtn.setEnabled(mExecChB.isSelected());
        if (mExecFileDialogBtn.isEnabled()) {
          showFileSettingsDialog();
        }
      }
    });
   
    mExecFileDialogBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        showFileSettingsDialog();
      }
    });
   
    ItemListener autoCloseListener = new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        mAutoCloseReminderTimeSp.setEnabled(mCloseOnTime.isSelected());
        secondsLabel.setEnabled(mCloseOnTime.isSelected());
        mShowTimeCounter.setEnabled(mCloseOnTime.isSelected() || mCloseOnEnd.isSelected());
      }
    };
   
    mCloseOnEnd.addItemListener(autoCloseListener);
    mCloseOnTime.addItemListener(autoCloseListener);
   
    mCloseOnTime.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        mShowTimeCounter.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
      }
    });
   
View Full Code Here

TOP

Related Classes of java.awt.event.ItemListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.