summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/SetZoomMode.java
blob: f5b6e0e33970853a5a0167f37601d2191708270d (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
92
93
94
/*    */ package NET.worlds.scape;
/*    */ 
/*    */ import NET.worlds.console.Window;
/*    */ import java.io.IOException;
/*    */ import java.util.Enumeration;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SetZoomMode
/*    */   extends Action
/*    */   implements MomentumBehavior
/*    */ {
/*    */   private boolean zoomMode;
/*    */   
/*    */   public SetZoomMode(boolean on)
/*    */   {
/* 28 */     this.zoomMode = on;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */   public SetZoomMode() {}
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */   public Persister trigger(Event e, Persister seqID)
/*    */   {
/* 41 */     SuperRoot owner = getOwner();
/* 42 */     if ((owner == null) || 
/* 43 */       (!(owner instanceof Pilot)) || (!((Pilot)owner).isActive())) {
/* 44 */       return null;
/*    */     }
/* 46 */     Window w = Window.getMainWindow();
/* 47 */     if (w == null) {
/* 48 */       return null;
/*    */     }
/* 50 */     w.setDeltaMode(this.zoomMode);
/* 51 */     return null;
/*    */   }
/*    */   
/* 54 */   private static Object classCookie = new Object();
/*    */   
/*    */   public void saveState(Saver s) throws IOException
/*    */   {
/* 58 */     s.saveVersion(0, classCookie);
/* 59 */     super.saveState(s);
/*    */   }
/*    */   
/*    */ 
/*    */   public void restoreState(Restorer r)
/*    */     throws IOException, TooNewException
/*    */   {
/* 66 */     switch (r.restoreVersion(classCookie)) {
/*    */     case 0: 
/* 68 */       super.restoreState(r);
/*    */       
/*    */ 
/* 71 */       break;
/*    */     default: 
/* 73 */       throw new TooNewException();
/*    */     }
/*    */     
/*    */   }
/*    */   
/*    */   public void transferFrom(Enumeration<Object> oldMBs)
/*    */   {
/* 80 */     while (oldMBs.hasMoreElements()) {
/* 81 */       SuperRoot sr = (SuperRoot)oldMBs.nextElement();
/* 82 */       if ((sr instanceof SetZoomMode)) {
/* 83 */         this.zoomMode = ((SetZoomMode)sr).zoomMode;
/* 84 */         break;
/*    */       }
/*    */     }
/*    */   }
/*    */ }


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