net.sourceforge.rssowl.controller
Class GUI

java.lang.Object
  extended bynet.sourceforge.rssowl.controller.GUI
All Implemented Interfaces:
ITranslatable

public class GUI
extends Object
implements ITranslatable

This is RSSOwl's Main controller. All GUI Elements are registered in here and getter Methods are provided so that other Classes are able to access and use them. All settings are loaded in here.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
(package private)  ArchiveManager archiveManager
           
private  org.eclipse.swt.widgets.Composite boxContainer
           
static org.eclipse.swt.widgets.Display display
          A lot of other obj have to access display
(package private)  EventManager eventManager
           
private  org.eclipse.swt.custom.SashForm holdContentSash
           
private  org.eclipse.swt.custom.SashForm holdNewsSash
           
static RSSOwlI18n i18n
          Internationalization for RSSOwl
static boolean isClosing
          Flag is set to TRUE when RSSOwl is exiting
(package private) static String loadURLOnStartup
          If the user has passed an argument to the application, it is stored here
static LoggerImpl logger
          Log all catched Exceptions
private  AmphetaRateThread rssOwlAmphetaRate
           
private  CryptoManager rssOwlCryptoManager
           
(package private)  FavoritesTree rssOwlFavoritesTree
           
private  FeedAutoUpdater rssOwlFeedAutoUpdater
           
(package private)  FeedCacheManager rssOwlFeedCacheManager
           
private  FeedQueueLoader rssOwlFeedQueueLoader
           
static GUI rssOwlGui
          For classes who needs to access the MainController
private  RSSOwlMenu rssOwlMenu
           
(package private)  NewsTabFolder rssOwlNewsTabFolder
           
private  NewsText rssOwlNewsText
           
private  Quickview rssOwlQuickView
           
(package private)  StatusLine rssOwlStatusLine
           
private  SystemTray rssOwlSystray
           
private  Hashtable sashWeights
           
static org.eclipse.swt.widgets.Shell shell
          A lot of other obj have to access shell
(package private)  Hashtable shellBounds
           
 
Constructor Summary
GUI(org.eclipse.swt.widgets.Display display, org.eclipse.swt.widgets.Shell splashShell)
          Instantiate a new GUI
 
Method Summary
 void abnormalShutDown()
          This method is called from the Shutdown Hook Thread in case RSSOwl was shut down not the normal way (e.g. the OS is shutting down).
 void changeWindowLayout()
          Change the window layout between 2 and 3 column window layout
 void displayNewsfeed(Channel rssChannel, String url, String searchPattern, boolean reselectNews, int displayMode)
          Display the selected newsfeed in the TabFolder
 void enableSystrayIcon(boolean enabled)
          Enable / Disable Systray Icon for RSSOwl
 ArchiveManager getArchiveManager()
          Get the archive manager for RSSOwl
 EventManager getEventManager()
          Get the event manager for RSSOwl.
 FeedCacheManager getFeedCacheManager()
          Get the feed cache manager
 AmphetaRateThread getRSSOwlAmphetaRate()
          Let other objects access this thread
 FavoritesTree getRSSOwlFavoritesTree()
          Method to let other obj access this object
 FeedQueueLoader getRSSOwlFeedQueueLoader()
          Let other objects access this thread
 RSSOwlMenu getRSSOwlMenu()
          Method to let other obj access this object
 NewsTabFolder getRSSOwlNewsTabFolder()
          Get the NewsTabFolder displaying newsfeeds
 NewsText getRSSOwlNewsText()
          Get the NewsText composite
 Quickview getRSSOwlQuickview()
          Get the RSSOwl quickview control
 StatusLine getRSSOwlStatusLine()
          Get the StatusLine control
 SystemTray getRSSOwlSystray()
          Get the SystemTray object
 Hashtable getSashWeights()
          Method to let other obj access this object
 Hashtable getShellBounds()
          Get the Shell bounds inside a Hashtable
private  void initComponents()
          Init all components
static boolean isAlive()
          This method is called to check if RSSOwl is still alive or was just closed by the user.
 boolean isBusyLoading()
          Check if RSSOwl is currently busy loading a newsfeed or aggregation.
 void loadNewsFeed(String url, String searchPattern, boolean displayNewsfeed, boolean reselectNews, int displayMode)
          Load a News feed.
(package private)  void onClose(org.eclipse.swt.widgets.Event event)
          Called when the Shell is closed
(package private)  void onClose(org.eclipse.swt.widgets.Event event, boolean forceExit)
          Called when the Shell is closed.
(package private)  void onDispose()
          Called when the Shell is disposed
