Package net.rim.device.api.ui

Examples of net.rim.device.api.ui.Field


    /**
     * @see Manager#sublayout(int, int)
     */
    protected void sublayout(final int width, final int height) {
        Field firstField;
        Field secondField;
        if (_giveTopFieldPriority) {
            firstField = _topField;
            secondField = _bottomField;
        } else {
            firstField = _bottomField;
            secondField = _topField;
        }

        int maxWidth = 0;

        final int firstFieldLeftMargin = firstField.getMarginLeft();
        final int firstFieldRightMargin = firstField.getMarginRight();
        final int secondFieldLeftMargin = secondField.getMarginLeft();
        final int secondFieldRightMargin = secondField.getMarginRight();

        final int bottomFieldMarginBottom = _bottomField.getMarginBottom();
        final int topFieldMarginTop = _topField.getMarginTop();

        int availableHeight = height;
        availableHeight -= topFieldMarginTop;
        availableHeight -=
                Math.max(_topField.getMarginBottom(), _bottomField
                        .getMarginTop());
        availableHeight -= bottomFieldMarginBottom;

        layoutChild(firstField, width - firstFieldLeftMargin
                - firstFieldRightMargin, availableHeight);
        maxWidth =
                Math.max(maxWidth, firstFieldLeftMargin + firstField.getWidth()
                        + firstFieldRightMargin);
        availableHeight -= firstField.getHeight();

        layoutChild(secondField, width - secondFieldLeftMargin
                - secondFieldRightMargin, availableHeight);

        maxWidth =
                Math.max(maxWidth, secondFieldLeftMargin
                        + secondField.getWidth() + secondFieldRightMargin);
        availableHeight -= secondField.getHeight();

        setPositionChild(_topField, 0, topFieldMarginTop);
        setPositionChild(_bottomField, 0, height - _bottomField.getHeight()
                - bottomFieldMarginBottom);

View Full Code Here


        /**
         * @see net.rim.device.api.ui.container.VerticalFieldManager#sublayout(int,int)
         */
        protected void sublayout(final int width, final int height) {
            // Prevent size of text area changing when typing on a new line
            final Field field = getField(0);
            layoutChild(field, Display.getWidth(), 100);
            setPositionChild(field, 0, 0);
            setExtent(Display.getWidth(), 100);
        }
View Full Code Here

        try {
            browserContent =
                    _renderingSession.getBrowserContent(connection, this, e);

            if (browserContent != null) {
                final Field field = browserContent.getDisplayableContent();

                if (field != null) {
                    synchronized (Application.getEventLock()) {
                        _mainScreen.deleteAll();
                        _mainScreen.add(field);
View Full Code Here

     * @see MainScreen#makeMenu(Menu, int)
     */
    protected void makeMenu(final Menu menu, final int instance) {
        super.makeMenu(menu, instance);

        final Field fieldWithFocus = this.getFieldWithFocus();

        if (fieldWithFocus == _editField) {
            // Get selected text from the EditField
            final Clipboard clipboard = Clipboard.getClipboard();
            _editField.selectionCopy(clipboard);
View Full Code Here

        } catch (final IOException ioe) {
            System.out.println("Error while opening the .svg file.");
        }

        // Get the SVG field
        final Field _svgField = (Field) _animator.getTargetComponent();

        // Manager to lay out checkboxes
        final VerticalFieldManager vfm = new VerticalFieldManager();
        this.add(vfm);
        vfm.add(_svgField);
View Full Code Here

        absoluteFieldManager.setBackground(BackgroundFactory
                .createSolidBackground(Color.KHAKI));
        add(absoluteFieldManager);

        // Set up video field
        final Field videoField = initializeVideo();

        if (videoField != null) {
            // Calculate position of video field and add to manager
            final int videoFieldX = (displayWidth - VIDEO_WIDTH) / 2;
            final int videoFieldY = (displayHeight - VIDEO_HEIGHT) / 2;
View Full Code Here

     * AdvancedVideoControl
     *
     * @return A UI Field object containing an AdvancedVideoControl
     */
    private Field initializeVideo() {
        Field videoField = null;

        try {
            // Create player from input stream
            final InputStream is =
                    getClass().getResourceAsStream("/media/BlackBerry.mp4");
View Full Code Here

            final Vector fields = (Vector) _fieldTable.get(type);
            if (fields == null) {
                return -1;
            }

            final Field field = (Field) fields.lastElement();

            return field.getIndex();
        }
View Full Code Here

        /**
         * @see MainScreen#makeMenu(Menu, int)
         */
        protected void makeMenu(final Menu menu, final int instance) {
            super.makeMenu(menu, instance);
            final Field focusField = getLeafFieldWithFocus();

            // Create the "open with" context menu item
            if (focusField == _contentHandlerMenuLabel) {
                final ContentHandlerMenu contentHandlerMenu =
                        new ContentHandlerMenu(getInvocation(), _registry,
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.Field

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.