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


Java Channel.Type方法代码示例

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


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

示例1: addChannel

import chatty.gui.components.Channel; //导入方法依赖的package包/类
/**
 * Adds a channel with the given name. If the default channel is still there
 * it is used for this channel and renamed.
 * 
 * @param channelName
 * @param type
 * @return 
 */
public Channel addChannel(String channelName, Channel.Type type) {
    if (channels.get(channelName) != null) {
        return null;
    }
    Channel panel;
    if (defaultChannel != null) {
        // Reuse default channel
        panel = defaultChannel;
        defaultChannel = null;
        panel.setName(channelName);
        panel.setType(type);
        channelChanged();
    }
    else {
        // No default channel, so create a new one
        panel = createChannel(channelName, type);
        tabs.addTab(panel);
        if (type != Channel.Type.WHISPER) {
            tabs.setSelectedComponent(panel);
        }
    }
    channels.put(channelName, panel);
    return panel;
}
 
开发者ID:chatty,项目名称:chatty,代码行数:33,代码来源:Channels.java

示例2: createChannel

import chatty.gui.components.Channel; //导入方法依赖的package包/类
private Channel createChannel(String name, Channel.Type type) {
    Channel channel = new Channel(name,type,gui,styleManager, contextMenuListener);
    channel.setUserlistWidth(defaultUserlistWidth, minUserlistWidth);
    channel.setMouseClickedListener(mouseClickedListener);
    channel.setScrollbarAlways(chatScrollbarAlaways);
    channel.setUserlistEnabled(defaultUserlistVisibleState);
    channel.setOnceOffEditListener(onceOffEditListener);
    if (type == Channel.Type.SPECIAL || type == Channel.Type.WHISPER) {
        channel.setUserlistEnabled(false);
    }
    return channel;
}
 
开发者ID:chatty,项目名称:chatty,代码行数:13,代码来源:Channels.java

示例3: getTypeFromChannelName

import chatty.gui.components.Channel; //导入方法依赖的package包/类
public Channel.Type getTypeFromChannelName(String name) {
    if (name.startsWith("#")) {
        return Channel.Type.CHANNEL;
    } else if (name.startsWith("$")) {
        return Channel.Type.WHISPER;
    } else if (name.startsWith("*")) {
        return Channel.Type.SPECIAL;
    }
    return Channel.Type.NONE;
}
 
开发者ID:chatty,项目名称:chatty,代码行数:11,代码来源:Channels.java

示例4: getChannelOfType

import chatty.gui.components.Channel; //导入方法依赖的package包/类
public Channel getChannelOfType(String channel, Channel.Type type) {
    Channel panel = channels.get(channel);
    if (panel != null && panel.getType() == type) {
        return panel;
    }
    if (panel == null) {
        return addChannel(channel, type);
    }
    return null;
}
 
开发者ID:chatty,项目名称:chatty,代码行数:11,代码来源:Channels.java

示例5: getChannelsOfType

import chatty.gui.components.Channel; //导入方法依赖的package包/类
/**
 * A list of all channels, be it in the main window or in popouts.
 * 
 * @param type
 * @return The {@code List} of {@code Channel} objects
 */
public List<Channel> getChannelsOfType(Channel.Type type) {
    List<Channel> result = new ArrayList<>(getTabs(type));
    for (Channel c : channels.values()) {
        // Add channels that aren't on tabs (popouts)
        if ((type == null || c.getType() == type) && !result.contains(c)) {
            result.add(c);
        }
    }
    return result;
}
 
开发者ID:chatty,项目名称:chatty,代码行数:17,代码来源:Channels.java

示例6: getTabs

import chatty.gui.components.Channel; //导入方法依赖的package包/类
public Collection<Channel> getTabs(Channel.Type type) {
    List<Channel> result = new ArrayList<>();
    for (Component comp : tabs.getAllComponents()) {
        Channel chan = (Channel)comp;
        if ((type == null || chan.getType() == type)
                && channels.containsValue(chan) || chan == defaultChannel) {
            result.add((Channel)comp);
        }
    }
    return result;
}
 
开发者ID:chatty,项目名称:chatty,代码行数:12,代码来源:Channels.java

示例7: getChannel

import chatty.gui.components.Channel; //导入方法依赖的package包/类
/**
 * Gets the Channel object for the given channel name. If none exists, the
 * channel is automatically added.
 * 
 * @param channel
 * @param type
 * @return 
 */
public Channel getChannel(String channel, Channel.Type type) {
    Channel panel = channels.get(channel);
    if (panel == null) {
        panel = addChannel(channel, type);
    }
    return panel;
}
 
开发者ID:chatty,项目名称:chatty,代码行数:16,代码来源:Channels.java


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