Package net.rim.device.api.ui

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


      if (hasField(title) && child == title) {
        continue;
        // Layout title last, separately
      }
      layoutChild(child, availableWidth, height);
      XYRect childExtent = child.getExtent();
      availableWidth -= childExtent.width;
      if (hasField(icon) && child == icon) {
        // skip the interior padding loss.
      } else {
        availableWidth -= interiorPadding;
      }
      maxHeight = Math.max(maxHeight, childExtent.height);
    }
    // Layout Title with remaining space
    if (hasField(title)) {
      child = title;
      layoutChild(child, availableWidth, height);
      XYRect childExtent = child.getExtent();
      availableWidth -= childExtent.width + interiorPadding;
      maxHeight = Math.max(maxHeight, childExtent.height);
    }
    // Set Positions
    if (hasField(icon)) {
View Full Code Here


   * @return the x position for the left of the field.
   */
  private int determineLeft(Field field, int availableWidth, Field[] others, int style) {
    int childX = 0;
    if (hasField(field)) {
      XYRect extent = field.getExtent();
      if (style == DrawStyle.RIGHT) {
        childX = hPadding + availableWidth - extent.width;
        for (int i = 0; i < others.length; i++) {
          if (hasField(others[i]) && others[i].getExtent().width > 0) {
            childX -= others[i].getExtent().width;
View Full Code Here

                return fields;
            }
        };

        // Set up regions
        dataTemplate.createRegion(new XYRect(0, 0, 1, 2), style);
        dataTemplate.createRegion(new XYRect(1, 0, 2, 1), style);
        dataTemplate.createRegion(new XYRect(1, 1, 1, 1), style);
        dataTemplate.createRegion(new XYRect(2, 1, 1, 1), style);

        // Specify the size of each column by percentage, and the height of a
        // row
        dataTemplate.setColumnProperties(0, new TemplateColumnProperties(15,
                TemplateColumnProperties.PERCENTAGE_WIDTH));
View Full Code Here

    protected void sublayout(final int width, final int height) {
        super.sublayout(width, height);

        // Calculate the title height
        final Manager manager = getMainManager();
        final XYRect extent = manager.getExtent(); // Scrollable section of the
                                                   // screen
        _titleHeight = extent.y; // Top of the scrollable section

        // Set the viewport dimensions for the current orientation
        _image.setViewportHeight(Display.getHeight() - _titleHeight);
View Full Code Here

        dataTemplate.useFixedHeight(true);

        // Define regions and row height
        dataTemplate.setRowProperties(0, new TemplateRowProperties(ROW_HEIGHT));
        for (int i = 0; i < NUM_COLUMNS; i++) {
            dataTemplate.createRegion(new XYRect(i, 0, 1, 1));
            dataTemplate.setColumnProperties(i, new TemplateColumnProperties(
                    Display.getWidth() / NUM_COLUMNS));
        }

        // Apply the template to the view
View Full Code Here

                return fields;
            }
        };

        // Define the regions of the data template and column/row size
        dataTemplate.createRegion(new XYRect(0, 0, 1, 1));
        dataTemplate.setColumnProperties(0, new TemplateColumnProperties(
                Display.getWidth()));
        dataTemplate.setRowProperties(0, new TemplateRowProperties(24));

        _view.setDataTemplate(dataTemplate);
View Full Code Here

                        { new LabelField(text, Field.NON_FOCUSABLE) };

                return fields;
            }
        };
        dataTemplate.createRegion(new XYRect(0, 0, 1, 1));
        dataTemplate.setColumnProperties(0, new TemplateColumnProperties(
                Display.getWidth()));
        dataTemplate.setRowProperties(0, new TemplateRowProperties(32));
        _view.setDataTemplate(dataTemplate);
        dataTemplate.useFixedHeight(true);
View Full Code Here

        setPositionDelegate(0, 0);
        layoutDelegate(width, height);

        // Center the dialog on the screen
        final XYRect fmExtent = getDelegate().getExtent();

        final int newX = width - fmExtent.width >> 1;
        final int newY = height - fmExtent.height >> 1;

        setPosition(newX + getMarginLeft(), newY + getMarginTop());
View Full Code Here

                return fields;
            }
        };

        // Define the regions of the data template and column/row size
        dataTemplate.createRegion(new XYRect(0, 0, 1, 1));
        dataTemplate.setColumnProperties(0, new TemplateColumnProperties(
                Display.getWidth()));
        dataTemplate.setRowProperties(0, new TemplateRowProperties(24));

        _view.setDataTemplate(dataTemplate);
View Full Code Here

                return fields;
            }
        };

        // Define the regions of the data template and column/row size
        dataTemplate.createRegion(new XYRect(0, 0, 1, 1));
        dataTemplate.setColumnProperties(0, new TemplateColumnProperties(
                Display.getWidth()));
        dataTemplate.setRowProperties(0, new TemplateRowProperties(24));

        _view.setDataTemplate(dataTemplate);
View Full Code Here

TOP

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

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.