Package javax.swing

Examples of javax.swing.JCheckBox


    mLastSelectedLayoutIndex = (short)mProgramArrangementCB.getSelectedIndex();

    mSettingsPn.add(mProgramArrangementCB, cc.xy(4, currentRow));

    // Cut long titles
    mCutLongTitlesCB = new JCheckBox(mLocalizer.msg("cutTitle",
        "Cut long titles"), Settings.propProgramTableCutTitle.getBoolean());
    mSettingsPn.add(mCutLongTitlesCB, cc.xyw(2, (currentRow += 2), 2));
    mCutLongTitlesSelection = new JSpinner(new SpinnerNumberModel(
        Settings.propProgramTableCutTitleLines.getInt(), 1, 3, 1));
    mSettingsPn.add(mCutLongTitlesSelection, cc.xy(4, currentRow));
    mCutLongTitlesLabel = new JLabel(mLocalizer.msg("lines", "Lines"));
    mSettingsPn.add(mCutLongTitlesLabel, cc.xy(6, currentRow));
   
    mCutLongTitlesCB.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        mCutLongTitlesSelection.setEnabled(mCutLongTitlesCB.isSelected());
        mCutLongTitlesLabel.setEnabled(mCutLongTitlesCB.isSelected());
      }
    });
    mCutLongTitlesCB.getActionListeners()[0].actionPerformed(null);
   
    // Short descriptions N lines
    mDescriptionLines = new JSpinner(new SpinnerNumberModel(
        Settings.propProgramPanelMaxLines.getInt(), 1, 5, 1));
    mSettingsPn.add(new JLabel(mLocalizer.msg("shortDescription",
        "Short description")), cc.xyw(2, currentRow += 2, 2));
    mSettingsPn.add(mDescriptionLines, cc.xy(4, currentRow));
    mSettingsPn.add(new JLabel(mLocalizer.msg("lines", "Lines")), cc.xy(6,
        currentRow));
   
    // Short programs no description
    mShortProgramsCB = new JCheckBox(mLocalizer.msg("shortPrograms",
        "If duration less than"),
        Settings.propProgramPanelShortDurationActive.getBoolean());
    mSettingsPn.add(mShortProgramsCB, cc.xyw(2, (currentRow += 2), 2));
    mShortProgramsMinutes = new JSpinner(new SpinnerNumberModel(
        Settings.propProgramPanelShortDurationMinutes.getInt(), 1, 30, 1));
    mSettingsPn.add(mShortProgramsMinutes, cc.xy(4, currentRow));
    mShortProgramsLabel = new JLabel(mLocalizer.msg("shortPrograms2",
        "minutes, then hide description"));
    mSettingsPn.add(mShortProgramsLabel, cc.xy(6, currentRow));

    mShortProgramsCB.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        mShortProgramsMinutes.setEnabled(mShortProgramsCB.isSelected());
        mShortProgramsLabel.setEnabled(mShortProgramsCB.isSelected());
      }
    });
    mShortProgramsCB.getActionListeners()[0].actionPerformed(null);
   
    // Column Rows ***************************************
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("5dlu"));
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("10dlu"));
   
    mSettingsPn.add(DefaultComponentFactory.getInstance().createSeparator(
        mLocalizer.msg("columnwidth", "column width")), cc.xyw(1,
        (currentRow += 2), 8));
   
    // column width
    int width = Settings.propColumnWidth.getInt();

    if (width > Settings.MAX_COLUMN_WIDTH) {
      width = Settings.MAX_COLUMN_WIDTH;
    }

    if (width < Settings.MIN_COLUMN_WIDTH) {
      width = Settings.MIN_COLUMN_WIDTH;
    }

    mColWidth = new JSpinner(new SpinnerNumberModel(
            width, Settings.MIN_COLUMN_WIDTH, Settings.MAX_COLUMN_WIDTH, 1));

    mSettingsPn.add(new JLabel(mLocalizer.msg("widthInPixels", "Width in Pixels")), cc.xy(2, (currentRow += 2)));
    mSettingsPn.add(mColWidth, cc.xy(4, currentRow));

    mDefaultBtn = new JButton(Localizer.getLocalization(Localizer.I18N_DEFAULT));
    mDefaultBtn.addActionListener(this);

    mSettingsPn.add(mDefaultBtn, cc.xy(6, currentRow));
   
    // Column Rows ***************************************
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("5dlu"));
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("3dlu"));
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("10dlu"));
   
    mSettingsPn.add(DefaultComponentFactory.getInstance().createSeparator(
        mLocalizer.msg("range", "Range")), cc.xyw(1, (currentRow += 2), 8));
   
    mSettingsPn.add(new JLabel(mLocalizer.msg("startOfDay", "Start of day")),
        cc.xy(2, (currentRow += 2)));
   
    TwoSpinnerDateModel startModel = new TwoSpinnerDateModel();
   
    mStartOfDayTimeSp = new JSpinner(startModel);
    startModel.setMe(mStartOfDayTimeSp);
   
    JSpinner.DateEditor dateEditor = new JSpinner.DateEditor(mStartOfDayTimeSp, Settings.getTimePattern());
    mStartOfDayTimeSp.setEditor(dateEditor);
    mSettingsPn.add(mStartOfDayTimeSp, cc.xy(4, currentRow));
    mSettingsPn.add(new JLabel("("
        + Localizer.getLocalization(Localizer.I18N_TODAY) + ")"), cc.xy(6,
        currentRow));
    CaretPositionCorrector.createCorrector(dateEditor.getTextField(), new char[] {':'}, -1);
   
    mSettingsPn.add(new JLabel(mLocalizer.msg("endOfDay", "End of day")), cc
        .xy(2, (currentRow += 2)));
   
    TwoSpinnerDateModel endModel = new TwoSpinnerDateModel();
   
    mEndOfDayTimeSp = new JSpinner(endModel);
    endModel.setMe(mEndOfDayTimeSp);
   
    dateEditor = new JSpinner.DateEditor(mEndOfDayTimeSp, Settings.getTimePattern());
    mEndOfDayTimeSp.setEditor(dateEditor);
    mSettingsPn.add(mEndOfDayTimeSp, cc.xy(4, currentRow));
    mSettingsPn.add(new JLabel("(" + mLocalizer.msg("nextDay", "next day")
        + ")"), cc.xy(6, currentRow));
    CaretPositionCorrector.createCorrector(dateEditor.getTextField(), new char[] {':'}, -1);
   
    int minutes;
    Calendar cal = Calendar.getInstance();
    minutes = Settings.propProgramTableStartOfDay.getInt();
    cal.set(Calendar.HOUR_OF_DAY, minutes / 60);
    cal.set(Calendar.MINUTE, minutes % 60);
    mStartOfDayTimeSp.setValue(cal.getTime());
   
   
    minutes = Settings.propProgramTableEndOfDay.getInt();
    cal.set(Calendar.HOUR_OF_DAY, minutes / 60);
    cal.set(Calendar.MINUTE, minutes % 60);
    mEndOfDayTimeSp.setValue(cal.getTime());
   
   
   
    // Table Background ***************************************
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("5dlu"));
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("10dlu"));

    mSettingsPn.add(DefaultComponentFactory.getInstance().createSeparator(
        mLocalizer.msg("tableBackground", "Table background")), cc.xyw(1,
        (currentRow += 2), 8));

    mSettingsPn.add(new JLabel(mLocalizer.msg("tableBackgroundStyle",
        "Table background style")), cc.xy(2, (currentRow += 2)));
   
    TableBackgroundStyle[] styles = getTableBackgroundStyles();
    mBackgroundStyleCB = new JComboBox(styles);

    String style = Settings.propTableBackgroundStyle.getString();
    for (int i = 0; i < styles.length; i++) {
      if (styles[i].getSettingsString().equals(style)) {
        mBackgroundStyleCB.setSelectedIndex(i);
        break;
      }
    }

    mBackgroundStyleCB.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        updateBackgroundStyleConfigureButton();
      }
    });

    mSettingsPn.add(mBackgroundStyleCB, cc.xy(4, currentRow));
   
    mConfigBackgroundStyleBt = new JButton(mLocalizer.ellipsisMsg("configure", "Configure"));

    mConfigBackgroundStyleBt.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        ConfigureBackgroundStyleDialog dlg = new ConfigureBackgroundStyleDialog(mBackgroundStyleCB,
            (TableBackgroundStyle) mBackgroundStyleCB.getSelectedItem());
        dlg.show();
      }
    });

    mSettingsPn.add(mConfigBackgroundStyleBt, cc.xy(6, currentRow));
       
    // Foreground color
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("5dlu"));
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("5dlu"));

    mForegroundColorLb = new ColorLabel(Settings.propProgramPanelForegroundColor.getColor());
    mForegroundColorLb.setStandardColor(Settings.propProgramPanelForegroundColor.getDefaultColor());
    ColorButton programPanelForegroundColorChangeBtn = new ColorButton(mForegroundColorLb);

    mSettingsPn.add(DefaultComponentFactory.getInstance().createSeparator(
        mLocalizer.msg("foreground", "Foreground")), cc.xyw(1,
        (currentRow += 2), 8));
   
    mSettingsPn.add(new JLabel(mLocalizer.msg("fontColor", "Font color")), cc
        .xy(2,
        (currentRow += 2)));
    mSettingsPn.add(mForegroundColorLb, cc.xy(4, currentRow));
    mSettingsPn.add(programPanelForegroundColorChangeBtn, cc.xy(6, currentRow));
   
    // Miscellaneous *********************************************
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("5dlu"));
    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("3dlu"));
    layout.appendRow(RowSpec.decode("pref"));

    mSettingsPn.add(DefaultComponentFactory.getInstance().createSeparator(
        mLocalizer.msg("mouse", "Mouse")), cc.xyw(1,
        (currentRow += 2), 8));

    mMouseOverCb = new JCheckBox(mLocalizer.msg("MouseOver", "Mouse-Over-Effect"));
    mMouseOverCb.setSelected(Settings.propProgramTableMouseOver.getBoolean());
    mSettingsPn.add(mMouseOverCb, cc.xy(2, (currentRow += 2)));
   
    mMouseOverColorLb = new ColorLabel(Settings.propProgramTableMouseOverColor.getColor());
    mMouseOverColorLb.setStandardColor(Settings.propProgramTableMouseOverColor.getDefaultColor());
    final ColorButton mouseOverColorChangeBtn = new ColorButton(mMouseOverColorLb);
    mMouseOverCb.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        boolean enabled = mMouseOverCb.isSelected();
        mMouseOverColorLb.setEnabled(enabled);
        mouseOverColorChangeBtn.setEnabled(enabled);
      }
    });
    mMouseOverCb.getActionListeners()[0].actionPerformed(null);

    mSettingsPn.add(mMouseOverColorLb, cc.xy(4, currentRow));
    mSettingsPn.add(mouseOverColorChangeBtn, cc.xy(6, currentRow));
   
    // auto scrolling
    mAutoScrollCb = new JCheckBox(mLocalizer.msg("mouseAutoScroll",
        "Throw'n scroll"));
    mAutoScrollCb.setSelected(Settings.propProgramTableMouseAutoScroll
        .getBoolean());
    mSettingsPn.add(mAutoScrollCb, cc.xyw(2, (currentRow += 2), 6));

