⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.java

📁 一个J2EE 做的 网上图书销售管理系统
💻 JAVA
字号:
package javazoom.Util;
import java.io.*;
import java.util.*;

/**
 * This class implements Config feature.
 *
 * @author	E.B from JavaZOOM
 *
 * Homepage : http://www.javazoom.net
 *
 *-----------------------------------------------------------------------
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *----------------------------------------------------------------------
 */

/**
 * This class provides all parameters for jlGui coming from a file.
 */
public class Config
{
  private static Config	_instance = null;
  private String		_lastUrl = "http://66.9.50.199:8000/";
  private String		_defaultSkin = "skins/baseskin.wsz";
  private String		_playlist = "javazoom.jlGui.playlist.BasePlaylist";
  private String		_playlistFilename = "default.m3u";
  private String		_proxyServer = null;
  private String		_proxyLogin = null;
  private String		_proxyPassword = null;
  private int			_proxyPort = -1;


  private Config()
  {}

  /**
   * Returns Config instance.
   */
  public synchronized static Config getInstance()
  {
	  if (_instance == null)
	  {
		_instance = new Config();
	  }
	  return _instance;
  }

  /**
   * Returns playlist filename.
   */
  public String getPlaylistFilename()
  {
	  return _playlistFilename;
  }

  /**
   * Returns last URL.
   */
  public String getLastURL()
  {
	  return _lastUrl;
  }

  /**
   * Returns proxy server.
   */
  public String getProxyServer()
  {
	  return _proxyServer;
  }

  /**
   * Returns proxy port.
   */
  public int getProxyPort()
  {
	  return _proxyPort;
  }

  /**
   * Sets last URL.
   */
  public void setLastURL(String url)
  {
	  _lastUrl = url;
  }

  /**
   * Sets Proxy info.
   */
  public void setProxy(String url, int port, String login, String password)
  {
	  _proxyServer = url;
	  _proxyPort = port;
	  _proxyLogin = login;
	  _proxyPassword = password;
  }


  /**
   * Enables Proxy.
   */
  public boolean enableProxy()
  {
		if ((_proxyServer != null) && (!_proxyServer.equals("")))
		{
			System.getProperties().put( "proxySet", "true" );
            System.getProperties().put( "proxyHost", _proxyServer );
            System.getProperties().put( "proxyPort", ""+_proxyPort );
            return true;
		}
		else return false;
  }

  /**
   * Returns default skin.
   */
  public String getDefaultSkin()
  {
	  return _defaultSkin;
  }

  /**
   * Returns default skin.
   */
  public String getPlaylistClassName()
  {
	  return _playlist;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -