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


Java Settings类代码示例

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


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

示例1: TwitchConnection

import chatty.util.settings.Settings; //导入依赖的package包/类
public TwitchConnection(final ConnectionListener listener, Settings settings,
        String label) {
    irc = new IrcConnection(label);
    this.listener = listener;
    this.settings = settings;
    this.twitchCommands = new TwitchCommands(this);
    spamProtection = new SpamProtection();
    spamProtection.setLinesPerSeconds(settings.getString("spamProtection"));
    users.setCapitalizedNames(settings.getBoolean("capitalizedNames"));
    users.addListener(new UserManager.UserManagerListener() {

        @Override
        public void userUpdated(User user) {
            if (user.isOnline()) {
                listener.onUserUpdated(user);
            }
        }
    });
}
 
开发者ID:chatty,项目名称:chatty,代码行数:20,代码来源:TwitchConnection.java

示例2: ChatLog

import chatty.util.settings.Settings; //导入依赖的package包/类
public ChatLog(Settings settings) {
    this.settings = settings;

    Path path = getPath();
    if (path == null) {
        log = null;
    } else {
        String logSplit = settings.getString("logSplit");
        boolean logSubdirectories = settings.getBoolean("logSubdirectories");
        boolean lockFiles = settings.getBoolean("logLockFiles");
        this.log = new LogManager(path, logSplit, logSubdirectories, lockFiles);
    }
    compactForChannels = new HashMap<>();
    try {
        String timestamp = settings.getString("logTimestamp");
        if (!timestamp.equals("off")) {
            sdf = new SimpleDateFormat(timestamp+" ");
        }
    } catch (IllegalArgumentException ex) {
        sdf = null;
    }
}
 
开发者ID:chatty,项目名称:chatty,代码行数:23,代码来源:ChatLog.java

示例3: copyMessage

import chatty.util.settings.Settings; //导入依赖的package包/类
public static void copyMessage(Settings settings, User user, String message,
        boolean highlighted) {
    if (!settings.getBoolean("cmEnabled")) {
        return;
    }
    if (settings.getBoolean("cmHighlightedOnly") && !highlighted) {
        return;
    }
    String channel = settings.getString("cmChannel");
    if (!channel.trim().isEmpty() && !channel.equalsIgnoreCase(user.getChannel())) {
        return;
    }
    String text = settings.getString("cmTemplate");
    text = text.replaceFirst("\\{user\\}", user.getDisplayNick());
    text = text.replaceFirst("\\{message\\}", message);
    MiscUtil.copyToClipboard(text);
}
 
开发者ID:chatty,项目名称:chatty,代码行数:18,代码来源:CopyMessages.java

示例4: ChatLog

import chatty.util.settings.Settings; //导入依赖的package包/类
public ChatLog(Settings settings) {
    this.settings = settings;
    
    Path path = getPath();
    if (path == null) {
        log = null;
    } else {
        this.log = new LogManager(path);
    }
    compactForChannels = new HashMap<>();
    try {
        String timestamp = settings.getString("logTimestamp");
        if (!timestamp.equals("off")) {
            sdf = new SimpleDateFormat(timestamp+" ");
        }
    } catch (IllegalArgumentException ex) {
        sdf = null;
    }
}
 
开发者ID:partouf,项目名称:Chatty-Twitch-Client,代码行数:20,代码来源:ChatLog.java

示例5: CustomNames

import chatty.util.settings.Settings; //导入依赖的package包/类
public CustomNames(Settings settings) {
    this.settings = settings;
    settings.addSettingChangeListener(new SettingChangeListener() {

        @Override
        public void settingChanged(String setting, int type, Object value) {
            if (setting.equals(SETTING_NAME)) {
                informListenersAllChanged();
            }
        }
    });
}
 
开发者ID:chatty,项目名称:chatty,代码行数:13,代码来源:CustomNames.java

示例6: aboutToSaveSettings

import chatty.util.settings.Settings; //导入依赖的package包/类
@Override
public void aboutToSaveSettings(Settings settings) {
    Collection<String> openChans;
    if (SwingUtilities.isEventDispatchThread()) {
        openChans = g.getOpenChannels();
    } else {
        openChans = c.getOpenChannels();
    }
    settings.setString("previousChannel", Helper.buildStreamsString(openChans));
    EmoticonSizeCache.saveToFile();
}
 
开发者ID:chatty,项目名称:chatty,代码行数:12,代码来源:TwitchClient.java

示例7: loadFavoritesFromSettings

import chatty.util.settings.Settings; //导入依赖的package包/类
/**
 * Loads the favorites from the settings.
 * 
 * @param settings The Settings object
 */
public void loadFavoritesFromSettings(Settings settings) {
    List<List> entriesToLoad = settings.getList("favoriteEmotes");
    favoritesNotFound.clear();
    favorites.clear();
    for (List item : entriesToLoad) {
        Favorite f = listToFavorite(item);
        if (f != null) {
            favoritesNotFound.put(f.code, f);
        }
    }
    loadedFavoritesFromSettings = true;
}
 
