From 587428e890799ee0c6d3a3224e4a161a3480811d Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 23 May 2008 17:15:53 +0000 Subject: [PATCH] starting project notifications git-svn-id: http://trooper/svn/projects/jSite/trunk@940 c3eda9e8-030b-0410-8277-bc7414b0a119 --- src/net/pterodactylus/jsite/gui/MainWindow.java | 58 ++++++++++++++++++++++ .../pterodactylus/jsite/gui/SwingInterface.java | 8 +-- src/net/pterodactylus/jsite/main/Main.java | 1 + 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/src/net/pterodactylus/jsite/gui/MainWindow.java b/src/net/pterodactylus/jsite/gui/MainWindow.java index 4e1b9aa..9731ec5 100644 --- a/src/net/pterodactylus/jsite/gui/MainWindow.java +++ b/src/net/pterodactylus/jsite/gui/MainWindow.java @@ -260,11 +260,69 @@ public class MainWindow extends JFrame implements WindowListener, I18nable, Prop } } + /** + * @param project + */ + void projectInsertStarted(Project project) { + ProjectPanel projectPanel = findProjectPanel(project); + if (projectPanel == null) { + return; + } + + } + + /** + * @param project + * @param totalBlocks + * @param requiredBlocks + * @param successfulBlocks + * @param failedBlocks + * @param fatallyFailedBlocks + * @param finalizedTotal + */ + void projectInsertProgressed(Project project, int totalBlocks, int requiredBlocks, int successfulBlocks, int failedBlocks, int fatallyFailedBlocks, boolean finalizedTotal) { + + } + + /** + * @param project + */ + void projectInsertGeneratedURI(Project project) { + + } + + /** + * @param project + * @param success + */ + void projectInsertFinished(Project project, boolean success) { + + } + // // PRIVATE METHODS // /** + * Locates the project panel that contains the given project. + * + * @param project + * The wanted project + */ + private ProjectPanel findProjectPanel(Project project) { + int tabCount = projectPane.getTabCount(); + for (int tabIndex = 1; tabIndex < tabCount; tabIndex++) { + Component tabComponent = projectPane.getComponentAt(tabIndex); + if (tabComponent instanceof ProjectPanel) { + if (((ProjectPanel) tabComponent).getProject() == project) { + return (ProjectPanel) tabComponent; + } + } + } + return null; + } + + /** * Initializes the window by creating all its components. */ private void initWindow() { diff --git a/src/net/pterodactylus/jsite/gui/SwingInterface.java b/src/net/pterodactylus/jsite/gui/SwingInterface.java index 3c073be..4fb7139 100644 --- a/src/net/pterodactylus/jsite/gui/SwingInterface.java +++ b/src/net/pterodactylus/jsite/gui/SwingInterface.java @@ -980,7 +980,7 @@ public class SwingInterface implements CoreListener, LoggingListener { * @see net.pterodactylus.jsite.core.CoreListener#projectInsertStarted(net.pterodactylus.jsite.project.Project) */ public void projectInsertStarted(Project project) { - /* TODO - show in interface */ + mainWindow.projectInsertStarted(project); } /** @@ -988,7 +988,7 @@ public class SwingInterface implements CoreListener, LoggingListener { * int, int, int, int, int, boolean) */ public void projectInsertProgressed(Project project, int totalBlocks, int requiredBlocks, int successfulBlocks, int failedBlocks, int fatallyFailedBlocks, boolean finalizedTotal) { - /* TODO - show in interface */ + mainWindow.projectInsertProgressed(project, totalBlocks, requiredBlocks, successfulBlocks, failedBlocks, fatallyFailedBlocks, finalizedTotal); } /** @@ -996,7 +996,7 @@ public class SwingInterface implements CoreListener, LoggingListener { * java.lang.String) */ public void projectInsertGeneratedURI(Project project, String uri) { - /* TODO - show in interface */ + mainWindow.projectInsertGeneratedURI(project); } /** @@ -1004,7 +1004,7 @@ public class SwingInterface implements CoreListener, LoggingListener { * boolean) */ public void projectInsertFinished(Project project, boolean success) { - /* TODO - show in interface */ + mainWindow.projectInsertFinished(project, success); } // diff --git a/src/net/pterodactylus/jsite/main/Main.java b/src/net/pterodactylus/jsite/main/Main.java index 329cbcf..c83dd46 100644 --- a/src/net/pterodactylus/jsite/main/Main.java +++ b/src/net/pterodactylus/jsite/main/Main.java @@ -58,6 +58,7 @@ public class Main { private void start() { Logging.setup("jSite"); + addLookAndFeel("NimROD", "com.nilo.plaf.nimrod.NimRODLookAndFeel"); CoreImpl core = new CoreImpl(); String configDirectory = System.getProperty("user.home") + File.separator + ".jSite"; -- 2.7.4