summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-01-23 12:10:14 +0100
committerAndrew Branson <andrew.branson@cern.ch>2014-01-23 12:10:14 +0100
commitcaabd3cba2ad9d454e119c4b241de9632b61cd43 (patch)
tree5a73ba7894b2c62bf27ec759b290d539a63dc438
parentbd88a6202439a9b4e10ca0cc79aca71f118ab0da (diff)
Changes to support the new ResourceLoader. Refs #149
-rw-r--r--src/main/java/com/c2kernel/gui/Console.java4
-rw-r--r--src/main/java/com/c2kernel/gui/ImageLoader.java9
-rw-r--r--src/main/java/com/c2kernel/gui/MenuBuilder.java10
3 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/com/c2kernel/gui/Console.java b/src/main/java/com/c2kernel/gui/Console.java
index 3427f82..f8420c5 100644
--- a/src/main/java/com/c2kernel/gui/Console.java
+++ b/src/main/java/com/c2kernel/gui/Console.java
@@ -24,9 +24,9 @@ import javax.swing.JTextArea;
import javax.swing.JTextField;
import com.c2kernel.process.Gateway;
+import com.c2kernel.process.resource.Resource;
import com.c2kernel.utils.FileStringUtility;
import com.c2kernel.utils.Logger;
-import com.c2kernel.utils.Resource;
/**************************************************************************
*
@@ -131,7 +131,7 @@ public class Console extends JFrame {
try {
// TODO: merge module script utilities together and prepend with namespace
- Properties utilProps = FileStringUtility.loadConfigFile( Resource.findTextResource("ScriptUtils.conf") );
+ Properties utilProps = FileStringUtility.loadConfigFile( Gateway.getResource().findTextResource("ScriptUtils.conf") );
Box utilBox = Box.createHorizontalBox();
for (Object name2 : utilProps.keySet()) {
diff --git a/src/main/java/com/c2kernel/gui/ImageLoader.java b/src/main/java/com/c2kernel/gui/ImageLoader.java
index 816aab7..4037f61 100644
--- a/src/main/java/com/c2kernel/gui/ImageLoader.java
+++ b/src/main/java/com/c2kernel/gui/ImageLoader.java
@@ -8,8 +8,9 @@ import java.util.Hashtable;
import javax.swing.ImageIcon;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.process.Gateway;
+import com.c2kernel.process.resource.Resource;
import com.c2kernel.utils.Logger;
-import com.c2kernel.utils.Resource;
public class ImageLoader {
@@ -25,7 +26,7 @@ public class ImageLoader {
*/
static public ImageIcon findImage(String resName) {
try {
- for (String ns : Resource.getModuleBaseURLs().keySet()) {
+ for (String ns : Gateway.getResource().getModuleBaseURLs().keySet()) {
try {
return getImage(ns, resName);
} catch (ObjectNotFoundException ex) { }
@@ -51,11 +52,11 @@ public class ImageLoader {
URL imgLocation = null;
if (ns == null)
try {
- imgLocation = Resource.getKernelResourceURL("images/"+resName);
+ imgLocation = Gateway.getResource().getKernelResourceURL("images/"+resName);
} catch (MalformedURLException ex) { }
else
try {
- imgLocation = Resource.getModuleResourceURL(ns, "images/"+resName);
+ imgLocation = Gateway.getResource().getModuleResourceURL(ns, "images/"+resName);
} catch (MalformedURLException ex) { }
if (imgLocation!= null) {
diff --git a/src/main/java/com/c2kernel/gui/MenuBuilder.java b/src/main/java/com/c2kernel/gui/MenuBuilder.java
index b5c41fe..c183cba 100644
--- a/src/main/java/com/c2kernel/gui/MenuBuilder.java
+++ b/src/main/java/com/c2kernel/gui/MenuBuilder.java
@@ -30,11 +30,11 @@ import com.c2kernel.lookup.DomainPath;
import com.c2kernel.lookup.Path;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.process.Gateway;
+import com.c2kernel.process.resource.Resource;
import com.c2kernel.property.Property;
import com.c2kernel.utils.FileStringUtility;
import com.c2kernel.utils.Language;
import com.c2kernel.utils.Logger;
-import com.c2kernel.utils.Resource;
/**
* @version $Revision: 1.47 $ $Date: 2006/03/03 13:52:21 $
* @author $Author: abranson $
@@ -225,18 +225,18 @@ public class MenuBuilder extends JMenuBar implements ActionListener, ItemListene
JLabel title = new JLabel(aboutInfo);
about.add(title);
- about.add(new JLabel("Kernel version: "+Resource.getKernelVersion()));
+ about.add(new JLabel("Kernel version: "+Gateway.getKernelVersion()));
about.add(new JLabel("Modules loaded: "+Gateway.getModuleManager().getModuleVersions()));
// get license info
StringBuffer lictxt = new StringBuffer();
try {
- lictxt.append(Resource.getTextResource(null, "textFiles/license.html"));
+ lictxt.append(Gateway.getResource().getTextResource(null, "textFiles/license.html"));
} catch (ObjectNotFoundException e) { } // no kernel license found
- for (String ns : Resource.getModuleBaseURLs().keySet()) {
+ for (String ns : Gateway.getResource().getModuleBaseURLs().keySet()) {
String domlictxt;
try {
- domlictxt = Resource.getTextResource(ns, "license.html");
+ domlictxt = Gateway.getResource().getTextResource(ns, "license.html");
lictxt.append(domlictxt).append("\n");
} catch (ObjectNotFoundException e) { }