Package com.jgoodies.forms.layout

Examples of com.jgoodies.forms.layout.FormLayout


  /**
   * Creates the settings panel for this tab.
   */
  public JPanel createSettingsPanel() {
    mSettingsPn = new JPanel(new FormLayout("5dlu, pref, 3dlu, default, fill:3dlu:grow, 3dlu",
        "pref, 5dlu, pref, 10dlu, pref, 5dlu, pref, 10dlu, pref, 5dlu, pref, 2dlu, pref, fill:3dlu:grow, pref"));
    mSettingsPn.setBorder(Borders.DIALOG_BORDER);

    CellConstraints cc = new CellConstraints();

View Full Code Here


  protected JPanel createContent(WizardHandler handler) {

    mNameTf = new JTextField(((Favorite)handler.getCurrentValue()).getName());


    PanelBuilder panelBuilder = new PanelBuilder(new FormLayout("5dlu, pref, 3dlu, default:grow",
        "pref"));
    panelBuilder.setBorder(Borders.DLU4_BORDER);
    CellConstraints cc = new CellConstraints();
    panelBuilder.add(new JLabel(mLocalizer.msg("saveAs", "Save as:")), cc.xy(2,1));
    panelBuilder.add(mNameTf, cc.xy(4,1));
View Full Code Here

      int row, int column) {

    if (column == 0) {
      try {
        // substance LNF has issues, if the checkbox and panel are cached, therefore recreate them during each rendering
        JPanel checkBoxPanel = new JPanel(new FormLayout("0dlu:grow,default,0dlu:grow",
            "fill:0dlu:grow,default,fill:0dlu:grow"));
        boolean checked = ((Boolean) value).booleanValue();

        JCheckBox checkBox = new JCheckBox("", checked);
        checkBox.setOpaque(false);
        checkBox.setContentAreaFilled(false);
        checkBox.setHorizontalAlignment(SwingConstants.CENTER);
        checkBox.setBorderPainted(true);
        if (isSelected) {
          checkBoxPanel.setForeground(table.getSelectionForeground());
          checkBoxPanel.setBackground(table.getSelectionBackground());
        } else {
          checkBoxPanel.setForeground(table.getForeground());
          checkBoxPanel.setBackground(table.getBackground());
        }
        checkBox.setSelected(checked);
        checkBox.setEnabled(table.getModel().isCellEditable(row, column));

        if (hasFocus) {
          checkBox.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
        } else {
          checkBox.setBorder(NO_FOCUS_BORDER);
        }

        checkBoxPanel.add(checkBox, mCC.xy(2, 2));

        return checkBoxPanel;
      } catch (Throwable t) {
        t.printStackTrace();
      }
    }

    JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

    if (value instanceof PluginProxy || value instanceof InternalPluginProxyIf || value instanceof TvDataServiceProxy) {
      Icon iconValue = null;
      String nameValue = null;
      String descValue = null;
      boolean isActivated = true;

      if (value instanceof PluginProxy) {
        PluginProxy plugin = (PluginProxy) value;

        iconValue = plugin.getPluginIcon();
        if (iconValue != null) {
          iconValue = new FixedSizeIcon(16, 16, iconValue);
        }
        descValue = plugin.getInfo().getDescription().replace('\n', ' ');

        isActivated = plugin.isActivated();

        nameValue = plugin.getInfo().getName() + " " + plugin.getInfo().getVersion();
      } else if (value instanceof InternalPluginProxyIf) {
        InternalPluginProxyIf plugin = (InternalPluginProxyIf) value;

        nameValue = plugin.getName();
        descValue = plugin.getButtonActionDescription().replace('\n', ' ');
        iconValue = plugin.getIcon();
      } else if (value instanceof TvDataServiceProxy) {
        TvDataServiceProxy service = (TvDataServiceProxy) value;
        nameValue = service.getInfo().getName() + " " + service.getInfo().getVersion();
        descValue = HTMLTextHelper.convertHtmlToText(service.getInfo().getDescription()).replace('\n', ' ');
      }

      if (iconValue == null) {
        iconValue = DEFAULT_ICON;
      }

      if (mPanel == null) {
        mIcon = new JLabel();
        mName = new JLabel();
        mName.setFont(table.getFont().deriveFont(Font.BOLD, table.getFont().getSize2D() + 2));

        mPanel = new JPanel(new FormLayout("default, 2dlu, fill:0dlu:grow", "default, 2dlu, default"));
        mPanel.setBorder(Borders.DLU2_BORDER);

        mPanel.add(mIcon, mCC.xy(1, 1));
        mPanel.add(mName, mCC.xy(3, 1));
      }
View Full Code Here

   * Create the GUI
   */
  private void createGui() {
    JPanel content = (JPanel) getContentPane();

    content.setLayout(new FormLayout("5dlu, fill:50dlu:grow, 3dlu", "pref, 5dlu, pref, 5dlu, pref, 5dlu, pref, fill:3dlu:grow, pref"));
    content.setBorder(Borders.DLU4_BORDER);

    CellConstraints cc = new CellConstraints();

    content.add(DefaultComponentFactory.getInstance().createSeparator(Localizer.getLocalization(Localizer.I18N_HELP)), cc.xyw(1,1,3));
View Full Code Here

          }
        });

        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();
            if (topRow != -1) {
              mList.ensureIndexIsVisible(topRow);
            }
          }
        });

        JButton close = new JButton(Localizer.getLocalization(Localizer.I18N_CLOSE));
        close.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            closeDialog();
          }
        });

        JPanel southPanel = new JPanel(new FormLayout("default,5dlu,default,0dlu:grow,default", "default"));
        southPanel.add(mSendBtn, cc.xy(1, 1));
        southPanel.add(mShowDescription, cc.xy(3, 1));
        southPanel.add(close, cc.xy(5, 1));

        mDialog.getContentPane().add(panel, BorderLayout.NORTH);
