diff options
Diffstat (limited to 'NET/worlds/scape/LibraryEntry.java')
| -rw-r--r-- | NET/worlds/scape/LibraryEntry.java | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/NET/worlds/scape/LibraryEntry.java b/NET/worlds/scape/LibraryEntry.java new file mode 100644 index 0000000..8002335 --- /dev/null +++ b/NET/worlds/scape/LibraryEntry.java @@ -0,0 +1,151 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.network.URL; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class LibraryEntry +/* */ extends SuperRoot +/* */ implements Iconic +/* */ { +/* */ protected URL iconURL; +/* */ protected URL contentURL; +/* */ protected String propertyName; +/* */ +/* */ public LibraryEntry() {} +/* */ +/* */ public LibraryEntry(String name, URL iconURL) +/* */ { +/* 37 */ setName(name); +/* 38 */ this.iconURL = iconURL; +/* */ } +/* */ +/* */ private void changed() +/* */ { +/* 43 */ Library owner = (Library)getOwner(); +/* 44 */ if (owner != null) +/* 45 */ owner.entryChanged(this); +/* */ } +/* */ +/* 48 */ public String getIconCaption() { return getName(); } +/* 49 */ public URL getIconURL() { return this.iconURL; } +/* 50 */ public URL getContentURL() { return this.contentURL; } +/* */ +/* */ public String getPropertyName(boolean checkParent) +/* */ { +/* */ Library owner; +/* 55 */ if ((this.propertyName == null) && (checkParent) && +/* 56 */ ((owner = (Library)getOwner()) != null)) +/* 57 */ return owner.getPropertyName(); +/* 58 */ return this.propertyName; +/* */ } +/* */ +/* 61 */ public void setName(String s) { super.setName(s);changed(); } +/* 62 */ public void setIconURL(URL s) { this.iconURL = s;changed(); } +/* 63 */ public void setContentURL(URL s) { this.contentURL = s;changed(); } +/* 64 */ public void setPropertyName(String s) { this.propertyName = s;changed(); +/* */ } +/* */ +/* */ public Object properties(int index, int offset, int mode, Object value) throws NoSuchPropertyException +/* */ { +/* 69 */ Object ret = null; +/* 70 */ switch (index - offset) { +/* */ case 0: +/* 72 */ if (mode == 0) { +/* 73 */ ret = URLPropertyEditor.make( +/* 74 */ new Property(this, index, "Icon").allowSetNull(), +/* 75 */ TextureDecoder.getJavaExts()); +/* 76 */ } else if (mode == 1) { +/* 77 */ ret = getIconURL(); +/* 78 */ } else if (mode == 2) +/* 79 */ setIconURL((URL)value); +/* 80 */ break; +/* */ case 1: +/* 82 */ if (mode == 0) { +/* 83 */ ret = URLPropertyEditor.make( +/* 84 */ new Property(this, index, "Content URL").allowSetNull(), +/* 85 */ "*wob"); +/* 86 */ } else if (mode == 1) { +/* 87 */ ret = this.contentURL; +/* 88 */ } else if (mode == 2) +/* 89 */ setContentURL((URL)value); +/* 90 */ break; +/* */ case 2: +/* 92 */ if (mode == 0) { +/* 93 */ ret = StringPropertyEditor.make( +/* 94 */ new Property(this, index, "Property Name") +/* 95 */ .allowSetNull()); +/* 96 */ } else if (mode == 1) { +/* 97 */ ret = getPropertyName(false); +/* 98 */ } else if (mode == 2) +/* 99 */ setPropertyName((String)value); +/* 100 */ break; +/* */ default: +/* 102 */ ret = super.properties(index, offset + 3, mode, value); +/* */ } +/* 104 */ return ret; +/* */ } +/* */ +/* 107 */ private static Object classCookie = new Object(); +/* */ +/* */ public void saveState(Saver s) throws IOException +/* */ { +/* 111 */ s.saveVersion(3, classCookie); +/* 112 */ super.saveState(s); +/* 113 */ URL.save(s, this.iconURL); +/* 114 */ URL.save(s, this.contentURL); +/* 115 */ s.saveString(this.propertyName); +/* */ } +/* */ +/* */ public void restoreState(Restorer r) throws IOException, TooNewException +/* */ { +/* 120 */ switch (r.restoreVersion(classCookie)) { +/* */ case 3: +/* 122 */ super.restoreState(r); +/* 123 */ this.iconURL = URL.restore(r); +/* 124 */ this.contentURL = URL.restore(r); +/* 125 */ this.propertyName = r.restoreString(); +/* 126 */ break; +/* */ case 2: +/* 128 */ super.restoreState(r); +/* 129 */ setName(r.restoreString()); +/* 130 */ this.iconURL = URL.restore(r); +/* 131 */ this.contentURL = URL.restore(r); +/* 132 */ break; +/* */ case 1: +/* 134 */ super.restoreState(r); +/* */ case 0: +/* 136 */ setName(r.restoreString()); +/* 137 */ this.iconURL = URL.restore(r); +/* 138 */ this.contentURL = URL.restore(r); +/* 139 */ r.restoreMaybeNull(); +/* 140 */ break; +/* */ default: +/* 142 */ throw new TooNewException(); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\LibraryEntry.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |