Package net.rim.device.api.ui.container

Examples of net.rim.device.api.ui.container.HorizontalFieldManager


      public void fieldChanged(Field field, int context) {
        execution2.execute(null);
      }
    };
    buttonField2.setChangeListener(changeListener2);
        HorizontalFieldManager hfm1 = new HorizontalFieldManager(HorizontalFieldManager.FIELD_RIGHT);
        hfm1.add(buttonField1);
        hfm1.add(buttonField2);
        VerticalFieldManager vfmLeft = new VerticalFieldManager();
        VerticalFieldManager vfmRight = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH);
        vfmLeft.add(labelField);
        vfmRight.add(hfm1);
        HorizontalFieldManager hfm = new HorizontalFieldManager();
        hfm.add(vfmLeft);
        hfm.add(vfmRight);
   
    return hfm;
  }
View Full Code Here


            select();
        }
    }

    private void initialize() {
        HorizontalFieldManager mgr = new HorizontalFieldManager( Field.FIELD_HCENTER );
        add( mgr );
        _ok = new ButtonField( "OK", Field.FIELD_HCENTER );
        _ok.setChangeListener( this );
        mgr.add( _ok );
        setEscapeEnabled( true );
    }
View Full Code Here

    add(new SeparatorField());
    add(geoTimeoutField)
    add(new SeparatorField());
    add(maxRetryDelayField);
    add(new SeparatorField());
    HorizontalFieldManager hfm = new HorizontalFieldManager(Field.USE_ALL_WIDTH);
    VerticalFieldManager vfmLeft = new VerticalFieldManager();
    VerticalFieldManager vfmRight = new VerticalFieldManager(DrawStyle.RIGHT|Field.FIELD_RIGHT);
    vfmLeft.add(startTrackingField);
    vfmLeft.add(stopTrackingField);
    vfmLeft.add(restartField);
    vfmRight.add(getSingleLocationField);
    vfmRight.add(getLastLocationField);
    vfmRight.add(satellitesField);
    hfm.add(vfmLeft);
    hfm.add(vfmRight);
    add(hfm);   
    add(new SeparatorField());
    add(statusField);
    add(new SeparatorField());
    add(locationField);
View Full Code Here

        vfm.add(_dateField);

        add(vfm);

        // Initialize a button for intitiating a travel time query
        final HorizontalFieldManager hfm =
                new HorizontalFieldManager(Field.FIELD_HCENTER);
        final ButtonField travelButton =
                new ButtonField("Get Travel Time", ButtonField.CONSUME_CLICK
                        | ButtonField.NEVER_DIRTY);
        hfm.add(travelButton);
        add(hfm);
        travelButton.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(final Field field, final int context) {
                findTravelTime();
            }
View Full Code Here

        // Add an ActivityIndicatorView with label and animation centered in a
        // horizontal layout
        bitmap = Bitmap.getBitmapResource("spinner.png");
        _views[1] =
                ActivityIndicatorFactory.createActivityIndicator(
                        new HorizontalFieldManager(), Field.FIELD_HCENTER,
                        bitmap, 5, 0, "horizontal centered layout",
                        Field.FIELD_HCENTER);
        add(_views[1]);
        add(new SeparatorField());

        // Add a centered ActivityIndicatorView between two focusable fields
        add(new LabelField("focusable field", Field.FOCUSABLE));
        bitmap = Bitmap.getBitmapResource("spinner2.png");
        _views[2] =
                ActivityIndicatorFactory.createActivityIndicator(
                        Field.FIELD_HCENTER, bitmap, 6, Field.FIELD_HCENTER,
                        "centered between focusable fields",
                        Field.FIELD_HCENTER);
        add(_views[2]);
        add(new LabelField("focusable field", Field.FOCUSABLE));
        add(new SeparatorField());

        // Add a right justified ActivityIndicatorView
        bitmap = Bitmap.getBitmapResource("spinner.png");
        _views[3] =
                ActivityIndicatorFactory.createActivityIndicator(
                        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] =
                ActivityIndicatorFactory.createActivityIndicator(0, bitmap, 6,
                        0);
        _views[4].setBackground(background);
        add(_views[4]);
        add(new LabelField("solid background"));
        add(new SeparatorField());

        // Add an ActivityIndicatorView to another ActivityIndicatorView
        bitmap = Bitmap.getBitmapResource("progress.png");
        background = BackgroundFactory.createSolidBackground(Color.DARKGRAY);
        _views[5] =
                ActivityIndicatorFactory.createActivityIndicator(0, bitmap, 12,
                        0, "view added to another", 0);
        _views[5].setBackground(background);
        bitmap = Bitmap.getBitmapResource("spinner.png");
        _views[6] =
                ActivityIndicatorFactory.createActivityIndicator(0, bitmap, 5,
                        0);
        _views[5].add(_views[6]);
        add(_views[5]);

        final MenuItem cancelItem =
                new MenuItem(new StringProvider("Cancel spinners "), 0x230020,
                        0);
        cancelItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    _views[i].getModel().cancel();
                }
            }
        }));

        final MenuItem resetItem =
                new MenuItem(new StringProvider("Reset spinners "), 0x230030, 0);
        resetItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    _views[i].getModel().reset();
                }
            }
        }));

        final MenuItem resumeItem =
                new MenuItem(new StringProvider("Resume spinners "), 0x230040,
                        0);
        resumeItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    _views[i].getModel().resume();
                }
            }
        }));

        final MenuItem delayedStop =
                new MenuItem(new StringProvider("Delayed start"), 0x230050, 0);
        delayedStop.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    final DelayedStart ds = new DelayedStart(_views[i]);
                    ds.start();
                }
            }
        }));

        final MenuItem delayedStart =
                new MenuItem(new StringProvider("Delayed stop"), 0x230060, 0);
        delayedStart.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    final DelayedStop ds = new DelayedStop(_views[i]);
                    ds.start();
                }
            }
        }));

        final MenuItem showPopupItem =
                new MenuItem(new StringProvider("Show Popup"), 0x230010, 0);
        showPopupItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                Bitmap bitmap = Bitmap.getBitmapResource("orchid2.png");
                final ActivityIndicatorView view =
                        ActivityIndicatorFactory.createActivityIndicator(0,
                                bitmap, 6, Field.FIELD_HCENTER);
                bitmap = Bitmap.getBitmapResource("progress2.png");
                final ActivityIndicatorView view2 =
                        ActivityIndicatorFactory.createActivityIndicator(
                                new HorizontalFieldManager(),
                                Field.FIELD_HCENTER, bitmap, 6, 0,
                                "horizontal", Field.FIELD_HCENTER);

                final ActivityPopupScreen activityPopupScreen =
                        new ActivityPopupScreen(view);
