public ChildrenListField() {
    super();
    Font defaultFont = Font.getDefault();
    titleFont = defaultFont.derive(Font.PLAIN, 3, Ui.UNITS_mm);
    rowFont = defaultFont.derive(Font.PLAIN, 3, Ui.UNITS_mm);

    screenWidth = Display.getWidth();
    firstRowPosition = (screenWidth) - (screenWidth - 4 - ((titleFont.getHeight() * 4) - 4));
    secondRowPosition = firstRowPosition + 20;
  }
예제 #2
0
  public AuctionCreateScreen(Card card, Bitmap cardthumb) {
    super(null);
    add(new ColorLabelField(""));
    this.card = card;
    SettingsBean _instance = SettingsBean.getSettings();
    _instance.created = false;
    SettingsBean.saveSettings(_instance);
    Font _font = getFont();
    _font = _font.derive(Const.TYPE, Const.FONT);
    setFont(_font);

    bgManager.setStatusHeight(exit.getContentHeight());

    exit.setChangeListener(this);
    auction.setChangeListener(this);

    // cardfield = new CardField(card, cardthumb);
    cardfield = new ThumbnailField(card);
    // add(cardfield);
    add(cardfield);
    add(lblOpeningBid);
    int val = 0;
    try {
      val = Integer.parseInt(card.getValue());
    } catch (Exception e) {
      val = 0;
    }
    openingBid.setText("" + val);
    buyNowPrice.setText("" + (2 * val));
    auctionDuration.setText("5");

    add(openingBid);
    add(lblBuyNowPrice);
    add(buyNowPrice);
    add(lblAuctionDuration);
    add(auctionDuration);

    addButton(auction);
    addButton(empty);
    addButton(exit);

    invalidate();
    setDisplaying(true);
  }
예제 #3
0
 /**
  * Create a LabelField that spans the entire width of the container with gray text and a single
  * pixel gray border at the bottom.
  *
  * @param title
  * @return
  */
 public static LabelField createGroupLabel(String title) {
   LabelField titleField =
       new LabelField(title, LabelField.USE_ALL_WIDTH) {
         protected void paint(Graphics graphics) {
           graphics.setColor(COLOR_GROUP_LABEL_FOREGROUND);
           super.paint(graphics);
         }
       };
   Font font = titleField.getFont();
   titleField.setFont(font.derive(Font.BOLD, font.getHeight() - 3));
   titleField.setPadding(new XYEdges(0, 0, 4, 0));
   titleField.setBorder(
       BorderFactory.createSimpleBorder(
           new XYEdges(0, 0, 1, 0),
           new XYEdges(0, 0, COLOR_GROUP_LABEL_BORDER, 0),
           Border.STYLE_SOLID));
   titleField.setMargin(new XYEdges(0, 0, 4, 0));
   return titleField;
 }