當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。