View Full Code Here


          }
          controller.addPropertyChangeListener(FurnitureController.Property.HEIGHT, heightChangeListener);
        }
      });
   
    this.keepProportionsCheckBox = new JCheckBox(SwingTools.getLocalizedLabelText(preferences,
        FurniturePanel.class, "keepProportionsCheckBox.text"), controller.isProportional());
    this.keepProportionsCheckBox.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent ev) {
          controller.setProportional(keepProportionsCheckBox.isSelected());
        }
View Full Code Here

              getDontShowDialog("weka.gui.beans.Classifier.AutoWrapInInputMappedClassifier")) {
           
            java.awt.GraphicsEnvironment ge =
              java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
            if (!ge.isHeadless()) {
              JCheckBox dontShow = new JCheckBox("Do not show this message again");
              Object[] stuff = new Object[2];
              stuff[0] = "Data used to train model and test set are not compatible.\n" +
              "Would you like to automatically wrap the classifier in\n" +
              "an \"InputMappedClassifier\" before proceeding?.\n";
              stuff[1] = dontShow;

              int result = JOptionPane.showConfirmDialog(this, stuff,
                  "KnowledgeFlow:Classifier", JOptionPane.YES_OPTION);

              if (result == JOptionPane.YES_OPTION) {
                wrapClassifier = true;
              }

              if (dontShow.isSelected()) {
                String response = (wrapClassifier) ? "yes" : "no";
                try {
                  Utils.
                  setDontShowDialogResponse("weka.gui.explorer.ClassifierPanel.AutoWrapInInputMappedClassifier",
                      response);
View Full Code Here

    maxAgeField = SwingHelper.createInputField(5);
    dialogPanel.add("Maximum age in days (leave empty to disable)",
        maxAgeField);

    cookiesEnabled = new JCheckBox();
    dialogPanel.add("Enable cookies",cookiesEnabled);

    allowWholeHost = new JCheckBox();
    dialogPanel.add("Allow all URLs on start host",allowWholeHost);

    allowWholeDomain = new JCheckBox();
    dialogPanel.add("Allow all URLs in the same domain",allowWholeDomain);

    flexibleHostCheck = new JCheckBox();
    dialogPanel.add("Do flexible host checking",flexibleHostCheck);

    ignoreRobotsTxt = new JCheckBox();
    dialogPanel.add("Ignore robots.txt",ignoreRobotsTxt);

    localizeLinks = new JCheckBox();
    dialogPanel.add("Localize links",localizeLinks);

    storeCGI = new JCheckBox();
    dialogPanel.add("Save dynamic pages",storeCGI);

    allowCaching = new JCheckBox();
    dialogPanel.add("Don't retrieve pages that are already on disk "
        +"(resume download)",
        allowCaching);

    /** End of input fields */
 
View Full Code Here

    btn.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
        close();
      }
    });
    mDisable = new JCheckBox(mLocalizer.msg("dialog.dontShowAnymore","Don't show anymore"));
    result.add(btn, BorderLayout.EAST);
    result.add(mDisable,BorderLayout.WEST);
    return result;
  }
