当前位置: 首页>>代码示例>>Java>>正文


Java ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH属性代码示例

本文整理汇总了Java中org.bukkit.util.ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH属性的典型用法代码示例。如果您正苦于以下问题:Java ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH属性的具体用法?Java ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH怎么用?Java ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.util.ChatPaginator的用法示例。


在下文中一共展示了ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: appendCenteredText

public ImageMessage appendCenteredText(String... text) {
    for (int y = 0; y < lines.length; y++) {
        if (text.length > y) {
            int len = ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH - lines[y].length();
            lines[y] = lines[y] + center(text[y], len);
        } else {
            return this;
        }
    }
    return this;
}
 
开发者ID:crazyhorse961,项目名称:NationZ,代码行数:11,代码来源:ImageMessage.java

示例2: ChatPage

/**
 * Instantiates a new chat page.
 *
 * @param header the header
 * @param text the text
 * @param sender the sender
 * @param param the param
 * @throws FactoidCommandException the factoid command exception
 */
public ChatPage(String header, String text, CommandSender sender, String param) throws FactoidCommandException {

    pageHeight = ChatPaginator.CLOSED_CHAT_PAGE_HEIGHT - 2;
    pageWidth = ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH;
    this.header = header;
    this.text = text;
    this.sender = sender;
    this.param = param;
}
 
开发者ID:Tabinol,项目名称:Factoid,代码行数:18,代码来源:ChatPage.java

示例3: getPosToWriteCentered

/**
 * Get number of space to add to center the
 * given text
 *
 * @param text Base text
 *
 * @return Number of space
 */
public static int getPosToWriteCentered(String text)
{
    return (ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH / 2) - (text.length() / 2);
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:12,代码来源:ChatUtils.java


注:本文中的org.bukkit.util.ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。