开发者ID:chatty,项目名称:chatty,代码行数:18,代码来源:EmoticonFavorites.java

示例8: saveFavoritesToSettings

import chatty.util.settings.Settings; //导入依赖的package包/类
/**
 * Saves the favorites to the settings, discarding any favorites that
 * haven't been found several times already.
 * 
 * @param settings The Settings object
 */
public void saveFavoritesToSettings(Settings settings) {
    if (!loadedFavoritesFromSettings) {
        LOGGER.warning("Not saving favorite emotes, because they don't seem to have been loaded in the first place.");
        return;
    }
    List<List> entriesToSave = new ArrayList<>();
    for (Favorite f : favorites.keySet()) {
        entriesToSave.add(favoriteToList(f));
    }
    settings.putList("favoriteEmotes", entriesToSave);
}
 
开发者ID:chatty,项目名称:chatty,代码行数:18,代码来源:EmoticonFavorites.java

示例9: loadFromSettings

import chatty.util.settings.Settings; //导入依赖的package包/类
/**
 * Removes all current hotkeys and loads the data from the settings.
 * 
 * @param settings 
 */
public synchronized void loadFromSettings(Settings settings) {
    this.settings = settings;
    List<List> loadFrom = settings.getList(SETTING_NAME);
    hotkeys.clear();
    for (List l : loadFrom) {
        Hotkey entry = listToHotkey(l);
        if (entry != null) {
            hotkeys.add(entry);
        }
    }
    updateHotkeys();
    checkGlobalHotkeyWarning();
}
 
开发者ID:chatty,项目名称:chatty,代码行数:19,代码来源:HotkeyManager.java

示例10: BotNameManager

import chatty.util.settings.Settings; //导入依赖的package包/类
public BotNameManager(Settings settings) {
    if (settings != null) {
        for (Object name : settings.getList("botNames")) {
            addBotName(null, (String)name);
        }
    }
}
 
开发者ID:chatty,项目名称:chatty,代码行数:8,代码来源:BotNameManager.java

示例11: NotificationManager

import chatty.util.settings.Settings; //导入依赖的package包/类
public NotificationManager(MainGui main,
        Settings settings) {
    this.settings = settings;
    this.main = main;
    loadFromSettings();
    settings.addSettingChangeListener((s, t, v) -> {
        if (s.equals(SETTING_NAME)) {
            loadFromSettings();
        }
    });
}
 
开发者ID:chatty,项目名称:chatty,代码行数:12,代码来源:NotificationManager.java

示例12: aboutToSaveSettings

import chatty.util.settings.Settings; //导入依赖的package包/类
@Override
public void aboutToSaveSettings(Settings settings) {
    if (SwingUtilities.isEventDispatchThread()) {
        System.out.println("Saving GUI settings.");
        client.settings.setLong("favoritesSorting", favoritesDialog.getSorting());
        emoticons.saveFavoritesToSettings(settings);
        client.settings.setString("statusHistorySorting", adminDialog.getStatusHistorySorting());
    }
}
 
开发者ID:chatty,项目名称:chatty,代码行数:10,代码来源:MainGui.java

示例13: UsercolorManager

import chatty.util.settings.Settings; //导入依赖的package包/类
public UsercolorManager(Settings settings) {
        this.settings = settings;
        loadFromSettings();
        // TEST
//        data = new ArrayList<>();
//        for (int i=0;i<10000;i++) {
//            data.add(new UsercolorItem("user"+i, Color.BLACK));
//        }
    }
 
开发者ID:chatty,项目名称:chatty,代码行数:10,代码来源:UsercolorManager.java

示例14: NotificationEditor

import chatty.util.settings.Settings; //导入依赖的package包/类
public NotificationEditor(JDialog owner, Settings settings) {
    super(SORTING_MODE_MANUAL, false);
    
    editor = new MyItemEditor(owner, settings);
    
    setModel(new MyTableModel());
    setItemEditor(editor);
    setRendererForColumn(0, new MyRenderer());
    setRendererForColumn(1, new MyRenderer());
    setRendererForColumn(2, new MyRenderer());
}
 
开发者ID:chatty,项目名称:chatty,代码行数:12,代码来源:NotificationEditor.java

示例15: setUpClass

import chatty.util.settings.Settings; //导入依赖的package包/类
@BeforeClass
public static void setUpClass() {
    highlighter = new Highlighter();
    Settings settings = new Settings("");
    settings.addBoolean("abSaveOnChange", false);
    ab = new Addressbook(null, null, settings);
    user.setAddressbook(ab);
    user2.setAddressbook(ab);
    ab.add("testUser", "testCat");
}
 
开发者ID:chatty,项目名称:chatty,代码行数:11,代码来源:HighlighterTest.java


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