Examples of BitmapField


Examples of net.rim.device.api.ui.component.BitmapField

        icon_row.add(new LabelField(" - LLCP sender"));
        add(icon_row);
    }

    private void indicateReceiver() {
        icon = new BitmapField(rcv_icon);
        icon_row.add(icon);
        icon_row.add(new LabelField(" - LLCP receiver"));
        add(icon_row);
    }
View Full Code Here

Examples of net.rim.device.api.ui.component.BitmapField

    Bitmap image = scaleImage(icon);

    if (this.icon != null) {
      this.icon.setBitmap(image);
    } else {
      this.icon = new BitmapField(image);
    }
    add(this.icon);
  }
View Full Code Here

Examples of net.rim.device.api.ui.component.BitmapField

    private TimerScreen() {
        super(Field.USE_ALL_HEIGHT | Field.USE_ALL_WIDTH | Screen.NO_VERTICAL_SCROLL);
        ColouredBackground bg = new ColouredBackground(Color.WHITE, Field.USE_ALL_HEIGHT | Field.USE_ALL_WIDTH | Screen.NO_VERTICAL_SCROLL);
        AbsoluteFieldManager ab_mgr = new AbsoluteFieldManager();
        hour1 = new BitmapField(digits[0]);
        hour2 = new BitmapField(digits[0]);
        minute1 = new BitmapField(digits[0]);
        minute2 = new BitmapField(digits[0]);
        second1 = new BitmapField(digits[0]);
        second2 = new BitmapField(digits[0]);
        colon1 = new BitmapField(colon);
        colon2 = new BitmapField(colon);
        bg.add(ab_mgr);

        int y = (Display.getHeight() - 112) / 2; // images are 112 pixels high
        int x = (Display.getWidth() - (8 * 60)) / 2; // and 60 pixels wide

View Full Code Here

Examples of net.rim.device.api.ui.component.BitmapField

        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()) {
            led = new BitmapField(reg_led);
        } else {
            led = new BitmapField(unr_led);
        }
        icon_manager.add(led,led_x, led_y);
       
        add(icon_manager);
View Full Code Here

Examples of net.rim.device.api.ui.component.BitmapField

        heading.setText("Event Log (newest items first)");
        heading.setFont(heading_font);

        if (_listener_mgr.is_listening()) {
            led = new BitmapField(reg_led,Field.FIELD_RIGHT);
        } else {
            led = new BitmapField(unr_led,Field.FIELD_RIGHT);
        }

        top_row.add(heading);
        top_row.add(led);
       
View Full Code Here

Examples of net.rim.device.api.ui.component.BitmapField

                    displayHeight - ROUND_RECT_HEIGHT_PAD, ARC_WIDTH,
                    ARC_HEIGHT);
            g.setColor(Color.DARKGRAY);
            g.drawText(Integer.toString(i), displayWidth / 2, displayHeight / 2);

            final BitmapField field = new BitmapField(bitmap);
            manager.add(field);
        }

        // Initialize Adjustment
        final Adjustment adjustment = manager.getHorizontalAdjustment();
View Full Code Here

Examples of net.rim.device.api.ui.component.BitmapField

         */
        public ZoomScreenDemoScreen() {
            setTitle("Zoom Screen Demo");

            _image = EncodedImage.getEncodedImageResource("img/building.jpg");
            final BitmapField bitmapField =
                    new BitmapField(_image.getBitmap(), FIELD_HCENTER
                            | FOCUSABLE);
            add(bitmapField);
        }
View Full Code Here

Examples of net.rim.device.api.ui.component.BitmapField

                final Object[] data =
                        (Object[]) ((TableModel) getView().getModel())
                                .getRow(modelRowIndex);

                final Field[] fields = new Field[4];
                fields[0] = new BitmapField((Bitmap) data[0]);
                fields[1] =
                        new LabelField(data[1], Field.FOCUSABLE
                                | DrawStyle.HCENTER);
                fields[2] = new LabelField(data[3], Field.FOCUSABLE);
                fields[3] = new LabelField(data[4], Field.FOCUSABLE);
View Full Code Here

