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
|
package org.litesoft.sandbox.multimodule.common.client.widgets;
import org.litesoft.sandbox.multimodule.common.client.*;
import org.litesoft.sandbox.multimodule.common.client.support.*;
import com.google.gwt.event.dom.client.*;
import com.google.gwt.user.client.ui.*;
public class CubeFace extends Grid
{
public CubeFace( FaceSwitcher pFaceSwitcher, String pSection, Places pCenter, Places pNorth, Places pEast, Places pWest, Places pSouth )
{
super( 3, 3 );
addStyleName( "CubeFace" );
setBorderWidth( 1 );
setCellPadding( 5 );
setWidget( 0, 0, new HelpWidget( pSection, "" + pNorth + "-" + pWest ) );
setWidget( 0, 1, createButton( pFaceSwitcher, pNorth ) );
setWidget( 0, 2, new HelpWidget( pSection, "" + pNorth + "-" + pEast ) );
setWidget( 1, 0, createButton( pFaceSwitcher, pWest ) );
setWidget( 1, 1, new Label( pCenter.name() ) );
setWidget( 1, 2, createButton( pFaceSwitcher, pEast ) );
setWidget( 2, 0, new HelpWidget( pSection, "" + pSouth + "-" + pWest ) );
setWidget( 2, 1, createButton( pFaceSwitcher, pSouth ) );
setWidget( 2, 2, new HelpWidget( pSection, "" + pSouth + "-" + pEast ) );
}
private Widget createButton( final FaceSwitcher pFaceSwitcher, final Places pFace )
{
return new Button( pFace.name(), new ClickHandler()
{
@Override
public void onClick( ClickEvent event )
{
pFaceSwitcher.switchTo( pFace );
}
} );
}
}
|