Package com.jgoodies.forms.layout

Examples of com.jgoodies.forms.layout.CellConstraints


    } else if (Settings.propBlockedPluginArray.isBlocked(mPlugin)) {
      mPluginPanel.add(createEmptyPanel(mLocalizer.msg("blocked", "Blocked"), mLocalizer.msg("blocked.text", "This plugin is blocked and cannot be activated.")), BorderLayout.NORTH);
    } else {
      // The plugin is not activated -> Tell it the user
      EnhancedPanelBuilder panelActivate = new EnhancedPanelBuilder(FormFactory.RELATED_GAP_COLSPEC.encode() + "," + FormFactory.PREF_COLSPEC.encode() + "," + FormFactory.RELATED_GAP_COLSPEC.encode() + "," + FormFactory.PREF_COLSPEC.encode() + ",default:grow");
      CellConstraints cc = new CellConstraints();

      panelActivate.addParagraph(mLocalizer.msg("activation", "Activation"));

      panelActivate.addRow();
      panelActivate.add(new JLabel(mLocalizer.msg("notactivated", "This Plugin is currently not activated.")), cc.xy(2, panelActivate.getRow()));

      final JButton btnActivate = new JButton(mLocalizer.msg("activate", "Activate"));
      btnActivate.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
          try {
            btnActivate.setEnabled(false);
            PluginProxyManager.getInstance().activatePlugin(mPlugin);
            SettingsDialog settingsDialog = SettingsDialog.getInstance();
            settingsDialog.invalidateTree();
            settingsDialog.createPluginTreeItems();
            settingsDialog.showSettingsTab(mPlugin.getId());
            MainFrame.getInstance().getToolbar().updatePluginButtons();
            // Update the settings
            String[] deactivatedPlugins = PluginProxyManager.getInstance().getDeactivatedPluginIds();
            Settings.propDeactivatedPlugins.setStringArray(deactivatedPlugins);
          } catch (TvBrowserException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
          }
        }});

      panelActivate.add(btnActivate, cc.xy(4, panelActivate.getRow()));
      mPluginPanel.add(panelActivate.getPanel(), BorderLayout.NORTH);
    }

    mPluginWasActivatedLastTime = mPlugin.isActivated();
View Full Code Here


      lowBnd = 0;
      upBnd = 24 * 60 - 1;
    }
    mTimePeriodChooser = new TimePeriodChooser(lowBnd, upBnd, TimePeriodChooser.ALIGN_RIGHT);

    CellConstraints cc = new CellConstraints();
    PanelBuilder panelBuilder = new PanelBuilder(new FormLayout("pref, default:grow, pref", "pref, 5dlu, pref, 5dlu, pref, 5dlu, pref, 5dlu, pref"));

    panelBuilder.setBorder(Borders.DLU4_BORDER);
    panelBuilder.add(new JLabel(mLocalizer.msg("mainQuestion", "Are there any limitations?")), cc.xy(1, 1));
    panelBuilder.add(mChannelCb = new JCheckBox(mLocalizer.msg("limitByChannel",
        "Certain channels only:")), cc.xy(1, 3));
    panelBuilder.add(mDayOfWeekCb = new JCheckBox(mLocalizer.msg("limitByDayOfWeek","Certain day of week only:")), cc.xy(1,5));
    panelBuilder.add(mTimeCb = new JCheckBox(mLocalizer.msg("limitByTime",
        "Certain start times only:")), cc.xy(1, 7));

    panelBuilder.add(mChooseChannelsBtn = new JButton(mLocalizer.msg("selectChannels","Select channels")), cc.xy(3,3));
    panelBuilder.add(mDayOfWeekCombo, cc.xy(3,5));
    panelBuilder.add(mTimePeriodChooser, cc.xy(3,7));

    updateControls();

    mChannelCb.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
View Full Code Here

      setSize(getWidth(), d.height);
    }
  }

  private JPanel createTitleChangePanel() {
    CellConstraints cc = new CellConstraints();

    if(mFavorite.getName().length() < 1) {
      mName = new JLabel(mLocalizer.msg("defaultName","Is going to be created automatically"));
      mName.setEnabled(false);
    } else {
      mName = new JLabel(mFavorite.getName());
    }

    JPanel panel = new JPanel(new FormLayout("pref,3dlu,30dlu:grow,3dlu,pref","pref"));
    panel.add(new JLabel(mLocalizer.msg("name","Name:")), cc.xy(1,1));
    panel.add(mName, cc.xy(3,1));

    JButton changeTitle = new JButton(mLocalizer.msg("changeName","Change name"));
    changeTitle.setFocusable(false);

    changeTitle.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        setFavoriteName();
      }
    });

    panel.add(changeTitle, cc.xy(5,1));

    return panel;
  }