View Full Code Here

        createGui();
    }

    private void createGui() {
        setLayout(new FormLayout("pref, 3dlu, fill:pref:grow", "pref, 3dlu, pref, 3dlu, pref"));
        setBorder(Borders.DLU4_BORDER);
        CellConstraints cc = new CellConstraints();

        add(new JLabel(mLocalizer.msg("user", "Username") + ":"), cc.xy(1, 3));
        mUsername = new JTextField();
View Full Code Here

      .getLocalizerFor(TvBrowserDataServiceSettingsPanel.class);

  protected TvBrowserDataServiceSettingsPanel(TvBrowserDataServiceSettings settings) {

    mSettings = settings;
    setLayout(new FormLayout("200dlu:grow","fill:150dlu:grow"));
    setBorder(Borders.createEmptyBorder(Sizes.DLUY5,Sizes.DLUX5,Sizes.DLUY5,Sizes.DLUX5));

    JTabbedPane tabbedPane = new JTabbedPane();

    /* level list pane */
 
View Full Code Here

    ini();
  }

  // Added method for building up the search bar
  private void ini() {
    PanelBuilder b = new PanelBuilder(new FormLayout(
        "2dlu,pref,5dlu,pref,5dlu,100dlu,5dlu,pref,5dlu,pref,15dlu,pref",
        "pref,3dlu"));
    CellConstraints cc = new CellConstraints();

    mSearchBar = b.getPanel();
View Full Code Here

    JPanel content = (JPanel)getContentPane();
    content.setBorder(Borders.DLU4_BORDER);

    CellConstraints cc = new CellConstraints();

    content.setLayout(new FormLayout("5dlu, 15dlu, fill:pref:grow, 3dlu, 100dlu",
            "pref, 3dlu,pref, 3dlu,pref, 3dlu,pref, 3dlu,pref, 3dlu,pref, 3dlu,pref, 3dlu,pref, fill:3dlu:grow ,pref, 3dlu,pref"));

    content.add(DefaultComponentFactory.getInstance().createSeparator(mLocalizer.msg("calendar", "Calendar")), cc.xyw(1,1,5));

    content.add(new JLabel(mLocalizer.msg("select", "Select Calendar:")), cc.xyw(2,3,2));
View Full Code Here

        c.weighty = 0;
        c.insets = new Insets(5, 0, 0, 0);
        c.gridwidth = GridBagConstraints.REMAINDER;

       
        FormLayout layout = new FormLayout("pref, fill:pref:grow, pref, 3dlu, pref", "pref");
        layout.setColumnGroups(new int[][]{{1,3,5}});
        JPanel buttonPanel = new JPanel(layout);
       
        JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
        JButton cancel = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
        ok.addActionListener(new ActionListener() {
View Full Code Here

TOP

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

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.