Examples of net.rim.device.api.ui.component.BitmapField

            // Scale the original Bitmap into the new Bitmap using
            // a Lanczos filter.
            bitmapOrig.scaleInto(bitmapScaled, Bitmap.FILTER_LANCZOS);

            // Display the original Bitmap on the screen
            final BitmapField bitmapFieldOrig =
                    new BitmapField(bitmapOrig, Field.FOCUSABLE);
            final StringBuffer strBuff = new StringBuffer("Original - ");
            strBuff.append(bitmapOrig.getWidth());
            strBuff.append(LABEL_X);
            strBuff.append(bitmapOrig.getHeight());
            add(new LabelField(strBuff.toString()));
            add(bitmapFieldOrig);

            add(new SeparatorField());

            // Display the scaled Bitmap on the screen
            final BitmapField bitmapFieldScaled1 =
                    new BitmapField(bitmapScaled, Field.FOCUSABLE);
            strBuff.delete(0, strBuff.length());
            strBuff.append("\nScaled - ");
            strBuff.append(bitmapScaled.getWidth());
            strBuff.append(LABEL_X);
            strBuff.append(bitmapScaled.getHeight());
            strBuff.append(" - FILTER_LANCZOS - Aspect ratio not preserved");
            add(new LabelField(strBuff.toString()));
            add(bitmapFieldScaled1);

            add(new SeparatorField());

            // Redefine the scaled Bitmap
            bitmapScaled =
                    new Bitmap(Bitmap.ROWWISE_32BIT_ARGB8888, scaledX, scaledY);

            // Scale the original Bitmap into the new Bitmap using
            // a bilinear filter and maintaining aspect ratio.
            bitmapOrig.scaleInto(bitmapScaled, Bitmap.FILTER_BILINEAR,
                    Bitmap.SCALE_TO_FILL);

            // Display the newly scaled Bitmap on the screen
            final BitmapField bitmapFieldScaled2 =
                    new BitmapField(bitmapScaled, Field.FOCUSABLE);
            strBuff.delete(0, strBuff.length());
            strBuff.append("\nScaled - ");
            strBuff.append(bitmapScaled.getWidth());
            strBuff.append(LABEL_X);
            strBuff.append(bitmapScaled.getHeight());
            strBuff.append(" - FILTER_BILINEAR - Aspect ratio preserved");
            add(new LabelField(strBuff.toString()));
            add(bitmapFieldScaled2);

            add(new SeparatorField());

            // Redefine the scaled Bitmap
            bitmapScaled =
                    new Bitmap(Bitmap.ROWWISE_32BIT_ARGB8888, scaledX, scaledY);

            // Calculate fragment dimensions
            final int fragmentWidth = bitmapOrig.getWidth() >> 1; // >> 1
                                                                  // equivalent
                                                                  // to / 2
            final int fragmentHeight = bitmapOrig.getHeight() >> 1; // >> 1
                                                                    // equivalent
                                                                    // to / 2

            // Scale a fragment of the original Bitmap into the new Bitmap
            // using a box filter.
            bitmapOrig.scaleInto(0, 0, fragmentWidth, fragmentHeight,
                    bitmapScaled, 0, 0, bitmapScaled.getWidth(), bitmapScaled
                            .getHeight(), Bitmap.FILTER_BOX);

            // Display the newly scaled Bitmap on the screen
            final BitmapField bitmapFieldScaled3 =
                    new BitmapField(bitmapScaled, Field.FOCUSABLE);
            strBuff.delete(0, strBuff.length());
            strBuff.append("\nScaled fragment ");
            strBuff.append(fragmentWidth);
            strBuff.append(LABEL_X);
            strBuff.append(fragmentHeight);
            strBuff.append(" into ");
            strBuff.append(bitmapScaled.getWidth());
            strBuff.append(LABEL_X);
            strBuff.append(bitmapScaled.getHeight());
            strBuff.append(" - FILTER_BOX");
            add(new LabelField(strBuff.toString()));
            add(bitmapFieldScaled3);

            // Add a menu item to display an animation in a popup screen
            final MenuItem showAnimation =
                    new MenuItem(new StringProvider("Show Animation"),
                            0x230010, 0);
            showAnimation.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object context) {
                    // Create an EncodedImage object to contain an animated
                    // gif resource.
                    final EncodedImage encodedImage =
                            EncodedImage
                                    .getEncodedImageResource("animation.gif");

                    // Create a BitmapField to contain the animation
                    final BitmapField bitmapFieldAnimation = new BitmapField();
                    bitmapFieldAnimation.setImage(encodedImage);

                    // Push a popup screen containing the BitmapField onto the
                    // display stack.
                    UiApplication.getUiApplication().pushScreen(
                            new BitmapDemoPopup(bitmapFieldAnimation));
View Full Code Here

Examples of net.rim.device.api.ui.component.BitmapField

                     */
                    public Field[] getDataFields(final int modelRowIndex) {
                        final Object[] data =
                                (Object[]) _tableModel.getRow(modelRowIndex);
                        final Field[] fields =
                                { new BitmapField((Bitmap) data[0]),
                                        new LabelField(data[1]),
                                        new LabelField(data[2]) };
                        return fields;
                    }
                };
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.