Example usage for com.jgoodies.forms.layout FormLayout setRowGroups

List of usage examples for com.jgoodies.forms.layout FormLayout setRowGroups

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout FormLayout setRowGroups.

Prototype

public void setRowGroups(int[][] groupOfIndices) 

Source Link

Document

Sets the row groups, where each row in such a group gets the same group wide height.

Usage

From source file:phex.gui.dialogs.options.DirectoriesPane.java

License:Open Source License

/**
 * Called when preparing this settings pane for display the first time. Can
 * be overriden to implement the look of the settings pane.
 *///from  w ww. ja  v a2s .  co m
@Override
protected void prepareComponent() {
    FormLayout layout = new FormLayout("10dlu, right:d, 2dlu, d:grow, 2dlu, d, 2dlu", // columns
            "p, 3dlu, p, 3dlu, p, 9dlu, " + // rows
                    "p, 3dlu, p, 3dlu, p, 15dlu:grow, 3dlu, p, 3dlu, p, 3dlu, p");
    layout.setRowGroups(new int[][] { { 3, 5, 9, 11, 14, 16, 18 } });

    //setLayout( new BorderLayout() );
    //JPanel contentPanel = new FormDebugPanel();
    //add( contentPanel, BorderLayout.CENTER );

    //PanelBuilder builder = new PanelBuilder( contentPanel, layout );
    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();

    builder.addSeparator(Localizer.getString("DirSettings_DownloadFolders"), cc.xywh(1, 1, 7, 1));

    builder.addLabel(Localizer.getString("DirSettings_Incomplete") + ": ", cc.xy(2, 3));
    incompleteDirectoryTF = new JTextField(DownloadPrefs.IncompleteDirectory.get(), 30);
    builder.add(incompleteDirectoryTF, cc.xy(4, 3));
    JButton button = new JButton(Localizer.getString("DirSettings_SetFolder"));
    //button.setMargin( noInsets );
    button.addActionListener(new SetIncompleteDirectoryListener());
    builder.add(button, cc.xy(6, 3));

    builder.addLabel(Localizer.getString("DirSettings_Completed") + ": ", cc.xy(2, 5));
    downloadDirectoryTF = new JTextField(DownloadPrefs.DestinationDirectory.get(), 30);
    builder.add(downloadDirectoryTF, cc.xy(4, 5));
    button = new JButton(Localizer.getString("DirSettings_SetFolder"));
    //button.setMargin( noInsets );
    button.addActionListener(new SetDownloadDirectoryListener());
    builder.add(button, cc.xy(6, 5));

}

From source file:phex.gui.dialogs.options.DisplayPromptsPane.java

License:Open Source License

/**
 * Called when preparing this settings pane for display the first time. Can
 * be overriden to implement the look of the settings pane.
 *///w w w . j  av a  2  s.  c o m
@Override
protected void prepareComponent() {
    setLayout(new BorderLayout());

    //JPanel contentPanel = new FormDebugPanel();
    JPanel contentPanel = new JPanel();
    add(contentPanel, BorderLayout.CENTER);

    FormLayout layout = new FormLayout("10dlu, d, 6dlu, d, 2dlu:grow", // columns
            "p, 3dlu, p, 3dlu, p, 3dlu, p"); // 7 rows 
    layout.setRowGroups(new int[][] { { 3, 5 } });
    contentPanel.setLayout(layout);

    PanelBuilder builder = new PanelBuilder(layout, contentPanel);
    CellConstraints cc = new CellConstraints();

    builder.addSeparator(Localizer.getString("PromptSettings_PromptSettings"), cc.xywh(1, 1, 5, 1));

    showCloseOptionsChkbx = new JCheckBox(Localizer.getString("PromptSettings_ClosePhexOptions"),
            InterfacePrefs.ShowCloseOptionsDialog.get().booleanValue());
    showCloseOptionsChkbx.setToolTipText(Localizer.getString("PromptSettings_TTTClosePhexOptions"));
    builder.add(showCloseOptionsChkbx, cc.xy(2, 3));

    showBetaUpdateNotificationChkbx = new JCheckBox(Localizer.getString("PromptSettings_NotifyOnNewBeta"),
            InterfacePrefs.ShowBetaUpdateNotification.get().booleanValue());
    showBetaUpdateNotificationChkbx.setToolTipText(Localizer.getString("PromptSettings_TTTNotifyOnNewBeta"));
    builder.add(showBetaUpdateNotificationChkbx, cc.xy(2, 5));

    showCopyrightLawsWarningChkbx = new JCheckBox(Localizer.getString("PromptSettings_RespectCopyrightNotice"),
            guiRegistry.isRespectCopyrightNoticeShown());
    showCopyrightLawsWarningChkbx
            .setToolTipText(Localizer.getString("PromptSettings_TTTRespectCopyrightNotice"));
    builder.add(showCopyrightLawsWarningChkbx, cc.xy(2, 7));
}

From source file:phex.gui.dialogs.options.DownloadPane.java

License:Open Source License

