Package com.jgoodies.forms.layout

Examples of com.jgoodies.forms.layout.CellConstraints


      setPluginInfo(info);
    }
  }

  public void setDefaultBorder(boolean plugin) {
    CellConstraints cc = new CellConstraints();
    String message;

    if (plugin) {
      message = mLocalizer.msg("about", "About this Plugin");
    } else {
      message = mLocalizer.msg("aboutDataService", "About this DataService");
    }
    add(DefaultComponentFactory.getInstance().createSeparator(message), cc.xyw(1, 1, 5));

    if (mShowSettingsSeparator) {
      add(DefaultComponentFactory.getInstance().createSeparator(
          Localizer.getLocalization(Localizer.I18N_SETTINGS)), cc.xyw(1, ++mYCount, 5));
    }
  }
View Full Code Here


    UiUtilities.registerForClosing(this);
   
    panel.setLayout(new FormLayout("default, 3dlu, fill:default:grow",
    "default, 3dlu, default, 3dlu, default, 3dlu, default, 3dlu, default, 3dlu, default, 3dlu, default, 5dlu, default, 3dlu, default, 3dlu:grow, default, 5dlu, default"));

    CellConstraints cc = new CellConstraints();

    panel.setBorder(Borders.DLU4_BORDER);

    // name
    panel.add(new JLabel(mLocalizer.msg("channelName", "Channel Name:")), cc.xy(1, 1));
    mChannelName = new JTextField(mChannel.getName());
    panel.add(mChannelName, cc.xy(3, 1));

    // provider
    panel.add(new JLabel(mLocalizer.msg("provider", "Provided by:")), cc.xy(1, 3));
    panel.add(new JLabel(ChannelUtil.getProviderName(mChannel)), cc.xy(3, 3));

    // logo
    panel.add(new JLabel(mLocalizer.msg("channelLogo", "Channel Logo:")), cc.xy(1, 5));
    if (mChannel.getUserIconFileName() != null) {
      mIconFile = new File(mChannel.getUserIconFileName());
    }
   
    mIconLabel = new JLabel(createUserIcon());
    mChangeIcon = new JButton(mLocalizer.msg("useIcon", "Select channel icon"));
    mChangeIcon.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        changeIcon();
      }
    });

    panel.add(mIconLabel, cc.xy(3, 5));
    panel.add(mChangeIcon, cc.xy(3, 7));

    // URL
    panel.add(new JLabel(mLocalizer.msg("webAddress", "Web Address:")), cc.xy(1, 9));
    mWebPage =new JTextField(mChannel.getWebpage());
    panel.add(mWebPage, cc.xy(3, 9));

    // time correction
    panel.add(new JLabel(mLocalizer.msg("time", "Time zone correction:")), cc.xy(1, 11));
    mCorrectionCB = new JComboBox(new String[] { "-1:00", "-0:45", "-0:30", "-0:15", "0:00", "+0:15", "+0:30", "+0:45", "+1:00" });
    mCorrectionCB.setSelectedIndex(mChannel.getTimeZoneCorrectionMinutes() / 15 + 4);
    panel.add(mCorrectionCB, cc.xy(3, 11));

    JTextArea txt = UiUtilities.createHelpTextArea(mLocalizer.msg("DLSTNote", ""));
    // Hack because of growing JTextArea in FormLayout
    txt.setMinimumSize(new Dimension(150, 20));
    panel.add(txt, cc.xy(3, 13));

    // time limitation
    panel.add(DefaultComponentFactory.getInstance().createLabel(mLocalizer.msg("timeLimits","Time limits:")), cc.xy(1,15));
   
    String timePattern = mLocalizer.msg("timePattern", "hh:mm a");
       
    mStartTimeLimit = new JSpinner(new SpinnerDateModel());
    mStartTimeLimit.setEditor(new JSpinner.DateEditor(mStartTimeLimit, timePattern));
    setTimeDate(mStartTimeLimit, mChannel.getStartTimeLimit());

    mEndTimeLimit = new JSpinner(new SpinnerDateModel());
    mEndTimeLimit.setEditor(new JSpinner.DateEditor(mEndTimeLimit, timePattern));
    setTimeDate(mEndTimeLimit, mChannel.getEndTimeLimit());
       
    ((JSpinner.DateEditor)mStartTimeLimit.getEditor()).getTextField().setHorizontalAlignment(SwingConstants.LEFT);
    ((JSpinner.DateEditor)mEndTimeLimit.getEditor()).getTextField().setHorizontalAlignment(SwingConstants.LEFT);
   
    CaretPositionCorrector.createCorrector(((JSpinner.DateEditor)mStartTimeLimit.getEditor()).getTextField(), new char[] {':'}, -1);
    CaretPositionCorrector.createCorrector(((JSpinner.DateEditor)mEndTimeLimit.getEditor()).getTextField(), new char[] {':'}, -1);
   
    PanelBuilder timeLimitPanel = new PanelBuilder(new FormLayout("default:grow,10dlu,default:grow","default,2dlu,default"));
   
    timeLimitPanel.addLabel(mLocalizer.msg("startTime","Start time:"), cc.xy(1,1));
    timeLimitPanel.addLabel(mLocalizer.msg("endTime","End time:"), cc.xy(3,1));
    timeLimitPanel.add(mStartTimeLimit, cc.xy(1,3));
    timeLimitPanel.add(mEndTimeLimit, cc.xy(3,3));
   
    panel.add(timeLimitPanel.getPanel(), cc.xy(3,15));
   
    JTextArea txt2 = UiUtilities.createHelpTextArea(mLocalizer.msg("DLSTNote", ""));
    // Hack because of growing JTextArea in FormLayout
    txt2.setMinimumSize(new Dimension(150, 20));
    panel.add(txt2, cc.xy(3, 17));
   
    // buttons
    ButtonBarBuilder2 builder = new ButtonBarBuilder2();
    JButton defaultButton = new JButton(Localizer.getLocalization(Localizer.I18N_DEFAULT));
   
    defaultButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        resetToDefaults();
      }

    });
   
    builder.addButton(defaultButton);
    builder.addRelatedGap();
    builder.addGlue();

    mOKBt = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    mOKBt.addActionListener(this);
   
    getRootPane().setDefaultButton(mOKBt);
   
    mCloseBt = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    mCloseBt.addActionListener(this);

    builder.addButton(new JButton[] { mOKBt, mCloseBt });

    panel.add(new JSeparator(), cc.xyw(1, 19, 3));
    panel.add(builder.getPanel(), cc.xyw(1, 21, 3));
   
    pack();
    Settings.layoutWindow("channelConfig", this, new Dimension(420,350));
  }
View Full Code Here

    PanelBuilder contentPanel = new PanelBuilder(new FormLayout("5dlu, pref, 3dlu, pref, fill:pref:grow, 3dlu",
        "pref, 5dlu, pref, 3dlu, fill:pref:grow"));
    contentPanel.setBorder(Borders.DIALOG_BORDER);

    CellConstraints cc = new CellConstraints();
    contentPanel.addSeparator(mLocalizer.msg("title", "Title"), cc.xyw(1,
        1, 6));

    contentPanel.add(UiUtilities.createHelpTextArea(mLocalizer.msg("ItemOrder", "Item Order:")), cc.xyw(2, 3, 4));

    contentPanel.add(mList, cc.xyw(2, 5, 4));

    fillListbox();

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

      info.setUndecorated(true);
      info.toFront();

      JPanel main = new JPanel(new FormLayout("5dlu,pref,5dlu","5dlu,pref,5dlu"));
      main.setBorder(BorderFactory.createLineBorder(Color.black));
      main.add(new JLabel(mLocalizer.msg("downloadinfo","A data update is running. TV-Browser will be closed when the update is done.")), new CellConstraints().xy(2,2));

      info.setContentPane(main);
      info.pack();
      info.setLocationRelativeTo(this);
View Full Code Here

  private SortableItemList mConfigurations;
  private JButton mAdd, mEdit, mDelete;

  public JPanel createSettingsPanel() {
    try {
      CellConstraints cc = new CellConstraints();
      PanelBuilder pb = new PanelBuilder(new FormLayout("5dlu,default:grow,5dlu","pref,5dlu,fill:default:grow,5dlu,pref,10dlu,pref"));
      pb.setDefaultDialogBorder();

      mConfigurations = new SortableItemList("",GlobalPluginProgramFormatingManager.getInstance().getAvailableGlobalPluginProgramFormatings());
      mConfigurations.getList().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

      mConfigurations.getList().addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
          if(SwingUtilities.isLeftMouseButton(e) && e.getClickCount() >= 2) {
            LocalPluginProgramFormatingSettingsDialog.createInstance(UiUtilities.getLastModalChildOf(MainFrame.getInstance()), (AbstractPluginProgramFormating)mConfigurations.getList().getSelectedValue(), GlobalPluginProgramFormatingManager.getDefaultConfiguration(), true, true);
            mConfigurations.getList().repaint();
          }
        }
      });

      pb.addSeparator(mLocalizer.msg("title","Plugin program formating"), cc.xyw(1,1,3));
      pb.add(mConfigurations, cc.xy(2,3));

      FormLayout layout = new FormLayout("default,5dlu,default,5dlu,default","pref");
      layout.setColumnGroups(new int[][] {{1,3,5}});

      JPanel buttonPanel = new JPanel(layout);

      mAdd = new JButton(Localizer.getLocalization(Localizer.I18N_ADD));
      mAdd.setIcon(TVBrowserIcons.newIcon(TVBrowserIcons.SIZE_SMALL));
      mAdd.addActionListener(this);

      mEdit = new JButton(Localizer.getLocalization(Localizer.I18N_EDIT));
      mEdit.setIcon(TVBrowserIcons.edit(TVBrowserIcons.SIZE_SMALL));
      mEdit.setEnabled(false);
      mEdit.addActionListener(this);

      mDelete = new JButton(Localizer.getLocalization(Localizer.I18N_DELETE));
      mDelete.setIcon(TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));
      mDelete.setEnabled(false);
      mDelete.addActionListener(this);

      buttonPanel.add(mAdd, cc.xy(1,1));
      buttonPanel.add(mEdit, cc.xy(3,1));
      buttonPanel.add(mDelete, cc.xy(5,1));

      pb.add(buttonPanel, cc.xy(2,5));
      pb.addLabel(mLocalizer.msg("help","<html>This list of formating can be used by several plugins. So a formating don't have to be entered in every plugin that should use the formating. The selection of the formating can be done in the settings of the plugin.</html>"), cc.xy(2,7));

      mConfigurations.getList().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
          if(!e.getValueIsAdjusting()) {
            mEdit.setEnabled(mConfigurations.getList().getSelectedIndex() != -1);
View Full Code Here

    mUseBigIconsCb = new JCheckBox(ContextMenu.mLocalizer.msg("bigIcons",
        "Use big icons"));
    mUseBigIconsCb.setSelected(Settings.propToolbarUseBigIcons.getBoolean());

    CellConstraints cc = new CellConstraints();

    tSetPanel.add(new JLabel(mLocalizer.msg("location", "Location")),cc.xy(1,1));
    tSetPanel.add(mLocationCB,cc.xy(3,1));
    tSetPanel.add(new JLabel(mLocalizer.msg("icons", "Icons")),cc.xy(5,1));
    tSetPanel.add(mShowCB,cc.xy(7,1));
    tSetPanel.add(mUseBigIconsCb,cc.xy(9,1));

    tSetPanel.setBorder(new CompoundBorder(BorderFactory.createMatteBorder(1,
        0, 1, 0, Color.GRAY), BorderFactory.createEmptyBorder(10, 5, 9, 5)));

    // The panel for the OK button
    JPanel okButtonPanel = new JPanel();
    okButtonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
    okButtonPanel.setLayout(new BoxLayout(okButtonPanel, BoxLayout.X_AXIS));
    okButtonPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 5));

    JButton ok = new JButton("OK");
    ok.addActionListener(this);

    okButtonPanel.add(Box.createHorizontalGlue());
    okButtonPanel.add(ok);

    // Register ActionListener to the settings
    mShowToolbarCb.addActionListener(this);
    mShowSearchFieldCb.addActionListener(this);
    mShowCB.addActionListener(this);
    mUseBigIconsCb.addActionListener(this);
    mLocationCB.addActionListener(this);

    // Add the components to the window
    this.getContentPane().add(tVisPanel, cc.xy(1,1));
    this.getContentPane().add(pane, cc.xy(1,3));
    this.getContentPane().add(tSetPanel, cc.xy(1,5));
    this.getContentPane().add(okButtonPanel, cc.xy(1,7));

    // Set up the windows attributes
    this.setSize(630, 400);
    this.addWindowListener(this);
    this.setTitle(mLocalizer.msg("modifyToolbar", "Modify Toolbar"));