(package private)  void onIconify()
          Called when the Shell is Iconified
 void reloadNewsFeed(String url)
          Re-Load a news feed
private  void runEventLoop()
          Runs the event loop for RSSOwl
 void setFavoritesMinimized(boolean minimize, boolean save)
          Set the state of the favorites Tree with setting the maximized control of the holdContentSash.
(package private)  void showGui()
          Open RSSOwl shell
(package private)  void shutDown()
          Shut down RSSOwl and perform some actions before closing
private  void startUp()
          Startup process of RSSOwl (called once at start)
(package private)  void updateCoreSettings(SettingsLoader settingsLoader, boolean isHotLoad)
          Update core settings of RSSOwl that need to be loaded first
 void updateI18N()
          Update all controlls text with i18n
(package private)  void updateUserSettings(SettingsLoader settingsLoader, boolean isHotLoad)
          Update some user settings from the "user.xml"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

display

public static org.eclipse.swt.widgets.Display display
A lot of other obj have to access display


i18n

public static RSSOwlI18n i18n
Internationalization for RSSOwl


isClosing

public static boolean isClosing
Flag is set to TRUE when RSSOwl is exiting


logger

public static LoggerImpl logger
Log all catched Exceptions


rssOwlGui

public static GUI rssOwlGui
For classes who needs to access the MainController


shell

public static org.eclipse.swt.widgets.Shell shell
A lot of other obj have to access shell


loadURLOnStartup

static String loadURLOnStartup
If the user has passed an argument to the application, it is stored here


boxContainer

private org.eclipse.swt.widgets.Composite boxContainer

holdContentSash

private org.eclipse.swt.custom.SashForm holdContentSash

holdNewsSash

private org.eclipse.swt.custom.SashForm holdNewsSash

rssOwlAmphetaRate

private AmphetaRateThread rssOwlAmphetaRate

rssOwlCryptoManager

private CryptoManager rssOwlCryptoManager

rssOwlFeedAutoUpdater

private FeedAutoUpdater rssOwlFeedAutoUpdater

rssOwlFeedQueueLoader

private FeedQueueLoader rssOwlFeedQueueLoader

rssOwlMenu

private RSSOwlMenu rssOwlMenu

rssOwlNewsText

private NewsText rssOwlNewsText

rssOwlQuickView

private Quickview rssOwlQuickView

rssOwlSystray

private SystemTray rssOwlSystray

sashWeights

private Hashtable sashWeights

archiveManager

ArchiveManager archiveManager

eventManager

EventManager eventManager

rssOwlFavoritesTree

FavoritesTree rssOwlFavoritesTree

rssOwlFeedCacheManager

FeedCacheManager rssOwlFeedCacheManager

rssOwlNewsTabFolder

NewsTabFolder rssOwlNewsTabFolder

rssOwlStatusLine

StatusLine rssOwlStatusLine

shellBounds

Hashtable shellBounds
Constructor Detail

GUI

public GUI(org.eclipse.swt.widgets.Display display,
           org.eclipse.swt.widgets.Shell splashShell)
Instantiate a new GUI

Parameters:
display - The display
splashShell - The shell holding the splash
Method Detail

isAlive

public static boolean isAlive()
This method is called to check if RSSOwl is still alive or was just closed by the user.

Returns:
boolean TRUE if RSSOwl is still running

abnormalShutDown

public void abnormalShutDown()
This method is called from the Shutdown Hook Thread in case RSSOwl was shut down not the normal way (e.g. the OS is shutting down).
It is not guaranteed, that this method will be executed in any case.


changeWindowLayout

public void changeWindowLayout()
Change the window layout between 2 and 3 column window layout


displayNewsfeed

public void displayNewsfeed(Channel rssChannel,
                            String url,
                            String searchPattern,
                            boolean reselectNews,
                            int displayMode)
Display the selected newsfeed in the TabFolder

Parameters:
rssChannel - The newsfeed to display
url - URL / Path to the RSS XML
searchPattern - Optional pattern for a search
reselectNews - Wether to reselect an already selected news
displayMode - One of the supported display modes

enableSystrayIcon

public void enableSystrayIcon(boolean enabled)
Enable / Disable Systray Icon for RSSOwl

Parameters:
enabled - TRUE if enabled

getArchiveManager

public ArchiveManager getArchiveManager()
Get the archive manager for RSSOwl

Returns:
Returns the archiveManager.

getEventManager

public EventManager getEventManager()
Get the event manager for RSSOwl.

Returns:
Returns the eventManager.

getFeedCacheManager

public FeedCacheManager getFeedCacheManager()
Get the feed cache manager

Returns:
RSSOwlFeedCachManager The cache manager

getRSSOwlAmphetaRate

public AmphetaRateThread getRSSOwlAmphetaRate()
Let other objects access this thread

Returns:
AmphetaRateThread Submit Thread

getRSSOwlFavoritesTree

public FavoritesTree getRSSOwlFavoritesTree()
Method to let other obj access this object

Returns:
FavoritesTree The tree holding all favorites

getRSSOwlFeedQueueLoader

public FeedQueueLoader getRSSOwlFeedQueueLoader()
Let other objects access this thread

Returns:
Returns the rssOwlFeedQueueLoader.

getRSSOwlMenu

public RSSOwlMenu getRSSOwlMenu()
Method to let other obj access this object

Returns:
RSSOwlMenu

getRSSOwlNewsTabFolder

public NewsTabFolder getRSSOwlNewsTabFolder()
Get the NewsTabFolder displaying newsfeeds

Returns:
NewsTabFolder

getRSSOwlNewsText

public NewsText getRSSOwlNewsText()
Get the NewsText composite

Returns:
NewsText

getRSSOwlQuickview

public Quickview getRSSOwlQuickview()
Get the RSSOwl quickview control

Returns:
Quickview

getRSSOwlStatusLine

public StatusLine getRSSOwlStatusLine()
Get the StatusLine control

Returns:
Returns the rssOwlStatusLine.

getRSSOwlSystray

public SystemTray getRSSOwlSystray()
Get the SystemTray object

Returns:
SystemTray The system tray implementation for RSSOwl

getSashWeights

public Hashtable getSashWeights()
Method to let other obj access this object

Returns:
Hashtable with the saved SashWeights

getShellBounds

public Hashtable getShellBounds()
Get the Shell bounds inside a Hashtable

Returns:
Hashtable containing the Shell bounds

isBusyLoading

public boolean isBusyLoading()
Check if RSSOwl is currently busy loading a newsfeed or aggregation.

Returns:
boolean TRUE if RSSOwl is busy loading

loadNewsFeed

public void loadNewsFeed(String url,
                         String searchPattern,
                         boolean displayNewsfeed,
                         boolean reselectNews,
                         int displayMode)
Load a News feed. The loading is done in a Thread to enable cancle of the loading via a button in the status line.

Parameters:
url - URL / Path to the feed
searchPattern - Search Pattern if search is performed
displayNewsfeed - TRUE if newsfeed should be displayed
reselectNews - Wether to reselect a selected news
displayMode - One of the supported displaymodes

reloadNewsFeed

public void reloadNewsFeed(String url)
Re-Load a news feed

Parameters:
url - URL to the newsfeed

setFavoritesMinimized

public void setFavoritesMinimized(boolean minimize,
                                  boolean save)
Set the state of the favorites Tree with setting the maximized control of the holdContentSash.

Parameters:
minimize - If TRUE minimize the favorites tree
save - If TRUE save the state to GlobalSettings

updateI18N

public void updateI18N()
Update all controlls text with i18n

Specified by:
updateI18N in interface ITranslatable

initComponents

private void initComponents()
Init all components


runEventLoop

private void runEventLoop()
Runs the event loop for RSSOwl


startUp

private void startUp()
Startup process of RSSOwl (called once at start)


onClose

void onClose(org.eclipse.swt.widgets.Event event)
Called when the Shell is closed

Parameters:
event - The occuring Event

onClose

void onClose(org.eclipse.swt.widgets.Event event,
             boolean forceExit)
Called when the Shell is closed. If boolean parameter forceExit is set to TRUE, RSSOwl will exit, even if "Minimize to Tray on Exit" is set to TRUE. This forced exit is called when the user has pressed the "Exit" menuitem from the "File" menu.

Parameters:
event - The occuring Event
forceExit - If TRUE, force RSSOwl to exit

onDispose

void onDispose()
Called when the Shell is disposed


onIconify

void onIconify()
Called when the Shell is Iconified


showGui

void showGui()
Open RSSOwl shell


shutDown

void shutDown()
Shut down RSSOwl and perform some actions before closing


updateCoreSettings

void updateCoreSettings(SettingsLoader settingsLoader,
                        boolean isHotLoad)
Update core settings of RSSOwl that need to be loaded first

Parameters:
settingsLoader - The settings parser to use
isHotLoad - TRUE if the settings are imported by the user from the running program

updateUserSettings

void updateUserSettings(SettingsLoader settingsLoader,
                        boolean isHotLoad)
Update some user settings from the "user.xml"

Parameters:
settingsLoader - The settings parser to use
isHotLoad - TRUE if the settings are imported by the user from the running program


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo