summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/SetURLAction.java
blob: 8a84be88444baa7f4f906e4cab992ff7640bd03c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*    */ package NET.worlds.scape;
/*    */ 
/*    */ import NET.worlds.console.Cursor;
/*    */ import NET.worlds.network.URL;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintStream;
/*    */ import java.net.MalformedURLException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SetURLAction
/*    */   extends SetPropertyAction
/*    */ {
/*    */   URL _value;
/*    */   
/*    */   public Persister trigger(Event e, Persister seqID)
/*    */   {
/* 24 */     if (useParam()) {
/*    */       try {
/* 26 */         this._value = new URL(param());
/*    */       }
/*    */       catch (MalformedURLException mue) {
/* 29 */         System.out.println(getName() + " unable to parse " + 
/* 30 */           paramName());
/*    */       }
/*    */     }
/* 33 */     set(this._value);
/* 34 */     return null;
/*    */   }
/*    */   
/*    */   public Object properties(int index, int offset, int mode, Object value)
/*    */     throws NoSuchPropertyException
/*    */   {
/* 40 */     Object ret = null;
/* 41 */     switch (index - offset) {
/*    */     case 0: 
/* 43 */       if (mode == 0) {
/* 44 */         ret = URLPropertyEditor.make(new Property(this, index, 
/* 45 */           "Set To")
/* 46 */           .allowSetNull(), 
/* 47 */           "ani;console;cur;drone;mid;mov;pilot;ra;ram;rwg;rwx;wav;wob;world;" + 
/* 48 */           TextureDecoder.getAllExts(), 
/* 49 */           Cursor.getSysCursorURLs());
/*    */       }
/* 51 */       else if (mode == 1) {
/* 52 */         ret = this._value;
/*    */       }
/* 54 */       else if (mode == 2) {
/* 55 */         this._value = ((URL)value);
/*    */       }
/* 57 */       break;
/*    */     default: 
/* 59 */       ret = super.properties(index, offset + 1, mode, value);
/*    */     }
/* 61 */     return ret;
/*    */   }
/*    */   
/* 64 */   private static Object classCookie = new Object();
/*    */   
/*    */   public void saveState(Saver s) throws IOException
/*    */   {
/* 68 */     s.saveVersion(1, classCookie);
/* 69 */     super.saveState(s);
/* 70 */     URL.save(s, this._value);
/*    */   }
/*    */   
/*    */   public void restoreState(Restorer r) throws IOException, TooNewException
/*    */   {
/* 75 */     switch (r.restoreVersion(classCookie)) {
/*    */     case 1: 
/* 77 */       super.restoreState(r);
/* 78 */       this._value = URL.restore(r);
/* 79 */       break;
/*    */     
/*    */     default: 
/* 82 */       throw new TooNewException();
/*    */     }
/*    */   }
/*    */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\SetURLAction.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */