Package net.rim.device.api.ui

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


  private static Bitmap _clock = EncodedImage.getEncodedImageResource("img/clock.PNG").getBitmap();
  private static Bitmap _icon = EncodedImage.getEncodedImageResource("img/icon.png").getBitmap();
  private VerticalFieldManager main = new VerticalFieldManager();

  public StartScreen() {
    XYEdges edges = new XYEdges(4, 4, 4, 4);
    main.setPadding(edges);
    searchBox.setPadding(edges);
    searchBox.setBorder(BorderFactory.createRoundedBorder(edges, Color.CORNFLOWERBLUE, Border.STYLE_SOLID));
    searchManager.setColumnProperty(0, GridFieldManager.AUTO_SIZE, 0);
    searchManager.setColumnProperty(1, GridFieldManager.PREFERRED_SIZE, 0);
View Full Code Here


  /**
   * Creates a new MyScreen object
   */
  public SocialScreen() {
    setBorder(BorderFactory.createBitmapBorder(new XYEdges(9, 9, 9, 9), Bitmap.getBitmapResource("border.png")));
    setTitle(new LabelField("(: The Social App :)", DrawStyle.HCENTER|Field.FIELD_HCENTER))

    filePickButton = new ButtonField("Photo Share", Field.FIELD_HCENTER) {
      protected boolean navigationClick(int status, int time) {
        FilePicker picker = FilePicker.getInstance();
        picker.setFilter(".jpg:.png");
        picker.setView(FilePicker.VIEW_PICTURES);
        String path = picker.show();

        if (path != null) {
          // Creating the data context as a JSONObject
          JSONObject context = new JSONObject();
          try {
            context.put(SendCommandContextKeys.PATH, path);
            /**
             * Since we are sharing a file path, you CANNOT add a
             * SUBJECT or TEXT type data. Only PATH seems to be
             * allowed.
             */
          } catch (JSONException e) {

          }

          /**
           * Getting the available SendCommand(s) for our SendCommand
           * type TYPE_TEXT by providing our data context. The 3rd
           * parameter is a boolean that indicates whether you want
           * all results or just the results that are possible based on the context.
           * Ideally this boolean param would be set to false,
           * but there seems to be a bug with BBM as it throws an
           * exception during the query. As a workaround, I am getting
           * all first and then filtering out the ones I dont need.
           */
          commandsAll = SendCommandRepository.getInstance().get(SendCommand.TYPE_PATH, context, true);
          commands = new SendCommand[2];
                   
          for (int i = 0; i < commandsAll.length; i++) {           
            if (commandsAll[i].getId().equals(TWITTER_PATH_ID)) {
              commands[0] = commandsAll[i];
            }
            if (commandsAll[i].getId().equals(FACEBOOK_PATH_ID)) {
              commands[1] = commandsAll[i];
            }
          }
          // Displays our SendCommands to the user.
          displayCommands();
        }

        return true;
      }

      public int getPreferredWidth() {
        return Display.getWidth()/2;
      }
    };

    add(filePickButton);

    add(new SeparatorField());
    add(new SeparatorField());
    add(new SeparatorField());

    // An EditField to let the user type in the text to share.
    textField = new EditField("", "Share this please.");
    textField.setBorder(BorderFactory.createRoundedBorder(new XYEdges(3, 3, 3, 3)));
   
    // A button that initiates the Text Share
    shareTextButton = new ButtonField("Text Share", Field.FIELD_HCENTER) {
      protected boolean navigationClick(int arg0, int arg1) {
        // Creating the data context as a JSONObject
View Full Code Here

public class SendDialog extends Dialog{
  public SendDialog(int type, String message, int defaultChoice, Bitmap bitmap){
    super(type, message, defaultChoice, bitmap, Dialog.NO_HORIZONTAL_SCROLL);   
    setBackground(BackgroundFactory.createSolidTransparentBackground(Color.BLACK, 200));
    setBorder(BorderFactory.createBitmapBorder(new XYEdges(9, 9, 9, 9), Bitmap.getBitmapResource("border.png")));   
  }
View Full Code Here

        Bitmap bitmap; // Reuse this reference

        // Add an ActivityIndicatorView featuring a rounded red border
        bitmap = Bitmap.getBitmapResource("spinner.png");
        final XYEdges edges = new XYEdges(2, 2, 2, 2);
        final Border border =
                BorderFactory.createRoundedBorder(edges, Color.CRIMSON,
                        Border.STYLE_SOLID);
        _views[0] =
                ActivityIndicatorFactory.createActivityIndicator(0, bitmap, 5,
View Full Code Here

        // XYEdge objects are used to represent different padding configurations
        // Each integer represents the amount of space between the box and
        // border
        // The four parameters of an XYEdge object represents each edge,
        // clockwise starting at the top
        final XYEdges thickPadding = new XYEdges(10, 10, 10, 10);
        final XYEdges noPadding = new XYEdges(0, 0, 0, 0);

        // Sample padding objects:
        // XYEdges verticalPadding = new XYEdges(10, 0, 10, 0);
        // XYEdges horizontalPadding = new XYEdges(0, 10, 0, 10);

        // XYEdges can also be used to represent colors
        final XYEdges multiColors =
                new XYEdges(Color.BLUEVIOLET, Color.AZURE, Color.DARKRED,
                        Color.KHAKI);
        final XYEdges pinkColors =
                new XYEdges(Color.HOTPINK, Color.HOTPINK, Color.HOTPINK,
                        Color.HOTPINK);
        final XYEdges blueColors =
                new XYEdges(Color.MIDNIGHTBLUE, Color.MIDNIGHTBLUE,
                        Color.MIDNIGHTBLUE, Color.MIDNIGHTBLUE);
        final XYEdges oliveColors =
                new XYEdges(Color.OLIVE, Color.OLIVE, Color.OLIVE, Color.OLIVE);

        // Set the title of the application
        setTitle("D�cor Demo");

        add(new RichTextField(Field.NON_FOCUSABLE));
View Full Code Here

                    BackgroundFactory.createLinearGradientBackground(
                            Color.BLUE, Color.BLUE, Color.LIGHTBLUE,
                            Color.LIGHTBLUE);

            // Initialize menu border
            final XYEdges thickPadding = new XYEdges(10, 10, 10, 10);
            final XYEdges colors =
                    new XYEdges(Color.DARKBLUE, Color.DARKBLUE, Color.DARKBLUE,
                            Color.DARKBLUE);
            _menuBorder =
                    BorderFactory.createBevelBorder(thickPadding, colors,
                            colors);
View Full Code Here

                    os, year, interfaces });
        }

        // Create and apply style
        final RegionStyles style =
                new RegionStyles(BorderFactory.createSimpleBorder(new XYEdges(
                        1, 1, 1, 1), Border.STYLE_SOLID), null, null, null,
                        RegionStyles.ALIGN_LEFT, RegionStyles.ALIGN_TOP);

        // Create the view and controller
        final TableView tableView = new TableView(_tableModel);
View Full Code Here

            model.enableLooping(true);

            // Create a pane
            VerticalFieldManager vfm = new VerticalFieldManager();
            vfm.add(new LabelField("Data 1"));
            final XYEdges edgesOne = new XYEdges(1, 1, 1, 1);
            vfm.setBorder(BorderFactory.createRoundedBorder(edgesOne));
            final Pane pane =
                    new Pane(new LabelField("Pane 1", Field.FOCUSABLE
                            | Field.FIELD_HCENTER), vfm);

            // Add the pane to the model
            model.addPane(pane);

            // Create a second pane
            vfm = new VerticalFieldManager();
            for (int i = 0; i < 30; i++) {
                vfm.add(new LabelField("Data " + i, Field.FOCUSABLE));
            }
            final LabelField iconTextLabelField =
                    new LabelField("Pane 2", Field.FOCUSABLE
                            | Field.FIELD_HCENTER);
            model.addPane(new Pane(iconTextLabelField, vfm));

            // Create a third pane
            vfm = new VerticalFieldManager();
            final ButtonField button =
                    new ButtonField("Button", ButtonField.CONSUME_CLICK
                            | ButtonField.NEVER_DIRTY);
            button.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(final Field field, final int context) {
                    Dialog.inform("Button activated.");
                }
            });
            vfm.add(button);
            model.addPane(new Pane(new LabelField("Pane 3", Field.FOCUSABLE
                    | Field.FIELD_HCENTER), vfm));

            // Choose which pane the model is displaying
            model.setCurrentlySelectedIndex(1);

            // Create the header and initialize the model and visual properties
            TitleView header;
            PaneManagerController controller;
            header = new HorizontalScrollableTitleView(Field.FOCUSABLE);
            ((HorizontalScrollableTitleView) header).enableArrows(true);
            controller = new HorizontalScrollableController();
            header.setModel(model);
            final XYEdges edgesFour = new XYEdges(4, 4, 4, 4);
            header.setBorder(BorderFactory.createRoundedBorder(edgesFour));

            // Set arrow images
            final Bitmap leftArrow = Bitmap.getBitmapResource("leftArrow.png");
            final Bitmap rightArrow =
View Full Code Here

         *            The prefix of the file name of the image to be loaded
         */
        public ControlField(final String prefix) {
            super(loadBitmap(prefix), FOCUSABLE);

            final XYEdges borderWidths = new XYEdges(2, 2, 2, 2);
            final Border border =
                    BorderFactory.createRoundedBorder(borderWidths);
            setBorder(border);
        }
View Full Code Here

                break;

            }

            return new RegionStyles(BorderFactory.createSimpleBorder(
                    new XYEdges(1, 1, 1, 1), border), null, null, null,
                    horizontal, vertical);
        }
View Full Code Here

TOP

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

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.