summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/Point2EditorDialog.java
blob: 4c3b28c9eea51cc3026bc1579e7c8597fbebeb07 (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
/*    */ package NET.worlds.scape;
/*    */ 
/*    */ import java.util.StringTokenizer;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ class Point2EditorDialog
/*    */   extends ListEditorDialog
/*    */ {
/*    */   private static final long serialVersionUID = 1L;
/*    */   protected Property property;
/*    */   protected Point2 p;
/*    */   
/*    */   Point2EditorDialog(EditTile parent, String title, Property property)
/*    */   {
/* 28 */     super(parent, title);
/* 29 */     this.property = property;
/* 30 */     ready();
/*    */   }
/*    */   
/*    */   protected void build()
/*    */   {
/* 35 */     this.p = ((Point2)this.property.get());
/* 36 */     super.build();
/*    */   }
/*    */   
/*    */   protected int getElementCount()
/*    */   {
/* 41 */     return 2;
/*    */   }
/*    */   
/*    */   protected String getElement(int index)
/*    */   {
/* 46 */     switch (index) {
/*    */     case 0: 
/* 48 */       return this.p.x;
/*    */     }
/* 50 */     return this.p.y;
/*    */   }
/*    */   
/*    */ 
/*    */   protected boolean setElements(StringTokenizer e)
/*    */   {
/* 56 */     Point2 p = new Point2();
/* 57 */     int count = 0;
/* 58 */     while (e.hasMoreTokens())
/*    */       try {
/* 60 */         float tmp = Float.valueOf(e.nextToken()).floatValue();
/* 61 */         switch (count++) {
/*    */         case 0: 
/* 63 */           p.x = tmp;
/* 64 */           break;
/*    */         case 1: 
/* 66 */           p.y = tmp;
/* 67 */           break;
/*    */         default: 
/* 69 */           return false;
/*    */         }
/*    */       } catch (Exception x) {
/* 72 */         return false;
/*    */       }
/* 74 */     if (count != 2)
/* 75 */       return false;
/* 76 */     this.parent.addUndoableSet(this.property, p);
/* 77 */     return true;
/*    */   }
/*    */ }


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