Example usage for com.jgoodies.forms.layout CellConstraints xyw

List of usage examples for com.jgoodies.forms.layout CellConstraints xyw

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout CellConstraints xyw.

Prototype

public CellConstraints xyw(int col, int row, int colSpan) 

Source Link

Document

Sets the column, row, width, and height; uses a height (row span) of 1 and the horizontal and vertical default alignments.

Examples:

 cc.xyw(1, 3, 7); cc.xyw(1, 3, 2); 

Usage

From source file:de.dal33t.powerfolder.ui.folders.OnlineStorageComponent.java

License:Open Source License

private void buildUI() {
    FormLayout layout = new FormLayout("pref, pref:grow, pref", "3dlu, pref, 3dlu, pref");
    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();

    builder.addSeparator(null, cc.xyw(1, 2, 3));
    builder.add(syncActionLabel.getUIComponent(), cc.xy(1, 4));
    builder.add(webButton, cc.xy(3, 4));
    uiComponent = builder.getPanel();//from  ww w .jav a 2  s. c  om
    uiComponent.setOpaque(false);
}

From source file:de.dal33t.powerfolder.ui.information.downloads.DownloadsInformationCard.java

License:Open Source License

/**
 * Build the ui component pane./*from   w w  w .  j ava2s  .  co  m*/
 */
private void buildUIComponent() {
    FormLayout layout = new FormLayout("3dlu, pref, 3dlu, pref:grow, 3dlu",
            "3dlu, pref, 3dlu, pref, 3dlu, fill:pref:grow, 3dlu, pref, pref, pref");
    // tools sep table dets sep stats
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();

    builder.add(toolBar, cc.xy(2, 2));
    builder.add(cleanupLabel, cc.xy(4, 2));
    builder.addSeparator(null, cc.xyw(1, 4, 5));
    builder.add(tablePanel.getUIComponent(), cc.xyw(2, 6, 3));
    builder.add(detailsPanel, cc.xyw(2, 8, 3));
    builder.addSeparator(null, cc.xyw(1, 9, 5));
    builder.add(statsPanel, cc.xyw(2, 10, 3));
    uiComponent = builder.getPanel();
    initStatsTimer();
}

From source file:de.dal33t.powerfolder.ui.information.folder.files.FileDetailsPanel.java

License:Open Source License

/**
 * Returns the ui component for the fileinfo panel
 *
 * @return the panel component/*from   ww w. ja  v  a  2s. c om*/
 */
public JPanel getPanel() {
    if (panel == null) {
        // Initalize components
        initComponents();

        FormLayout layout;
        if (includeSeparator) {
            layout = new FormLayout("right:max(p;50dlu), 3dlu, 107dlu, 40dlu, right:p, 3dlu, 107dlu, p:g",
                    "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu");
        } else {
            layout = new FormLayout("right:max(p;50dlu), 3dlu, 107dlu, 40dlu, right:p, 3dlu, 107dlu, p:g",
                    "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu");
        }
        DefaultFormBuilder builder = new DefaultFormBuilder(layout);
        CellConstraints cc = new CellConstraints();

        int row = 1;

        if (includeSeparator) {
            builder.addSeparator(null, cc.xyw(1, row, 8));

            row += 2;
        }

        builder.addLabel(Translation.getTranslation("file_details_panel.name"), cc.xy(1, row));
        builder.add(nameField, cc.xywh(3, row, 5, 1));

        row += 2;

        builder.addLabel(Translation.getTranslation("file_details_panel.location"), cc.xy(1, row));
        builder.add(locationField, cc.xy(3, row));

        builder.addLabel(Translation.getTranslation("general.folder"), cc.xy(5, row));
        builder.add(folderField, cc.xy(7, row));

        row += 2;

        builder.addLabel(Translation.getTranslation("general.size"), cc.xy(1, row));
        builder.add(sizeField, cc.xy(3, row));

        builder.addLabel(Translation.getTranslation("file_details_panel.modified_by"), cc.xy(5, row));
        builder.add(modifiedByField, cc.xy(7, row));

        row += 2;

        builder.addLabel(Translation.getTranslation("file_details_panel.status"), cc.xy(1, row));
        builder.add(statusField, cc.xy(3, row));

        builder.addLabel(Translation.getTranslation("file_details_panel.modified_date"), cc.xy(5, row));
        builder.add(modifiedDateField, cc.xy(7, row));

        row += 2;

        builder.addLabel(Translation.getTranslation("file_details_panel.version"), cc.xy(5, row));
        builder.add(versionField, cc.xy(7, row));

        builder.addLabel(Translation.getTranslation("file_details_panel.availability"), cc.xy(1, row));
        builder.add(sourcesField, cc.xy(3, row));

        row += 2;

        builder.addLabel(Translation.getTranslation("general.local_copy_at"), cc.xy(1, row));
        builder.add(localCopyAtField, cc.xywh(3, row, 5, 1));

        panel = builder.getPanel();
        panel.setVisible(false);
    }

    return panel;
}

From source file:de.dal33t.powerfolder.ui.information.folder.files.FilesTab.java

License:Open Source License

/**
 * Bulds the ui component.//from ww w.  j  av a  2 s  . co  m
 */
private void buildUIComponent() {
    FormLayout layout = new FormLayout("3dlu, pref:grow, 3dlu",
            "3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, fill:pref:grow, 3dlu, pref, pref");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();

    builder.add(createToolBar(), cc.xy(2, 2));
    builder.add(padBreadcrumb(), cc.xy(2, 4));
    builder.addSeparator(null, cc.xyw(1, 6, 3));

    builder.add(tablePanel.getUIComponent(), cc.xy(2, 8));
    builder.addSeparator(null, cc.xy(2, 10));
    builder.add(statsPanel.getUiComponent(), cc.xy(2, 11));
    uiComponent = builder.getPanel();
}

From source file:de.dal33t.powerfolder.ui.information.folder.members.MembersExpertTab.java

License:Open Source License

/**
 * Builds the ui component.//www.j  a  va  2s . c  o m
 */
private void buildUIComponent() {
    FormLayout layout = new FormLayout("3dlu, fill:pref:grow, 3dlu",
            "3dlu, pref, 3dlu, pref , 3dlu, fill:0:grow");
    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();
    builder.add(createToolBar(), cc.xy(2, 2));
    builder.addSeparator(null, cc.xyw(1, 4, 3));
    builder.add(scrollPane, cc.xy(2, 6));

    uiComponent = builder.getPanel();
}

From source file:de.dal33t.powerfolder.ui.information.folder.members.MembersSimpleTab.java

License:Open Source License

/**
 * Bulds the ui component./*  ww w . j a  v a2 s . c o  m*/
 */
private void buildUIComponent() {
    FormLayout layout = new FormLayout("3dlu, fill:pref:grow, 3dlu",
            "3dlu, pref, 3dlu, pref , 3dlu, fill:0:grow, 3dlu, pref");
    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();
    builder.add(createToolBar(), cc.xy(2, 2));
    builder.addSeparator(null, cc.xyw(1, 4, 3));
    builder.add(scrollPane, cc.xy(2, 6));
    uiComponent = builder.getPanel();
}

From source file:de.dal33t.powerfolder.ui.information.folder.problems.ProblemsTab.java

License:Open Source License

/**
 * Bulds the ui component.//from  w w w.java  2s. c  o m
 */
private void buildUIComponent() {
    FormLayout layout = new FormLayout("3dlu, fill:pref:grow, 3dlu",
            "3dlu, pref, 3dlu, pref , 3dlu, fill:0:grow, 3dlu");
    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();
    builder.add(createToolBar(), cc.xy(2, 2));
    builder.addSeparator(null, cc.xyw(1, 4, 3));
    builder.add(scrollPane, cc.xy(2, 6));

    uiComponent = builder.getPanel();
}

From source file:de.dal33t.powerfolder.ui.information.folder.settings.SettingsTab.java

License:Open Source License

/**
 * Builds the ui component./*from  ww w . j a  v a 2  s . c o  m*/
 */
private void buildUIComponent() {
    // label folder butn padding
    FormLayout layout = new FormLayout("3dlu, right:pref, 3dlu, 140dlu, 3dlu, pref, pref:grow",
            "3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 12dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();

    int row = 2;
    Boolean expertMode = PreferencesEntry.EXPERT_MODE.getValueBoolean(getController());
    if (expertMode) {
        builder.add(new JLabel(Translation.getTranslation("general.transfer_mode")), cc.xy(2, row));
        builder.add(transferModeSelectorPanel.getUIComponent(), cc.xyw(4, row, 4));
    } else {
        transferModeSelectorPanel.getUIComponent();
    }

    row += 2;
    builder.add(new JLabel(Translation.getTranslation("settings_tab.local_folder_location")), cc.xy(2, row));
    builder.add(localFolderField, cc.xy(4, row));
    builder.add(localFolderButton, cc.xy(6, row));

    row += 2;
    builder.add(new JLabel(Translation.getTranslation("general.local_archive_mode")), cc.xy(2, row));
    builder.add(localArchiveModeSelectorPanel.getUIComponent(), cc.xyw(4, row, 4));

    if (expertMode) {
        row += 2;
        builder.add(onlineLabel, cc.xy(2, row));
        builder.add(onlineArchiveModeSelectorPanel.getUIComponent(), cc.xyw(4, row, 4));
    }

    row += 2;
    if (expertMode) {
        builder.addLabel(Translation.getTranslation("exp.settings_tab.download_script"), cc.xy(2, row));
        builder.add(createScriptField(), cc.xyw(4, row, 4));
    }

    row += 2;
    if (expertMode) {
        builder.add(new JLabel(Translation.getTranslation("exp.settings_tab.ignore_patterns")),
                cc.xy(2, row, "right, top"));
        builder.add(createPatternsPanel(), cc.xyw(4, row, 4));
        row += 2;
        builder.add(createConfigurePanel(), cc.xy(4, row));
    } else {
        createPatternsPanel();
        createConfigurePanel();
        row += 2;
    }

    // Disabled. Not used anymore.
    createPreviewPanel();
    // row += 2;
    // builder.add(createPreviewPanel(), cc.xy(4, row));

    row += 2;
    builder.add(createDeletePanel(), cc.xy(4, row));

    if (expertMode) {
        row += 2;
        builder.add(createMaintainPanel(), cc.xy(4, row));
    }

    addSelectionListener();

    uiComponent = builder.getPanel();
}

From source file:de.dal33t.powerfolder.ui.information.notices.NoticesInformationCard.java

License:Open Source License

/**
 * Build the ui component pane./* ww w  .  jav a2s. c o  m*/
 */
private void buildUIComponent() {
    FormLayout layout = new FormLayout("3dlu, pref:grow, 3dlu",
            "3dlu, pref, 3dlu, pref, 3dlu, fill:pref:grow, 3dlu");
    // tools sep table dets sep stats
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();
    JScrollPane pane = new JScrollPane(noticesTable);
    builder.add(buildToolbar().getPanel(), cc.xy(2, 2));
    builder.addSeparator(null, cc.xyw(1, 4, 3));
    builder.add(pane, cc.xy(2, 6));
    uiComponent = builder.getPanel();
    buildPopupMenus();
}

From source file:de.dal33t.powerfolder.ui.information.stats.StatsInformationCard.java

License:Open Source License

private JPanel getAveragePanel() {
    DateAxis domain = new DateAxis(Translation.getTranslation("stats_information_card.date"));
    TimeSeriesCollection series = new TimeSeriesCollection();
    NumberAxis axis = new NumberAxis(Translation.getTranslation("stats_information_card.percentage"));

    series.addSeries(percentageBandwidthSeries);

    XYItemRenderer renderer = new StandardXYItemRenderer();
    XYPlot plot = new XYPlot(series, domain, axis, renderer);
    JFreeChart graph = new JFreeChart(plot);
    ChartPanel cp = new ChartPanel(graph);

    FormLayout layout = new FormLayout("3dlu, fill:pref:grow, 3dlu",
            "3dlu, pref , 3dlu, pref, 3dlu, fill:pref:grow, 3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();

    JPanel p = buildPercentStatsControlPanel();

    builder.add(p, cc.xy(2, 2));/*from  w  w w.  j a  va  2s. co m*/
    builder.addSeparator(null, cc.xyw(1, 4, 3));
    builder.add(cp, cc.xy(2, 6));
    return builder.getPanel();
}