Examples of MsbState


Examples of nfc.sample.Ndef.Read.buttons.MsbState

        // position the little LED in the top right hand corner
        int led_x = (Display.getWidth() - reg_led.getWidth() - 5);
        int led_y = 5;
      
        MsbConfig sc_btn_config = new MsbConfig();
        MsbState sc_btn_state = new MsbState(Constants.REG_BTN_STATE, "Register Listener", "Register Listener");
        sc_btn_state.setbmp_focused(reg_focused);
        sc_btn_state.setbmp_unfocused(reg_unfocused);
        sc_btn_state.setbmp_clicked(reg_clicked);
        sc_btn_state.setbmp_unclicked(reg_focused);
        sc_btn_config.addState(sc_btn_state);
        msbf_sc = new MultiStateButtonField(sc_btn_config, new RegisterListenerCommand(), 0, Field.FIELD_HCENTER);
        icon_manager.add(msbf_sc,x1,y);

        MsbConfig sr_btn_config = new MsbConfig();
        MsbState sr_btn_state = new MsbState(Constants.UNR_BTN_STATE, "Unregister Listener", "Unregister Listener");
        sr_btn_state.setbmp_focused(unr_focused);
        sr_btn_state.setbmp_unfocused(unr_unfocused);
        sr_btn_state.setbmp_clicked(unr_clicked);
        sr_btn_state.setbmp_unclicked(unr_focused);
        sr_btn_config.addState(sr_btn_state);
        msbf_sr = new MultiStateButtonField(sr_btn_config, new UnregisterListenerCommand(), 0, Field.FIELD_HCENTER);
        icon_manager.add(msbf_sr,x2,y);

        if (_listener_mgr.is_listening()) {
View Full Code Here

Examples of nfc.sample.Ndef.Write.buttons.MsbState

        int x2= x1 + 120 + hgap;
        int y1 = vgap;
        int y2 = y1 + 120 + vgap;

        MsbConfig uri_btn_config = new MsbConfig();
        MsbState uri_btn_state = new MsbState(Constants.BTN_STATE, "Create URI type tag", "Create URI type tag");
        uri_btn_state.setbmp_focused(uri_focused);
        uri_btn_state.setbmp_unfocused(uri_unfocused);
        uri_btn_state.setbmp_clicked(uri_clicked);
        uri_btn_state.setbmp_unclicked(uri_focused);
        uri_btn_config.addState(uri_btn_state);
        msbf_uri = new MultiStateButtonField(uri_btn_config, new CreateUriTagCommand(), 0, Field.FIELD_HCENTER);
        mgr.add(msbf_uri,x1,y1);
        msbf_uri.setFocusListener(focus_listener);

        MsbConfig sp_btn_config = new MsbConfig();
        MsbState sp_btn_state = new MsbState(Constants.BTN_STATE, "Create Smart Poster type tag", "Create Smart Poster type tag");
        sp_btn_state.setbmp_focused(sp_focused);
        sp_btn_state.setbmp_unfocused(sp_unfocused);
        sp_btn_state.setbmp_clicked(sp_clicked);
        sp_btn_state.setbmp_unclicked(sp_focused);
        sp_btn_config.addState(sp_btn_state);
        msbf_sp = new MultiStateButtonField(sp_btn_config, new CreateSpTagCommand(), 0, Field.FIELD_HCENTER);
        mgr.add(msbf_sp,x2,y1);
        msbf_sp.setFocusListener(focus_listener);

        MsbConfig text_btn_config = new MsbConfig();
        MsbState text_btn_state = new MsbState(Constants.BTN_STATE, "Create Text type tag", "Create Text type tag");
        text_btn_state.setbmp_focused(text_focused);
        text_btn_state.setbmp_unfocused(text_unfocused);
        text_btn_state.setbmp_clicked(text_clicked);
        text_btn_state.setbmp_unclicked(text_focused);
        text_btn_config.addState(text_btn_state);
        msbf_text = new MultiStateButtonField(text_btn_config, new CreateTextTagCommand(), 0, Field.FIELD_HCENTER);
        mgr.add(msbf_text,x1,y2);
        msbf_text.setFocusListener(focus_listener);

        MsbConfig custom_btn_config = new MsbConfig();
        MsbState custom_btn_state = new MsbState(Constants.BTN_STATE, "Create custom type tag", "Create custom type tag");
        custom_btn_state.setbmp_focused(custom_focused);
        custom_btn_state.setbmp_unfocused(custom_unfocused);
        custom_btn_state.setbmp_clicked(custom_clicked);
        custom_btn_state.setbmp_unclicked(custom_focused);
        custom_btn_config.addState(custom_btn_state);
        msbf_custom = new MultiStateButtonField(custom_btn_config, new CreateCustomTagCommand(), 0, Field.FIELD_HCENTER);
        mgr.add(msbf_custom,x2,y2);
        msbf_custom.setFocusListener(focus_listener);
View Full Code Here

Examples of nfc.sample.llcp.buttons.MsbState

        int x1= hgap;
        int x2= x1 + 120 + hgap;
        int y = (int) (vgap * 0.75);
       
        MsbConfig snd_btn_config = new MsbConfig();
        MsbState snd_btn_state = new MsbState(Constants.SND_BTN_STATE, "Send data over LLCP", "Send data over LLCP");
        snd_btn_state.setbmp_focused(snd_focused);
        snd_btn_state.setbmp_unfocused(snd_unfocused);
        snd_btn_state.setbmp_clicked(snd_clicked);
        snd_btn_state.setbmp_unclicked(snd_focused);
        snd_btn_config.addState(snd_btn_state);
        msbf_snd = new MultiStateButtonField(snd_btn_config, new SendCommand(), 0, Field.FIELD_HCENTER);
        btn_row.add(msbf_snd,x1,y);

        MsbConfig rcv_btn_config = new MsbConfig();
        MsbState rcv_btn_state = new MsbState(Constants.RCV_BTN_STATE, "Receive data over LLCP", "Receive data over LLCP");
        rcv_btn_state.setbmp_focused(rcv_focused);
        rcv_btn_state.setbmp_unfocused(rcv_unfocused);
        rcv_btn_state.setbmp_clicked(rcv_clicked);
        rcv_btn_state.setbmp_unclicked(rcv_focused);
        rcv_btn_config.addState(rcv_btn_state);
        msbf_rcv = new MultiStateButtonField(rcv_btn_config, new ReceiveCommand(), 0, Field.FIELD_HCENTER);
        btn_row.add(msbf_rcv,x2,y);

        msbf_rcv.setFocusListener(focus_listener);
View Full Code Here

Examples of nfc.sample.nfctransaction.ui.buttons.MsbState

        // centre LEDs over the button columns
        mgr.add(nfc_led, x_centre_1 - (bmp_nfc_led_on.getWidth() / 2), 0);
        mgr.add(cem_led, x_centre_2 - (bmp_ce_led_on.getWidth() / 2), 0);
       
        MsbConfig config1 = new MsbConfig();
        MsbState ce_off = new MsbState(Constants.BTN_CE_OFF, "Switch card emulation OFF", "CE OFF");
        ce_off.setbmp_focused(ce_off_focused);
        ce_off.setbmp_unfocused(ce_off_unfocused);
        ce_off.setbmp_clicked(ce_off_clicked);
        ce_off.setbmp_unclicked(ce_off_unclicked);
        config1.addState(ce_off);
        MsbState ce_on = new MsbState(Constants.BTN_CE_ON, "Switch card emulation ON", "CE ON");
        ce_on.setbmp_focused(ce_on_focused);
        ce_on.setbmp_unfocused(ce_on_unfocused);
        ce_on.setbmp_clicked(ce_on_clicked);
        ce_on.setbmp_unclicked(ce_on_unclicked);
        config1.addState(ce_on);
        msbf_ce_on = new MultiStateButtonField(config1, new ToggleCeCommand(), 0, Field.FIELD_HCENTER);
        mgr.add(msbf_ce_on, x1, y1);

        MsbConfig config2 = new MsbConfig();
        MsbState clear = new MsbState(Constants.BTN_DEFAULT, "Clear last AID received field", "Clear");
        clear.setbmp_focused(clear_focused);
        clear.setbmp_unfocused(clear_unfocused);
        clear.setbmp_clicked(clear_clicked);
        clear.setbmp_unclicked(clear_unclicked);
        config2.addState(clear);
        msbf_clear = new MultiStateButtonField(config2, new ClearCommand(), 0, Field.FIELD_HCENTER);
        mgr.add(msbf_clear, x2, y1);

        MsbConfig config3 = new MsbConfig();
        MsbState select_on = new MsbState(Constants.BTN_DEFAULT, "Select applet", "Select");
        select_on.setbmp_focused(select_on_focused);
        select_on.setbmp_unfocused(select_on_unfocused);
        select_on.setbmp_clicked(select_on_clicked);
        select_on.setbmp_unclicked(select_on_unclicked);
        config3.addState(select_on);
        MsbState select_off = new MsbState(Constants.BTN_SELECT_OFF, "Select applet", "Select");
        select_off.setbmp_focused(select_off_focused);
        select_off.setbmp_unfocused(select_off_unfocused);
        select_off.setbmp_clicked(select_off_clicked);
        select_off.setbmp_unclicked(select_off_unclicked);
        config3.addState(select_off);
        Iso7816Command select_command = new Iso7816Command();
        msbf_select = new MultiStateButtonField(config3, select_command, 0, Field.FIELD_HCENTER);
        mgr.add(msbf_select, x1, y2);

        MsbConfig config4 = new MsbConfig();
        MsbState close = new MsbState(0, "Send to background", "Close");
        close.setbmp_focused(close_focused);
        close.setbmp_unfocused(close_unfocused);
        close.setbmp_clicked(close_clicked);
        close.setbmp_unclicked(close_unclicked);
        config4.addState(close);
        msbf_close = new MultiStateButtonField(config4, new CloseCommand(), 0, Field.FIELD_HCENTER);
        mgr.add(msbf_close, x2, y2);
       
        mgr.add(last_aids, last_aids_x, last_aids_y);
View Full Code Here

Examples of nfc.sample.peer2peer.buttons.MsbState

        int vgap = (int) (Display.getHeight() - 120) / 2;
        int x= hgap;
        int y = (int) (vgap * 0.75);
       
        MsbConfig vcardResponderBtnConfig = new MsbConfig();
        MsbState vcardResponderBtnState = new MsbState(Constants.VCARD_RESPONDER_BTN_STATE,
                "vCard Responder",
                "vCard Responder");
        vcardResponderBtnState.setbmp_focused(vcardResponderFocused);
        vcardResponderBtnState.setbmp_unfocused(vcardResponderUnfocused);
        vcardResponderBtnState.setbmp_clicked(vcardResponderClicked);
        vcardResponderBtnState.setbmp_unclicked(vcardResponderFocused);
        vcardResponderBtnConfig.addState(vcardResponderBtnState);
        msbfVcardResponder = new MultiStateButtonField(vcardResponderBtnConfig,
                new ResponderCommand(), 0, Field.FIELD_HCENTER);
        btnRow.add(msbfVcardResponder,x,y);

View Full Code Here

Examples of nfc.sample.tictactoe.tiles.MsbState

        // 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;
View Full Code Here

Examples of nfc.sample.tictactoe.tiles.MsbState

        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);
       
