Package net.rim.device.api.ui.decor

Examples of net.rim.device.api.ui.decor.Background


                }
                g.fillRect( 0, 0, scaledBgImage.getScaledWidth(), scaledBgImage.getScaledHeight() );
                g.drawImage( 0, 0, scaledBgImage.getScaledWidth(), scaledBgImage.getScaledHeight(),
                    scaledBgImage, 0, 0, 0 );

                Background bg = BackgroundFactory.createBitmapBackground( bgImg,
                        Background.POSITION_X_CENTER, Background.POSITION_Y_CENTER, Background.REPEAT_SCALE_TO_FIT );
                this.setBackground( bg );
                this.getMainManager().setBackground( bg );
            }
        } else {
            // -1 denotes an invalid color
            if( bgColor != -1 ) {
                Background color = BackgroundFactory.createSolidBackground( bgColor );
                this.setBackground( color );
                this.getMainManager().setBackground( color );
            }
        }
View Full Code Here


        _bgColor = processColorString( _wConfig.getLoadingScreenColor() );

        // Set background color of the browserfield.
        // -1 denotes an invalid color.
        if( _bgColor != -1 ) {
            Background color = BackgroundFactory.createSolidBackground( _bgColor );
            _browserField.setBackground( color );
            _manager.setBackground( color );
            this.setBackground( color );
            this.getMainManager().setBackground( color );
        }
View Full Code Here

        mi_about.setCommand(new Command(new AboutCommand()));
        addMenuItem(mi_about);

        AbsoluteFieldManager abmgr = new AbsoluteFieldManager();
        new_game_screen = BitmapFactory.getNewGameScreen();
        Background bg_new_game = BackgroundFactory.createBitmapBackground(new_game_screen);
        abmgr.setBackground(bg_new_game);
        status_message = new TimedLabelField(this, "");
        abmgr.add(status_message);
        add(abmgr);
    }
View Full Code Here

        AbsoluteFieldManager abmgr = new AbsoluteFieldManager();

        cmd_select_tile = new SelectTileCommand();

        Background board = BackgroundFactory.createBitmapBackground(BitmapFactory.getBackground(width, height));
        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++) {
View Full Code Here

                        Field.USE_ALL_WIDTH, bitmap, 5, Field.FIELD_RIGHT,
                        "right justified layout", Field.FIELD_VCENTER);
        add(_views[3]);
        add(new SeparatorField());

        Background background; // Reuse this reference

        // Add an ActivityIndicatorView featuring a solid black background
        bitmap = Bitmap.getBitmapResource("orchid.png");
        background = BackgroundFactory.createSolidBackground(Color.BLACK);
        _views[4] =
View Full Code Here

        // Create border and background objects
        final Border roundedBorder =
                BorderFactory.createRoundedBorder(thickPadding,
                        Border.STYLE_SOLID);
        final Background solidBackground =
                BackgroundFactory.createSolidBackground(Color.LIGHTSTEELBLUE);

        // Set the objects for use
        simpleField.setBorder(roundedBorder);
        simpleField.setBackground(solidBackground);

        // Add the field to the screen
        add(simpleField);
        add(new RichTextField(Field.NON_FOCUSABLE));

        // Sample text field with a thick and dotted rounded border
        // and single color transparent background.
        final RichTextField transparentField =
                new RichTextField(
                        "Dotted rounded border, transparent background");
        final Border dottedBorder =
                BorderFactory.createRoundedBorder(thickPadding,
                        Border.STYLE_DOTTED);
        final Background transparentBackground =
                BackgroundFactory.createSolidTransparentBackground(
                        Color.LIGHTSTEELBLUE, 50);
        transparentField.setBorder(dottedBorder);
        transparentField.setBackground(transparentBackground);
        add(transparentField);
        add(new RichTextField(Field.NON_FOCUSABLE));

        // Sample text field with a thick and dashed border
        // and gradient background.
        final RichTextField gradientField =
                new RichTextField("Dashed simple border, gradient background");
        final Border dashedBorder =
                BorderFactory.createSimpleBorder(thickPadding, blueColors,
                        Border.STYLE_DASHED);
        final Background gradientBackground =
                BackgroundFactory.createLinearGradientBackground(Color.RED,
                        Color.GREEN, Color.BLUE, Color.WHITE);
        gradientField.setBorder(dashedBorder);
        gradientField.setBackground(gradientBackground);
        add(gradientField);
        add(new RichTextField(Field.NON_FOCUSABLE));

        // Sample text field with a no padding dotted border and no background.
        final RichTextField noPaddingField =
                new RichTextField("Dotted simple border, no padding");
        final Border noPaddingBorder =
                BorderFactory.createSimpleBorder(noPadding, oliveColors,
                        Border.STYLE_DOTTED);
        noPaddingField.setBorder(noPaddingBorder);
        add(noPaddingField);
        add(new RichTextField(Field.NON_FOCUSABLE));

        // Sample text field with a thick bevel border and bitmap background.
        final RichTextField bevelAndBitmapField =
                new RichTextField("Bevel border, bitmap background");
        final Border bevelBorder =
                BorderFactory.createBevelBorder(thickPadding, multiColors,
                        pinkColors);

        // Attempt to load a bitmap background
        try {
            final Background bitmapBackground =
                    BackgroundFactory.createBitmapBackground(Bitmap
                            .getBitmapResource("smiley.bmp"),
                            Background.POSITION_X_CENTER,
                            Background.POSITION_Y_CENTER,
                            Background.REPEAT_BOTH);
View Full Code Here

        setTitle("Spinner Demo");

        // Initialize a VerticalFieldManager
        final VerticalFieldManager fieldManager = new VerticalFieldManager();

        final Background background =
                BackgroundFactory.createSolidBackground(Color.LIGHTBLUE);

        final LabelField dateLabel =
                new LabelField("Date Field", Field.FIELD_HCENTER);
        dateLabel.setBackground(background);
View Full Code Here

        super(Field.FOCUSABLE);

        _text = text;

        // Set the background color for this field
        final Background background =
                BackgroundFactory.createSolidBackground(color);
        setBackground(background);
    }
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.decor.Background

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.