View Full Code Here

  private ProgramPreviewPanel mProgramPreviewPanel;
  private JCheckBox mShowPluginMarkingCb;

  public ExtrasTab(Frame dlgParent) {
    CellConstraints cc = new CellConstraints();
   
    PanelBuilder pb = new PanelBuilder(new FormLayout("5dlu,pref:grow",
        "pref,5dlu,pref,3dlu,pref,10dlu"), this);
    pb.setDefaultDialogBorder();
    pb.addSeparator(mLocalizer.msg("programItem","Program item"), cc.xyw(1,1,2));
    pb.add(mProgramPreviewPanel = new ProgramPreviewPanel(dlgParent), cc.xy(2,3));
    pb.add(mShowPluginMarkingCb = new JCheckBox(mLocalizer.msg("showPluginMarkings","Show plugin markings")), cc.xy(2,5));

    mShowPluginMarkingCb.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
        mProgramPreviewPanel.setShowPluginMarking(mShowPluginMarkingCb.isSelected());
      }
View Full Code Here

    FormLayout layout = new FormLayout(
        "pref, 3dlu, fill:pref:grow, 3dlu, pref", "");
    JPanel content = new JPanel(layout);
    content.setBorder(Borders.DIALOG_BORDER);

    CellConstraints cc = new CellConstraints();
    int currentRow = 1;

    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("5dlu"));
    content.add(UiUtilities.createHelpTextArea(mLocalizer
        .msg("description", "")), cc.xyw(1, currentRow, 5));

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

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

  private JComboBox mChannelsPerPageCB;
  private JComboBox mLayoutCB;
  private DefaultComboBoxModel mLayoutCBModel;

  public LayoutTab() {
    CellConstraints cc = new CellConstraints();
    mLayoutCBModel = new DefaultComboBoxModel();
   
    PanelBuilder pb = new PanelBuilder(new FormLayout("5dlu,pref,10dlu,pref:grow",
        "pref,5dlu,pref,2dlu,pref,10dlu"), this);
    pb.setDefaultDialogBorder();
   
    pb.addSeparator(mLocalizer.msg("channelsAndColumns","Channels and columns"), cc.xyw(1,1,4));
    pb.addLabel(mLocalizer.msg("channelsPerPage","Channels per page")+":", cc.xy(2,3));
    pb.add(mChannelsPerPageCB = new JComboBox(createIntegerArray(2,22)), cc.xy(4,3));
    pb.addLabel(mLocalizer.msg("columnsPerPage","columns")+":", cc.xy(2,5));
    pb.add(mLayoutCB = new JComboBox(mLayoutCBModel), cc.xy(4,5));

    mChannelsPerPageCB.addItemListener(new ItemListener(){
      public void itemStateChanged(ItemEvent e) {
        int val = ((Integer)mChannelsPerPageCB.getSelectedItem()).intValue();
        updateLayoutCombobox(val);
View Full Code Here

   */
  private JPanel createFilterPanel() {
    JPanel filter = new JPanel(new FormLayout("fill:pref:grow",
        "pref, 3dlu, pref, 3dlu"));

    CellConstraints cc = new CellConstraints();

    JComponent filterSeparator = DefaultComponentFactory.getInstance()
        .createSeparator(
            mLocalizer.msg("channelFilter", "Channel Filter") + ":");
    filterSeparator.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));

    filter.add(filterSeparator, cc.xy(1, 1));

    JPanel filterPanel = new JPanel(new FormLayout(
        "pref, 3dlu, pref:grow, fill:60dlu, 3dlu, pref, 3dlu, pref:grow, pref",
        "pref, 3dlu, pref"));

    mCountryCB = new JComboBox();
    filterPanel.add(new JLabel(mLocalizer.msg("country", "Country") + ":"), cc
        .xy(1, 1));
    filterPanel.add(mCountryCB, cc.xyw(3, 1, 2));

    mCategoryCB = new JComboBox();
    mCategoryCB.setMaximumRowCount(20);

    filterPanel.add(new JLabel(mLocalizer.msg("category", "Category") + ":"),
        cc.xy(6, 1));
    filterPanel.add(mCategoryCB, cc.xyw(8, 1, 2));

    JPanel namePanel = new JPanel(new BorderLayout());

    namePanel.add(new JLabel(mLocalizer.msg("filterText",
        "With the following Text")
        + ": "), BorderLayout.WEST);

    mChannelName = new JTextField();
    namePanel.add(mChannelName, BorderLayout.CENTER);

    filterPanel.add(namePanel, cc.xyw(1, 3, 4));
    JButton reset = new JButton(mLocalizer.msg("reset", "Reset"));

    reset.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        mChannelName.setText("");
        mCategoryCB.setSelectedIndex(1);
        mCountryCB.setSelectedIndex(0);
      }
    });

    filterPanel.add(reset, cc.xy(9, 3));

    filter.add(filterPanel, cc.xy(1, 3));

    final ItemListener filterItemListener = new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if ((e == null) || (e.getStateChange() == ItemEvent.SELECTED)) {
          if (!mListUpdating) {
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.