View Full Code Here

    mCaller = caller;
  }

  public JPanel createContent(WizardHandler handler) {
    JPanel pn = new JPanel(new FormLayout("fill:default:grow", "fill:pref:grow"));
    CellConstraints cc = new CellConstraints();
    pn.add(new JLabel(mLocalizer.msg("msg", "Die Lieblingssendung ist nun eingerichtet!"), SwingConstants.CENTER), cc.xy(1,1));
    handler.allowCancel(false);
    final WizardDlg dialog=handler.getDialog();
    pn.addFocusListener(new FocusAdapter() {

        public void focusGained(FocusEvent e) {
View Full Code Here

          mChannelLabel.setText(getChannelString(mChannelArr));
        }
      }
    });

    CellConstraints cc = new CellConstraints();

    JPanel limitPn = new JPanel(new BorderLayout());
    JPanel pn = new JPanel(new FormLayout("pref, 3dlu, pref", "pref"));
    pn.add(mTimePeriodChooser, cc.xy(1,1));
    pn.add(mLimitDaysCB, cc.xy(3,1));
    limitPn.add(pn, BorderLayout.EAST);

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

    panelBuilder.add(mLimitChannelCb, cc.xy(1, 1));
    panelBuilder.add(mChannelLabel, cc.xy(2, 1));
    panelBuilder.add(mChangeChannelsBtn, cc.xy(3, 1));
    panelBuilder.add(mLimitTimeCb, cc.xy(1, 3));
    panelBuilder.add(limitPn, cc.xyw(2, 3, 2));

    return panelBuilder.getPanel();
  }
