Package nfc.sample.tictactoe.tiles

Examples of nfc.sample.tictactoe.tiles.MsbConfig


        abmgr.setBackground(board);
        // Each button has 3 states : blank|nought|cross
        int i = 0;
        for(int r = 0; r < 3; r++) {
            for(int c = 0; c < 3; c++) {
                MsbConfig tile_btn_config = new MsbConfig();
                MsbState tile_btn_state_blank = new MsbState(Constants.TILE_STATE_BLANK, "Blank Tile", "Blank Tile");
                tile_btn_state_blank.setbmp_focused(blank_focused);
                tile_btn_state_blank.setbmp_unfocused(blank_unfocused);
                tile_btn_state_blank.setbmp_clicked(blank_clicked);
                tile_btn_state_blank.setbmp_unclicked(blank_focused);
                tile_btn_config.addState(tile_btn_state_blank);
                MsbState tile_btn_state_nought = new MsbState(Constants.TILE_STATE_NOUGHT, "Nought", "Nought");
                tile_btn_state_nought.setbmp_focused(nought_focused);
                tile_btn_state_nought.setbmp_unfocused(nought_unfocused);
                tile_btn_state_nought.setbmp_clicked(nought_clicked);
                tile_btn_state_nought.setbmp_unclicked(nought_focused);
                tile_btn_config.addState(tile_btn_state_nought);
                MsbState tile_btn_state_cross = new MsbState(Constants.TILE_STATE_CROSS, "Cross", "Cross");
                tile_btn_state_cross.setbmp_focused(cross_focused);
                tile_btn_state_cross.setbmp_unfocused(cross_unfocused);
                tile_btn_state_cross.setbmp_clicked(cross_clicked);
                tile_btn_state_cross.setbmp_unclicked(cross_focused);
                tile_btn_config.addState(tile_btn_state_cross);

                MultiStateButtonField msbf_tile = new MultiStateButtonField(tile_btn_config, cmd_select_tile, 0, Field.FIELD_HCENTER);
                msbf_tile.setFocusListener(focus_listener);
                tiles[i] = msbf_tile;
                abmgr.add(msbf_tile, uiconfig.getTileX(i), uiconfig.getTileY(i));
View Full Code Here


        Bitmap cross_unfocused = BitmapFactory.getCrossUnfocused();
        Bitmap cross_focused = BitmapFactory.addStateIndicator(cross_unfocused, Constants.FOCUSED_COLOUR);
        Bitmap cross_clicked = BitmapFactory.addStateIndicator(cross_unfocused, Constants.CLICKED_COLOUR);
       
        MsbConfig nought_btn_config = new MsbConfig();
        MsbState btn_state_nought = new MsbState(Constants.SELECT_STATE_NOUGHT, "", "");
        btn_state_nought.setbmp_focused(nought_focused);
        btn_state_nought.setbmp_unfocused(nought_unfocused);
        btn_state_nought.setbmp_clicked(nought_clicked);
        btn_state_nought.setbmp_unclicked(nought_focused);
        nought_btn_config.addState(btn_state_nought);

        msbf_nought = new MultiStateButtonField(nought_btn_config, new ChooseNoughtCommand(this), 0, Field.FIELD_HCENTER);
        msbf_nought.setFocusListener(focus_listener);

        MsbConfig cross_btn_config = new MsbConfig();
        MsbState tile_btn_state_cross = new MsbState(Constants.SELECT_STATE_CROSS, "", "");
        tile_btn_state_cross.setbmp_focused(cross_focused);
        tile_btn_state_cross.setbmp_unfocused(cross_unfocused);
        tile_btn_state_cross.setbmp_clicked(cross_clicked);
        tile_btn_state_cross.setbmp_unclicked(cross_focused);
        cross_btn_config.addState(tile_btn_state_cross);

        msbf_cross = new MultiStateButtonField(cross_btn_config, new ChooseCrossCommand(this), 0, Field.FIELD_HCENTER);
        msbf_cross.setFocusListener(focus_listener);
       
        // we know icons are all the same dimensions and we can fit three across the screen
View Full Code Here

TOP

Related Classes of nfc.sample.tictactoe.tiles.MsbConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.