Added constructor without Prototype parameter to make it possible

to have SkinFiles which don't know or care about what prototype
they belong to.
This commit is contained in:
hns 2002-03-25 18:54:07 +00:00
parent 77da4999aa
commit 1a777b5c5a

View file

@ -43,6 +43,19 @@ public class SkinFile implements Updatable {
this.skin = new Skin (body, app); this.skin = new Skin (body, app);
} }
/**
* Create a skinfile without that doesn't belong to a prototype, or at
* least it doesn't know about its prototype and isn't managed by the prototype.
*/
public SkinFile (File file, String name, Application app) {
this.prototype = null;
this.app = app;
this.name = name;
this.file = file;
this.skin = null;
}
/** /**
* Tell the type manager whether we need an update. this is the case when * Tell the type manager whether we need an update. this is the case when
* the file has been modified or deleted. * the file has been modified or deleted.
@ -56,8 +69,10 @@ public class SkinFile implements Updatable {
if (!file.exists ()) { if (!file.exists ()) {
// remove skin from prototype // remove skin from prototype
if (prototype != null) {
prototype.skins.remove (name); prototype.skins.remove (name);
prototype.updatables.remove (file.getName()); prototype.updatables.remove (file.getName());
}
} else { } else {
// we only need to update if the skin has already been initialized // we only need to update if the skin has already been initialized
if (skin != null) if (skin != null)