View Full Code Here

Examples of nfc.sample.virtual.target.buttons.MsbState

        int x1= hgap;
        int x2= x1 + 120 + hgap;
        int y = (int) (vgap * 0.75);
       
        MsbConfig sc_btn_config = new MsbConfig();
        MsbState sc_btn_state = new MsbState(Constants.SC_BTN_STATE, "Emulate Smart Card", "Emulate Smart Card");
        sc_btn_state.setbmp_focused(sc_focused);
        sc_btn_state.setbmp_unfocused(sc_unfocused);
        sc_btn_state.setbmp_clicked(sc_clicked);
        sc_btn_state.setbmp_unclicked(sc_focused);
        sc_btn_config.addState(sc_btn_state);
        msbf_sc = new MultiStateButtonField(sc_btn_config, new EmulateScCommand(), 0, Field.FIELD_HCENTER);
        btn_row.add(msbf_sc,x1,y);

        MsbConfig sr_btn_config = new MsbConfig();
        MsbState sr_btn_state = new MsbState(Constants.SR_BTN_STATE, "Emulate Reader", "Emulate Reader");
        sr_btn_state.setbmp_focused(sr_focused);
        sr_btn_state.setbmp_unfocused(sr_unfocused);
        sr_btn_state.setbmp_clicked(sr_clicked);
        sr_btn_state.setbmp_unclicked(sr_focused);
        sr_btn_config.addState(sr_btn_state);
        msbf_sr = new MultiStateButtonField(sr_btn_config, new EmulateSrCommand(), 0, Field.FIELD_HCENTER);
        btn_row.add(msbf_sr,x2,y);

        msbf_sc.setFocusListener(focus_listener);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.