litesoft
Diff Revisions
947
vs
948
for /trunk/GWT_Sandbox/MultiModule/foundation/src/org/litesoft/sandbox/multimodule/foundation/client/widgets/DieRotator.java
|
@@ -8,13 +8,11 @@ |
8 |
8 |
|
import com.google.gwt.event.dom.client.*; |
9 |
9 |
|
import com.google.gwt.user.client.ui.*; |
10 |
10 |
|
|
11 |
|
- |
public class DieRotator extends Grid |
12 |
|
- |
{ |
|
11 |
+ |
public class DieRotator extends Grid { |
13 |
12 |
|
private Die mDie; |
14 |
13 |
|
private Image mDieImage; |
15 |
14 |
|
|
16 |
|
- |
public DieRotator( FaceSwitcher pFaceSwitcher ) |
17 |
|
- |
{ |
|
15 |
+ |
public DieRotator( FaceSwitcher pFaceSwitcher ) { |
18 |
16 |
|
super( 3, 3 ); |
19 |
17 |
|
addStyleName( "DieRotator" ); |
20 |
18 |
|
setCellPadding( 5 ); |
|
@@ -25,24 +23,19 @@ |
25 |
23 |
|
setWidget( 2, 1, createButton( pFaceSwitcher, "Up", View.South ) ); |
26 |
24 |
|
} |
27 |
25 |
|
|
28 |
|
- |
public void setDie( Die pDie ) |
29 |
|
- |
{ |
|
26 |
+ |
public void setDie( Die pDie ) { |
30 |
27 |
|
mDie = pDie; |
31 |
28 |
|
updateDieImage(); |
32 |
29 |
|
} |
33 |
30 |
|
|
34 |
|
- |
private void updateDieImage() |
35 |
|
- |
{ |
|
31 |
+ |
private void updateDieImage() { |
36 |
32 |
|
mDieImage.setUrl( "common/dice/die_" + mDie.getResult() + ".gif" ); |
37 |
33 |
|
} |
38 |
34 |
|
|
39 |
|
- |
private Widget createButton( final FaceSwitcher pFaceSwitcher, String pArrowDirection, final View pViewToMakeResult ) |
40 |
|
- |
{ |
41 |
|
- |
PushButton zButton = new PushButton( new Image( "common/Arrow" + pArrowDirection + ".gif" ), new ClickHandler() |
42 |
|
- |
{ |
|
35 |
+ |
private Widget createButton( final FaceSwitcher pFaceSwitcher, String pArrowDirection, final View pViewToMakeResult ) { |
|
36 |
+ |
PushButton zButton = new PushButton( new Image( "common/Arrow" + pArrowDirection + ".gif" ), new ClickHandler() { |
43 |
37 |
|
@Override |
44 |
|
- |
public void onClick( ClickEvent event ) |
45 |
|
- |
{ |
|
38 |
+ |
public void onClick( ClickEvent event ) { |
46 |
39 |
|
mDie.makeViewResult( pViewToMakeResult ); |
47 |
40 |
|
updateDieImage(); |
48 |
41 |
|
pFaceSwitcher.switchTo( Places.fromOrdinal( mDie.getResult() ) ); |