X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FBlogReader.java;h=c120a1bde09aa56cd93f5b529ae9d4df6cd6e44d;hb=c932f0e85a8852824cdd8ce790af68682732c85c;hp=1807764276a6960db631b15e65ef4d1fa95e167e;hpb=dcac7508c650e40ce26902ab81f3fcbf86d709eb;p=jalview.git diff --git a/src/jalview/gui/BlogReader.java b/src/jalview/gui/BlogReader.java index 1807764..c120a1b 100644 --- a/src/jalview/gui/BlogReader.java +++ b/src/jalview/gui/BlogReader.java @@ -21,6 +21,7 @@ package jalview.gui; import jalview.bin.Cache; +import jalview.bin.Console; import jalview.util.MessageManager; import java.awt.BorderLayout; @@ -199,7 +200,7 @@ public class BlogReader extends JPanel { if (parent != null) { - Cache.log.debug("News window closed."); + Console.debug("News window closed."); jd = null; parent.showNews(false); } @@ -219,7 +220,7 @@ public class BlogReader extends JPanel } }; - }; + } private JLabel lblChannels = new JLabel(); @@ -247,17 +248,15 @@ public class BlogReader extends JPanel public BlogReader(Desktop desktop) { - Cache.log.debug("Constructing news reader."); + Console.debug("Constructing news reader."); parent = desktop; _channelModel = new ChannelListModel(); // Construct our jalview news channel Channel chan = new Channel(); - chan.setURL( - jalview.bin.Cache.getDefault("JALVIEW_NEWS_RSS", - jalview.bin.Cache.getDefault("www.jalview.org", - "https://www.jalview.org") - + "/feeds/desktop/rss")); + chan.setURL(Cache.getDefault("JALVIEW_NEWS_RSS", + Cache.getDefault("www.jalview.org", "https://www.jalview.org") + + "/feeds/desktop/rss")); loadLastM(); _channelModel.addChannel(chan); updating = true; @@ -279,11 +278,11 @@ public class BlogReader extends JPanel if (setvisible) { - Cache.log.debug("Will show jalview news automatically"); + Console.debug("Will show jalview news automatically"); showNews(); } } - Cache.log.debug("Completed construction of reader."); + Console.debug("Completed construction of reader."); } @@ -343,7 +342,7 @@ public class BlogReader extends JPanel MessageManager.getString("label.news_from_jalview"), bounds.width, bounds.height); jd.frame.setModalExclusionType(ModalExclusionType.NO_EXCLUDE); - Cache.log.debug("Displaying news."); + Console.debug("Displaying news."); jd.waitForInput(); } } @@ -368,10 +367,9 @@ public class BlogReader extends JPanel } catch (Exception x) { } - ; if (chan != null && chan.getItems() != null) { - Cache.log.debug("Scanning news items: newsnew=" + newsnew + Console.debug("Scanning news items: newsnew=" + newsnew + " and lastDate is " + lastDate); for (Item i : (List) chan.getItems()) { @@ -430,7 +428,7 @@ public class BlogReader extends JPanel { String formatted = Cache .setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", lastDate); - Cache.log.debug("Saved last read date as " + formatted); + Console.debug("Saved last read date as " + formatted); } } } @@ -755,12 +753,16 @@ public class BlogReader extends JPanel } } + /** + * @j2sIgnore + * @param args + */ public static void main(String args[]) { // this tests the detection of new news based on the last read date stored // in jalview properties - jalview.bin.Cache.loadProperties(null); - jalview.bin.Cache.initLogger(); + Cache.loadProperties(null); + Console.initLogger(); // test will advance read date each time Calendar today = Calendar.getInstance(), lastread = Calendar.getInstance(); @@ -770,19 +772,19 @@ public class BlogReader extends JPanel String formattedDate = Cache.setDateProperty( "JALVIEW_NEWS_RSS_LASTMODIFIED", lastread.getTime()); BlogReader me = new BlogReader(); - System.out.println("Set last date to " + formattedDate); + jalview.bin.Console.outPrintln("Set last date to " + formattedDate); if (me.isNewsNew()) { - Cache.log.debug("There is news to read."); + Console.debug("There is news to read."); } else { - Cache.log.debug("There is no new news."); + Console.debug("There is no new news."); me.xf.setTitle("Testing : Last read is " + me.lastDate); me.showNews(); me.xf.toFront(); } - Cache.log.debug("Waiting for closure."); + Console.debug("Waiting for closure."); do { try @@ -791,16 +793,15 @@ public class BlogReader extends JPanel } catch (InterruptedException x) { } - ; } while (me.isVisible()); if (me.isNewsNew()) { - Cache.log.debug("Still new news after reader displayed."); + Console.debug("Still new news after reader displayed."); } if (lastread.getTime().before(me.lastDate)) { - Cache.log.debug("The news was read."); + Console.debug("The news was read."); lastread.setTime(me.lastDate); } else