Package com.salas.bb.core

Examples of com.salas.bb.core.GlobalModel


     * Tests that if the selection events come faster than the delayed selection
     * triggers only one (the last) event will be triggered in the end after the delay.
     */
    public void testQuickFeedSelection()
    {
        GlobalModel.SINGLETON = new GlobalModel(null);
       
        // Compute delay [100;500] and corresponding allowed error 33%
        long delay = 500;
        long error = (long)(delay * DELAY_PRECISION);
        long waitTime = delay - error;
View Full Code Here


            GlobalController controller = GlobalController.SINGLETON;
            MainFrame mainFrame = controller.getMainFrame();
            ITagsStorage tagsNetworker = controller.getTagsStorage();
            final AbstractTagsDialog dialog = getTagsDialog(mainFrame, tagsNetworker);

            GlobalModel model = GlobalModel.SINGLETON;
            final UserPreferences userPreferences = model.getUserPreferences();

            // We call the code in the next EDT event to consume keyboard shortcut ('T')
            // if the code is called with it, or otherwise it will appear as a letter 'T'
            // in the text field of the dialog once it's opened.
            SwingUtilities.invokeLater(new Runnable()
View Full Code Here

        Thread thPing = new Thread(new Runnable()
        {
            public void run()
            {
                // Ping URL
                GlobalModel model = GlobalController.SINGLETON.getModel();
                UserPreferences prefs = model.getUserPreferences();
                String url = prefs.getPingOnReadingListPublicationURL().trim();
                if (prefs.isPingOnReadingListPublication() && url.length() > 0 && url.indexOf("%u") != -1)
                {
                    IGuide[] publishedGuides = collectGuides(model.getGuidesSet());
                    pingGuides(publishedGuides, url);
                }
            }
        }, THREAD_NAME_PING);
View Full Code Here

     *
     * @return <code>TRUE</code> if low-rated.
     */
    static boolean isLowRated(IFeed feed)
    {
        GlobalModel model = GlobalModel.SINGLETON;
        if (model == null) return false;

        // NOTE: We intentionally don't count gray starz
        int threshold = model.getUserPreferences().getGoodChannelStarz() - 1;

        return feed.getRating() > -1 && feed.getRating() < threshold;
    }
View Full Code Here

        {
            progressDialog.open();
        }

        // Create empty model and read in all preferences we have
        model = new GlobalModel(null, false);
        model.restorePreferences(Application.getUserPreferences());

        // Create empty database

        progressDialog.succeedStep();
View Full Code Here

         *
         * @param id guide ID.
         */
        public void guideClicked(long id)
        {
            GlobalModel model = GlobalModel.SINGLETON;
            GuidesSet set = model.getGuidesSet();
            guideClicked(set.findGuideByID(id));
        }
View Full Code Here

         *
         * @param id feed ID.
         */
        public void feedClicked(long id)
        {
            GlobalModel model = GlobalModel.SINGLETON;
            GuidesSet set = model.getGuidesSet();
            feedClicked(set.findFeedByID(id));
        }
View Full Code Here

    public void actionPerformed(ActionEvent e)
    {
        if (feed == null || feed.getID() == -1 || !(feed instanceof DirectFeed)) return;
        DirectFeed dFeed = (DirectFeed)feed;

        GlobalModel model = GlobalModel.SINGLETON;
        UserPreferences preferences = model.getUserPreferences();
        BrowserLauncher.showDocument(dFeed.getSiteURL(), preferences.getInternetBrowser());
    }
View Full Code Here

        {
            URL baseURL = list.getURL();
            List feeds = aGuide.getFeeds();
            Set<String> urls = new HashSet<String>();

            GlobalModel model = GlobalController.SINGLETON.getModel();
            int limit = model.getUserPreferences().getFeedImportLimit();

            // Collect all XML URL's of all direct feeds
            List<DirectFeed> feedsList = new ArrayList<DirectFeed>(feeds.size());
            for (int i = 0; limit > 0 && i < feeds.size(); i++)
            {
View Full Code Here

     *
     * @param event original event object.
     */
    protected void doAction(ActionEvent event)
    {
        GlobalModel model = GlobalModel.SINGLETON;
        IFeed[] feeds = getFeeds();
        GlobalController.readFeeds(true, model.getSelectedGuide(), feeds);
    }
View Full Code Here

TOP

Related Classes of com.salas.bb.core.GlobalModel

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.