View Full Code Here

    mOldTitleFont = settings.getTitleFontName();
    mOldBodyFont = settings.getBodyFontName();
    mOldTitleStyle = settings.getTitleFontStyle();
    mOldBodyStyle = settings.getBodyFontStyle();

    mAntiAliasing = new JCheckBox(ProgramInfo.mLocalizer
        .msg("antialiasing", "Antialiasing"));
    mAntiAliasing.setSelected(mOldAntiAliasingSelected);

    mUserFont = new JCheckBox(ProgramInfo.mLocalizer.msg("userfont", "Use user fonts"));
    mUserFont.setSelected(mOldUserFontSelected);

    mTitleFont = new FontChooserPanel(null, new Font(mOldTitleFont, mOldTitleStyle, mOldTitleFontSize), true);
    mTitleFont.setBorder(BorderFactory.createEmptyBorder());
//    mTitleFont.setMaximumSize(mTitleFont.getPreferredSize());
    mTitleFont.setAlignmentX(Component.LEFT_ALIGNMENT);

    mBodyFont = new FontChooserPanel(null, new Font(mOldBodyFont, mOldBodyStyle, mOldBodyFontSize), true);
    mBodyFont.setBorder(BorderFactory.createEmptyBorder());
//    mBodyFont.setMaximumSize(mBodyFont.getPreferredSize());
    mBodyFont.setAlignmentX(Component.LEFT_ALIGNMENT);

    mTitleFont.setEnabled(mUserFont.isSelected());
    mBodyFont.setEnabled(mUserFont.isSelected());

    mOldLook = settings.getLook();

    String[] lf = { "Aqua", "Metal", "Motif", "Windows XP", "Windows Classic" };

    mLook = new JComboBox(lf);

    String look = mOldLook.length() > 0 ? mOldLook : LookAndFeelAddons.getBestMatchAddonClassName();

    for(int i = 0; i < mLf.length; i++) {
      if(look.toLowerCase().indexOf(mLf[i].toLowerCase()) != -1) {
        mLook.setSelectedIndex(i);
        break;
      }
    }

    mOldShowFunctions = settings.getShowFunctions();

    mShowFunctions = new JCheckBox(ProgramInfo.mLocalizer.msg("showFunctions",
        "Show Functions"), settings.getShowFunctions());
    mShowTextSearchButton = new JCheckBox(ProgramInfo.mLocalizer.msg(
        "showTextSearchButton", "Show \"Search in program\""), ProgramInfo
        .getInstance().getSettings().getShowSearchButton());

    mShowTextSearchButton.setEnabled(mShowFunctions.isSelected());

    mShowFunctions.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        mShowTextSearchButton.setEnabled(mShowFunctions.isSelected());
      }
    });

    mHighlight = new JCheckBox(ProgramInfoDialog.mLocalizer.msg("highlight", "Highlight favorite matches"), settings.getHighlightFavorite());
    mHighlight.addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {
        mHighlightColorLb.setEnabled(mHighlight.isSelected());
        mHighlightButton.setEnabled(mHighlight.isSelected());
      }
    });

    CellConstraints cc = new CellConstraints();
    EnhancedPanelBuilder formatPanel = new EnhancedPanelBuilder(new FormLayout("5dlu,10dlu,pref,pref,5dlu,default:grow,pref,5dlu"));
    formatPanel.setDefaultDialogBorder();
    formatPanel.addParagraph(ProgramInfo.mLocalizer.msg("font","Font settings"));
    formatPanel.addRow();
    formatPanel.add(mAntiAliasing, cc.xyw(2,formatPanel.getRowCount(), formatPanel.getColumnCount() - 2));
    formatPanel.addRow();
    formatPanel.add(mUserFont, cc.xyw(2,formatPanel.getRowCount(),formatPanel.getColumnCount() - 2));
    formatPanel.addRow();
    final JLabel titleLabel = new JLabel(ProgramInfo.mLocalizer.msg("title", "Title font"));
    formatPanel.add(titleLabel, cc.xy(3, formatPanel.getRowCount()));
    formatPanel.add(mTitleFont, cc.xyw(6,formatPanel.getRowCount(),2));
    formatPanel.addRow();
    final JLabel bodyLabel = new JLabel(ProgramInfo.mLocalizer.msg("body", "Description font"));
    formatPanel.add(bodyLabel, cc.xy(3,formatPanel.getRowCount()));
    formatPanel.add(mBodyFont, cc.xyw(6,formatPanel.getRowCount(),2));

    mUserFont.addChangeListener(new ChangeListener() {
      public void stateChanged(ChangeEvent e) {
        mTitleFont.setEnabled(mUserFont.isSelected());
        mBodyFont.setEnabled(mUserFont.isSelected());
        titleLabel.setEnabled(mUserFont.isSelected());
        bodyLabel.setEnabled(mUserFont.isSelected());
      }
    });

    mTitleFont.setEnabled(mUserFont.isSelected());
    mBodyFont.setEnabled(mUserFont.isSelected());
    titleLabel.setEnabled(mUserFont.isSelected());
    bodyLabel.setEnabled(mUserFont.isSelected());

    formatPanel.addParagraph(ProgramInfo.mLocalizer.msg("design","Design"));
    formatPanel.addRow();
    formatPanel.add(mLook, cc.xyw(2,formatPanel.getRowCount(),2));

    formatPanel.addParagraph(ProgramInfoDialog.mLocalizer.msg("functions","Functions"));
    formatPanel.addRow();
    formatPanel.add(mShowFunctions, cc.xyw(2,formatPanel.getRowCount(),formatPanel.getColumnCount() - 2));
    formatPanel.addRow();
    formatPanel.add(mShowTextSearchButton, cc.xyw(3,formatPanel.getRowCount(),formatPanel.getColumnCount() - 3));

    formatPanel.addParagraph(ProgramInfo.mLocalizer.msg("favorites","Favorites"));
    formatPanel.addRow();
    formatPanel.add(mHighlight, cc.xyw(2,formatPanel.getRowCount(),5));
    JPanel panel = new JPanel(new FlowLayout());
    mHighlightColorLb = new ColorLabel(settings.getHighlightColor());
    panel.add(mHighlightColorLb);
    mHighlightColorLb.setStandardColor(settings.getHighlightColor());
    mHighlightButton = new ColorButton(mHighlightColorLb);
    panel.add(mHighlightButton);
    mHighlight.getActionListeners()[0].actionPerformed(null);
    formatPanel.add(panel, cc.xy(7,formatPanel.getRowCount()));

    mOldOrder = settings.getFieldOrder();
    mOldSetupState = ProgramInfo.getInstance().getSettings().getSetupwasdone();

    mList = new OrderChooser(mOldOrder, ProgramTextCreator.getDefaultOrder(),
        true);

    JButton previewBtn = new JButton(ProgramInfo.mLocalizer.msg("preview", "Preview"));
    previewBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        saveSettings();
        ProgramInfo.getInstance().showProgramInformation(
            Plugin.getPluginManager().getExampleProgram(), false);
        restoreSettings();
      }
    });

    JButton defaultBtn = new JButton(ProgramInfo.mLocalizer.msg("default", "Default"));
    defaultBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        resetSettings();
      }
    });

    EnhancedPanelBuilder orderPanel = new EnhancedPanelBuilder("default:grow");
    orderPanel.setDefaultDialogBorder();

    orderPanel.addRow("fill:default:grow");
    orderPanel.add(mList, cc.xy(1, orderPanel.getRowCount()));


    EnhancedPanelBuilder picturePanel = new EnhancedPanelBuilder("default:grow");
    picturePanel.setDefaultDialogBorder();

    picturePanel.addRow("default");
    picturePanel.add(mPictureSettings = new PluginsPictureSettingsPanel(ProgramInfo.getInstance().getPictureSettings(),false), cc.xy(1, picturePanel.getRowCount()));

    PanelBuilder pb = new PanelBuilder(new FormLayout("default,2dlu,default,5dlu,default","default"));

    pb.add(mZoomEnabled = new JCheckBox(ProgramInfo.mLocalizer.msg(
        "scaleImage", "Scale picture:"), ProgramInfo.getInstance()
        .getSettings().getZoomEnabled()), cc.xy(1, 1));
    pb.add(mZoomValue = new JSpinner(new SpinnerNumberModel(ProgramInfo
        .getInstance().getSettings().getZoomValue(), 50, 300, 1)), cc.xy(3, 1));
    final JLabel label = pb.addLabel("%",cc.xy(5,1));

    mZoomEnabled.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        mZoomValue.setEnabled(mZoomEnabled.isSelected());
        label.setEnabled(mZoomEnabled.isSelected());
      }
    });

    mZoomValue.setEnabled(mZoomEnabled.isSelected());
    label.setEnabled(mZoomEnabled.isSelected());

    picturePanel.addRow("5dlu");
    picturePanel.addRow("default");
    picturePanel.add(pb.getPanel(), cc.xy(1, picturePanel.getRowCount()));



    PluginAccess webPlugin = PluginManagerImpl.getInstance().getActivatedPluginForId("java.webplugin.WebPlugin");

    mAvailableTargetGroup = new ButtonGroup();

    final ArrayList<InternalRadioButton<?>> availableDefaultTargets = new ArrayList<InternalRadioButton<?>>();

    availableDefaultTargets.add(new InternalRadioButton<String>(ProgramInfoDialog.mLocalizer.msg("searchTvBrowser","Search in TV-Browser")));
    mAvailableTargetGroup.add(availableDefaultTargets.get(0));
    availableDefaultTargets.add(new InternalRadioButton<String>(ProgramInfoDialog.mLocalizer.msg("searchWikipedia","Search in Wikipedia")));
    mAvailableTargetGroup.add(availableDefaultTargets.get(1));

    final String currentValue = settings.getActorSearch();

    int selectedIndex = -1;

    if(webPlugin != null && webPlugin.canReceiveProgramsWithTarget()) {
      ProgramReceiveTarget[] targets = webPlugin.getProgramReceiveTargets();

      if(targets != null) {
        for(ProgramReceiveTarget target : targets) {
          availableDefaultTargets.add(new InternalRadioButton<ProgramReceiveTarget>(target));
          mAvailableTargetGroup.add(availableDefaultTargets.get(availableDefaultTargets.size()-1));

          if(currentValue.equals(target.getReceiveIfId() + "#_#_#" + target.getTargetId())) {
            selectedIndex = availableDefaultTargets.size()-1;
          }
        }
      }
    }

    if(selectedIndex == -1) {
      if(currentValue.equals("internalSearch")) {
        selectedIndex = 0;
      }
      else {
        selectedIndex = 1;
      }
    }

    availableDefaultTargets.get(selectedIndex).setSelected(true);

    ScrollableJPanel buttonPanel = new ScrollableJPanel();
    buttonPanel.setLayout(new BoxLayout(buttonPanel,BoxLayout.Y_AXIS));
    buttonPanel.setOpaque(false);

    for(InternalRadioButton<?> button : availableDefaultTargets) {
      buttonPanel.add(button);
    }

    final JScrollPane scrollPane = new JScrollPane(buttonPanel);
    scrollPane.setBackground(UIManager.getDefaults().getColor("List.background"));
    scrollPane.getViewport().setBackground(UIManager.getDefaults().getColor("List.background"));
    PanelBuilder actorPanel = new PanelBuilder(
        new FormLayout(
        "default:grow", "pref,3dlu,default,1dlu,fill:default:grow"));
    actorPanel.setDefaultDialogBorder();

    mPersonSearchCB = new JCheckBox(ProgramInfo.mLocalizer.msg("enableSearch",
        "Show person names as links to person search"));
    actorPanel.add(mPersonSearchCB, cc.xy(1, 1));
    final JLabel searchLabel = new JLabel(ProgramInfo.mLocalizer.msg(
        "defaultActorSearchMethod", "Default search method:"));
    actorPanel.add(searchLabel, cc.xy(1, 3));