View Full Code Here

                "abc", 100, BasicEditField.FILTER_DEFAULT));

        // Add components to the south eye-lid of the blinker
        _eyelidFieldManager.addBottom(new CustomLabelField(
                "Here is a row of buttons..."));
        final HorizontalFieldManager buttonPanel =
                new HorizontalFieldManager(Field.FIELD_HCENTER
                        | Field.USE_ALL_WIDTH);
        buttonPanel.add(new SimpleButton("ABC"));
        buttonPanel.add(new SimpleButton("123"));
        buttonPanel.add(new SimpleButton("XYZ"));
        _eyelidFieldManager.addBottom(buttonPanel);

        // Add checkbox in non-eyelid region for showing eyelids on user input
        _showOnInputCheckbox =
                new CheckboxField("Show eyelids on user input", true,
View Full Code Here

        final int displayWidth = Display.getWidth();
        final int displayHeight = Display.getHeight();

        // Create scrollable manager to contain pages
        final HorizontalFieldManager manager =
                new HorizontalFieldManager(ScrollView.HORIZONTAL_SCROLL);

        // Create three pages inside the manager
        for (int i = 0; i < 3; i++) {
            final Bitmap bitmap = new Bitmap(displayWidth, displayHeight);

            final Graphics g = Graphics.create(bitmap);
            g.setBackgroundColor(Color.BLACK);
            g.clear();
            g.setColor(Color.ALICEBLUE);
            g.fillRoundRect(10, 10, displayWidth - ROUND_RECT_WIDTH_PAD,
                    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();
        adjustment.setPageSize(displayWidth);

        // Set page step so that pages must be moved 1/4 of their
        // width for the screen to scroll to the adjacent page.
        adjustment.setPageStep(Display.getWidth() / 4);
View Full Code Here

        _bitmapOrig = bitmap;

        _bitmapField = new DemoBitmapField(bitmap, FIELD_HCENTER);

        // Center BitmapField using managers
        final HorizontalFieldManager hfm =
                new HorizontalFieldManager(USE_ALL_HEIGHT);
        final VerticalFieldManager vfm =
                new VerticalFieldManager(USE_ALL_WIDTH | FIELD_VCENTER);
        vfm.add(_bitmapField);
        hfm.add(vfm);
        add(hfm);

        // Enable pinch
        final InputSettings inputSettings =
                TouchscreenSettings.createEmptySet();
View Full Code Here

                new ButtonField("Resume", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _resumeButton.setChangeListener(this);

        // Add buttons to manager
        final HorizontalFieldManager hfm =
                new HorizontalFieldManager(Field.FIELD_HCENTER);
        hfm.add(_processButton);
        hfm.add(_cancelButton);
        hfm.add(_resumeButton);

        add(hfm);
        add(new SeparatorField());
        add(view);
    }
View Full Code Here

                            "Brasilia", "Melbourne" };
            _spinBoxField = new TextSpinBoxField(choices);
            _spinBoxField.setVisibleRows(3);
            add(new LabelField("Choose city:"));
            add(new SeparatorField());
            final HorizontalFieldManager hfm =
                    new HorizontalFieldManager(Field.FIELD_HCENTER);
            hfm.add(_spinBoxField);
            add(hfm);
        }
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.container.HorizontalFieldManager

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.