• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java NullField类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中net.rim.device.api.ui.component.NullField的典型用法代码示例。如果您正苦于以下问题:Java NullField类的具体用法?Java NullField怎么用?Java NullField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

NullField类属于net.rim.device.api.ui.component包,在下文中一共展示了NullField类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: display

点赞 2

import net.rim.device.api.ui.component.NullField; //导入依赖的package包/类
public void display(int relations) {
    root.deleteAll();
    screen.deleteAll();

    screen.setBanner(title);

    root.add(new NullField());
    root.add(image);

    RichVector visibleFields = new RichVector();

    addToFriends.setFixedWidth(-1);
    rejectRequest.setFixedWidth(-1);
    cancelRequest.setFixedWidth(-1);
    sendMessage.setFixedWidth(-1);
    deleteFriend.setFixedWidth(-1);

    if (relations == UserScreen.RELATIONS_FRIENDSHIP) {
        visibleFields.addElement(sendMessage);
        root.add(sendMessage);
        visibleFields.addElement(deleteFriend);
        root.add(deleteFriend);
    } else if (relations == UserScreen.RELATIONS_NONE) {
        visibleFields.addElement(addToFriends);
        root.add(addToFriends);
    } else if (relations == UserScreen.RELATIONS_NONE) {
        visibleFields.addElement(addToFriends);
        root.add(addToFriends);
        visibleFields.addElement(rejectRequest);
        root.add(rejectRequest);
    } else if (relations == UserScreen.RELATIONS_OUTCOMING_REQUEST) {
        visibleFields.addElement(cancelRequest);
        root.add(cancelRequest);
    }

    int max = 0;
    for (int i = 0; i < visibleFields.size(); ++i) {
        max = Math.max(max, ((Field) visibleFields.elementAt(i)).getPreferredWidth());
    }

    for (int i = 0; i < visibleFields.size(); ++i) {
        Object o = visibleFields.elementAt(i);
        if (o instanceof ButtonField) {
            ((ButtonField) o).setFixedWidth(max);
        } else if (o instanceof MultiFontButtonField) {
            ((MultiFontButtonField) o).setFixedWidth(max);
        }
    }

    addToFriends.setChangeListener(null);
    rejectRequest.setChangeListener(null);
    cancelRequest.setChangeListener(null);
    sendMessage.setChangeListener(null);
    deleteFriend.setChangeListener(null);
    image.setChangeListener(null);

    addToFriends.setChangeListener(screen);
    rejectRequest.setChangeListener(screen);
    cancelRequest.setChangeListener(screen);
    sendMessage.setChangeListener(screen);
    deleteFriend.setChangeListener(screen);
    image.setChangeListener(screen);

    screen.add(root);
}
 

开发者ID:yanex,
项目名称:vika,
代码行数:66,
代码来源:UserScreenGui.java

示例2: set

点赞 2

import net.rim.device.api.ui.component.NullField; //导入依赖的package包/类
public void set(User u) {
    this.user = u;
    rfm.deleteAll();

    rfm.setMargin(VkConversationTitleField.px(2), VkConversationTitleField.px(2),
            VkConversationTitleField.px(2),
            VkConversationTitleField.px(2));

    if (userField == null) {
        userField = new VkConversationUserField(Field.FIELD_LEFT);
        userField.setMargin(VkConversationTitleField.px(2), VkConversationTitleField.px(2),
                VkConversationTitleField.px(2), VkConversationTitleField.px(4));
    }

    userField.setName(user.getFullName());

    String caption = null;
    if (user.isOnline()) {
        caption = "online";
    } else {
        if (user.getLastSeen() == 0) {
            userField.setStatus("");
        } else {
            String was = VkMainScreen.tr(VikaResource.wasm);
            if (!user.isMale()) {
                was = VkMainScreen.tr(VikaResource.wasf);
            }
            userField.setStatus(was + " " + VkMainScreen.tr(VikaResource.in_network) + " "
                    + textTime(user.getLastSeen()));
        }
    }

    userField.setStatus(caption);

    if (photo == null) {
        photo = new AutoLoadingBitmapField(new XYDimension(DP12, DP12),
                Field.FIELD_RIGHT, true);
        photo.setURL(u.getPhotoURL());
        photo.setMargin(VkConversationTitleField.px(2), 0, VkConversationTitleField.px(2),
                VkConversationTitleField.px(2));
    }

    rfm.add(userField);
    rfm.add(new NullField());
    animationManager.add(animation);
    rfm.add(animationManager);
    rfm.add(photo);
}
 

开发者ID:yanex,
项目名称:vika,
代码行数:49,
代码来源:VkConversationTitleField.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)