/**
 * Called when preparing this settings pane for display the first time. Can
 * be overriden to implement the look of the settings pane.
 */// ww w  .j  a  v a  2 s  .  c  om
@Override
protected void prepareComponent() {
    FormLayout layout = new FormLayout("10dlu, right:d, 2dlu, d, 2dlu:grow", // columns
            "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p"); // rows
    layout.setRowGroups(new int[][] { { 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23 } });
    setLayout(layout);

    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();

    builder.addSeparator(Localizer.getString("GeneralDownloadSettings"), cc.xywh(1, 1, 5, 1));

    JLabel label = builder.addLabel(Localizer.getString("DownloadSettings_TotalParallelDownloads") + ": ",
            cc.xy(2, 3));
    label.setToolTipText(Localizer.getString("DownloadSettings_TTTTotalParallelDownloads"));
    totalWorkersTF = new IntegerTextField(DownloadPrefs.MaxTotalDownloadWorker.get().toString(), 6, 2);
    totalWorkersTF.setToolTipText(Localizer.getString("DownloadSettings_TTTTotalParallelDownloads"));
    builder.add(totalWorkersTF, cc.xy(4, 3));

    label = builder.addLabel(Localizer.getString("DownloadSettings_ParallelDownloadsPerFile") + ": ",
            cc.xy(2, 5));
    label.setToolTipText(Localizer.getString("DownloadSettings_TTTParallelDownloadsPerFile"));
    workerPerDownloadTF = new IntegerTextField(DownloadPrefs.MaxWorkerPerDownload.get().toString(), 6, 2);
    workerPerDownloadTF.setToolTipText(Localizer.getString("DownloadSettings_TTTParallelDownloadsPerFile"));
    builder.add(workerPerDownloadTF, cc.xy(4, 5));

    label = builder.addLabel(Localizer.getString("DownloadSettings_InitialSegmentSizeKb") + ": ", cc.xy(2, 7));
    label.setToolTipText(Localizer.getString("DownloadSettings_TTTInitialSegmentSizeKb"));
    initialSegmentSizeTF = new IntegerTextField(
            String.valueOf(DownloadPrefs.SegmentInitialSize.get().intValue() / 1024), 6, 4);
    initialSegmentSizeTF.setToolTipText(Localizer.getString("DownloadSettings_TTTInitialSegmentSizeKb"));
    builder.add(initialSegmentSizeTF, cc.xy(4, 7));

    label = builder.addLabel(Localizer.getString("DownloadSettings_SegmentTransferTimeSec") + ": ",
            cc.xy(2, 9));
    label.setToolTipText(Localizer.getString("DownloadSettings_TTTSegmentTransferTimeSec"));
    segmentTransferTimeTF = new IntegerTextField(DownloadPrefs.SegmentTransferTargetTime.get().toString(), 6,
            3);
    segmentTransferTimeTF.setToolTipText(Localizer.getString("DownloadSettings_TTTSegmentTransferTimeSec"));
    builder.add(segmentTransferTimeTF, cc.xy(4, 9));

    builder.addLabel(Localizer.getString("PushTimeout") + ": ", cc.xy(2, 11));
    pushTimeoutTF = new IntegerTextField(
            String.valueOf(DownloadPrefs.PushRequestTimeout.get().intValue() / 1000), 6, 3);
    builder.add(pushTimeoutTF, cc.xy(4, 11));

    readoutMagmaChkbx = new JCheckBox(Localizer.getString("DownloadSettings_ReadoutDownloadedMagmas"),
            DownloadPrefs.AutoReadoutMagmaFiles.get().booleanValue());
    readoutMagmaChkbx.setToolTipText(Localizer.getString("DownloadSettings_TTTReadoutDownloadedMagmas"));
    builder.add(readoutMagmaChkbx, cc.xywh(2, 13, 4, 1));

    readoutMetalinkChkbx = new JCheckBox(Localizer.getString("DownloadSettings_ReadoutDownloadedMetalink"),
            DownloadPrefs.AutoReadoutMetalinkFiles.get().booleanValue());
    readoutMetalinkChkbx.setToolTipText(Localizer.getString("DownloadSettings_TTTReadoutDownloadedMetalink"));
    builder.add(readoutMetalinkChkbx, cc.xywh(2, 15, 4, 1));

    readoutRSSChkbx = new JCheckBox(Localizer.getString("DownloadSettings_ReadoutDownloadedRSS"),
            DownloadPrefs.AutoReadoutRSSFiles.get().booleanValue());
    readoutRSSChkbx.setToolTipText(Localizer.getString("DownloadSettings_TTTReadoutDownloadedRSS"));
    builder.add(readoutRSSChkbx, cc.xywh(2, 17, 4, 1));

    silentSubscriptionsChkbx = new JCheckBox(
            Localizer.getString("DownloadSettings_DownloadSubscriptionsSilently"),
            SubscriptionPrefs.DownloadSilently.get().booleanValue());
    silentSubscriptionsChkbx
            .setToolTipText(Localizer.getString("DownloadSettings_TTTDownloadSubscriptionsSilently"));
    builder.add(silentSubscriptionsChkbx, cc.xywh(2, 19, 4, 1));

    removeCompletedDownloadsChkbx = new JCheckBox(
            Localizer.getString("DownloadSettings_AutoRemoveCompletedDownloads"),
            DownloadPrefs.AutoRemoveCompleted.get().booleanValue());
    removeCompletedDownloadsChkbx
            .setToolTipText(Localizer.getString("DownloadSettings_TTTAutoRemoveCompletedDownloads"));
    builder.add(removeCompletedDownloadsChkbx, cc.xywh(2, 21, 4, 1));

    enableHitSnoopingChkbx = new JCheckBox(Localizer.getString("DownloadSettings_EnableHitSnooping"),
            ConnectionPrefs.EnableQueryHitSnooping.get().booleanValue());
    enableHitSnoopingChkbx.setToolTipText(Localizer.getString("DownloadSettings_TTTEnableHitSnooping"));
    builder.add(enableHitSnoopingChkbx, cc.xywh(2, 23, 4, 1));

    initConfigValues();
    refreshEnableState();
}

From source file:phex.gui.dialogs.options.GeneralUIPane.java

License:Open Source License

/**
 * Called when preparing this settings pane for display the first time. Can
 * be overriden to implement the look of the settings pane.
 *//*from www.  ja  va  2s.  c  om*/
@Override
protected void prepareComponent() {
    setLayout(new BorderLayout());

    //JPanel contentPanel = new FormDebugPanel();
    JPanel contentPanel = new JPanel();
    add(contentPanel, BorderLayout.CENTER);

    FormLayout layout = new FormLayout("10dlu, d, 2dlu, d, 2dlu:grow", // columns
            "p, 3dlu, p, 3dlu, p, 3dlu, p, 5dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 5dlu, p"); // 13 rows 
    layout.setRowGroups(new int[][] { { 3, 5, 7, 9, 11 } });
    contentPanel.setLayout(layout);

    PanelBuilder builder = new PanelBuilder(layout, contentPanel);
    CellConstraints cc = new CellConstraints();

    builder.addSeparator(Localizer.getString("GeneralUserInterfaceSettings"), cc.xywh(1, 1, 5, 1));

    // L&F
    JLabel lafLabel = builder.addLabel(Localizer.getString("LookAndFeel"), cc.xy(2, 3));
    lafLabel.setToolTipText(Localizer.getString("TTTLookAndFeel"));
    UIManager.LookAndFeelInfo[] lafs = LookAndFeelUtils.getAvailableLAFs();
    lafBox = new JComboBox(lafs);
    lafBox.addItemListener(new LAFItemListener());
    int currentLAFIndex = determineCurrentLAFIndex(lafs);
    lafBox.setSelectedIndex(currentLAFIndex);
    lafBox.setRenderer(new LAFListCellRenderer());
    lafBox.setToolTipText(Localizer.getString("TTTLookAndFeel"));
    builder.add(lafBox, cc.xy(4, 3));

    // L&F Theme
    JLabel themeLabel = builder.addLabel(Localizer.getString("ColorTheme"), cc.xy(2, 5));
    themeLabel.setToolTipText(Localizer.getString("TTTColorTheme"));
    themeModel = new DefaultComboBoxModel();
    themeBox = new JComboBox(themeModel);
    themeBox.setToolTipText(Localizer.getString("TTTColorTheme"));
    builder.add(themeBox, cc.xy(4, 5));
    LookAndFeelInfo laf = (UIManager.LookAndFeelInfo) lafBox.getSelectedItem();
    updateThemes(laf);
    themeBox.setRenderer(new LAFThemeListCellRenderer());

    // Icon packs
    JLabel iconPackLabel = builder.addLabel(Localizer.getString("UISettings_IconPack"), cc.xy(2, 7));
    iconPackLabel.setToolTipText(Localizer.getString("UISettings_TTTIconPack"));
    DefaultComboBoxModel iconPackModel = new DefaultComboBoxModel(IconPack.getAllIconPackIds().toArray());
    iconPackBox = new JComboBox(iconPackModel);
    iconPackBox.setToolTipText(Localizer.getString("UISettings_TTTIconPack"));
    iconPackBox.setSelectedItem(GUIRegistry.getInstance().getPlafIconPack().getName());
    builder.add(iconPackBox, cc.xy(4, 7));

    // ToolTip
    displayTooltipChkbx = new JCheckBox(Localizer.getString("DisplayTooltipText"),
            InterfacePrefs.DisplayTooltip.get().booleanValue());
    displayTooltipChkbx.setToolTipText(Localizer.getString("TTTDisplayTooltipText"));
    builder.add(displayTooltipChkbx, cc.xywh(2, 9, 3, 1));

    // table lines...
    showTableHorizontalLinesChkbx = new JCheckBox(Localizer.getString("ShowTableHorizontalLines"),
            guiRegistry.getShowTableHorizontalLines());
    showTableHorizontalLinesChkbx.setToolTipText(Localizer.getString("TTTShowTableHorizontalLines"));
    builder.add(showTableHorizontalLinesChkbx, cc.xywh(2, 11, 3, 1));

    showTableVerticalLinesChkbx = new JCheckBox(Localizer.getString("ShowTableVerticalLines"),
            guiRegistry.getShowTableVerticalLines());
    showTableVerticalLinesChkbx.setToolTipText(Localizer.getString("TTTShowTableVerticalLines"));
    builder.add(showTableVerticalLinesChkbx, cc.xywh(2, 13, 3, 1));

    // minimize
    String backgroundText;
    // whether we have sys tray support or not
    if (GUIRegistry.getInstance().getDesktopIndicator() != null) {
        backgroundText = Localizer.getString("WhenClosingMinToSysTray");
    } else {
        backgroundText = Localizer.getString("WhenClosingMinToBackground");
    }
    minimizeWhenClosingChkbx = new JCheckBox(backgroundText,
            InterfacePrefs.MinimizeToBackground.get().booleanValue());
    builder.add(minimizeWhenClosingChkbx, cc.xywh(2, 15, 3, 1));

    JButton clearSearchHistory = new JButton(Localizer.getString("UISettings_ClearSearchHistory"));
    clearSearchHistory.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            MainFrame mainFrame = GUIRegistry.getInstance().getMainFrame();
            SearchTab searchTab = (SearchTab) mainFrame.getTab(MainFrame.SEARCH_TAB_ID);
            searchTab.clearSearchHistory();
        }
    });
    builder.add(clearSearchHistory, cc.xywh(2, 17, 3, 1, "left,center"));
}

From source file:phex.gui.dialogs.options.I2PPane.java

License:Open Source License

/**
 * Called when preparing this settings pane for display the first time. Can
 * be overriden to implement the look of the settings pane.
 *///from www.  ja v  a  2  s.co m
@Override
protected void prepareComponent() {
    FormLayout layout = new FormLayout("10dlu, right:d, 2dlu, 50dlu, " + // 4 columns
            "10dlu, right:d, 2dlu, 50dlu, 2dlu:grow", // 5 columns
            "p, 3dlu, p, 3dlu, p, 3dlu, " + // 6 rows
                    "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, " + // 8 rows
                    "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu" // 8 rows
    );
    layout.setRowGroups(new int[][] { { 3, 5, 9, 11, 13, 15, 21 } });
    layout.setColumnGroups(new int[][] { { 4, 8 }, { 2, 6 } });

    setLayout(layout);
    //FormDebugPanel contentPanel = new FormDebugPanel();
    //JPanel contentPanel = new JPanel();
    //add( this, BorderLayout.CENTER );
    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();

    builder.addSeparator(Localizer.getString("I2CPSettings"), cc.xywh(1, 1, 9, 1));

    i2cpHostLabel = builder.addLabel(Localizer.getString("I2CPHost") + ": ", cc.xy(2, 3));
    i2cpHostTF = new JTextField(I2PPrefs.I2CPHost.get(), 15);
    builder.add(i2cpHostTF, cc.xy(4, 3));

    i2cpPortLabel = builder.addLabel(Localizer.getString("I2CPPort") + ": ", cc.xy(6, 3));
    i2cpPortTF = new IntegerTextField(I2PPrefs.I2CPPort.get().toString(), 5, 5);
    builder.add(i2cpPortTF, cc.xy(8, 3));

    builder.addSeparator(Localizer.getString("I2PTunnelSettings"), cc.xywh(1, 5, 9, 1));

    inboundLengthLabel = builder.addLabel(Localizer.getString("InboundLength") + ": ", cc.xy(2, 9));
    inboundLengthTF = new IntegerTextField(I2PPrefs.InboundLength.get().toString(), 1, 1);
    builder.add(inboundLengthTF, cc.xy(4, 9));

    outboundLengthLabel = builder.addLabel(Localizer.getString("OutboundLength") + ": ", cc.xy(6, 9));
    outboundLengthTF = new IntegerTextField(I2PPrefs.OutboundLength.get().toString(), 1, 1);
    builder.add(outboundLengthTF, cc.xy(8, 9));

    inboundLengthVarianceLabel = builder.addLabel(Localizer.getString("InboundLengthVariance") + ": ",
            cc.xy(2, 11));
    inboundLengthVarianceTF = new IntegerTextField(I2PPrefs.InboundLengthVariance.get().toString(), 1, 1);
    builder.add(inboundLengthVarianceTF, cc.xy(4, 11));

    outboundLengthVarianceLabel = builder.addLabel(Localizer.getString("OutboundLengthVariance") + ": ",
            cc.xy(6, 11));
    outboundLengthVarianceTF = new IntegerTextField(I2PPrefs.OutboundLengthVariance.get().toString(), 1, 1);
    builder.add(outboundLengthVarianceTF, cc.xy(8, 11));

    inboundQuantityLabel = builder.addLabel(Localizer.getString("InboundQuantity") + ": ", cc.xy(2, 13));
    inboundQuantityTF = new IntegerTextField(I2PPrefs.InboundQuantity.get().toString(), 1, 1);
    builder.add(inboundQuantityTF, cc.xy(4, 13));

    outboundQuantityLabel = builder.addLabel(Localizer.getString("OutboundQuantity") + ": ", cc.xy(6, 13));
    outboundQuantityTF = new IntegerTextField(I2PPrefs.OutboundQuantity.get().toString(), 1, 1);
    builder.add(outboundQuantityTF, cc.xy(8, 13));

    inboundBackupQuantityLabel = builder.addLabel(Localizer.getString("InboundBackupQuantity") + ": ",
            cc.xy(2, 15));
    inboundBackupQuantityTF = new IntegerTextField(I2PPrefs.InboundBackupQuantity.get().toString(), 1, 1);
    builder.add(inboundBackupQuantityTF, cc.xy(4, 15));

    outboundBackupQuantityLabel = builder.addLabel(Localizer.getString("OutboundBackupQuantity") + ": ",
            cc.xy(6, 15));
    outboundBackupQuantityTF = new IntegerTextField(I2PPrefs.OutboundBackupQuantity.get().toString(), 1, 1);
    builder.add(outboundBackupQuantityTF, cc.xy(8, 15));

    refreshEnableState();
}

From source file:phex.gui.dialogs.options.NetworkPane.java

License:Open Source License

/**
 * Called when preparing this settings pane for display the first time. Can
 * be overriden to implement the look of the settings pane.
 *///from   w  ww  .  j  a va  2s.  c o m
protected void prepareComponent() {
    setLayout(new BorderLayout());

    JPanel contentPanel = new JPanel();
    //JPanel contentPanel = new FormDebugPanel();
    add(contentPanel, BorderLayout.CENTER);

    FormLayout layout = new FormLayout("10dlu, right:d, 2dlu, d, " + "10dlu, right:d, 2dlu, d, 2dlu:grow", // columns
            "p, 3dlu, p, 3dlu, p, 3dlu, p, 8dlu, " + "p, 3dlu, p, 3dlu, p, 8dlu, " + "p, 3dlu, p");
    layout.setColumnGroups(new int[][] { { 4, 8 }, { 2, 6 } });
    layout.setRowGroups(new int[][] { { 3, 5, 9, 11, 13, 17 } });

    PanelBuilder builder = new PanelBuilder(layout, contentPanel);

    CellConstraints cc = new CellConstraints();

    int row = 1;
    builder.addSeparator(Localizer.getString("NetworkSettings"), cc.xywh(1, row, 9, 1));

    row += 2;
    builder.addLabel(Localizer.getString("ListeningPort") + ": ", cc.xy(2, row));
    listeningPortTF = new IntegerTextField(NetworkPrefs.ListeningPort.get().toString(), 5, 5);
    builder.add(listeningPortTF, cc.xy(4, row));

    builder.addLabel(Localizer.getString("ConnectionTimeout") + ": ", cc.xy(6, row));
    connectionTimeoutTF = new IntegerTextField(
            String.valueOf(NetworkPrefs.TcpConnectTimeout.get().intValue() / 1000), 3, 3);
    builder.add(connectionTimeoutTF, cc.xy(8, row));

    row += 2;
    JLabel label = builder.addLabel(Localizer.getString("NetworkSettings_MaxConcurrentConnectAttempts") + ": ",
            cc.xy(6, row));
    label.setToolTipText(Localizer.getString("NetworkSettings_TTTMaxConcurrentConnectAttempts"));
    maxConcurrentConnectAttemptsTF = new IntegerTextField(
            NetworkPrefs.MaxConcurrentConnectAttempts.get().toString(), 2, 2);
    maxConcurrentConnectAttemptsTF
            .setToolTipText(Localizer.getString("NetworkSettings_TTTMaxConcurrentConnectAttempts"));
    builder.add(maxConcurrentConnectAttemptsTF, cc.xy(8, row));

    row += 2;
    autoConnectChkbx = new JCheckBox(Localizer.getString("AutoConnectOnStartup"),
            ConnectionPrefs.AutoConnectOnStartup.get().booleanValue());
    builder.add(autoConnectChkbx, cc.xywh(2, row, 3, 1));

    connectedToLANChkbx = new JCheckBox(Localizer.getString("ConnectedToLAN"),
            NetworkPrefs.ConnectedToLAN.get().booleanValue());
    connectedToLANChkbx.setToolTipText(Localizer.getString("TTTConnectedToLAN"));
    builder.add(connectedToLANChkbx, cc.xywh(6, row, 3, 1));

    row += 2;
    builder.addSeparator(Localizer.getString("UltrapeerSettings"), cc.xywh(1, row, 9, 1));

    row += 2;
    allowToBeUPChkbx = new JCheckBox(Localizer.getString("AllowToBecomeUltrapeer"),
            ConnectionPrefs.AllowToBecomeUP.get().booleanValue());
    allowToBeUPChkbx.setToolTipText(Localizer.getString("TTTAllowToBecomeUltrapeer"));
    allowToBeUPChkbx.addActionListener(new CheckboxActionListener());
    builder.add(allowToBeUPChkbx, cc.xywh(2, row, 3, 1));

    forceToBeUPChkbx = new JCheckBox(Localizer.getString("ForceToBeUltrapeer"),
            ConnectionPrefs.ForceToBeUltrapeer.get().booleanValue());
    forceToBeUPChkbx.setToolTipText(Localizer.getString("TTTForceToBeUltrapeer"));
    forceToBeUPChkbx.addActionListener(new CheckboxActionListener());
    builder.add(forceToBeUPChkbx, cc.xywh(6, row, 3, 1));

    row += 2;
    up2upConnectionsLabel = builder.addLabel(Localizer.getString("ConnectionsToUltrapeers") + ": ",
            cc.xy(2, row));
    up2upConnectionsLabel.setToolTipText(Localizer.getString("TTTToUltrapeers"));
    up2upConnectionsTF = new IntegerTextField(ConnectionPrefs.Up2UpConnections.get().toString(), 2, 2);
    up2upConnectionsTF.setToolTipText(Localizer.getString("TTTToUltrapeers"));
    builder.add(up2upConnectionsTF, cc.xy(4, row));

    up2LeafConnectionsLabel = builder.addLabel(Localizer.getString("ConnectionsToLeafs") + ": ", cc.xy(6, row));
    up2LeafConnectionsLabel.setToolTipText(Localizer.getString("TTTToLeafs"));

    up2LeafConnectionsTF = new IntegerTextField(ConnectionPrefs.Up2LeafConnections.get().toString(), 3, 3);
    up2LeafConnectionsTF.setToolTipText(Localizer.getString("TTTToLeafs"));
    builder.add(up2LeafConnectionsTF, cc.xy(8, row));

    row += 2;
    builder.addSeparator(Localizer.getString("LeafSettings"), cc.xywh(1, row, 9, 1));

    row += 2;
    leaf2upConnectionsLabel = builder.addLabel(Localizer.getString("ConnectionsToUltrapeers") + ": ",
            cc.xy(2, row));
    leaf2upConnectionsLabel.setToolTipText(Localizer.getString("TTTToUltrapeers"));

    leaf2upConnectionsTF = new IntegerTextField(ConnectionPrefs.Leaf2UpConnections.get().toString(), 2, 1);
    leaf2upConnectionsTF.setToolTipText(Localizer.getString("TTTToUltrapeers"));
    builder.add(leaf2upConnectionsTF, cc.xy(4, row));

    refreshEnableState();
}

From source file:phex.gui.dialogs.options.ProxyPane.java

License:Open Source License

/**
 * Called when preparing this settings pane for display the first time. Can
 * be overriden to implement the look of the settings pane.
 *///from  w ww  .  j a  v a  2  s .  c om
@Override
protected void prepareComponent() {
    FormLayout layout = new FormLayout("10dlu, right:d, 2dlu, d, " + // 4 columns
            "10dlu, right:d, 2dlu, d, 2dlu:grow", // 5 columns
            "p, 3dlu, p, 3dlu, p, 3dlu, " + // 6 rows
                    "p, 3dlu, p, 3dlu, p, 3dlu, p, 6dlu, " + //8 rows
                    "p, 3dlu, fill:d:grow, 3dlu, p, 3dlu, p, 6dlu" //8 rows
    );
    layout.setRowGroups(new int[][] { { 3, 5, 9, 11, 13, 15, 21 } });

    setLayout(layout);
    //FormDebugPanel contentPanel = new FormDebugPanel();
    //JPanel contentPanel = new JPanel();
    //add( this, BorderLayout.CENTER );
    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();

    builder.addSeparator(Localizer.getString("FirewallSettings"), cc.xywh(1, 1, 9, 1));

    exportIPLabel = builder.addLabel(Localizer.getString("ExportIPAs") + ": ", cc.xy(2, 3));
    exportIPTF = new IPTextField();
    exportIPTF.setIPString(ProxyPrefs.ForcedIp.get());
    builder.add(exportIPTF, cc.xy(4, 3));

    builder.addSeparator(Localizer.getString("SOCKSSettings"), cc.xywh(1, 5, 9, 1));

    socks5ProxyCkbx = new JCheckBox(Localizer.getString("UseSocks5Proxy"),
            ProxyPrefs.UseSocks5.get().booleanValue());
    socks5ProxyCkbx.addActionListener(new CheckboxActionListener());
    builder.add(socks5ProxyCkbx, cc.xywh(2, 7, 3, 1));

    socks5HostLabel = builder.addLabel(Localizer.getString("ProxyHostIP") + ": ", cc.xy(2, 9));
    socks5ProxyHostTF = new JTextField(ProxyPrefs.Socks5Host.get(), 15);
    builder.add(socks5ProxyHostTF, cc.xy(4, 9));

    socks5PortLabel = builder.addLabel(Localizer.getString("Port") + ": ", cc.xy(6, 9));
    socks5ProxyPortTF = new IntegerTextField(ProxyPrefs.Socks5Port.get().toString(), 5, 5);
    builder.add(socks5ProxyPortTF, cc.xy(8, 9));

    socks5AuthenticationCkbx = new JCheckBox(Localizer.getString("Authentication"),
            ProxyPrefs.Socks5Authentication.get().booleanValue());
    socks5AuthenticationCkbx.addActionListener(new CheckboxActionListener());
    builder.add(socks5AuthenticationCkbx, cc.xywh(2, 11, 3, 1));

    socks5UserLabel = builder.addLabel(Localizer.getString("Username") + ": ", cc.xy(2, 13));
    socks5UserNameTF = new JTextField(ProxyPrefs.Socks5User.get(), 10);
    builder.add(socks5UserNameTF, cc.xy(4, 13));

    socks5PasswordLabel = builder.addLabel(Localizer.getString("Password") + ": ", cc.xy(6, 13));
    socks5PasswordTF = new JPasswordField(ProxyPrefs.Socks5Password.get(), 10);
    builder.add(socks5PasswordTF, cc.xy(8, 13));

    builder.addSeparator(Localizer.getString("HTTPProxySettings"), cc.xywh(1, 15, 9, 1));

    infoLabel = new PlainMultiLinePanel(Localizer.getString("HttpProxyInfoText"));
    builder.add(infoLabel, cc.xywh(2, 17, 8, 1));

    httpProxyCkbx = new JCheckBox(Localizer.getString("UseHTTPProxy"), ProxyPrefs.UseHttp.get().booleanValue());
    httpProxyCkbx.addActionListener(new CheckboxActionListener());
    builder.add(httpProxyCkbx, cc.xywh(2, 19, 3, 1));

    httpHostLabel = builder.addLabel(Localizer.getString("ProxyHostIP") + ": ", cc.xy(2, 21));
    httpProxyHostTF = new JTextField(ProxyPrefs.HttpHost.get(), 15);
    builder.add(httpProxyHostTF, cc.xy(4, 21));

    httpPortLabel = builder.addLabel(Localizer.getString("Port") + ": ", cc.xy(6, 21));
    httpProxyPortTF = new IntegerTextField(ProxyPrefs.HttpPort.get().toString(), 5, 5);
    builder.add(httpProxyPortTF, cc.xy(8, 21));

    refreshEnableState();
}

From source file:phex.gui.dialogs.options.SharingPane.java

License:Open Source License

/**
 * Called when preparing this settings pane for display the first time. Can
 * be overriden to implement the look of the settings pane.
 *///from w  ww.  j a  v  a 2  s .c  om
@Override
protected void prepareComponent() {
    FormLayout layout = new FormLayout("10dlu, right:d, 2dlu, d, " + "10dlu, right:d, 2dlu, d, 2dlu:grow", // columns
            "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 9dlu, " + // rows
                    "p, 3dlu, p, 3dlu, p, 3dlu, p");
    layout.setRowGroups(new int[][] { { 3, 5, 7, 9, 13, 15, 17 } });

    setLayout(layout);

    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();
    CellConstraints cc2 = new CellConstraints();

    builder.addSeparator(Localizer.getString("GeneralUploadSettings"), cc.xywh(1, 1, 9, 1));

    simultaneousUploadsTF = new IntegerTextField(UploadPrefs.MaxParallelUploads.get().toString(), 6, 3);
    builder.addLabel(Localizer.getString("MaxParallelUploads") + ": ", cc.xy(2, 3), simultaneousUploadsTF,
            cc2.xy(4, 3));

    uploadsPerHostTF = new IntegerTextField(UploadPrefs.MaxUploadsPerIP.get().toString(), 6, 2);
    builder.addLabel(Localizer.getString("MaxUploadsPerHost") + ": ", cc.xy(6, 3), uploadsPerHostTF,
            cc2.xy(8, 3));

    builder.addLabel(Localizer.getString("MaxReturnedSearchHits") + ": ", cc.xy(2, 5));
    returnedSearchLimitTF = new IntegerTextField(
            String.valueOf(LibraryPrefs.MaxResultsPerQuery.get().toString()), 6, 3);
    builder.add(returnedSearchLimitTF, cc.xy(4, 5));

    allowBrowsingChkbx = new JCheckBox(Localizer.getString("AllowBrowsingDirectories"),
            LibraryPrefs.AllowBrowsing.get().booleanValue());
    builder.add(allowBrowsingChkbx, cc.xywh(2, 7, 3, 1));

    sharePartialFilesChkbx = new JCheckBox(Localizer.getString("SharePartialFiles"),
            UploadPrefs.SharePartialFiles.get().booleanValue());
    builder.add(sharePartialFilesChkbx, cc.xywh(6, 7, 3, 1));

    removeCompletedUploadsChkbx = new JCheckBox(Localizer.getString("AutoCleanFinishedUploads"),
            UploadPrefs.AutoRemoveCompleted.get().booleanValue());
    builder.add(removeCompletedUploadsChkbx, cc.xywh(2, 9, 3, 1));

    builder.addSeparator(Localizer.getString("UploadQueuing"), cc.xywh(1, 11, 9, 1));

    allowUploadQueuingChkbx = new JCheckBox(Localizer.getString("AllowUploadQueuing"),
            UploadPrefs.AllowQueuing.get().booleanValue());
    allowUploadQueuingChkbx.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            refreshEnableState();
        }
    });
    builder.add(allowUploadQueuingChkbx, cc.xywh(2, 13, 4, 1));

    queueLimitLabel = builder.addLabel(Localizer.getString("MaxQueueLength") + ": ", cc.xy(2, 15));
    queueLimitTF = new IntegerTextField(UploadPrefs.MaxQueueSize.get().toString(), 6, 2);
    builder.add(queueLimitTF, cc.xy(4, 15));

    minPollTimeLabel = builder.addLabel(Localizer.getString("MinPollTime") + ": ", cc.xy(2, 17));
    minPollTimeTF = new IntegerTextField(UploadPrefs.MinQueuePollTime.get().toString(), 6, 3);
    builder.add(minPollTimeTF, cc.xy(4, 17));

    maxPollTimeLabel = builder.addLabel(Localizer.getString("MaxPollTime") + ": ", cc.xy(6, 17));
    maxPollTimeTF = new IntegerTextField(UploadPrefs.MaxQueuePollTime.get().toString(), 6, 3);
    builder.add(maxPollTimeTF, cc.xy(8, 17));

    refreshEnableState();
}

From source file:phex.gui.dialogs.UpdateNotificationDialog.java

License:Open Source License

private JPanel buildNotificationPanel() {
    JPanel panel = new JPanel();
    //JPanel panel = new FormDebugPanel();

    CellConstraints cc = new CellConstraints();
    FormLayout layout = new FormLayout("16dlu, d, 8dlu, right:d, 16dlu", // columns
            "p, 8dlu, p"); // rows
    layout.setRowGroups(new int[][] { { 1, 3 } });
    PanelBuilder builder = new PanelBuilder(layout, panel);

    builder.addLabel(Localizer.getString("UpdateNotification_YourVersion"), cc.xy(2, 1));
    builder.addLabel(PhexVersion.getFullVersion(), cc.xy(4, 1));

    String releaseVersion = updateChecker.getReleaseVersion();
    String betaVersion = updateChecker.getBetaVersion();
    if (releaseVersion != null) {
        builder.addLabel(Localizer.getString("UpdateNotification_AvailableStableVersion"), cc.xy(2, 3));
        JLabel label = builder.addLabel(releaseVersion, cc.xy(4, 3));
        label.setFont(label.getFont().deriveFont(Font.BOLD));
    } else if (betaVersion != null) {
        builder.addLabel(Localizer.getString("UpdateNotification_AvailableBetaVersion"), cc.xy(2, 3));
        JLabel label = builder.addLabel(betaVersion, cc.xy(4, 3));
        label.setFont(label.getFont().deriveFont(Font.BOLD));
    }//from   ww  w . ja  v a  2s . com

    return panel;
}

From source file:pl.edu.agh.iisg.salomon.plugin.treeevaluator.result.TreeEvaluatorSettingsComponent.java

License:Open Source License

private JComponent createSettingsComponent(IDataEngine dataEngine) throws PlatformException {

    ITree[] trees = dataEngine.getTreeManager().getAll();
    String[] treesNames = new String[trees.length];
    for (int i = 0; i < trees.length; i++) {
        ITree tree = trees[i];//from w w  w  . j av a  2s  .c  om
        treesNames[i] = tree.getName();

    }
    _treeName = new JComboBox(treesNames);

    IDataSet[] dataSets = dataEngine.getDataSetManager().getAll();
    String[] dataSetNames = new String[dataSets.length];
    for (int i = 0; i < dataSets.length; i++) {
        IDataSet dataSet = dataSets[i];
        dataSetNames[i] = dataSet.getName();

    }
    _dataSetName = new JComboBox(dataSetNames);

    FormLayout formLayout = new FormLayout("pref, 4dlu, pref:GROW, 4dlu, min", // columns
            "pref, 2dlu, pref, 2dlu, pref, 2dlu, pref"); // rows)
    formLayout.setRowGroups(new int[][] { { 3, 5 } });

    CellConstraints cellConstraints = new CellConstraints();
    PanelBuilder panelBuilder = new PanelBuilder(formLayout);
    panelBuilder.setDefaultDialogBorder();

    panelBuilder.addSeparator("Tree", cellConstraints.xyw(1, 1, 5));
    panelBuilder.add(new JLabel("Name:"), cellConstraints.xy(1, 3));
    panelBuilder.add(_treeName, cellConstraints.xy(3, 3));

    panelBuilder.addSeparator("Data set", cellConstraints.xyw(1, 5, 5));
    panelBuilder.add(new JLabel("Name:"), cellConstraints.xy(1, 7));
    panelBuilder.add(_dataSetName, cellConstraints.xy(3, 7));

    return panelBuilder.getPanel();
}