Examples of MapDataModel


Examples of net.rim.device.api.lbs.maps.model.MapDataModel

        public EnhancedMapFieldDemoScreen() {
            super(Screen.DEFAULT_CLOSE | Screen.DEFAULT_MENU);

            _bigMap = MapFactory.getInstance().generateRichMapField();

            final MapDataModel data = _bigMap.getModel();

            // Create RIM head office location and add it with appropriate tags
            final MapLocation rimOffice =
                    new MapLocation(ORIGIN_LATITUDE, ORIGIN_LONGITUDE,
                            "Research In Motion", "Head office");

            // Set styles for MapLocation using class based style
            final StyleSet styles = _bigMap.getMapField().getDrawingStyles();
            final Style classBasedStyle = new Style();
            classBasedStyle.setLabelFillColor(Color.BLACK);
            classBasedStyle.setLabelFontColor(Color.WHITE);
            classBasedStyle.setLabelFontStyle(Font.BOLD);
            styles.addClassBasedStyle(MapLocation.class, classBasedStyle);

            final int rimOfficeID = data.add(rimOffice, "rim");

            data.tag(rimOfficeID, "head"); // Locations can have more than one
                                           // tag
            data.setVisible("head");

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

            // Initialize PIP map
View Full Code Here

Examples of org.beryl.gui.model.MapDataModel

    }
  }

  private void initialize(Widget parent, int type, String title, String message, String details)
    throws GUIException {
    dataModel = new MapDataModel();

    size = new Dimension(500, 100);
    bigSize = new Dimension(500, 200);

    if (less == null) {
View Full Code Here

Examples of org.beryl.gui.model.MapDataModel

public class DnDTest extends Controller {
  private Frame frame = null;
  private MapDataModel dataModel = null;

  public DnDTest() throws GUIException {
    dataModel = new MapDataModel();
    frame = constructFrame("DnDTest", dataModel);
    List list1 = (List) frame.getWidget("List1");
    List list2 = (List) frame.getWidget("List2");

    ListDataModel strings = new ListDataModel();
View Full Code Here

Examples of org.beryl.gui.model.MapDataModel

  private ConsoleAttribute boldAttribute = null;

  public Test() throws GUIException {
    /* Create a new data model and initialize it
     * with default values for the main window */
    model = new MapDataModel();
    model.setValue("username", "wazlaf");
    model.setValue("password", "blubb");
    model.setValue("combo.index", new Integer(1));
    model.setValue("list.index", new int[] { 1 });
    model.setValue("icon.index", new Integer(1));
View Full Code Here

Examples of org.beryl.gui.model.MapDataModel

    list.setCellRenderer(new ListCellRenderer());
    scrollPane = new JScrollPane(list);
    list.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        try {
          MapDataModel model = getDataModel();
          if (sendEvents && model != null && !e.getValueIsAdjusting()) {
            try {
              sendEvents = false;
              processEvents = false;
              if (indexKey != null)
                model.setValue(List.this, indexKey, list.getSelectedIndices());
              if (valueKey != null)
                model.setValue(List.this, valueKey, list.getSelectedValues());
            } finally {
              sendEvents = true;
              processEvents = true;
            }
          }
View Full Code Here

Examples of org.beryl.gui.model.MapDataModel

      }
    }
  }

  private void reload() throws GUIException {
    MapDataModel model = getDataModel();
    if (model != null) {
      try {
        processEvents = false;

        int[] indices = indexKey == null ? null : (int[]) model.getValue(indexKey);
        Object values[] = valueKey == null ? null : (Object[]) model.getValue(valueKey);

        if (indices != null) {
          setSelectionIndices(indices);
        } else if (values != null) {
          setSelectionValues(values);
        }

        if (((values != null && indices == null) || (values == null && indices == null)) && indexKey != null) {
          model.setValue(List.this, indexKey, list.getSelectedIndices());
        }

        if (((indices != null && values == null) || (values == null && indices == null)) && valueKey != null) {
          model.setValue(List.this, valueKey, list.getSelectedValues());
        }
      } finally {
        processEvents = true;
      }
    }
View Full Code Here

Examples of org.beryl.gui.model.MapDataModel

      buttonGroup.add(button);

      button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          try {
            MapDataModel model = getDataModel();
            if (model != null && key != null) {
              model.setValue(ButtonGroup.this, key, radioButton.getValue());
            }
          } catch (GUIException ex) {
            throw new RuntimeException(ex);
          }
        }
View Full Code Here

Examples of org.beryl.gui.model.MapDataModel

  public void setColumnClasses(Class columnClasses[]) {
    this.columnClasses = columnClasses;
  }

  private void synchronizeDataModel() throws GUIException {
    MapDataModel model = getDataModel();
    if (model == null)
      return;

    if (indexKey != null) {
      int indices[] = table.getSelectedRows();
      for (int i = 0; i < indices.length; i++) {
        indices[i] = sorter.getRowForSortedRow(indices[i]);
      }
      model.setValue(Table.this, indexKey, indices);
    }

    if (valueKey != null) {
      int indices[] = table.getSelectedRows();
      TableRow rows[] = new TableRow[indices.length];
      for (int i = 0; i < indices.length; i++) {
        rows[i] = tableDataModel.getTableRow(sorter.getRowForSortedRow(indices[i]));
      }
      model.setValue(Table.this, valueKey, rows);
    }
  }
View Full Code Here

Examples of org.beryl.gui.model.MapDataModel

      }
    }
  }

  public void reload() throws GUIException {
    MapDataModel model = getDataModel();
    if (model != null) {
      try {
        processEvents = false;

        int[] indices = indexKey == null ? null : (int[]) model.getValue(indexKey);
        TableRow values[] = valueKey == null ? null : (TableRow[]) model.getValue(valueKey);

        if (indices != null) {
          setSelectionIndices(indices);
        } else if (values != null) {
          setSelectionValues(values);
        }

        if (((values != null && indices == null) || (values == null && indices == null)) && indexKey != null) {
          int indices2[] = table.getSelectedRows();
          for (int i = 0; i < indices2.length; i++) {
            indices2[i] = sorter.getRowForSortedRow(indices[i]);
          }
          model.setValue(Table.this, indexKey, indices);
        }

        if (((indices != null && values == null) || (values == null && indices == null)) && valueKey != null) {
          int indices2[] = table.getSelectedRows();
          TableRow rows[] = new TableRow[indices2.length];
          for (int i = 0; i < indices2.length; i++)
            rows[i] = tableDataModel.getTableRow(sorter.getRowForSortedRow(indices2[i]));
          model.setValue(Table.this, valueKey, rows);
        }
      } finally {
        processEvents = true;
      }
    }
View Full Code Here

Examples of org.beryl.gui.model.MapDataModel

    comboBox = new JComboBox();
    comboBox.setPreferredSize(new Dimension(MAX_WIDTH, DEFAULT_HEIGHT));
    comboBox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
          MapDataModel model = getDataModel();
          if (sendEvents && model != null) {
            try {
              sendEvents = false;
              processEvents = false;
              if (indexKey != null)
                model.setValue(ComboBox.this, indexKey, new Integer(comboBox.getSelectedIndex()));
              if (valueKey != null)
                model.setValue(ComboBox.this, valueKey, comboBox.getSelectedItem());
            } finally {
              sendEvents = true;
              processEvents = true;
            }
          }
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.