Package java.awt

Examples of java.awt.BorderLayout


  }


  public JPanel createSettingsPanel() {
    mContentPanel=new JPanel(new BorderLayout());
    mContentPanel.setBorder(Borders.DIALOG_BORDER);
    PluginInfoPanel pluginInfoPanel=new PluginInfoPanel(mPlugin.getInfo(), mSettingsTab != null);
    pluginInfoPanel.setDefaultBorder(true);
    mContentPanel.add(pluginInfoPanel,BorderLayout.NORTH);
View Full Code Here


    {
      // Nothing to do
      return;
    }
    if (mPluginPanel == null) {
      mPluginPanel = new JPanel(new BorderLayout());
    } else {
      mPluginPanel.removeAll();
    }
    if (mPlugin.isActivated()) {
      // active plugin with settings
View Full Code Here

  /**
   * Create the Statusbar
   */
  public StatusBar() {
    setOpaque(false);
    setLayout(new BorderLayout(2, 0));
    setBorder(BorderFactory.createEmptyBorder(2,0,0,0));
    setPreferredSize(new Dimension(0, 18));

    mInfoLabel = new JLabel();
    mInfoLabel.setBorder(BorderFactory.createEtchedBorder());
View Full Code Here

    String msg;

    mResult = CANCEL;

    JPanel contentPane = (JPanel) getContentPane();
    contentPane.setLayout(new BorderLayout());
    contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    this.setTitle(mLocalizer.msg("dlgTitle", "TV data update"));
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));

    mUpdateBtn = new JButton(mLocalizer.msg("updateNow", "Update now"));
    mUpdateBtn.addActionListener(this);
    buttonPanel.add(mUpdateBtn);
    getRootPane().setDefaultButton(mUpdateBtn);

    mCancelBtn = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    mCancelBtn.addActionListener(this);
    buttonPanel.add(mCancelBtn);

    contentPane.add(buttonPanel, BorderLayout.SOUTH);

    JPanel northPanel = new JPanel();
    northPanel.setLayout(new BoxLayout(northPanel, BoxLayout.Y_AXIS));
   
    // first show reason of update
    if (reason != null && !reason.isEmpty()) {
      String question = mLocalizer.msg("question", "Do you want to update now?");
      JLabel lbReason = new JLabel("<html>" + reason + "<br>" + question + "</html>");
      JPanel panelReason = new JPanel(new BorderLayout(7, 0));
      panelReason.add(lbReason, BorderLayout.WEST);
      northPanel.add(panelReason);
      northPanel.add(new JLabel(" "));
    }

    // then time selection
    JPanel panel1 = new JPanel(new BorderLayout(7, 0));
    msg = mLocalizer.msg("period", "Update program for");
    panel1.add(new JLabel(msg), BorderLayout.WEST);
    mComboBox = new JComboBox(PeriodItem.getPeriodItems());
    panel1.add(mComboBox, BorderLayout.EAST);
    northPanel.add(panel1);

    // channel selection
    TvDataServiceProxy[] serviceArr = getActiveDataServices();
    if (serviceArr.length > 1) {
      panel1.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
      JPanel dataServicePanel = new JPanel();
      dataServicePanel.setLayout(new BoxLayout(dataServicePanel,
          BoxLayout.Y_AXIS));
      dataServicePanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
      mDataServiceCbArr = new TvDataServiceCheckBox[serviceArr.length];

      String[] checkedServiceNames = Settings.propDataServicesForUpdate
          .getStringArray();

      boolean expand = false;
      for (int i = 0; i < serviceArr.length; i++) {
        mDataServiceCbArr[i] = new TvDataServiceCheckBox(serviceArr[i]);
        boolean isSelected = tvDataServiceIsChecked(serviceArr[i],
            checkedServiceNames);
        mDataServiceCbArr[i].setSelected(isSelected);
        if (!isSelected) {
          expand = true;
        }
        dataServicePanel.add(mDataServiceCbArr[i]);
      }
      DisclosureTriangle disclosureButton = new DisclosureTriangle(dataServicePanel);
      disclosureButton.setLabelText(mLocalizer.msg("dataSources", "Data sources"));
      if (expand) {
        disclosureButton.expand();
      }
      northPanel.add(disclosureButton);
    }

    int period = Settings.propDownloadPeriod.getInt();
    PeriodItem pi = new PeriodItem(period);
    mComboBox.setSelectedItem(pi);

    // auto update options
    if (Settings.propAutoDownloadType.getString().equals("never")) {
      JPanel p = new JPanel(new BorderLayout());
      p.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
      northPanel.add(p);
      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();
View Full Code Here

    if(mIsVersionChange) {
      setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    }
   
    JPanel contentPane = (JPanel) getContentPane();
    contentPane.setLayout(new BorderLayout(0, 10));
    contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 11, 11));
    mCloseBtn = new JButton(Localizer.getLocalization(Localizer.I18N_CLOSE));
    mCloseBtn.addActionListener(this);
    mCloseBtn.setEnabled(!mIsVersionChange);

    mDownloadBtn = new JButton(mLocalizer.msg("download", "Download selected items"));
    mDownloadBtn.addActionListener(this);

    mHelpBtn = new JButton(mLocalizer.msg("openWebsite","Open website"), TVBrowserIcons.webBrowser(TVBrowserIcons.SIZE_SMALL));
    mHelpBtn.addActionListener(this);
    mHelpBtn.setEnabled(false);

    ButtonBarBuilder2 builder = new ButtonBarBuilder2();

    if(onlyUpdate && !mIsVersionChange) {
      mAutoUpdates = new JCheckBox(mLocalizer.msg("autoUpdates","Find plugin updates automatically"), Settings.propAutoUpdatePlugins.getBoolean());
      mAutoUpdates.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          Settings.propAutoUpdatePlugins.setBoolean(e.getStateChange() == ItemEvent.SELECTED);
        }
      });

      builder.addFixed(mAutoUpdates);
      builder.addRelatedGap();
    }
    builder.addFixed(mHelpBtn);

    builder.addGlue();
    builder.addFixed(mDownloadBtn);
   
    builder.addRelatedGap();
    builder.addFixed(mCloseBtn);
   

    final CellConstraints cc = new CellConstraints();

    FormLayout layout = new FormLayout("default,5dlu,0dlu:grow","default");

    JPanel northPn = new JPanel(layout);
    northPn.add(new JLabel(onlyUpdate ?mLocalizer.msg("updateHeader","Updates for installed plugins were found.") :
      mLocalizer.msg("header","Here you can download new plugins and updates for it.")), cc.xyw(1,1,3));

    JPanel southPn = new JPanel(new BorderLayout());

    southPn.add(builder.getPanel(), BorderLayout.SOUTH);

    ArrayList<SoftwareUpdateItem> selectedItems = new ArrayList<SoftwareUpdateItem>();
    for (SoftwareUpdateItem item : itemArr) {
View Full Code Here

  }

  public JPanel getSettingsPanel() {
    mNewSearchFormSettings = mSearchFormSettings;

    mSettingsPanel = new JPanel(new BorderLayout());

    mSettingsPanel.add(UiUtilities.createHelpTextArea(mLocalizer.msg("desc",
        "help-text")), BorderLayout.NORTH);

    mTextInput = new JTextArea(mText);
View Full Code Here

  /**
   * Create the GUI
   */
  private void createGui() {
    final JPanel panel = new JPanel(new BorderLayout(3,0));
    panel.setBorder(BorderFactory.createCompoundBorder(UIManager.getBorder("TextField.border"),BorderFactory.createEmptyBorder(2,2,1,2)));
    mText = new SearchTextField(15);
    if(UIManager.getLookAndFeel().getClass().getCanonicalName().equals("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel")) {
      mText.setBackground(Color.white);
      mText.setBorder(BorderFactory.createLineBorder(mText.getBackground(), 2));
View Full Code Here

    return (program.getChannel().getCategories() & mCategories) == mCategories;
  }

  @Override
  public JPanel getSettingsPanel() {
    final JPanel panel = new JPanel(new BorderLayout());
    ArrayList<String> allCategories = new ArrayList<String>(CATEGORIES.length);
    ArrayList<String> checkedCategories = new ArrayList<String>();
    for (int category : CATEGORIES) {
      final String name = Channel.getLocalizedCategory(category);
      allCategories.add(name);
View Full Code Here

   * Gibt einen Panel zurueck, der es ermoeglicht, den Filter einzustellen
   *
   * @see tvbrowser.core.filters.FilterComponent#getSettingsPanel()
   */
  public JPanel getSettingsPanel() {
    final JPanel centerPanel = new JPanel(new BorderLayout());
    String[] infoMessages = ProgramInfoHelper.getInfoIconMessages();
    int[] infoBits = ProgramInfoHelper.getInfoBits();
    final String[] allItems = new String[infoMessages.length];
    final ArrayList<String> selectedItems = new ArrayList<String>();
    for (int i = 0; i < infoMessages.length; i++) {
      final String item = infoMessages[i];
      allItems[i] = item;
      if (bitSet(mSelectedBits, infoBits[i])) {
        selectedItems.add(item);
      }
    }
    mList = new SelectableItemList(selectedItems.toArray(), allItems);
    mList.addCenterRendererComponent(String.class,
        new SelectableItemRendererCenterComponentIf() {
          private DefaultListCellRenderer mRenderer = new DefaultListCellRenderer();

          @Override
          public void calculateSize(JList list, int index, JPanel contentPane) {
          }

          @Override
          public JPanel createCenterPanel(JList list, Object value, int index,
              boolean isSelected, boolean isEnabled,
              JScrollPane parentScrollPane, int leftColumnWidth) {
            DefaultListCellRenderer label = (DefaultListCellRenderer) mRenderer
                .getListCellRendererComponent(list, value, index, isSelected,
                    false);
            label.setIcon(ProgramInfoHelper.getInfoIcons()[index]);
            label.setHorizontalAlignment(SwingConstants.LEADING);
            label.setVerticalAlignment(SwingConstants.CENTER);
            label.setOpaque(false);

            JPanel panel = new JPanel(new BorderLayout());
            if (isSelected && isEnabled) {
              panel.setOpaque(true);
              panel.setForeground(list.getSelectionForeground());
              panel.setBackground(list.getSelectionBackground());
            } else {
View Full Code Here

    out.writeInt(mToTime);
    out.writeBoolean(mShowRunning);
  }

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

    mFromTimeSp = new JSpinner(new SpinnerDateModel());
    JSpinner.DateEditor dateEditor = new JSpinner.DateEditor(mFromTimeSp,
        Settings.getTimePattern());
    mFromTimeSp.setEditor(dateEditor);
    mFromTimeSp.setValue(setTimeToDate(mFromTime));
    CaretPositionCorrector.createCorrector(dateEditor.getTextField(),
        new char[] { ':' }, -1);

    mToTimeSp = new JSpinner(new SpinnerDateModel());
    dateEditor = new JSpinner.DateEditor(mToTimeSp, Settings.getTimePattern());
    mToTimeSp.setEditor(dateEditor);
    mToTimeSp.setValue(setTimeToDate(mToTime));
    CaretPositionCorrector.createCorrector(dateEditor.getTextField(),
        new char[] { ':' }, -1);

    JPanel timePn = new JPanel(new GridLayout(2, 2));
    timePn.setBorder(BorderFactory.createTitledBorder(mLocalizer.msg(
        "TimeOfDay", "Uhrzeit")));
    timePn.add(new JLabel(mLocalizer.msg("from", "from")));
    timePn.add(mFromTimeSp);
    timePn.add(new JLabel(mLocalizer.msg("till", "till")));
    timePn.add(mToTimeSp);

    mIncludeBtn = new JCheckBox(mLocalizer.msg("includeRunning",
        "Include programs running at start time"));
    mIncludeBtn.setSelected(mShowRunning);
    content.add(UiUtilities.createHelpTextArea(mLocalizer.msg("desc", "")),
        BorderLayout.NORTH);
    content.add(timePn, BorderLayout.CENTER);
    content.add(mIncludeBtn, BorderLayout.SOUTH);

    JPanel centerPanel = new JPanel(new BorderLayout());
    centerPanel.add(content, BorderLayout.NORTH);
    return centerPanel;
  }
View Full Code Here

TOP

Related Classes of java.awt.BorderLayout

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.