summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/ScaleWidget.java
blob: 21987152136801c6d395f4a9ec64d62fc7b0b1ab (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
/*    */ package NET.worlds.scape;
/*    */ 
/*    */ import NET.worlds.console.Console;
/*    */ import NET.worlds.console.GammaFrame;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ class ScaleWidget
/*    */   extends WidgetButton
/*    */ {
/*    */   private static final long serialVersionUID = 1L;
/*    */   
/*    */   public ScaleWidget(ToolBar toolbar)
/*    */   {
/* 24 */     super(toolbar, "scale.gif", Console.message("Scale"));
/*    */   }
/*    */   
/*    */   public String drag(boolean initialDrag, float deltax, float deltay)
/*    */   {
/* 29 */     WObject wobj = getWObject();
/* 30 */     float delta = Math.abs(deltax) > Math.abs(deltay) ? deltax : deltay;
/* 31 */     delta = (float)Math.pow(1.01D, delta);
/* 32 */     if (initialDrag)
/* 33 */       Console.getFrame().getEditTile().addUndoable(
/* 34 */         new UndoablTransform(wobj));
/* 35 */     wobj.scale(delta);
/* 36 */     wobj.markEdited();
/* 37 */     return "Scale: " + wobj.getScale();
/*    */   }
/*    */ }


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