📄 config.java
字号:
temp.addAll(componentMap.get(other)); } list.add(other); } set.removeAll(list); set.addAll(temp); } } this.setSnapWindow(plWindow, find); //更新EQ状态 me = this.getComponentName(eqWindow); list.clear(); list.add(me); set = componentMap.get(me); find = false; out: while (true) { if (set.size() == 0) { break out; } else { Set<String> temp = new HashSet<String>(); for (String other : set) { log.log(Level.FINEST, "me=" + me + ",other=" + other); if (other.equals(MAIN_WINDOW)) { find = true; break out; } else if (!list.contains(other)) { temp.addAll(componentMap.get(other)); } list.add(other); } set.removeAll(list); set.addAll(temp); } } this.setSnapWindow(eqWindow, find); } public void setIsSnapLrcWindow(boolean isSnapLrcWindow) { this.isSnapLrcWindow = isSnapLrcWindow; } public boolean isSnapPlWindow() { return isSnapPlWindow; } public void setIsSnapPlWindow(boolean isSnapPlWindow) { this.isSnapPlWindow = isSnapPlWindow; } public int[] getLastEqualizer() { return lastEqualizer; }// public String getTagInfoPolicy() {// return tagInfoPolicy;// }//// public void setTagInfoPolicy(String tag) {// this.tagInfoPolicy = tag;// } public int getXLocation() { return xLocation; } public int getYLocation() { return yLocation; } public String getAudioDevice() { return audioDevice; } public String getCurrentFileOrUrl() { return currentFileOrUrl; } public boolean isEqualizerOn() { return equalizerOn; } public static boolean load() { ObjectInputStream ois = null; try { if (!HOME.exists()) { HOME.mkdirs(); } ois = new ObjectInputStream(new FileInputStream(new File(Config.HOME, NAME + ".dat"))); config = (Config) ois.readObject(); log.log(Level.INFO, Config.getResource("SongInfoDialog.loadConfigSuccess")); return true; } catch (Exception ex) { log.log(Level.SEVERE, Config.getResource("SongInfoDialog.loadConfigFailure")); return false; } finally { try { config.isLinux = System.getProperty("os.name").startsWith("Linux"); ois.close(); } catch (Exception ex) { } } } public static boolean load(String initConfig) { ObjectInputStream ois = null; try { ois = new ObjectInputStream(new FileInputStream(initConfig)); config = (Config) ois.readObject(); ois.close(); return true; } catch (Exception ex) { Logger.getLogger(Config.class.getName()).log(Level.SEVERE, null, ex); return false; } finally { try { ois.close(); } catch (Exception ex) { Logger.getLogger(Config.class.getName()).log(Level.SEVERE, null, ex); } } } public static void save(String path) { try { FileOutputStream fout = new FileOutputStream(new File(path)); ObjectOutputStream oos = new ObjectOutputStream(fout); oos.writeObject(config); oos.flush(); fout.close(); log.log(Level.INFO, Config.getResource("SongInfoDialog.saveConfigSuccess")); } catch (Exception exe) { exe.printStackTrace(); } } public static void save() { try { if (!Config.HOME.exists()) { Config.HOME.mkdirs(); } FileOutputStream fout = new FileOutputStream((new File(Config.HOME, NAME + ".dat"))); ObjectOutputStream oos = new ObjectOutputStream(fout); oos.writeObject(config); oos.flush(); fout.close(); log.log(Level.INFO, Config.getResource("SongInfoDialog.saveConfigSuccess")); } catch (Exception exe) { exe.printStackTrace(); } } public String getPlaylistFilename() { return null; } public void setCurrentFileOrUrl(String currentFileOrUrl) { this.currentFileOrUrl = currentFileOrUrl; } public int getGainValue() { return gainValue; } public void setEqualizerAuto(boolean b) { this.equalizerAuto = b; } public boolean isEqualizerAuto() { return equalizerAuto; } public void setEqualizerOn(boolean b) { this.equalizerOn = b; } public void setGainValue(int gainValue) { this.gainValue = gainValue; } public void setIconParent(ImageIcon jlguiIcon) { } public void setLastEqualizer(int[] gainValue) { this.lastEqualizer = gainValue; } public void setLocation(int x, int y) { this.xLocation = x; this.yLocation = y; } public String getPlayListFileName() { return playListFileName; } public void setPlayListFileName(String playListFileName) { this.playListFileName = playListFileName; } public int getPlayStrategy() { return playStrategy; } public void setPlayStrategy(int playStrategy) { this.playStrategy = playStrategy; } public static boolean startWithProtocol(String input) { boolean ret = false; if (input != null) { input = input.toLowerCase(); for (int i = 0; i < protocols.length; i++) { if (input.startsWith(protocols[i])) { ret = true; break; } } } return ret; } public boolean isRepeatEnabled() { return repeatEnabled; } public void setRepeatEnabled(boolean b) { repeatEnabled = b; } public boolean isShowEq() { return showEq; } public void setAudioDevice(String mixerName) { this.audioDevice = mixerName; } public void setPlaylistFilename(String string) { this.playListFileName = string; } public void setShowEq(boolean showEq) { this.showEq = showEq; } public boolean isShowLrc() { return showLrc; } public void setShowLrc(boolean showLrc) { this.showLrc = showLrc; } public boolean isShowPlayList() { return showPlayList; } public void setShowPlayList(boolean showPlayList) { this.showPlayList = showPlayList; } public static Config getInstance() { return config; } public String getExtensions() { return null; } public static String getResource(String key) { return rb.getString(key); } public int getRepeatStrategy() { return repeatStrategy; } public void setRepeatStrategy(int repeatStrategy) { this.repeatStrategy = repeatStrategy; } public boolean isAutoResize() { return autoResize; } public void setAutoResize(boolean autoResize) { this.autoResize = autoResize; } public int getLpState() { return lpState; } public void setLpState(int lpState) { this.lpState = lpState; } public Color getLyricBackground() { return lyricBackground; } public void setLyricBackground(Color BACK_GROUND) { this.lyricBackground = BACK_GROUND; } public Font getLyricFont() { return lyricFont; } public void setLyricFont(Font FONT) { this.lyricFont = FONT; } public Color getLyricForeground() { return lyricForeground; } public void setLyricForeground(Color FORE_GROUND) { this.lyricForeground = FORE_GROUND; } public Color getLyricHilight() { return lyricHilight; } public void setLyricHilight(Color HIGH_LIGHT) { this.lyricHilight = HIGH_LIGHT; } public int getH_SPACE() { return H_SPACE; } public void setH_SPACE(int H_SPACE) { this.H_SPACE = H_SPACE; } public int getRefreshInterval() { return refreshInterval; } public void setRefreshInterval(int REFRESH_INTERVAL) { this.refreshInterval = REFRESH_INTERVAL; } public int getV_SPACE() { return V_SPACE; } public void setTopParent(JFrame aThis) { this.topParent = aThis; } public JFrame getTopParent() { return topParent; } public void setV_SPACE(int V_SPACE) { this.V_SPACE = V_SPACE; } public void setVolume(int gainValue) { this.gainValue = gainValue; } public String getLastDir() { return lastDir; } private Config() { lastEqualizer = new int[10]; playlists = new Vector<PlayList>(); Arrays.fill(lastEqualizer, 50); componentMap = new HashMap<String, Set<String>>(); searchLyricDirs.add(saveLyricDir); } /** * 得到全局的单例的config对象 * @return */ public synchronized static Config getConfig() { return config; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -