Examples of BBFormBuilder


Examples of com.salas.bb.utils.uif.BBFormBuilder

     *
     * @return table.
     */
    protected JPanel createDataTable(JPanel table, int max)
    {
        BBFormBuilder builder = new BBFormBuilder("16px, 4dlu, 50dlu:grow, 2dlu, p, 7dlu, p", table);
        builder.setDefaultDialogBorder();

        // Output header
        builder.append(UifUtilities.boldFont(new JLabel(headerEntityTitle)), 3);
        builder.append(UifUtilities.boldFont(new JLabel(Strings.message("report.activity"))), 1,
            CellConstraints.CENTER, CellConstraints.DEFAULT);
        builder.append(UifUtilities.boldFont(new JLabel(Strings.message("report.stats"))), 1,
            CellConstraints.CENTER, CellConstraints.DEFAULT);

        LineChartConfig config = new SparklineConfig();
        config.setValueXStep(2);

        // Output data
        if (stats != null)
        {
            int i = 0;
            for (ReadStats stat : stats)
            {
                if (i++ == max) break;

                LineChartData data = new LineChartData(stat.getCounts());
                LineChart chart = new LineChart(data, config);

                builder.appendRelatedComponentsGapRow(2);
                builder.appendRow("max(p;20px)");
                builder.append(new JLabel(itemIcon));
                builder.append(createLabel(stat.getObjectId(), stat.getObjectTitle()));
                builder.append(chart, 1, CellConstraints.CENTER, CellConstraints.FILL);
                builder.append(new JLabel("<html><b>" + stat.getTotal() + " articles</b><br>" +
                    getAvg(stat) + " a day"));
            }
        }

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

Examples of com.salas.bb.utils.uif.BBFormBuilder

        int ascendingSortingInd = sort2index(feed == null ? null : feed.getAscendingSorting());
        cbAscendingSorting = new JComboBox(new String[] {
            "Global", "Ascending", "Descending"});
        cbAscendingSorting.setSelectedIndex(ascendingSortingInd);

        BBFormBuilder builder = new BBFormBuilder("7dlu, p, 4dlu, p, 0:grow", this);
        builder.setDefaultDialogBorder();

        builder.append(Strings.message("show.feed.properties.tab.display.type"), 2, cbFeedType, 1);
        builder.appendUnrelatedComponentsGapRow(2);
        builder.append(chCustomViewModeEnabled, 5);
        builder.setLeadingColumnOffset(1);
        JLabel lbViewMode = builder.append(Strings.message("show.feed.properties.tab.display.mode"), 1);
        builder.append(cbViewMode);
        lbViewMode.setLabelFor(cbViewMode);

        builder.setLeadingColumnOffset(0);
        builder.nextLine();
        builder.append("Sorting order: ", 2, cbAscendingSorting, 1);

        StateUpdatingToggleListener.install(chCustomViewModeEnabled, lbViewMode, cbViewMode);
    }
View Full Code Here

Examples of com.salas.bb.utils.uif.BBFormBuilder

        // Initialize the panel itself
        setBackground(config.getBackgroundColor());

        // Build the layout
        BBFormBuilder builder = new BBFormBuilder("p:grow", this);
        builder.setDefaultDialogBorder();

        JLabel lbByDay = new JLabel(Strings.message("report.articles.read.by.hour.title"));
        Font fntBold = lbByDay.getFont().deriveFont(Font.BOLD);
        lbByDay.setFont(fntBold);
        builder.append(lbByDay, 1, CellConstraints.CENTER, CellConstraints.DEFAULT);
        builder.appendRelatedComponentsGapRow(2);
        builder.appendRow("p:grow");
        builder.append(chartByHour, 1, CellConstraints.FILL, CellConstraints.FILL);
        builder.appendUnrelatedComponentsGapRow(2);

        JLabel lbByWeek = new JLabel(Strings.message("report.articles.read.by.hour.title") + " " +
            Strings.message("report.since.reset.box"));
        lbByWeek.setFont(fntBold);
        builder.append(lbByWeek, 1, CellConstraints.CENTER, CellConstraints.DEFAULT);
        builder.appendRelatedComponentsGapRow(2);
        builder.appendRow("p:grow");
        builder.append(chartByHourReset, 1, CellConstraints.FILL, CellConstraints.FILL);
    }
View Full Code Here

Examples of com.salas.bb.utils.uif.BBFormBuilder

     */
    protected JComponent buildBody()
    {
        initComponents();

        BBFormBuilder builder = new BBFormBuilder("right:pref, 4dlu, 150dlu:grow, 2dlu, pref");

        builder.append(Strings.message("subscribe.to.feed.wording"), 5);
        builder.appendUnrelatedComponentsGapRow(2);
        builder.append(Strings.message("subscribe.to.feed.address"), chanURL, btnSuggest);
        builder.appendUnrelatedComponentsGapRow(2);
        builder.appendRow("top:pref");
        builder.append(Strings.message("subscribe.to.feed.examples"), 1);
        builder.append(lbExamples, 3);

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

Examples of com.salas.bb.utils.uif.BBFormBuilder

        // Register changes monitor
        ActionListener monitor = new SearchCriteriaChangeMonitor(chPinnedArticlesOnly, tfSearch, helpIcon);
        tfSearch.addActionListener(monitor);
        chPinnedArticlesOnly.addActionListener(monitor);

        BBFormBuilder builder = new BBFormBuilder("p, 2dlu, 50dlu, 2dlu, p, 4dlu, p, 7dlu, p, 14dlu:grow, p");

        JLabel lbSearch = builder.append(Strings.message("search.prompt"), 1);
        lbSearch.setLabelFor(tfSearch);
        UifUtilities.smallerFont(lbSearch);
        UifUtilities.smallerFont(tfSearch);
        builder.append(tfSearch);
        builder.append(helpIcon);
        builder.append(chPinnedArticlesOnly, 1, CellConstraints.DEFAULT, CellConstraints.CENTER);
        builder.append(lbResults);
        builder.append(pgSpinner);
        builder.appendUnrelatedComponentsGapRow();

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

Examples of com.salas.bb.utils.uif.BBFormBuilder

     *
     * @return control panel.
     */
    private JComponent buildControlPanel()
    {
        BBFormBuilder builder = new BBFormBuilder("5dlu, p, 5dlu");

        builder.appendRelatedComponentsGapRow();
        builder.setLeadingColumnOffset(1);
        builder.nextLine();

        // Grouping
        Action actGroup = new AbstractAction()
        {
            private ActionLabel selection;
            public void actionPerformed(ActionEvent e)
            {
                if (selection == e.getSource()) return;
                if (selection != null) selection.setSelected(false);
                onGroupingChange(e.getID());
                selection = (ActionLabel)e.getSource();
            }
        };
        ActionLabel albFlat = new ActionLabel(actGroup,
            Strings.message("search.groupping.flat"), SearchResultsListModel.GROUP_FLAT);
        ActionLabel albKind = new ActionLabel(actGroup,
            Strings.message("search.groupping.kind"), SearchResultsListModel.GROUP_KIND);
        ActionLabel albDate = new ActionLabel(actGroup,
            Strings.message("search.groupping.date"), SearchResultsListModel.GROUP_DATE);
        albKind.setSelected(true);

        // Filtering
        Action actFiltering = new AbstractAction()
        {
            private ActionLabel selection;
            public void actionPerformed(ActionEvent e)
            {
                if (selection == e.getSource()) return;
                if (selection != null) selection.setSelected(false);
                onFilteringChange(e.getID());
                selection = (ActionLabel)e.getSource();
            }
        };
        ActionLabel albAnyDate = new ActionLabel(actFiltering,
            Strings.message("search.when.any.date"),
            ResultsList.DATE_ANY);
        ActionLabel albToday = new ActionLabel(actFiltering,
            Strings.message("search.when.today"),
            ResultsList.DATE_TODAY);
        ActionLabel albYesterday =new ActionLabel(actFiltering,
            Strings.message("search.when.since.yesterday"),
            ResultsList.DATE_YESTERDAY);
        ActionLabel albThisWeek = new ActionLabel(actFiltering,
            Strings.message("search.when.this.week"),
            ResultsList.DATE_WEEK);
        ActionLabel albThisMonth = new ActionLabel(actFiltering,
            Strings.message("search.when.this.month"),
            ResultsList.DATE_MONTH);
        ActionLabel albThisYear = new ActionLabel(actFiltering,
            Strings.message("search.when.this.year"),
            ResultsList.DATE_YEAR);
        albAnyDate.setSelected(true);

        builder.append(smallLabel(Strings.message("search.groupping")));
        builder.nextLine();
        builder.append(albFlat);
        builder.nextLine();
        builder.append(albKind);
        builder.nextLine();
        builder.append(albDate);
//        builder.nextLine();

        builder.appendUnrelatedComponentsGapRow(2);
        builder.setLeadingColumnOffset(0);
        builder.append(new JLabel(), 3);
//        builder.append(new JPopupMenu.Separator(), 3);

        builder.setLeadingColumnOffset(1);
        builder.append(smallLabel(Strings.message("search.when")));
        builder.nextLine();
        builder.append(albAnyDate);
        builder.nextLine();
        builder.append(albToday);
        builder.nextLine();
        builder.append(albYesterday);
        builder.nextLine();
        builder.append(albThisWeek);
        builder.nextLine();
        builder.append(albThisMonth);
        builder.nextLine();
        builder.append(albThisYear);
        builder.nextLine();

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

Examples of com.salas.bb.utils.uif.BBFormBuilder

     *
     * @return table.
     */
    protected JPanel createDataTable(JPanel table, int max)
    {
        BBFormBuilder builder = new BBFormBuilder("16px, 2dlu, 50dlu:grow, 2dlu, center:p", table);
        builder.setDefaultDialogBorder();

        // Output header
        builder.append(UifUtilities.boldFont(new JLabel(Strings.message("report.feed"))), 3);
        builder.append(UifUtilities.boldFont(new JLabel(Strings.message("report.days"))));

        // Output data
        int i = 0;
        for (RFeed feed : data)
        {
            if (i++ == max) break;

            builder.append(new JLabel(ResultItemType.FEED.getIcon()));
            builder.append(createFeedLabel(feed.feed));
            builder.append(new JLabel(Integer.toString(feed.getDaysWithoutAPost())));
        }

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

Examples of com.salas.bb.utils.uif.BBFormBuilder

    private void layoutComponents()
    {
        JComponent wording = ComponentsFactory.createWrappedMultilineLabel(
            Strings.message("userprefs.tab.readinglists.wording"));

        BBFormBuilder builder = new BBFormBuilder("7dlu, p, 4dlu, p, 0:grow", this);
        builder.setDefaultDialogBorder();

        builder.append(wording, 5);
        builder.appendUnrelatedComponentsGapRow(2);

        builder.appendSeparator(Strings.message("userprefs.tab.readinglists.updates"));
        builder.setLeadingColumnOffset(1);
        builder.append(rbUpdateManually, 4);
        builder.append(rbUpdatePeriodically, cbUpdatePeriod);

        builder.setLeadingColumnOffset(0);
        builder.appendSeparator(Strings.message("userprefs.tab.readinglists.command"));
        builder.setLeadingColumnOffset(1);
        builder.append(chUpdateFeeds, 4);
        builder.append(chUpdateReadingLists, 4);

        builder.setLeadingColumnOffset(0);
        builder.appendSeparator(Strings.message("userprefs.tab.readinglists.action"));
        builder.setLeadingColumnOffset(1);
        builder.append(rbChangeSilently, 4);
        builder.append(rbChangeWithNotification, 4);
        builder.append(rbChangeWithConfirmation, 4);
    }
View Full Code Here

Examples of com.salas.bb.utils.uif.BBFormBuilder

     */
    private Component buildBody()
    {
        initComponents();

        BBFormBuilder builder = new BBFormBuilder("40dlu, 2dlu, 95dlu, 2dlu, 72px, 2dlu, max(20dlu;p)");
        appendDeleteArticleSelection(builder);
        appendDeleteFeedSelection(builder);
        JPanel optionsPanel = builder.getPanel();

        builder = new BBFormBuilder("p, 4dlu, p");
        builder.append(buildGuideSelection(), 3);
        builder.append(optionsPanel, 1, CellConstraints.FILL, CellConstraints.TOP);
        builder.append(buildResultsTable(), 1, CellConstraints.FILL, CellConstraints.FILL);

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

Examples of com.salas.bb.utils.uif.BBFormBuilder

     *
     * @return main panel.
     */
    private Component buildMainPanel()
    {
        BBFormBuilder builder = new BBFormBuilder("pref, 4dlu, 150dlu, 2dlu, pref");

        builder.append(getTitleLabel(), tfTitle, 3);
        builder.append(Strings.message("tags.description"), tfDescription, 3);
        builder.append(Strings.message("tags.extended"), tfExtended, 3);
        builder.append(Strings.message("tags.tags"), tfTags, new JButton(new SuggestTagsAction()));

        builder.nextLine();
        builder.appendUnrelatedComponentsGapRow();
        builder.nextLine();

        builder.append(Strings.message("tags.other.tags"), 1, lbSharedTags, btnFetch);

        builder.appendUnrelatedComponentsGapRow();
       
        return builder.getPanel();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.