View Full Code Here

  }

  private JPanel createExtrasPanel() {

    JPanel panel = new JPanel(new FormLayout("pref, pref:grow, pref", "pref,3dlu,pref"));
    CellConstraints cc = new CellConstraints();

    mPassProgramPlugins = mFavorite.getForwardPlugins();
    mPassProgramsLb = new JLabel(getForwardPluginsLabelString(mPassProgramPlugins));
    mChangePassProgramsBtn = new JButton(mLocalizer.msg("change", "Change"));
    mChangePassProgramsBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        PluginChooserDlg dlg = new PluginChooserDlg((Window)EditFavoriteDialog.this, mPassProgramPlugins, null, ReminderPluginProxy.getInstance(), FavoritesPlugin.getInstance().getClientPluginTargetIds());
        UiUtilities.centerAndShow(dlg);
        ProgramReceiveTarget[] pluginArr = dlg.getReceiveTargets();
        if (pluginArr != null) {
          mPassProgramPlugins = pluginArr;
          mPassProgramsLb.setText(getForwardPluginsLabelString(mPassProgramPlugins));
          if (pluginArr.length == 0) {
            mPassProgramsCheckBox.setSelected(false);
            updatePassProgramsPanel();
          }
        }
      }
    });

    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")));
    mPassProgramsCheckBox.setEnabled(FavoritesPlugin.getInstance().getClientPluginTargetIds().length == 0);
    mPassProgramsCheckBox.addActionListener(new ActionListener() {
View Full Code Here

      p = new JPanel(new BorderLayout());
      p.setBorder(BorderFactory.createTitledBorder(mLocalizer
          .msg("autoUpdateTitle", "Automatic update")));
     
      JPanel boxPanel = new JPanel(new FormLayout("10dlu,pref:grow","default,2dlu,default,default"));
      CellConstraints cc = new CellConstraints();
     
      mAutoUpdate = new JCheckBox(mLocalizer.msg("autoUpdateMessage", "Update data automatically"));
     
      mStartUpdate = new JRadioButton(mLocalizer.msg("onStartUp", "Only on TV-Browser startup"), false);
      mRecurrentUpdate = new JRadioButton(mLocalizer.msg("recurrent", "Recurrent"), true);
     
      mStartUpdate.setEnabled(false);
      mRecurrentUpdate.setEnabled(false);
     
      boxPanel.add(mAutoUpdate, cc.xyw(1,1,2));
      boxPanel.add(mStartUpdate, cc.xy(2,3));
      boxPanel.add(mRecurrentUpdate, cc.xy(2,4));
     
      p.add(boxPanel, BorderLayout.CENTER);
     
      ButtonGroup bg = new ButtonGroup();
     
View Full Code Here

  private JCheckBox mProgramItemWithMarkingsIsShowingBorder, mProgramPanelUsesExtraSpaceForMarkIcons;
  private JComboBox mDefaultColor;
  private JEditorPane mHelpLabel;
 
  public JPanel createSettingsPanel() {
    CellConstraints cc = new CellConstraints();
    PanelBuilder pb = new PanelBuilder(new FormLayout("5dlu,default:grow","pref,5dlu,pref,10dlu,pref,5dlu,pref,fill:10dlu:grow,default"));
    pb.setDefaultDialogBorder();
   
    JPanel defaultMarkings = new JPanel(new FormLayout("default, 5dlu, default",
    "default,2dlu,default,2dlu,default"));

    String[] colors = {mLocalizer.msg("color.noPriority","Don't highlight"),mLocalizer.msg("color.minPriority","1. Color (minimal priority)"),mLocalizer.msg("color.lowerMediumPriority","2. Color (lower medium priority)"),mLocalizer.msg("color.mediumPriority","3. Color (medium priority)"),mLocalizer.msg("color.higherMediumPriority","4. Color (higher medium priority)"),mLocalizer.msg("color.maxPriority","5. Color (maximum priority)")};

    defaultMarkings.add(mProgramPanelUsesExtraSpaceForMarkIcons = new JCheckBox(mLocalizer.msg("panel.extraSpace","Use additional space for the mark icons"), Settings.propProgramPanelUsesExtraSpaceForMarkIcons.getBoolean()), cc.xyw(1,1,3));
    defaultMarkings.add(mProgramItemWithMarkingsIsShowingBorder = new JCheckBox(mLocalizer.msg("color.showBorder","Show border for highlighted programs"), Settings.propProgramPanelWithMarkingsShowingBoder.getBoolean()), cc.xyw(1,3,3));
    defaultMarkings.add(new JLabel(mLocalizer.msg("color.showColor","Highlight with color (default color):")), cc.xy(1,5));
    defaultMarkings.add(mDefaultColor = new JComboBox(colors), cc.xy(3,5));
    mDefaultColor.setSelectedIndex(Settings.propProgramPanelUsedDefaultMarkPriority.getInt()+1);
   
    mDefaultColor.setRenderer(new MarkPriorityComboBoxRenderer());
   
    JPanel markings = new JPanel(new FormLayout("default, 5dlu, default, 5dlu, default",
        "default, 3dlu, default, 3dlu, default, 3dlu, default, 3dlu, default, 3dlu, default"));
       
    Color programItemMinMarkedColor = Settings.propProgramPanelMarkedMinPriorityColor.getColor();
    Color programItemMinDefaultMarkedColor = Settings.propProgramPanelMarkedMinPriorityColor.getDefaultColor();
   
    markings.add(new JLabel(colors[1]), cc.xy(1,1));
    markings.add(mProgramItemMinMarkedColorLb = new ColorLabel(programItemMinMarkedColor), cc.xy(3,1));
    mProgramItemMinMarkedColorLb.setStandardColor(programItemMinDefaultMarkedColor);
    markings.add(new ColorButton(mProgramItemMinMarkedColorLb), cc.xy(5,1));
   
    Color programItemLowerMediumMarkedColor = Settings.propProgramPanelMarkedLowerMediumPriorityColor.getColor();
    Color programItemDefaultLowerMediumMarkedColor = Settings.propProgramPanelMarkedLowerMediumPriorityColor.getDefaultColor();

    markings.add(new JLabel(colors[2]), cc.xy(1,3));
    markings.add(mProgramItemLowerMediumMarkedColorLb = new ColorLabel(programItemLowerMediumMarkedColor), cc.xy(3,3));
    mProgramItemLowerMediumMarkedColorLb.setStandardColor(programItemDefaultLowerMediumMarkedColor);
    markings.add(new ColorButton(mProgramItemLowerMediumMarkedColorLb), cc.xy(5,3));
   
    Color programItemMediumMarkedColor = Settings.propProgramPanelMarkedMediumPriorityColor.getColor();
    Color programItemMediumDefaultMarkedColor = Settings.propProgramPanelMarkedMediumPriorityColor.getDefaultColor();
   
    markings.add(new JLabel(colors[3]), cc.xy(1,5));
    markings.add(mProgramItemMediumMarkedColorLb = new ColorLabel(programItemMediumMarkedColor), cc.xy(3,5));
    mProgramItemMediumMarkedColorLb.setStandardColor(programItemMediumDefaultMarkedColor);
    markings.add(new ColorButton(mProgramItemMediumMarkedColorLb), cc.xy(5,5));

    Color programItemHigherMediumMarkedColor = Settings.propProgramPanelMarkedHigherMediumPriorityColor.getColor();
    Color programItemHigherMediumDefaultMarkedColor = Settings.propProgramPanelMarkedHigherMediumPriorityColor.getDefaultColor();
   
    markings.add(new JLabel(colors[4]), cc.xy(1,7));
    markings.add(mProgramItemHigherMediumMarkedColorLb = new ColorLabel(programItemHigherMediumMarkedColor), cc.xy(3,7));
    mProgramItemHigherMediumMarkedColorLb.setStandardColor(programItemHigherMediumDefaultMarkedColor);
    markings.add(new ColorButton(mProgramItemHigherMediumMarkedColorLb), cc.xy(5,7));
   
    Color programItemMaxMarkedColor = Settings.propProgramPanelMarkedMaxPriorityColor.getColor();
    Color programItemMaxDefaultMarkedColor = Settings.propProgramPanelMarkedMaxPriorityColor.getDefaultColor();
   
    markings.add(new JLabel(colors[5]), cc.xy(1,9));
    markings.add(mProgramItemMaxMarkedColorLb = new ColorLabel(programItemMaxMarkedColor), cc.xy(3,9));
    mProgramItemMaxMarkedColorLb.setStandardColor(programItemMaxDefaultMarkedColor);
    markings.add(new ColorButton(mProgramItemMaxMarkedColorLb), cc.xy(5,9));

   
    mHelpLabel = UiUtilities.createHtmlHelpTextArea(mLocalizer.msg("color.help","The priority that a plugin uses for a program is used to decide which color have to be used for the marking. A higher priority color replaces a lower priority color. The setting for the default color is only for plugins that do not care about the priority. But it works like for plugins that uses the priorities, so if you select the highest priority color there, all marking of plugin which do not care about the priority will replace lower marking colors."), new HyperlinkListener() {
      public void hyperlinkUpdate(HyperlinkEvent e) {
      }
    });
   
    pb.addSeparator(mLocalizer.msg("color.programMarked","Highlighting by plugins"), cc.xyw(1,1,2));
    pb.add(defaultMarkings, cc.xy(2,3));
    pb.addSeparator(mLocalizer.msg("color.programMarkedAdditional","Additional colors (replacing default color)"), cc.xyw(1,5,2));
    pb.add(markings, cc.xy(2,7));
    pb.add(mHelpLabel, cc.xy(2,9));
   
    return pb.getPanel();
  }
View Full Code Here

   */
  private JPanel createButtonPn(JButton btn1, JButton btn2) {
    JPanel result = new JPanel(new FormLayout("pref",
        "fill:pref:grow, pref, 3dlu, pref, fill:pref:grow"));

    CellConstraints cc = new CellConstraints();

    result.add(btn1, cc.xy(1, 2));
    result.add(btn2, cc.xy(1, 4));

    return result;
  }
View Full Code Here

      JButton btn4) {
    JPanel result = new JPanel(
        new FormLayout("pref",
            "fill:pref:grow, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, fill:pref:grow"));

    CellConstraints cc = new CellConstraints();

    result.add(btn1, cc.xy(1, 2));
    result.add(btn2, cc.xy(1, 4));
    result.add(btn3, cc.xy(1, 6));
    result.add(btn4, cc.xy(1, 8));

    return result;
  }
View Full Code Here

TOP

Related Classes of com.jgoodies.forms.layout.CellConstraints

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.