View Full Code Here

    PanelBuilder panelBuilder = new PanelBuilder(new FormLayout("pref",
                    "pref, 5dlu, pref, 5dlu, pref, 5dlu, pref"));

    panelBuilder.setBorder(Borders.DLU4_BORDER);
    panelBuilder.add(new JLabel(mLocalizer.msg("mainQuestion","Wollen Sie automatisch auf diese Sendung hingewiesen werden?")), cc.xy(1,1));
    panelBuilder.add(mReminderCb = new JCheckBox(mLocalizer.msg("option.remind","Automatisch an diese Sendung erinnern.")), cc.xy(1,3));
    panelBuilder.add(mCheckOnUpdateCb = new JCheckBox(mLocalizer.msg("option.checkAfterUpdate","Sofort alarmieren, wenn die Sendung nach einer Aktualisierung gefunden wird.")), cc.xy(1,5));

    mReminderCb.setSelected(FavoritesPlugin.getInstance().isAutoSelectingReminder());
    JPanel result = panelBuilder.getPanel();
    result.addFocusListener(new FocusAdapter() {
View Full Code Here

    mTimePeriodChooser = new TimePeriodChooser(from, to, TimePeriodChooser.ALIGN_RIGHT);

    mChangeChannelsBtn = new JButton(mLocalizer.msg("change", "Change"));
    mChannelArr = mFavorite.getLimitationConfiguration().getChannels();

    mLimitChannelCb = new JCheckBox(mLocalizer.msg("channels", "Channels:") + " ");
    mLimitTimeCb = new JCheckBox(mLocalizer.msg("time", "Time:") + " ");

    mChannelLabel = new JLabel(getChannelString(mChannelArr));

    mLimitDaysCB = new JComboBox(new Object[] {
        LimitationConfiguration.DAYLIMIT_DAILY,
View Full Code Here

    return panelBuilder.getPanel();
  }

  private JPanel createReminderPanel() {
    JPanel panel = new JPanel(new GridLayout(-1, 1));
    panel.add(mUseReminderCb = new JCheckBox(mLocalizer.msg("reminderWindow", "Reminder window")));

    String[] s = mFavorite.getReminderConfiguration().getReminderServices();
    for (String element : s) {
      if (ReminderConfiguration.REMINDER_DEFAULT.equals(element)) {
        mUseReminderCb.setSelected(true);
View Full Code Here

          }
        }
      }
    });

    panel.add(mReminderAfterDownloadCb = new JCheckBox(mLocalizer.msg("autoAlert",
        "Alert me, whenever a matching program is discovered")), cc.xyw(1, 1, 2));

    panel.add(mPassProgramsCheckBox = new JCheckBox(mLocalizer.msg("passProgramsTo", "Pass programs to") +" "), cc.xy(1, 3));
    panel.add(mPassProgramsLb, cc.xy(2, 3));
    panel.add(mChangePassProgramsBtn, cc.xy(3, 3));
    mReminderAfterDownloadCb.setSelected(mFavorite.isRemindAfterDownload());

    mPassProgramsCheckBox.setSelected(mPassProgramPlugins != null && mPassProgramPlugins.length > 0 && !mPassProgramsLb.getText().equals(mLocalizer.msg("dontpass", "don't pass programs")));
View Full Code Here

TOP

Related Classes of javax.swing.JCheckBox

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.