Subversion Repository Public Repository

litesoft

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
package org.litesoft.sandbox.multimodule.groupfront.client.front;

import org.litesoft.sandbox.infrastructure.client.*;
import org.litesoft.sandbox.infrastructure.client.widgets.*;
import org.litesoft.sandbox.multimodule.foundation.client.*;
import org.litesoft.sandbox.multimodule.foundation.client.support.*;
import org.litesoft.sandbox.multimodule.foundation.client.widgets.*;

import com.google.gwt.event.dom.client.*;
import com.google.gwt.user.client.ui.*;

public class FrontViewImpl implements FrontView,
                                      FaceSwitcher {
    private final DieRotator mDieRotator = new DieRotator( this );
    private final Places mCenter = Places.Front;
    private final Widget mAsWidget;
    private Presenter mPresenter;
    private Long mLuckyId;

    public FrontViewImpl() {
        String zSection = "FrontGroup";
        VerticalPanel zPanel = new VerticalPanel();
        zPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
        zPanel.add( UtilsGwt.horizontal( new Label( "" + mCenter ), new Spacer().width( 10 ), new HelpWidget( zSection, "" + mCenter ) ) );
        zPanel.add( mDieRotator );
        zPanel.add( UtilsGwt.horizontal( new Spacer().width( 50 ), //
                                         new Button( "Home", createHomeClickHandler() ), //
                                         new Spacer().width( 220 ), //
                                         new HelpWidget( zSection, "Lucky" ), //
                                         new Spacer().width( 10 ), //
                                         new Button( "Feeling Lucky", createFeelingLuckyClickHandler() ) ) );
        mAsWidget = zPanel;
    }

    private ClickHandler createHomeClickHandler() {
        return new ClickHandler() {
            @Override
            public void onClick( ClickEvent event ) {
                switchTo( Places.Home );
            }
        };
    }

    private ClickHandler createFeelingLuckyClickHandler() {
        return new ClickHandler() {
            @Override
            public void onClick( ClickEvent event ) {
                switchTo( PlacesSupport.deNull( mLuckyId, mCenter.getOppositeFace() ) );
            }
        };
    }

    @Override
    public void setPresenter( Presenter pPresenter ) {
        mDieRotator.setDie( (mPresenter = pPresenter).getDie() );
    }

    @Override
    public void setLuckyId( Long pLuckyId ) {
        mLuckyId = pLuckyId;
    }

    @Override
    public Widget asWidget() {
        return mAsWidget;
    }

    @Override
    public void switchTo( Places pPlace ) {
        mPresenter.goTo( PlacesSupport.createPlace( pPlace, (long) mCenter.getOppositeFace().ordinal() ) );
    }
}

Commits for litesoft/trunk/GWT_Sandbox/MultiModule/groupFront/src/org/litesoft/sandbox/multimodule/groupfront/client/front/FrontViewImpl.java

Diff revisions: vs.
Revision Author Commited Message
948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

552 Diff Diff GeorgeS picture GeorgeS Tue 11 Oct, 2011 04:01:56 +0000
540 Diff Diff GeorgeS picture GeorgeS Mon 03 Oct, 2011 04:22:28 +0000
538 Diff Diff GeorgeS picture GeorgeS Sun 02 Oct, 2011 22:14:59 +0000
506 GeorgeS picture GeorgeS Thu 15 Sep, 2011 13:50:15 +0000

MultiModules