diff options
author | Matt Windsor <mattwindsor@btinternet.com> | 2011-03-21 21:54:31 +0000 |
---|---|---|
committer | Matt Windsor <mattwindsor@btinternet.com> | 2011-03-21 21:54:31 +0000 |
commit | df7d7981b56a4560c95ea7e9b194080e93398ecf (patch) | |
tree | b3ae4f02d23ae1f7f4951c776ee8d91b0047dd6f /src/uk/org | |
parent | 2d073129857a42ab4195cd433c8be152e357033f (diff) |
GREAT PACKAGE RESHUFFLE: Everything is now organised into frontend, backend and common (to frontend and backend) packages. Things may have been broken. Doc refresh.
Diffstat (limited to 'src/uk/org')
-rw-r--r-- | src/uk/org/ury/backend/config/Auth.java (renamed from src/uk/org/ury/config/Auth.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/config/ConfigReader.java (renamed from src/uk/org/ury/config/ConfigReader.java) | 4 | ||||
-rw-r--r-- | src/uk/org/ury/backend/config/Database.java (renamed from src/uk/org/ury/config/Database.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/database/DatabaseDriver.java (renamed from src/uk/org/ury/database/DatabaseDriver.java) | 8 | ||||
-rw-r--r-- | src/uk/org/ury/backend/database/DatabaseItem.java (renamed from src/uk/org/ury/database/DatabaseItem.java) | 4 | ||||
-rw-r--r-- | src/uk/org/ury/backend/database/UserClass.java (renamed from src/uk/org/ury/database/UserClass.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/database/exceptions/ConnectionFailureException.java (renamed from src/uk/org/ury/database/exceptions/ConnectionFailureException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/database/exceptions/MissingCredentialsException.java (renamed from src/uk/org/ury/database/exceptions/MissingCredentialsException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/database/exceptions/MissingPropertyException.java (renamed from src/uk/org/ury/database/exceptions/MissingPropertyException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/database/exceptions/QueryFailureException.java (renamed from src/uk/org/ury/database/exceptions/QueryFailureException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/database/exceptions/package.html (renamed from src/uk/org/ury/database/exceptions/package.html) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/backend/database/package.html (renamed from src/uk/org/ury/database/package.html) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/backend/handlers/LibraryRequestHandler.java (renamed from src/uk/org/ury/library/LibraryRequestHandler.java) | 37 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/AbstractRequestHandler.java (renamed from src/uk/org/ury/server/AbstractRequestHandler.java) | 20 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/ApiRequestHandler.java (renamed from src/uk/org/ury/server/ApiRequestHandler.java) | 4 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/HttpHandler.java (renamed from src/uk/org/ury/server/HttpHandler.java) | 16 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/HttpListenerThread.java (renamed from src/uk/org/ury/server/HttpListenerThread.java) | 7 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/HttpWorkerThread.java (renamed from src/uk/org/ury/server/HttpWorkerThread.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/Server.java (renamed from src/uk/org/ury/server/Server.java) | 12 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/ServerRequestHandler.java (renamed from src/uk/org/ury/server/ServerRequestHandler.java) | 8 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/exceptions/BadRequestException.java (renamed from src/uk/org/ury/server/exceptions/BadRequestException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/exceptions/HandleFailureException.java (renamed from src/uk/org/ury/server/exceptions/HandleFailureException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/exceptions/HandlerNotFoundException.java (renamed from src/uk/org/ury/server/exceptions/HandlerNotFoundException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/exceptions/HandlerSetupFailureException.java (renamed from src/uk/org/ury/server/exceptions/HandlerSetupFailureException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/exceptions/HandlingException.java (renamed from src/uk/org/ury/server/exceptions/HandlingException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/exceptions/NotAHandlerException.java (renamed from src/uk/org/ury/server/exceptions/NotAHandlerException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/exceptions/UnknownFunctionException.java (renamed from src/uk/org/ury/server/exceptions/UnknownFunctionException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/backend/server/package.html (renamed from src/uk/org/ury/server/package.html) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/common/library/LibraryUtils.java (renamed from src/uk/org/ury/library/LibraryUtils.java) | 12 | ||||
-rw-r--r-- | src/uk/org/ury/common/library/exceptions/EmptySearchException.java (renamed from src/uk/org/ury/library/exceptions/EmptySearchException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/common/library/item/LibraryItem.java (renamed from src/uk/org/ury/library/item/LibraryItem.java) | 4 | ||||
-rw-r--r-- | src/uk/org/ury/common/library/item/LibraryItemProperty.java (renamed from src/uk/org/ury/library/item/LibraryItemProperty.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/common/protocol/Directive.java (renamed from src/uk/org/ury/protocol/Directive.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/common/protocol/ProtocolUtils.java (renamed from src/uk/org/ury/protocol/ProtocolUtils.java) | 6 | ||||
-rw-r--r-- | src/uk/org/ury/common/protocol/Status.java (renamed from src/uk/org/ury/protocol/Status.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/common/protocol/exceptions/DecodeFailureException.java (renamed from src/uk/org/ury/protocol/exceptions/DecodeFailureException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/common/protocol/exceptions/InvalidMessageException.java (renamed from src/uk/org/ury/protocol/exceptions/InvalidMessageException.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/common/show/ShowChannel.java (renamed from src/uk/org/ury/show/ShowChannel.java) | 4 | ||||
-rw-r--r-- | src/uk/org/ury/common/show/ShowUtils.java (renamed from src/uk/org/ury/show/ShowUtils.java) | 10 | ||||
-rw-r--r-- | src/uk/org/ury/common/show/ShowUtils.properties (renamed from src/uk/org/ury/show/ShowUtils.properties) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/common/show/item/ShowItem.java (renamed from src/uk/org/ury/show/item/ShowItem.java) | 6 | ||||
-rw-r--r-- | src/uk/org/ury/common/show/item/ShowItemProperty.java (renamed from src/uk/org/ury/show/item/ShowItemProperty.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/common/show/item/package.html (renamed from src/uk/org/ury/show/item/package.html) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/FrontendApplet.java | 2 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/FrontendFrame.java | 584 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/FrontendModule.java | 42 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/client/Client.java (renamed from src/uk/org/ury/client/Client.java) | 6 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/client/test/ClientTest.java (renamed from src/uk/org/ury/client/test/ClientTest.java) | 10 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/cpanels/menu/DemoControlPanel.java (renamed from src/uk/org/ury/testrig/DemoControlPanel.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/cpanels/menu/demo_control_panel.xml (renamed from src/uk/org/ury/testrig/demo_control_panel.xml) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/cpanels/show/LibraryControlPanel.java (renamed from src/uk/org/ury/show/viewer/LibraryControlPanel.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/cpanels/show/library_control_panel.xml (renamed from src/uk/org/ury/show/viewer/library_control_panel.xml) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/library/LibraryTableModel.java (renamed from src/uk/org/ury/library/viewer/LibraryTableModel.java) | 8 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/library/LibraryViewer.java (renamed from src/uk/org/ury/library/viewer/LibraryViewer.java) | 18 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/library/LibraryViewer.properties (renamed from src/uk/org/ury/library/viewer/LibraryViewer.properties) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/library/LibraryViewerPanel.java (renamed from src/uk/org/ury/library/viewer/LibraryViewerPanel.java) | 9 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/library/library_viewer_gui.xml (renamed from src/uk/org/ury/library/viewer/library_viewer_gui.xml) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/menu/DemoMenu.java (renamed from src/uk/org/ury/testrig/DemoMenu.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/menu/DemoMenuPanel.java | 68 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/show/ChannelPanel.java (renamed from src/uk/org/ury/show/viewer/ChannelPanel.java) | 4 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/show/ShowViewer.java (renamed from src/uk/org/ury/show/viewer/ShowViewer.java) | 18 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/show/ShowViewerPanel.java (renamed from src/uk/org/ury/show/viewer/ShowViewerPanel.java) | 10 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/show/TrackBin.java (renamed from src/uk/org/ury/show/viewer/TrackBin.java) | 2 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/show/channel_panel.xml (renamed from src/uk/org/ury/show/viewer/channel_panel.xml) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/show/show_viewer_gui.xml (renamed from src/uk/org/ury/show/viewer/show_viewer_gui.xml) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/show/show_viewer_gui_old.xml (renamed from src/uk/org/ury/show/viewer/show_viewer_gui_old.xml) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/show/show_viewer_gui_panels.xml (renamed from src/uk/org/ury/show/viewer/show_viewer_gui_panels.xml) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/modules/show/track_bin.xml (renamed from src/uk/org/ury/show/viewer/track_bin.xml) | 0 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/testrig/ApplicationLauncher.java | 27 | ||||
-rw-r--r-- | src/uk/org/ury/frontend/testrig/Launcher.java (renamed from src/uk/org/ury/testrig/Launcher.java) | 4 | ||||
-rw-r--r-- | src/uk/org/ury/testrig/ApplicationLauncher.java | 32 | ||||
-rw-r--r-- | src/uk/org/ury/testrig/DemoMenuPanel.java | 90 |
72 files changed, 528 insertions, 618 deletions
diff --git a/src/uk/org/ury/config/Auth.java b/src/uk/org/ury/backend/config/Auth.java index 81be6e2..46660e5 100644 --- a/src/uk/org/ury/config/Auth.java +++ b/src/uk/org/ury/backend/config/Auth.java @@ -1,4 +1,4 @@ -package uk.org.ury.config; +package uk.org.ury.backend.config; /** * A login authorisation configuration diff --git a/src/uk/org/ury/config/ConfigReader.java b/src/uk/org/ury/backend/config/ConfigReader.java index ed2d852..63403c9 100644 --- a/src/uk/org/ury/config/ConfigReader.java +++ b/src/uk/org/ury/backend/config/ConfigReader.java @@ -1,4 +1,4 @@ -package uk.org.ury.config; +package uk.org.ury.backend.config; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -10,7 +10,7 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; -import uk.org.ury.database.exceptions.MissingCredentialsException; +import uk.org.ury.backend.database.exceptions.MissingCredentialsException; /** * Reads in an XML config file and creates config objects diff --git a/src/uk/org/ury/config/Database.java b/src/uk/org/ury/backend/config/Database.java index 19fe9bc..1939a4a 100644 --- a/src/uk/org/ury/config/Database.java +++ b/src/uk/org/ury/backend/config/Database.java @@ -1,4 +1,4 @@ -package uk.org.ury.config; +package uk.org.ury.backend.config; /** * A Database Server configuration diff --git a/src/uk/org/ury/database/DatabaseDriver.java b/src/uk/org/ury/backend/database/DatabaseDriver.java index e48b0a1..5cd9b98 100644 --- a/src/uk/org/ury/database/DatabaseDriver.java +++ b/src/uk/org/ury/backend/database/DatabaseDriver.java @@ -1,4 +1,4 @@ -package uk.org.ury.database; +package uk.org.ury.backend.database; import java.sql.Connection; import java.sql.DriverManager; @@ -7,9 +7,9 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import uk.org.ury.config.ConfigReader; -import uk.org.ury.database.exceptions.ConnectionFailureException; -import uk.org.ury.database.exceptions.MissingCredentialsException; +import uk.org.ury.backend.config.ConfigReader; +import uk.org.ury.backend.database.exceptions.ConnectionFailureException; +import uk.org.ury.backend.database.exceptions.MissingCredentialsException; /** * A database connection manager that connects to the URY databases using diff --git a/src/uk/org/ury/database/DatabaseItem.java b/src/uk/org/ury/backend/database/DatabaseItem.java index bac23a5..b25e9f2 100644 --- a/src/uk/org/ury/database/DatabaseItem.java +++ b/src/uk/org/ury/backend/database/DatabaseItem.java @@ -1,9 +1,9 @@ -package uk.org.ury.database; +package uk.org.ury.backend.database; import java.util.HashMap; import java.util.Map; -import uk.org.ury.database.exceptions.MissingPropertyException; +import uk.org.ury.backend.database.exceptions.MissingPropertyException; /** * An abstract class presenting a template for objects serving as a data diff --git a/src/uk/org/ury/database/UserClass.java b/src/uk/org/ury/backend/database/UserClass.java index 48cb2d3..1cd39fc 100644 --- a/src/uk/org/ury/database/UserClass.java +++ b/src/uk/org/ury/backend/database/UserClass.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.database; +package uk.org.ury.backend.database; /** * The various user classes of the database driver. diff --git a/src/uk/org/ury/database/exceptions/ConnectionFailureException.java b/src/uk/org/ury/backend/database/exceptions/ConnectionFailureException.java index 030b24f..393f3ce 100644 --- a/src/uk/org/ury/database/exceptions/ConnectionFailureException.java +++ b/src/uk/org/ury/backend/database/exceptions/ConnectionFailureException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.database.exceptions; +package uk.org.ury.backend.database.exceptions; /** * Exception thrown when the database backend fails to connect to diff --git a/src/uk/org/ury/database/exceptions/MissingCredentialsException.java b/src/uk/org/ury/backend/database/exceptions/MissingCredentialsException.java index 2e45526..4c73683 100644 --- a/src/uk/org/ury/database/exceptions/MissingCredentialsException.java +++ b/src/uk/org/ury/backend/database/exceptions/MissingCredentialsException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.database.exceptions; +package uk.org.ury.backend.database.exceptions; /** * Exception thrown when the database credentials required to diff --git a/src/uk/org/ury/database/exceptions/MissingPropertyException.java b/src/uk/org/ury/backend/database/exceptions/MissingPropertyException.java index 3766fcf..485771b 100644 --- a/src/uk/org/ury/database/exceptions/MissingPropertyException.java +++ b/src/uk/org/ury/backend/database/exceptions/MissingPropertyException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.database.exceptions; +package uk.org.ury.backend.database.exceptions; /** diff --git a/src/uk/org/ury/database/exceptions/QueryFailureException.java b/src/uk/org/ury/backend/database/exceptions/QueryFailureException.java index 5293a7c..6c01e61 100644 --- a/src/uk/org/ury/database/exceptions/QueryFailureException.java +++ b/src/uk/org/ury/backend/database/exceptions/QueryFailureException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.database.exceptions; +package uk.org.ury.backend.database.exceptions; /** diff --git a/src/uk/org/ury/database/exceptions/package.html b/src/uk/org/ury/backend/database/exceptions/package.html index b5e7cac..b5e7cac 100644 --- a/src/uk/org/ury/database/exceptions/package.html +++ b/src/uk/org/ury/backend/database/exceptions/package.html diff --git a/src/uk/org/ury/database/package.html b/src/uk/org/ury/backend/database/package.html index 2b138b8..2b138b8 100644 --- a/src/uk/org/ury/database/package.html +++ b/src/uk/org/ury/backend/database/package.html diff --git a/src/uk/org/ury/library/LibraryRequestHandler.java b/src/uk/org/ury/backend/handlers/LibraryRequestHandler.java index a81851d..25423f6 100644 --- a/src/uk/org/ury/library/LibraryRequestHandler.java +++ b/src/uk/org/ury/backend/handlers/LibraryRequestHandler.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.library; +package uk.org.ury.backend.handlers; import java.io.UnsupportedEncodingException; import java.util.ArrayList; @@ -18,23 +18,24 @@ import org.apache.http.protocol.HTTP; import org.apache.http.protocol.HttpContext; import org.json.simple.JSONValue; -import uk.org.ury.database.DatabaseDriver; -import uk.org.ury.database.UserClass; -import uk.org.ury.database.exceptions.ConnectionFailureException; -import uk.org.ury.database.exceptions.MissingCredentialsException; -import uk.org.ury.database.exceptions.QueryFailureException; -import uk.org.ury.library.exceptions.EmptySearchException; -import uk.org.ury.library.item.LibraryItem; -import uk.org.ury.protocol.Directive; -import uk.org.ury.protocol.Status; -import uk.org.ury.server.AbstractRequestHandler; -import uk.org.ury.server.Server; -import uk.org.ury.server.exceptions.BadRequestException; -import uk.org.ury.server.exceptions.HandleFailureException; -import uk.org.ury.server.exceptions.HandlerNotFoundException; -import uk.org.ury.server.exceptions.HandlerSetupFailureException; -import uk.org.ury.server.exceptions.NotAHandlerException; -import uk.org.ury.server.exceptions.UnknownFunctionException; +import uk.org.ury.backend.database.DatabaseDriver; +import uk.org.ury.backend.database.UserClass; +import uk.org.ury.backend.database.exceptions.ConnectionFailureException; +import uk.org.ury.backend.database.exceptions.MissingCredentialsException; +import uk.org.ury.backend.database.exceptions.QueryFailureException; +import uk.org.ury.backend.server.AbstractRequestHandler; +import uk.org.ury.backend.server.Server; +import uk.org.ury.backend.server.exceptions.BadRequestException; +import uk.org.ury.backend.server.exceptions.HandleFailureException; +import uk.org.ury.backend.server.exceptions.HandlerNotFoundException; +import uk.org.ury.backend.server.exceptions.HandlerSetupFailureException; +import uk.org.ury.backend.server.exceptions.NotAHandlerException; +import uk.org.ury.backend.server.exceptions.UnknownFunctionException; +import uk.org.ury.common.library.LibraryUtils; +import uk.org.ury.common.library.exceptions.EmptySearchException; +import uk.org.ury.common.library.item.LibraryItem; +import uk.org.ury.common.protocol.Directive; +import uk.org.ury.common.protocol.Status; /** * A request handler for library queries. diff --git a/src/uk/org/ury/server/AbstractRequestHandler.java b/src/uk/org/ury/backend/server/AbstractRequestHandler.java index 9b964b0..53517d7 100644 --- a/src/uk/org/ury/server/AbstractRequestHandler.java +++ b/src/uk/org/ury/backend/server/AbstractRequestHandler.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.server; +package uk.org.ury.backend.server; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -20,15 +20,15 @@ import org.apache.http.protocol.HttpContext; import org.apache.http.protocol.HttpRequestHandler; import org.json.simple.JSONValue; -import uk.org.ury.protocol.Directive; -import uk.org.ury.protocol.Status; -import uk.org.ury.server.exceptions.BadRequestException; -import uk.org.ury.server.exceptions.HandleFailureException; -import uk.org.ury.server.exceptions.HandlerNotFoundException; -import uk.org.ury.server.exceptions.HandlerSetupFailureException; -import uk.org.ury.server.exceptions.HandlingException; -import uk.org.ury.server.exceptions.NotAHandlerException; -import uk.org.ury.server.exceptions.UnknownFunctionException; +import uk.org.ury.backend.server.exceptions.BadRequestException; +import uk.org.ury.backend.server.exceptions.HandleFailureException; +import uk.org.ury.backend.server.exceptions.HandlerNotFoundException; +import uk.org.ury.backend.server.exceptions.HandlerSetupFailureException; +import uk.org.ury.backend.server.exceptions.HandlingException; +import uk.org.ury.backend.server.exceptions.NotAHandlerException; +import uk.org.ury.backend.server.exceptions.UnknownFunctionException; +import uk.org.ury.common.protocol.Directive; +import uk.org.ury.common.protocol.Status; /** * An abstract request handler for HttpCore, providing basic functionality such diff --git a/src/uk/org/ury/server/ApiRequestHandler.java b/src/uk/org/ury/backend/server/ApiRequestHandler.java index a2290f8..fc867ce 100644 --- a/src/uk/org/ury/server/ApiRequestHandler.java +++ b/src/uk/org/ury/backend/server/ApiRequestHandler.java @@ -1,8 +1,8 @@ -package uk.org.ury.server; +package uk.org.ury.backend.server; import java.util.Map; -import uk.org.ury.server.exceptions.HandleFailureException; +import uk.org.ury.backend.server.exceptions.HandleFailureException; /** diff --git a/src/uk/org/ury/server/HttpHandler.java b/src/uk/org/ury/backend/server/HttpHandler.java index 948e03a..ed94d3d 100644 --- a/src/uk/org/ury/server/HttpHandler.java +++ b/src/uk/org/ury/backend/server/HttpHandler.java @@ -37,7 +37,7 @@ * <http://www.apache.org/>. */ -package uk.org.ury.server; +package uk.org.ury.backend.server; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; @@ -53,13 +53,13 @@ import org.apache.http.protocol.HttpContext; import org.apache.http.protocol.HttpRequestHandler; import org.json.simple.JSONValue; -import uk.org.ury.protocol.Directive; -import uk.org.ury.protocol.Status; -import uk.org.ury.server.exceptions.BadRequestException; -import uk.org.ury.server.exceptions.HandleFailureException; -import uk.org.ury.server.exceptions.HandlerNotFoundException; -import uk.org.ury.server.exceptions.HandlerSetupFailureException; -import uk.org.ury.server.exceptions.NotAHandlerException; +import uk.org.ury.backend.server.exceptions.BadRequestException; +import uk.org.ury.backend.server.exceptions.HandleFailureException; +import uk.org.ury.backend.server.exceptions.HandlerNotFoundException; +import uk.org.ury.backend.server.exceptions.HandlerSetupFailureException; +import uk.org.ury.backend.server.exceptions.NotAHandlerException; +import uk.org.ury.common.protocol.Directive; +import uk.org.ury.common.protocol.Status; /** * @author Matt Windsor, Apache Software Foundation diff --git a/src/uk/org/ury/server/HttpListenerThread.java b/src/uk/org/ury/backend/server/HttpListenerThread.java index c6b042b..c14ddb9 100644 --- a/src/uk/org/ury/server/HttpListenerThread.java +++ b/src/uk/org/ury/backend/server/HttpListenerThread.java @@ -37,7 +37,7 @@ * <http://www.apache.org/>. */ -package uk.org.ury.server; +package uk.org.ury.backend.server; import java.io.IOException; import java.net.ServerSocket; @@ -60,12 +60,13 @@ import org.apache.http.protocol.ResponseContent; import org.apache.http.protocol.ResponseDate; import org.apache.http.protocol.ResponseServer; -import uk.org.ury.library.LibraryRequestHandler; +import uk.org.ury.backend.handlers.LibraryRequestHandler; /** * Listener thread for the URY server HTTP interface. * - * @author Matt Windsor, Apache Software Foundation + * @author Matt Windsor + * @author Apache Software Foundation */ public class HttpListenerThread extends Thread { private ServerSocket ssocket; diff --git a/src/uk/org/ury/server/HttpWorkerThread.java b/src/uk/org/ury/backend/server/HttpWorkerThread.java index 246038c..563832a 100644 --- a/src/uk/org/ury/server/HttpWorkerThread.java +++ b/src/uk/org/ury/backend/server/HttpWorkerThread.java @@ -37,7 +37,7 @@ * <http://www.apache.org/>. */ -package uk.org.ury.server; +package uk.org.ury.backend.server; import java.io.IOException; import java.io.InterruptedIOException; diff --git a/src/uk/org/ury/server/Server.java b/src/uk/org/ury/backend/server/Server.java index 0ab8c8c..57a0030 100644 --- a/src/uk/org/ury/server/Server.java +++ b/src/uk/org/ury/backend/server/Server.java @@ -9,15 +9,15 @@ * (C) 2011 URY Computing */ -package uk.org.ury.server; +package uk.org.ury.backend.server; import java.io.IOException; -import uk.org.ury.config.ConfigReader; -import uk.org.ury.database.DatabaseDriver; -import uk.org.ury.database.UserClass; -import uk.org.ury.database.exceptions.ConnectionFailureException; -import uk.org.ury.database.exceptions.MissingCredentialsException; +import uk.org.ury.backend.config.ConfigReader; +import uk.org.ury.backend.database.DatabaseDriver; +import uk.org.ury.backend.database.UserClass; +import uk.org.ury.backend.database.exceptions.ConnectionFailureException; +import uk.org.ury.backend.database.exceptions.MissingCredentialsException; /** * The unified URY server, accepting requests over HTTP. diff --git a/src/uk/org/ury/server/ServerRequestHandler.java b/src/uk/org/ury/backend/server/ServerRequestHandler.java index df67faf..82764f2 100644 --- a/src/uk/org/ury/server/ServerRequestHandler.java +++ b/src/uk/org/ury/backend/server/ServerRequestHandler.java @@ -1,14 +1,14 @@ /** * */ -package uk.org.ury.server; +package uk.org.ury.backend.server; import java.util.HashMap; import java.util.Map; -import uk.org.ury.server.Server; -import uk.org.ury.server.ApiRequestHandler; -import uk.org.ury.server.exceptions.HandleFailureException; +import uk.org.ury.backend.server.ApiRequestHandler; +import uk.org.ury.backend.server.Server; +import uk.org.ury.backend.server.exceptions.HandleFailureException; /** diff --git a/src/uk/org/ury/server/exceptions/BadRequestException.java b/src/uk/org/ury/backend/server/exceptions/BadRequestException.java index 189c7f5..6f200f3 100644 --- a/src/uk/org/ury/server/exceptions/BadRequestException.java +++ b/src/uk/org/ury/backend/server/exceptions/BadRequestException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.server.exceptions; +package uk.org.ury.backend.server.exceptions; /** * Exception thrown when the server meets a malformed request, or diff --git a/src/uk/org/ury/server/exceptions/HandleFailureException.java b/src/uk/org/ury/backend/server/exceptions/HandleFailureException.java index ddcfdea..0efb7a3 100644 --- a/src/uk/org/ury/server/exceptions/HandleFailureException.java +++ b/src/uk/org/ury/backend/server/exceptions/HandleFailureException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.server.exceptions; +package uk.org.ury.backend.server.exceptions; /** * Generic exception thrown when a server request handler fails to diff --git a/src/uk/org/ury/server/exceptions/HandlerNotFoundException.java b/src/uk/org/ury/backend/server/exceptions/HandlerNotFoundException.java index 7b614f6..a7ba136 100644 --- a/src/uk/org/ury/server/exceptions/HandlerNotFoundException.java +++ b/src/uk/org/ury/backend/server/exceptions/HandlerNotFoundException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.server.exceptions; +package uk.org.ury.backend.server.exceptions; /** * Exception thrown when the server request handler requested diff --git a/src/uk/org/ury/server/exceptions/HandlerSetupFailureException.java b/src/uk/org/ury/backend/server/exceptions/HandlerSetupFailureException.java index d301eac..d70624a 100644 --- a/src/uk/org/ury/server/exceptions/HandlerSetupFailureException.java +++ b/src/uk/org/ury/backend/server/exceptions/HandlerSetupFailureException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.server.exceptions; +package uk.org.ury.backend.server.exceptions; /** * Exception thrown when the server request handler requested diff --git a/src/uk/org/ury/server/exceptions/HandlingException.java b/src/uk/org/ury/backend/server/exceptions/HandlingException.java index 2ce681b..edca0aa 100644 --- a/src/uk/org/ury/server/exceptions/HandlingException.java +++ b/src/uk/org/ury/backend/server/exceptions/HandlingException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.server.exceptions; +package uk.org.ury.backend.server.exceptions; /** * Generic exception thrown when the server cannot handle a request. diff --git a/src/uk/org/ury/server/exceptions/NotAHandlerException.java b/src/uk/org/ury/backend/server/exceptions/NotAHandlerException.java index 9a67d62..d5c9d93 100644 --- a/src/uk/org/ury/server/exceptions/NotAHandlerException.java +++ b/src/uk/org/ury/backend/server/exceptions/NotAHandlerException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.server.exceptions; +package uk.org.ury.backend.server.exceptions; /** * Exception thrown if the class requested as a handler by the client diff --git a/src/uk/org/ury/server/exceptions/UnknownFunctionException.java b/src/uk/org/ury/backend/server/exceptions/UnknownFunctionException.java index 13c1386..c0a8a06 100644 --- a/src/uk/org/ury/server/exceptions/UnknownFunctionException.java +++ b/src/uk/org/ury/backend/server/exceptions/UnknownFunctionException.java @@ -9,7 +9,7 @@ * (C) 2011 URY Computing */ -package uk.org.ury.server.exceptions; +package uk.org.ury.backend.server.exceptions; /** * Exception thrown when a handler receives a request for a path that does not diff --git a/src/uk/org/ury/server/package.html b/src/uk/org/ury/backend/server/package.html index b19b3b7..b19b3b7 100644 --- a/src/uk/org/ury/server/package.html +++ b/src/uk/org/ury/backend/server/package.html diff --git a/src/uk/org/ury/library/LibraryUtils.java b/src/uk/org/ury/common/library/LibraryUtils.java index 9b4471a..335b8b5 100644 --- a/src/uk/org/ury/library/LibraryUtils.java +++ b/src/uk/org/ury/common/library/LibraryUtils.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.library; +package uk.org.ury.common.library; import java.sql.ResultSet; import java.sql.SQLException; @@ -10,12 +10,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import uk.org.ury.database.DatabaseDriver; -import uk.org.ury.database.exceptions.QueryFailureException; +import uk.org.ury.backend.database.DatabaseDriver; +import uk.org.ury.backend.database.exceptions.QueryFailureException; +import uk.org.ury.common.library.exceptions.EmptySearchException; +import uk.org.ury.common.library.item.LibraryItem; +import uk.org.ury.common.library.item.LibraryItemProperty; -import uk.org.ury.library.exceptions.EmptySearchException; -import uk.org.ury.library.item.LibraryItem; -import uk.org.ury.library.item.LibraryItemProperty; /** diff --git a/src/uk/org/ury/library/exceptions/EmptySearchException.java b/src/uk/org/ury/common/library/exceptions/EmptySearchException.java index 9b4691f..fc4ed68 100644 --- a/src/uk/org/ury/library/exceptions/EmptySearchException.java +++ b/src/uk/org/ury/common/library/exceptions/EmptySearchException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.library.exceptions; +package uk.org.ury.common.library.exceptions; /** * Exception thrown when a library search is initiated diff --git a/src/uk/org/ury/library/item/LibraryItem.java b/src/uk/org/ury/common/library/item/LibraryItem.java index d2a790b..3e81041 100644 --- a/src/uk/org/ury/library/item/LibraryItem.java +++ b/src/uk/org/ury/common/library/item/LibraryItem.java @@ -1,12 +1,12 @@ /** * */ -package uk.org.ury.library.item; +package uk.org.ury.common.library.item; import java.util.Map; -import uk.org.ury.database.DatabaseItem; +import uk.org.ury.backend.database.DatabaseItem; /** diff --git a/src/uk/org/ury/library/item/LibraryItemProperty.java b/src/uk/org/ury/common/library/item/LibraryItemProperty.java index 44f5f22..2e4d2ef 100644 --- a/src/uk/org/ury/library/item/LibraryItemProperty.java +++ b/src/uk/org/ury/common/library/item/LibraryItemProperty.java @@ -1,4 +1,4 @@ -package uk.org.ury.library.item; +package uk.org.ury.common.library.item; /** * The parameters that are stored in the LibraryItem. diff --git a/src/uk/org/ury/protocol/Directive.java b/src/uk/org/ury/common/protocol/Directive.java index bd0be0e..e1edd98 100644 --- a/src/uk/org/ury/protocol/Directive.java +++ b/src/uk/org/ury/common/protocol/Directive.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.protocol; +package uk.org.ury.common.protocol; /** * Directives supported by the protocol. diff --git a/src/uk/org/ury/protocol/ProtocolUtils.java b/src/uk/org/ury/common/protocol/ProtocolUtils.java index b2d3ed9..8686eb7 100644 --- a/src/uk/org/ury/protocol/ProtocolUtils.java +++ b/src/uk/org/ury/common/protocol/ProtocolUtils.java @@ -1,15 +1,15 @@ /** * */ -package uk.org.ury.protocol; +package uk.org.ury.common.protocol; import java.util.Map; import org.json.simple.JSONObject; import org.json.simple.JSONValue; -import uk.org.ury.protocol.exceptions.DecodeFailureException; -import uk.org.ury.protocol.exceptions.InvalidMessageException; +import uk.org.ury.common.protocol.exceptions.DecodeFailureException; +import uk.org.ury.common.protocol.exceptions.InvalidMessageException; /** * Utilities for converting between strings encoded in the response protocol and diff --git a/src/uk/org/ury/protocol/Status.java b/src/uk/org/ury/common/protocol/Status.java index f822c34..b424fc9 100644 --- a/src/uk/org/ury/protocol/Status.java +++ b/src/uk/org/ury/common/protocol/Status.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.protocol; +package uk.org.ury.common.protocol; /** diff --git a/src/uk/org/ury/protocol/exceptions/DecodeFailureException.java b/src/uk/org/ury/common/protocol/exceptions/DecodeFailureException.java index 708732b..978ca7b 100644 --- a/src/uk/org/ury/protocol/exceptions/DecodeFailureException.java +++ b/src/uk/org/ury/common/protocol/exceptions/DecodeFailureException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.protocol.exceptions; +package uk.org.ury.common.protocol.exceptions; /** diff --git a/src/uk/org/ury/protocol/exceptions/InvalidMessageException.java b/src/uk/org/ury/common/protocol/exceptions/InvalidMessageException.java index 3cf1105..739b501 100644 --- a/src/uk/org/ury/protocol/exceptions/InvalidMessageException.java +++ b/src/uk/org/ury/common/protocol/exceptions/InvalidMessageException.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.protocol.exceptions; +package uk.org.ury.common.protocol.exceptions; /** diff --git a/src/uk/org/ury/show/ShowChannel.java b/src/uk/org/ury/common/show/ShowChannel.java index 1b8c4fb..1c1b8ce 100644 --- a/src/uk/org/ury/show/ShowChannel.java +++ b/src/uk/org/ury/common/show/ShowChannel.java @@ -9,14 +9,14 @@ * (C) 2011 URY Computing */ -package uk.org.ury.show; +package uk.org.ury.common.show; import java.util.ArrayList; import java.util.List; import javax.swing.AbstractListModel; -import uk.org.ury.show.item.ShowItem; +import uk.org.ury.common.show.item.ShowItem; /** * A channel of ShowItems in a show. diff --git a/src/uk/org/ury/show/ShowUtils.java b/src/uk/org/ury/common/show/ShowUtils.java index 32125ec..a806d8f 100644 --- a/src/uk/org/ury/show/ShowUtils.java +++ b/src/uk/org/ury/common/show/ShowUtils.java @@ -9,7 +9,7 @@ * (C) 2011 URY Computing */ -package uk.org.ury.show; +package uk.org.ury.common.show; import java.sql.ResultSet; import java.sql.SQLException; @@ -18,11 +18,11 @@ import java.util.HashMap; import java.util.List; import java.util.ResourceBundle; -import uk.org.ury.database.DatabaseDriver; -import uk.org.ury.database.exceptions.QueryFailureException; +import uk.org.ury.backend.database.DatabaseDriver; +import uk.org.ury.backend.database.exceptions.QueryFailureException; +import uk.org.ury.common.show.item.ShowItem; +import uk.org.ury.common.show.item.ShowItemProperty; -import uk.org.ury.show.item.ShowItem; -import uk.org.ury.show.item.ShowItemProperty; /** * A set of common utility routines to facilitate the extraction of show items diff --git a/src/uk/org/ury/show/ShowUtils.properties b/src/uk/org/ury/common/show/ShowUtils.properties index 7f8a2fa..7f8a2fa 100644 --- a/src/uk/org/ury/show/ShowUtils.properties +++ b/src/uk/org/ury/common/show/ShowUtils.properties diff --git a/src/uk/org/ury/show/item/ShowItem.java b/src/uk/org/ury/common/show/item/ShowItem.java index 0a9154f..d1d1be1 100644 --- a/src/uk/org/ury/show/item/ShowItem.java +++ b/src/uk/org/ury/common/show/item/ShowItem.java @@ -1,13 +1,13 @@ /** * */ -package uk.org.ury.show.item; +package uk.org.ury.common.show.item; import java.util.Map; -import uk.org.ury.database.DatabaseItem; -import uk.org.ury.database.exceptions.MissingPropertyException; +import uk.org.ury.backend.database.DatabaseItem; +import uk.org.ury.backend.database.exceptions.MissingPropertyException; /** diff --git a/src/uk/org/ury/show/item/ShowItemProperty.java b/src/uk/org/ury/common/show/item/ShowItemProperty.java index a4239b5..43d4e99 100644 --- a/src/uk/org/ury/show/item/ShowItemProperty.java +++ b/src/uk/org/ury/common/show/item/ShowItemProperty.java @@ -1,4 +1,4 @@ -package uk.org.ury.show.item; +package uk.org.ury.common.show.item; /** diff --git a/src/uk/org/ury/show/item/package.html b/src/uk/org/ury/common/show/item/package.html index 0b2af5a..0b2af5a 100644 --- a/src/uk/org/ury/show/item/package.html +++ b/src/uk/org/ury/common/show/item/package.html diff --git a/src/uk/org/ury/frontend/FrontendApplet.java b/src/uk/org/ury/frontend/FrontendApplet.java index 8e0e229..375a260 100644 --- a/src/uk/org/ury/frontend/FrontendApplet.java +++ b/src/uk/org/ury/frontend/FrontendApplet.java @@ -11,7 +11,7 @@ import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import uk.org.ury.frontend.exceptions.LoadFailureException; -import uk.org.ury.testrig.Launcher; +import uk.org.ury.frontend.testrig.Launcher; /** * A frame that hosts a FrontendModulePanel, used for serving frontend panels in diff --git a/src/uk/org/ury/frontend/FrontendFrame.java b/src/uk/org/ury/frontend/FrontendFrame.java index 1683c9b..24a12cb 100644 --- a/src/uk/org/ury/frontend/FrontendFrame.java +++ b/src/uk/org/ury/frontend/FrontendFrame.java @@ -14,330 +14,270 @@ import javax.swing.UnsupportedLookAndFeelException; import uk.org.ury.frontend.exceptions.LoadFailureException; /** - * A frame that hosts a FrontendModulePanel, used for serving frontend - * panels in a window (application mode). + * A frame that hosts a FrontendModulePanel, used for serving frontend panels in + * a window (application mode). * * @author Matt Windsor - * + * */ -public class FrontendFrame extends JFrame implements FrontendMaster -{ - /** - * - */ - - private static final long serialVersionUID = 740928181256928433L; - - private FrontendBanner banner; - private FrontendModulePanel child; - private FrontendControlPanel cpanel; - - - /** - * Construct a new FrontendFrame given an initial frontend module. - * - * Loading will fail with a fatal error if the class is not found, - * or is not an implementor of FrontendModule. - * - * @param moduleName The fully qualified class-name of the module, - * minus the leading "uk.org.ury." domain. - */ - - public - FrontendFrame (String moduleName) - { - super ("URY newBAPS"); - try - { - loadModule (moduleName); - } - catch (LoadFailureException e) - { - fatalError (e.getMessage ()); - } - } - - - /** - * Set up the user interface of the frame. - */ - - public void - setupUI () - { - try - { - // Set System L&F - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName ()); - } - catch (UnsupportedLookAndFeelException e) - { - // handle exception - } - catch (ClassNotFoundException e) - { - // handle exception - } - catch (InstantiationException e) - { - // handle exception - } - catch (IllegalAccessException e) - { - // handle exception - } - - setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); - - Container cp = getContentPane (); - - // Banner - System.out.println (child); - banner = new FrontendBanner (child.getModuleName ()); - - // Composition - - cp.add (banner, BorderLayout.NORTH); - cp.add (child, BorderLayout.CENTER); - - setPreferredSize (new Dimension (800, 600)); - setMinimumSize (new Dimension (800, 600)); - - pack (); - setVisible (true); - } - - - /** - * Load a module into the frontend frame. - * - * Loading will fail with a fatal error if the class is not found, - * or is not an implementor of FrontendModule. - * - * @param moduleName The fully qualified class-name of the module, - * minus the leading "uk.org.ury." domain. - * - * @throws LoadFailureException if the class is - * not found, or is not an implementor of - * FrontendModule. - */ - - @Override - public void - loadModule (String moduleName) - throws LoadFailureException - { - Class<?> moduleClass = null; - - try - { - moduleClass = Class.forName ("uk.org.ury." + moduleName); - } - catch (ClassNotFoundException e) - { - throw new LoadFailureException ("Could not load module: " - + e.getMessage ()); - } - - - if (FrontendModule.class.isAssignableFrom (moduleClass) == false) - { - throw new LoadFailureException ("Could not load module: Not a FrontendModule"); - } - else - { - FrontendModulePanel temp = child; - - try - { - child = ((FrontendModule) moduleClass.newInstance ()).runFrontend (this); - } - catch (InstantiationException e) - { - throw new LoadFailureException ("Could not load module: " - + e.getMessage ()); - } - catch (IllegalAccessException e) - { - throw new LoadFailureException ("Could not load module: " - + e.getMessage ()); - } - - if (temp != null) - remove (temp); - - add (child); - child.setMaster (this); - - if (banner != null) - banner.setTitle (child.getModuleName ()); - - pack (); - } - } - - - /** - * Load a module into the frontend frame, additionally installing - * a control panel to communicate with the previous module. - * - * Loading will fail with a fatal error if the class is not found, - * or is not an implementor of FrontendModule. - * - * @param moduleName The fully qualified class-name of the module, - * minus the leading "uk.org.ury." domain. - * - * @param cPanelName The fully qualified class-name of the control - * panel to install, minus the leading - * "uk.org.ury." domain. - * - * @throws LoadFailureException if the class is - * not found, or is not an implementor of - * FrontendModule. - */ - - @Override - public void - loadModule (String moduleName, String cPanelName) - throws LoadFailureException - { - FrontendModulePanel newParent = child; - loadModule (moduleName); - FrontendModulePanel newChild = child; - - loadControlPanel (cPanelName, newParent, newChild); - } - - - /** - * Load and install a control panel class given the class name. - * - * @param cPanelName The fully qualified class-name of the control - * panel to load, minus the leading - * "uk.org.ury." domain. - * - * @param parent The parent panel in the relationship modelled - * by the control panel interface. - * - * @param child The child panel in the relationship modelled - * by the control panel interface. - * - * @throws LoadFailureException if the class is - * not found, or is not an implementor of - * FrontendControlPanel. - */ - - private void - loadControlPanel (String cPanelName, FrontendModulePanel parent, - FrontendModulePanel child) - throws LoadFailureException - { - Class<?> cPanelClass = null; - - try - { - cPanelClass = Class.forName ("uk.org.ury." + cPanelName); - } - catch (ClassNotFoundException e) - { - throw new LoadFailureException ("Could not load control panel: " - + e.getMessage ()); - } - - - if (FrontendControlPanel.class.isAssignableFrom (cPanelClass)) - { - FrontendControlPanel temp = cpanel; - - try - { - cpanel = ((FrontendControlPanel) cPanelClass.newInstance ()); - } - catch (InstantiationException e) - { - throw new LoadFailureException ("Could not load control panel: " - + e.getMessage ()); - } - catch (IllegalAccessException e) - { - throw new LoadFailureException ("Could not load control panel: " - + e.getMessage ()); - } - - if (temp != null) - remove (temp); - - cpanel.setPanels (parent, child); - cpanel.setMaster (this); - cpanel.setPreviousCPanel (temp); - - add (cpanel, BorderLayout.SOUTH); - pack (); - } - } - - - /** - * Restore an existing module and control panel into the frontend - * frame. - * - * @param mpanel The module panel to restore. - * - * @param cpanel The control panel to restore, if any. A null - * value signifies a lack of control panel. - * - * @throws IllegalArgumentException if the mpanel is null. - */ - - @Override - public void - restoreModule (FrontendModulePanel mpanel, - FrontendControlPanel cpanel) - { - if (mpanel == null) - throw new IllegalArgumentException ("mpanel is null."); - - remove (child); - remove (this.cpanel); - - child = mpanel; - add (child); - banner.setTitle (child.getModuleName ()); - - if (cpanel != null) - add (cpanel, BorderLayout.SOUTH); - - this.cpanel = cpanel; - - pack (); - repaint (); - } - - - /** - * Report a fatal error, - * - * @param message The message, eg the exception message, to report - * to the user. - */ - - @Override - public void - fatalError (String message) - { - FrontendError.reportFatal (message, this); - } - - - /** - * @return the resource directory. - */ - - @Override - public String - getResourceDirectory () - { - return "res/"; - } +public class FrontendFrame extends JFrame implements FrontendMaster { + /** + * + */ + private static final long serialVersionUID = 740928181256928433L; + + private FrontendBanner banner; + private FrontendModulePanel child; + private FrontendControlPanel cpanel; + + /** + * Construct a new FrontendFrame given an initial frontend module. + * + * Loading will fail with a fatal error if the class is not found, or is not + * an implementor of FrontendModule. + * + * @param moduleName + * The fully qualified class-name of the module, minus the + * leading "uk.org.ury." domain. + */ + public FrontendFrame(String moduleName) { + super("URY newBAPS"); + try { + loadModule(moduleName); + } catch (LoadFailureException e) { + fatalError(e.getMessage()); + } + } + + /** + * Set up the user interface of the frame. + */ + public void setupUI() { + try { + // Set System L&F + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (UnsupportedLookAndFeelException e) { + // handle exception + } catch (ClassNotFoundException e) { + // handle exception + } catch (InstantiationException e) { + // handle exception + } catch (IllegalAccessException e) { + // handle exception + } + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + Container cp = getContentPane(); + + // Banner + System.out.println(child); + banner = new FrontendBanner(child.getModuleName()); + + // Composition + cp.add(banner, BorderLayout.NORTH); + cp.add(child, BorderLayout.CENTER); + + setPreferredSize(new Dimension(800, 600)); + setMinimumSize(new Dimension(800, 600)); + + pack(); + setVisible(true); + } + + /** + * Load a module into the frontend frame. + * + * Loading will fail with a fatal error if the class is not found, or is not + * an implementor of FrontendModule. + * + * @param moduleName + * The fully qualified class-name of the module, minus the + * leading "uk.org.ury." domain. + * + * @throws LoadFailureException + * if the class is not found, or is not an implementor of + * FrontendModule. + */ + @Override + public void loadModule(String moduleName) throws LoadFailureException { + Class<?> moduleClass = null; + + try { + moduleClass = Class.forName("uk.org.ury.frontend.modules." + + moduleName); + } catch (ClassNotFoundException e) { + throw new LoadFailureException("Could not load module: " + + e.getMessage()); + } + + if (FrontendModule.class.isAssignableFrom(moduleClass) == false) { + throw new LoadFailureException( + "Could not load module: Not a FrontendModule"); + } else { + FrontendModulePanel temp = child; + + try { + child = ((FrontendModule) moduleClass.newInstance()) + .runFrontend(this); + } catch (InstantiationException e) { + throw new LoadFailureException("Could not load module: " + + e.getMessage()); + } catch (IllegalAccessException e) { + throw new LoadFailureException("Could not load module: " + + e.getMessage()); + } + + if (temp != null) + remove(temp); + + add(child); + child.setMaster(this); + + if (banner != null) + banner.setTitle(child.getModuleName()); + + pack(); + } + } + + /** + * Load a module into the frontend frame, additionally installing a control + * panel to communicate with the previous module. + * + * Loading will fail with a fatal error if the class is not found, or is not + * an implementor of FrontendModule. + * + * @param moduleName + * The fully qualified class-name of the module, minus the + * leading "uk.org.ury." domain. + * + * @param cPanelName + * The fully qualified class-name of the control panel to + * install, minus the leading "uk.org.ury." domain. + * + * @throws LoadFailureException + * if the class is not found, or is not an implementor of + * FrontendModule. + */ + @Override + public void loadModule(String moduleName, String cPanelName) + throws LoadFailureException { + FrontendModulePanel newParent = child; + loadModule(moduleName); + FrontendModulePanel newChild = child; + + loadControlPanel(cPanelName, newParent, newChild); + } + + /** + * Load and install a control panel class given the class name. + * + * @param cPanelName + * The fully qualified class-name of the control panel to load, + * minus the leading "uk.org.ury." domain. + * + * @param parent + * The parent panel in the relationship modelled by the control + * panel interface. + * + * @param child + * The child panel in the relationship modelled by the control + * panel interface. + * + * @throws LoadFailureException + * if the class is not found, or is not an implementor of + * FrontendControlPanel. + */ + private void loadControlPanel(String cPanelName, + FrontendModulePanel parent, FrontendModulePanel child) + throws LoadFailureException { + Class<?> cPanelClass = null; + + try { + cPanelClass = Class.forName("uk.org.ury.frontend.cpanels." + cPanelName); + } catch (ClassNotFoundException e) { + throw new LoadFailureException("Could not load control panel: " + + e.getMessage()); + } + + if (FrontendControlPanel.class.isAssignableFrom(cPanelClass)) { + FrontendControlPanel temp = cpanel; + + try { + cpanel = ((FrontendControlPanel) cPanelClass.newInstance()); + } catch (InstantiationException e) { + throw new LoadFailureException("Could not load control panel: " + + e.getMessage()); + } catch (IllegalAccessException e) { + throw new LoadFailureException("Could not load control panel: " + + e.getMessage()); + } + + if (temp != null) + remove(temp); + + cpanel.setPanels(parent, child); + cpanel.setMaster(this); + cpanel.setPreviousCPanel(temp); + + add(cpanel, BorderLayout.SOUTH); + pack(); + } + } + + /** + * Restore an existing module and control panel into the frontend frame. + * + * @param mpanel + * The module panel to restore. + * + * @param cpanel + * The control panel to restore, if any. A null value signifies a + * lack of control panel. + * + * @throws IllegalArgumentException + * if the mpanel is null. + */ + @Override + public void restoreModule(FrontendModulePanel mpanel, + FrontendControlPanel cpanel) { + if (mpanel == null) + throw new IllegalArgumentException("mpanel is null."); + + remove(child); + remove(this.cpanel); + + child = mpanel; + add(child); + banner.setTitle(child.getModuleName()); + + if (cpanel != null) + add(cpanel, BorderLayout.SOUTH); + + this.cpanel = cpanel; + + pack(); + repaint(); + } + + /** + * Report a fatal error, + * + * @param message + * The message, eg the exception message, to report to the user. + */ + @Override + public void fatalError(String message) { + FrontendError.reportFatal(message, this); + } + + /** + * @return the resource directory. + */ + @Override + public String getResourceDirectory() { + return "res/"; + } } diff --git a/src/uk/org/ury/frontend/FrontendModule.java b/src/uk/org/ury/frontend/FrontendModule.java index 4d1e3bf..8298ac5 100644 --- a/src/uk/org/ury/frontend/FrontendModule.java +++ b/src/uk/org/ury/frontend/FrontendModule.java @@ -4,38 +4,32 @@ package uk.org.ury.frontend; /** - * Interface for all system modules that are to be reachable from - * the frontend array. + * Interface for all system modules that are to be reachable from the frontend + * array. * * Frontend-exposed modules must: * * - be runnable standalone, as either an application or an applet; * - * - contain their user interface in a subclass of FrontendModulePanel - * which can be embedded either in a FrontendFrame, a web page - * or another module; - * + * - contain their user interface in a subclass of FrontendModulePanel which can + * be embedded either in a FrontendFrame, a web page or another module; + * * - use the frontend error reporting systems. * - * An abstract implementation of this interface, - * AbstractFrontendModule, is provided to simplify the creation of - * frontend modules. + * An abstract implementation of this interface, AbstractFrontendModule, is + * provided to simplify the creation of frontend modules. * * @author Matt Windsor - * + * */ - -public interface FrontendModule -{ - /** - * Begin execution of the frontend module. - * - * @param master The FrontendMaster driving the frontend. - * - * @return the frontend panel to insert into the - * FrontendMaster. - */ - - public FrontendModulePanel - runFrontend (FrontendMaster master); +public interface FrontendModule { + /** + * Begin execution of the frontend module. + * + * @param master + * The FrontendMaster driving the frontend. + * + * @return the frontend panel to insert into the FrontendMaster. + */ + public FrontendModulePanel runFrontend(FrontendMaster master); } diff --git a/src/uk/org/ury/client/Client.java b/src/uk/org/ury/frontend/client/Client.java index 5b8be62..9606d89 100644 --- a/src/uk/org/ury/client/Client.java +++ b/src/uk/org/ury/frontend/client/Client.java @@ -1,4 +1,4 @@ -package uk.org.ury.client; +package uk.org.ury.frontend.client; import java.io.BufferedReader; import java.io.IOException; @@ -10,8 +10,8 @@ import java.net.URLConnection; import java.util.Map; -import uk.org.ury.protocol.ProtocolUtils; -import uk.org.ury.protocol.exceptions.DecodeFailureException; +import uk.org.ury.common.protocol.ProtocolUtils; +import uk.org.ury.common.protocol.exceptions.DecodeFailureException; public class Client { /** diff --git a/src/uk/org/ury/client/test/ClientTest.java b/src/uk/org/ury/frontend/client/test/ClientTest.java index 3ee70ef..d75a0ac 100644 --- a/src/uk/org/ury/client/test/ClientTest.java +++ b/src/uk/org/ury/frontend/client/test/ClientTest.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.client.test; +package uk.org.ury.frontend.client.test; import java.util.Map; @@ -11,9 +11,9 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import uk.org.ury.client.Client; -import uk.org.ury.protocol.Directive; -import uk.org.ury.protocol.exceptions.DecodeFailureException; +import uk.org.ury.common.protocol.Directive; +import uk.org.ury.common.protocol.exceptions.DecodeFailureException; +import uk.org.ury.frontend.client.Client; /** * JUnit test for the low-level client logic. @@ -37,7 +37,7 @@ public class ClientTest { } /** - * Test method for {@link uk.org.ury.client.Client#get(java.lang.String)}. + * Test method for {@link uk.org.ury.frontend.client.Client#get(java.lang.String)}. */ @Test public void testGet() { diff --git a/src/uk/org/ury/testrig/DemoControlPanel.java b/src/uk/org/ury/frontend/cpanels/menu/DemoControlPanel.java index 85789c5..7ef0907 100644 --- a/src/uk/org/ury/testrig/DemoControlPanel.java +++ b/src/uk/org/ury/frontend/cpanels/menu/DemoControlPanel.java @@ -1,4 +1,4 @@ -package uk.org.ury.testrig; +package uk.org.ury.frontend.cpanels.menu; import uk.org.ury.frontend.FrontendControlPanel; diff --git a/src/uk/org/ury/testrig/demo_control_panel.xml b/src/uk/org/ury/frontend/cpanels/menu/demo_control_panel.xml index a9b5329..a9b5329 100644 --- a/src/uk/org/ury/testrig/demo_control_panel.xml +++ b/src/uk/org/ury/frontend/cpanels/menu/demo_control_panel.xml diff --git a/src/uk/org/ury/show/viewer/LibraryControlPanel.java b/src/uk/org/ury/frontend/cpanels/show/LibraryControlPanel.java index c385f05..a3d7512 100644 --- a/src/uk/org/ury/show/viewer/LibraryControlPanel.java +++ b/src/uk/org/ury/frontend/cpanels/show/LibraryControlPanel.java @@ -1,4 +1,4 @@ -package uk.org.ury.show.viewer; +package uk.org.ury.frontend.cpanels.show; import uk.org.ury.frontend.FrontendControlPanel; diff --git a/src/uk/org/ury/show/viewer/library_control_panel.xml b/src/uk/org/ury/frontend/cpanels/show/library_control_panel.xml index bdf8af0..bdf8af0 100644 --- a/src/uk/org/ury/show/viewer/library_control_panel.xml +++ b/src/uk/org/ury/frontend/cpanels/show/library_control_panel.xml diff --git a/src/uk/org/ury/library/viewer/LibraryTableModel.java b/src/uk/org/ury/frontend/modules/library/LibraryTableModel.java index 1ce5709..334eb8b 100644 --- a/src/uk/org/ury/library/viewer/LibraryTableModel.java +++ b/src/uk/org/ury/frontend/modules/library/LibraryTableModel.java @@ -1,15 +1,15 @@ /** * */ -package uk.org.ury.library.viewer; +package uk.org.ury.frontend.modules.library; import java.util.List; import javax.swing.table.AbstractTableModel; -import uk.org.ury.database.exceptions.MissingPropertyException; -import uk.org.ury.library.item.LibraryItem; -import uk.org.ury.library.item.LibraryItemProperty; +import uk.org.ury.backend.database.exceptions.MissingPropertyException; +import uk.org.ury.common.library.item.LibraryItem; +import uk.org.ury.common.library.item.LibraryItemProperty; /** diff --git a/src/uk/org/ury/library/viewer/LibraryViewer.java b/src/uk/org/ury/frontend/modules/library/LibraryViewer.java index 9548338..c4a3630 100644 --- a/src/uk/org/ury/library/viewer/LibraryViewer.java +++ b/src/uk/org/ury/frontend/modules/library/LibraryViewer.java @@ -9,7 +9,7 @@ * (C) 2011 URY Computing */ -package uk.org.ury.library.viewer; +package uk.org.ury.frontend.modules.library; import java.util.ArrayList; import java.util.HashMap; @@ -17,18 +17,18 @@ import java.util.List; import java.util.Map; import java.util.Set; -import uk.org.ury.client.Client; +import uk.org.ury.common.library.exceptions.EmptySearchException; +import uk.org.ury.common.library.item.LibraryItem; +import uk.org.ury.common.library.item.LibraryItemProperty; +import uk.org.ury.common.protocol.Directive; +import uk.org.ury.common.protocol.ProtocolUtils; +import uk.org.ury.common.protocol.exceptions.DecodeFailureException; +import uk.org.ury.common.protocol.exceptions.InvalidMessageException; import uk.org.ury.frontend.AbstractFrontendModule; import uk.org.ury.frontend.FrontendMaster; import uk.org.ury.frontend.FrontendModulePanel; +import uk.org.ury.frontend.client.Client; import uk.org.ury.frontend.exceptions.UICreationFailureException; -import uk.org.ury.library.exceptions.EmptySearchException; -import uk.org.ury.library.item.LibraryItem; -import uk.org.ury.library.item.LibraryItemProperty; -import uk.org.ury.protocol.Directive; -import uk.org.ury.protocol.ProtocolUtils; -import uk.org.ury.protocol.exceptions.DecodeFailureException; -import uk.org.ury.protocol.exceptions.InvalidMessageException; /** * Module for investigating the track library. diff --git a/src/uk/org/ury/library/viewer/LibraryViewer.properties b/src/uk/org/ury/frontend/modules/library/LibraryViewer.properties index bb88988..bb88988 100644 --- a/src/uk/org/ury/library/viewer/LibraryViewer.properties +++ b/src/uk/org/ury/frontend/modules/library/LibraryViewer.properties diff --git a/src/uk/org/ury/library/viewer/LibraryViewerPanel.java b/src/uk/org/ury/frontend/modules/library/LibraryViewerPanel.java index 94496fc..37c134a 100644 --- a/src/uk/org/ury/library/viewer/LibraryViewerPanel.java +++ b/src/uk/org/ury/frontend/modules/library/LibraryViewerPanel.java @@ -9,7 +9,7 @@ * (C) 2011 URY Computing */ -package uk.org.ury.library.viewer; +package uk.org.ury.frontend.modules.library; import java.util.ResourceBundle; import java.util.concurrent.ExecutionException; @@ -21,12 +21,13 @@ import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.SwingWorker; + +import uk.org.ury.common.library.exceptions.EmptySearchException; +import uk.org.ury.common.protocol.exceptions.InvalidMessageException; import uk.org.ury.frontend.FrontendMaster; import uk.org.ury.frontend.FrontendModulePanel; import uk.org.ury.frontend.HintField; import uk.org.ury.frontend.exceptions.UICreationFailureException; -import uk.org.ury.library.exceptions.EmptySearchException; -import uk.org.ury.protocol.exceptions.InvalidMessageException; /** * Frontend panel providing access to an underlying library viewer. @@ -92,7 +93,7 @@ public class LibraryViewerPanel extends FrontendModulePanel { // Fill in locale-specific data. rb = ResourceBundle - .getBundle("uk.org.ury.library.viewer.LibraryViewer"); + .getBundle("uk.org.ury.frontend.modules.library.LibraryViewer"); searchFailureMessage = rb.getString("ERR_UNKNOWN"); diff --git a/src/uk/org/ury/library/viewer/library_viewer_gui.xml b/src/uk/org/ury/frontend/modules/library/library_viewer_gui.xml index ce30a1d..ce30a1d 100644 --- a/src/uk/org/ury/library/viewer/library_viewer_gui.xml +++ b/src/uk/org/ury/frontend/modules/library/library_viewer_gui.xml diff --git a/src/uk/org/ury/testrig/DemoMenu.java b/src/uk/org/ury/frontend/modules/menu/DemoMenu.java index 19e68d9..2210ef8 100644 --- a/src/uk/org/ury/testrig/DemoMenu.java +++ b/src/uk/org/ury/frontend/modules/menu/DemoMenu.java @@ -1,4 +1,4 @@ -package uk.org.ury.testrig; +package uk.org.ury.frontend.modules.menu; import uk.org.ury.frontend.AbstractFrontendModule; import uk.org.ury.frontend.FrontendMaster; diff --git a/src/uk/org/ury/frontend/modules/menu/DemoMenuPanel.java b/src/uk/org/ury/frontend/modules/menu/DemoMenuPanel.java new file mode 100644 index 0000000..3520f2a --- /dev/null +++ b/src/uk/org/ury/frontend/modules/menu/DemoMenuPanel.java @@ -0,0 +1,68 @@ +package uk.org.ury.frontend.modules.menu; + +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JButton; + +import uk.org.ury.frontend.FrontendMaster; +import uk.org.ury.frontend.FrontendModulePanel; +import uk.org.ury.frontend.exceptions.LoadFailureException; + +public class DemoMenuPanel extends FrontendModulePanel { + /** + * + */ + private static final long serialVersionUID = 5268978856289909262L; + + /** + * Construct a new DemoMenuPanel. + * + * @param inMaster + * The new frontend master of the panel, if any. + */ + public DemoMenuPanel(FrontendMaster inMaster) { + super(null, inMaster); + + setLayout(new GridLayout(2, 1)); + + JButton lb = new JButton("Library Viewer Demo"); + JButton sb = new JButton("Show Viewer Demo"); + + lb.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent arg0) { + try { + master.loadModule("library.LibraryViewer", + "menu.DemoControlPanel"); + } catch (LoadFailureException e) { + master.fatalError(e.getMessage()); + } + } + }); + + sb.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent arg0) { + try { + master.loadModule("show.ShowViewer", + "menu.DemoControlPanel"); + } catch (LoadFailureException e) { + master.fatalError(e.getMessage()); + } + } + }); + + add(lb); + add(sb); + } + + /** + * @return the name of the module. + */ + @Override + public String getModuleName() { + return "Demo Menu"; + } +} diff --git a/src/uk/org/ury/show/viewer/ChannelPanel.java b/src/uk/org/ury/frontend/modules/show/ChannelPanel.java index 54e33dd..150f1bc 100644 --- a/src/uk/org/ury/show/viewer/ChannelPanel.java +++ b/src/uk/org/ury/frontend/modules/show/ChannelPanel.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.show.viewer; +package uk.org.ury.frontend.modules.show; import java.awt.event.KeyEvent; @@ -9,9 +9,9 @@ import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JList; +import uk.org.ury.common.show.ShowChannel; import uk.org.ury.frontend.FrontendPanel; import uk.org.ury.frontend.exceptions.UICreationFailureException; -import uk.org.ury.show.ShowChannel; /** diff --git a/src/uk/org/ury/show/viewer/ShowViewer.java b/src/uk/org/ury/frontend/modules/show/ShowViewer.java index d11e8d5..641ee3a 100644 --- a/src/uk/org/ury/show/viewer/ShowViewer.java +++ b/src/uk/org/ury/frontend/modules/show/ShowViewer.java @@ -9,22 +9,22 @@ * (C) 2011 URY Computing */ -package uk.org.ury.show.viewer; +package uk.org.ury.frontend.modules.show; import java.util.List; -import uk.org.ury.config.ConfigReader; -import uk.org.ury.database.DatabaseDriver; -import uk.org.ury.database.UserClass; -import uk.org.ury.database.exceptions.MissingCredentialsException; -import uk.org.ury.database.exceptions.QueryFailureException; +import uk.org.ury.backend.config.ConfigReader; +import uk.org.ury.backend.database.DatabaseDriver; +import uk.org.ury.backend.database.UserClass; +import uk.org.ury.backend.database.exceptions.MissingCredentialsException; +import uk.org.ury.backend.database.exceptions.QueryFailureException; +import uk.org.ury.common.show.ShowChannel; +import uk.org.ury.common.show.ShowUtils; +import uk.org.ury.common.show.item.ShowItem; import uk.org.ury.frontend.AbstractFrontendModule; import uk.org.ury.frontend.FrontendMaster; import uk.org.ury.frontend.FrontendModulePanel; import uk.org.ury.frontend.exceptions.UICreationFailureException; -import uk.org.ury.show.ShowChannel; -import uk.org.ury.show.ShowUtils; -import uk.org.ury.show.item.ShowItem; /** * Frontend module for viewing show details. diff --git a/src/uk/org/ury/show/viewer/ShowViewerPanel.java b/src/uk/org/ury/frontend/modules/show/ShowViewerPanel.java index 0bc5cd2..c4eb6e2 100644 --- a/src/uk/org/ury/show/viewer/ShowViewerPanel.java +++ b/src/uk/org/ury/frontend/modules/show/ShowViewerPanel.java @@ -1,19 +1,19 @@ /** * */ -package uk.org.ury.show.viewer; +package uk.org.ury.frontend.modules.show; import java.awt.GridLayout; import java.util.List; import javax.swing.JPanel; -import uk.org.ury.database.exceptions.QueryFailureException; +import uk.org.ury.backend.database.exceptions.QueryFailureException; +import uk.org.ury.common.show.ShowChannel; import uk.org.ury.frontend.FrontendMaster; import uk.org.ury.frontend.FrontendModulePanel; import uk.org.ury.frontend.exceptions.LoadFailureException; import uk.org.ury.frontend.exceptions.UICreationFailureException; -import uk.org.ury.show.ShowChannel; /** @@ -122,8 +122,8 @@ public class ShowViewerPanel extends FrontendModulePanel { try { - master.loadModule ("library.viewer.LibraryViewer", - "show.viewer.LibraryControlPanel"); + master.loadModule ("library.LibraryViewer", + "show.LibraryControlPanel"); } catch (LoadFailureException e) { diff --git a/src/uk/org/ury/show/viewer/TrackBin.java b/src/uk/org/ury/frontend/modules/show/TrackBin.java index 7234912..96b67f4 100644 --- a/src/uk/org/ury/show/viewer/TrackBin.java +++ b/src/uk/org/ury/frontend/modules/show/TrackBin.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.show.viewer; +package uk.org.ury.frontend.modules.show; import javax.swing.JLabel; diff --git a/src/uk/org/ury/show/viewer/channel_panel.xml b/src/uk/org/ury/frontend/modules/show/channel_panel.xml index bf576ce..bf576ce 100644 --- a/src/uk/org/ury/show/viewer/channel_panel.xml +++ b/src/uk/org/ury/frontend/modules/show/channel_panel.xml diff --git a/src/uk/org/ury/show/viewer/show_viewer_gui.xml b/src/uk/org/ury/frontend/modules/show/show_viewer_gui.xml index 90b8cb5..90b8cb5 100644 --- a/src/uk/org/ury/show/viewer/show_viewer_gui.xml +++ b/src/uk/org/ury/frontend/modules/show/show_viewer_gui.xml diff --git a/src/uk/org/ury/show/viewer/show_viewer_gui_old.xml b/src/uk/org/ury/frontend/modules/show/show_viewer_gui_old.xml index d11e579..d11e579 100644 --- a/src/uk/org/ury/show/viewer/show_viewer_gui_old.xml +++ b/src/uk/org/ury/frontend/modules/show/show_viewer_gui_old.xml diff --git a/src/uk/org/ury/show/viewer/show_viewer_gui_panels.xml b/src/uk/org/ury/frontend/modules/show/show_viewer_gui_panels.xml index eda711b..eda711b 100644 --- a/src/uk/org/ury/show/viewer/show_viewer_gui_panels.xml +++ b/src/uk/org/ury/frontend/modules/show/show_viewer_gui_panels.xml diff --git a/src/uk/org/ury/show/viewer/track_bin.xml b/src/uk/org/ury/frontend/modules/show/track_bin.xml index d1ff9da..d1ff9da 100644 --- a/src/uk/org/ury/show/viewer/track_bin.xml +++ b/src/uk/org/ury/frontend/modules/show/track_bin.xml diff --git a/src/uk/org/ury/frontend/testrig/ApplicationLauncher.java b/src/uk/org/ury/frontend/testrig/ApplicationLauncher.java new file mode 100644 index 0000000..4a194ac --- /dev/null +++ b/src/uk/org/ury/frontend/testrig/ApplicationLauncher.java @@ -0,0 +1,27 @@ +/** + * + */ +package uk.org.ury.frontend.testrig; + +import uk.org.ury.frontend.FrontendFrame; + +/** + * An application-based entry point into the frontend. + * + * If provided with no arguments, this will launch the main menu. + * + * @author Matt Windsor + */ +public class ApplicationLauncher implements Launcher { + /** + * Main method. + * + * @param args + * The command-line arguments to the program. These will + * currently be ignored. + */ + public static void main(String[] args) { + FrontendFrame fr = new FrontendFrame(DEFAULT_MODULE_NAME); + fr.setupUI(); + } +} diff --git a/src/uk/org/ury/testrig/Launcher.java b/src/uk/org/ury/frontend/testrig/Launcher.java index d5126c7..8e92831 100644 --- a/src/uk/org/ury/testrig/Launcher.java +++ b/src/uk/org/ury/frontend/testrig/Launcher.java @@ -1,7 +1,7 @@ /** * */ -package uk.org.ury.testrig; +package uk.org.ury.frontend.testrig; /** @@ -13,5 +13,5 @@ package uk.org.ury.testrig; public interface Launcher { - public String DEFAULT_MODULE_NAME = "testrig.DemoMenu"; + public String DEFAULT_MODULE_NAME = "menu.DemoMenu"; } diff --git a/src/uk/org/ury/testrig/ApplicationLauncher.java b/src/uk/org/ury/testrig/ApplicationLauncher.java deleted file mode 100644 index ce48722..0000000 --- a/src/uk/org/ury/testrig/ApplicationLauncher.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - */ -package uk.org.ury.testrig; - -import uk.org.ury.frontend.FrontendFrame; - - -/** - * An application-based entry point into the frontend. - * - * If provided with no arguments, this will launch the main menu. - * - * @author Matt Windsor - */ - -public class ApplicationLauncher implements Launcher -{ - /** - * Main method. - * - * @param args The command-line arguments to the program. These - * will currently be ignored. - */ - - public static void - main (String[] args) - { - FrontendFrame fr = new FrontendFrame (DEFAULT_MODULE_NAME); - fr.setupUI (); - } -} diff --git a/src/uk/org/ury/testrig/DemoMenuPanel.java b/src/uk/org/ury/testrig/DemoMenuPanel.java deleted file mode 100644 index f38a3a0..0000000 --- a/src/uk/org/ury/testrig/DemoMenuPanel.java +++ /dev/null @@ -1,90 +0,0 @@ -package uk.org.ury.testrig; - -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JButton; - -import uk.org.ury.frontend.FrontendMaster; -import uk.org.ury.frontend.FrontendModulePanel; -import uk.org.ury.frontend.exceptions.LoadFailureException; - -public class DemoMenuPanel extends FrontendModulePanel -{ - /** - * - */ - private static final long serialVersionUID = 5268978856289909262L; - - - /** - * Construct a new DemoMenuPanel. - * - * @param inMaster The new frontend master of the panel, if any. - */ - - public - DemoMenuPanel (FrontendMaster inMaster) - { - super (null, inMaster); - - setLayout (new GridLayout (2, 1)); - - JButton lb = new JButton ("Library Viewer Demo"); - JButton sb = new JButton ("Show Viewer Demo"); - - lb.addActionListener (new ActionListener () - { - @Override - public void - actionPerformed (ActionEvent arg0) - { - try - { - master.loadModule ("library.viewer.LibraryViewer", - "testrig.DemoControlPanel"); - } - catch (LoadFailureException e) - { - master.fatalError (e.getMessage ()); - } - } - }); - - - sb.addActionListener (new ActionListener () - { - @Override - public void - actionPerformed (ActionEvent arg0) - { - try - { - master.loadModule ("show.viewer.ShowViewer", - "testrig.DemoControlPanel"); - } - catch (LoadFailureException e) - { - master.fatalError (e.getMessage ()); - } - } - }); - - - add (lb); - add (sb); - } - - - /** - * @return the name of the module. - */ - - @Override - public String - getModuleName () - { - return "Demo Menu"; - } -} |