Package javax.swing

Examples of javax.swing.SpinnerNumberModel


    // 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));

View Full Code Here


    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) {
View Full Code Here

    bg.add(mShowInSubMenu);
    bg.add(mShowInTray);
   
    int maxSizeValue = Settings.propTrayImportantProgramsInSubMenu.getBoolean() ? 30 : 15;
   
    mSize = new JSpinner(new SpinnerNumberModel(Settings.propTrayImportantProgramsSize.getInt(), 1, maxSizeValue, 1));
   
    mShowIconAndName = new JRadioButton(mLocalizer.msg("showIconName","Show channel icon and channel name"),Settings.propTrayImportantProgramsContainsName.getBoolean() && Settings.propTrayImportantProgramsContainsIcon.getBoolean());
    mShowName = new JRadioButton(mLocalizer.msg("showName","Show channel name"),Settings.propTrayImportantProgramsContainsName.getBoolean() && !Settings.propTrayImportantProgramsContainsIcon.getBoolean());
    mShowIcon = new JRadioButton(mLocalizer.msg("showIcon","Show channel icon"),!Settings.propTrayImportantProgramsContainsName.getBoolean() && Settings.propTrayImportantProgramsContainsIcon.getBoolean());
   
    ButtonGroup bg1 = new ButtonGroup();
    bg1.add(mShowIconAndName);
    bg1.add(mShowIcon);
    bg1.add(mShowName);
   
    mShowDate = new JCheckBox(mLocalizer.msg("showDate","Show date"),Settings.propTrayImportantProgramsContainsDate.getBoolean());
    mShowTime = new JCheckBox(mLocalizer.msg("showTime","Show start time"),Settings.propTrayImportantProgramsContainsTime.getBoolean());
    mShowToolTip = new JCheckBox(mLocalizer.msg("showToolTip","Show additional information of the program in a tool tip"),Settings.propTrayImportantProgramsContainsToolTip.getBoolean());
    mShowToolTip.setToolTipText(mLocalizer.msg("toolTipTip","Tool tips are small helper to something, like this one."));
       
    mHelpLabel = UiUtilities.createHtmlHelpTextArea(mLocalizer.msg("help","The Tray is deactivated. To activate these settings activate the option <b>Tray activated</b> in the <a href=\"#link\">Tray Base settings</a>."), new HyperlinkListener() {
      public void hyperlinkUpdate(HyperlinkEvent e) {
        if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
          SettingsDialog.getInstance().showSettingsTab(SettingsItem.TRAY);
        }
      }
    });
   
    JPanel priority = new JPanel(new FormLayout("pref,5dlu,pref","1dlu,pref"));
   
    Localizer localizer = MarkingsSettingsTab.mLocalizer;
   
    String[] colors = {localizer.msg("color.minPriority","1. Color (minimum priority)"),localizer.msg("color.lowerMediumPriority","2. Color (lower medium priority)"),localizer.msg("color.mediumPriority","3. Color (Medium priority)"),localizer.msg("color.higherMediumPriority","4. Color (higher medium priority)"),localizer.msg("color.maxPriority","5. Color (maximum priority)")};
   
    mPriorityText = new JLabel(mLocalizer.msg("importantMarkPriority","Mark priority higher or the same like:"));
   
    mPriority = new JComboBox(colors);
    mPriority.setSelectedIndex(Settings.propTrayImportantProgramsPriority.getInt());
    mPriority.setRenderer(new MarkPriorityComboBoxRenderer());

    priority.add(mPriorityText, cc.xy(1,2));
    priority.add(mPriority, cc.xy(3,2));
   
    JPanel c = (JPanel) builder.addSeparator(mLocalizer.msg("important","Important programs"), cc.xyw(1,1,8));
    builder.add(mIsEnabled, cc.xyw(2,3,6));
    builder.add(mShowInTray, cc.xyw(3,4,5));
    builder.add(mShowInSubMenu, cc.xyw(3,5,5));
    mSizeLabel = builder.addLabel(mLocalizer.msg("importantSize","Number of shown programs:"), cc.xy(3,6));
    builder.add(mSize, cc.xy(5,6));
    mSizeInfo = builder.addLabel(mLocalizer.msg("sizeInfo","(maximum: {0})",maxSizeValue), cc.xy(7,6));
    builder.add(priority, cc.xyw(3,7,5));
   
    JPanel c1 = (JPanel) builder.addSeparator(mLocalizer.msg("iconNameSeparator","Channel icons/channel name"), cc.xyw(1,9,8));
    builder.add(mShowIconAndName, cc.xyw(2,11,6));
    builder.add(mShowIcon, cc.xyw(2,12,6));
    builder.add(mShowName, cc.xyw(2,13,6));
   
    JPanel c2 = (JPanel) builder.addSeparator(mLocalizer.msg("settings","Settings"), cc.xyw(1,15,8));
    builder.add(mShowDate, cc.xyw(2,17,6));
    builder.add(mShowTime, cc.xyw(2,18,6));
    builder.add(mShowToolTip, cc.xyw(2,19,6));
    builder.add(mHelpLabel, cc.xyw(1,21,8));
   
    mSeparator1 = (JLabel)c.getComponent(0);
    mIconSeparator = (JLabel)c1.getComponent(0);
    mSeparator2 = (JLabel)c2.getComponent(0);
   
    setEnabled(true);
   
    mShowInSubMenu.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        mSize.setModel(new SpinnerNumberModel(((Integer)mSize.getValue()).intValue(), 1, 30, 1));
        mSizeInfo.setText(mLocalizer.msg("sizeInfo","(maximum: {0})",30));
      }
    });

    mShowInTray.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        int value = ((Integer)mSize.getValue()).intValue();
        mSize.setModel(new SpinnerNumberModel(value > 15 ? 15 : value, 1, 15, 1));
        mSizeInfo.setText(mLocalizer.msg("sizeInfo","(maximum: {0})",15));
      }
    });
   
    mIsEnabled.addActionListener(new ActionListener() {
View Full Code Here

  }

  public JPanel getSettingsPanel() {
    JPanel content = new JPanel(new BorderLayout());

    mAgeSpinner = new JSpinner(new SpinnerNumberModel(16, 6, 21, 1));
    mAgeSpinner.setValue(mRequiredAge);
    content.add(UiUtilities.createHelpTextArea(mLocalizer
        .msg("description", "")), BorderLayout.NORTH);
    content.add(mAgeSpinner, BorderLayout.SOUTH);
View Full Code Here

    mContent = new JPanel(new TabLayout(1));

    JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEADING));
    mContent.add(p1);
    p1.add(new JLabel(mLocalizer.msg("timeBlock.blockSize", "Block size")));
    mTimeBlockSizeSp = new JSpinner(new SpinnerNumberModel(Settings.propTimeBlockSize.getInt(), 1, 23, 1));

    p1.add(mTimeBlockSizeSp);
    p1.add(new JLabel(mLocalizer.msg("timeBlock.hours", "hours")));

    p1 = new JPanel(new TabLayout(3));
View Full Code Here

    final JPanel panel = new JPanel();
   
    mMin = Math.min(1000,Math.max(0,mMin));
    mMax = Math.min(1000,Math.max(1,mMax));

    mMinSpinner = new JSpinner(new SpinnerNumberModel(mMin, 0, 1000, 1));
    mMaxSpinner = new JSpinner(new SpinnerNumberModel(mMax, 1, 1000, 1));
    mMinCheck = new JCheckBox(mLocalizer.msg("minimum", "minimum in Minutes")
        + ":", mUseMin);
    mMaxCheck = new JCheckBox(mLocalizer.msg("maximum", "maximum in Minutes")
        + ":", mUseMax);
View Full Code Here

    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("3dlu"));

    content.add(new JLabel(mLocalizer.msg("from.1", "From today plus")), cc.xy(
        1, currentRow += 2));
    mFromSpinner = new JSpinner(new SpinnerNumberModel(0, 0, 28, 1));
    mFromSpinner.setValue(mStartDays);
    content.add(mFromSpinner, cc.xy(3, currentRow));
    content.add(new JLabel(mLocalizer.msg("from.2", "days")), cc.xy(5,
        currentRow));

    layout.appendRow(RowSpec.decode("pref"));

    content.add(new JLabel(mLocalizer.msg("to.1", "Until today plus")), cc.xy(
        1, currentRow += 2));
    mToSpinner = new JSpinner(new SpinnerNumberModel(7, 0, 28, 1));
    mToSpinner.setValue(mEndDays);
    content.add(mToSpinner, cc.xy(3, currentRow));
    content.add(new JLabel(mLocalizer.msg("to.2", "days")), cc
        .xy(5, currentRow));
View Full Code Here

    mAskBeforeDownloadRadio.setSelected(Settings.propAskForAutoDownload.getBoolean());
    mAskTimeRadio.setSelected(!Settings.propAskForAutoDownload.getBoolean());

    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) {
View Full Code Here

     * Creates one Spinner
     *
     * @return Spinner
     */
    private JSpinner createSpinner() {
        SpinnerModel model = new SpinnerNumberModel(100, 0, 255, 1);

        JSpinner ret = new JSpinner(model);
        ret.setMinimumSize(new Dimension(50, 10));
        ret.setPreferredSize(new Dimension(50, 10));
        return ret;
View Full Code Here

   * .JTable, java.lang.Object, boolean, int, int)
   */
  @Override
  public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    timeSpinner = new JSpinner();
    SpinnerNumberModel spinnerModel = new SpinnerNumberModel();
    spinnerModel.setMinimum(0);
    spinnerModel.setMaximum(90);
    timeSpinner.setModel(spinnerModel);
    timeSpinner.setValue(value);

    return timeSpinner;
  }
View Full Code Here

TOP

Related Classes of javax.swing.SpinnerNumberModel

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.