本文整理汇总了Java中net.fs.utils.Tools类的典型用法代码示例。如果您正苦于以下问题:Java Tools类的具体用法?Java Tools怎么用?Java Tools使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Tools类属于net.fs.utils包,在下文中一共展示了Tools类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setSpeed
import net.fs.utils.Tools; //导入依赖的package包/类
void setSpeed(int downloadSpeed, int uploadSpeed) {
config.setDownloadSpeed(downloadSpeed);
config.setUploadSpeed(uploadSpeed);
int s1 = (int) ((float) downloadSpeed * 1.1f);
text_ds.setText(" " + Tools.getSizeStringKB(s1) + "/s ");
int s2 = (int) ((float) uploadSpeed * 1.1f);
text_us.setText(" " + Tools.getSizeStringKB(s2) + "/s ");
Route.localDownloadSpeed = downloadSpeed;
Route.localUploadSpeed = config.uploadSpeed;
saveConfig();
}
开发者ID:breakEval13,项目名称:NSS,代码行数:13,代码来源:ClientUI.java
示例2: updateUISpeed
import net.fs.utils.Tools; //导入依赖的package包/类
public void updateUISpeed(int conn, int downloadSpeed, int uploadSpeed) {
String string =
" 下载:" + Tools.getSizeStringKB(downloadSpeed) + "/s"
+ " 上传:" + Tools.getSizeStringKB(uploadSpeed) + "/s";
if (downloadSpeedField != null) {
downloadSpeedField.setText(string);
}
}
开发者ID:breakEval13,项目名称:NSS,代码行数:9,代码来源:ClientUI.java
示例3: checkUpdate
import net.fs.utils.Tools; //导入依赖的package包/类
public void checkUpdate() {
for (int i = 0; i < 3; i++) {
checkingUpdate = true;
try {
Properties propServer = new Properties();
HttpURLConnection uc = Tools.getConnection(updateUrl);
uc.setUseCaches(false);
InputStream in = uc.getInputStream();
propServer.load(in);
serverVersion = Integer.parseInt(propServer.getProperty("version"));
break;
} catch (Exception e) {
e.printStackTrace();
try {
Thread.sleep(3 * 1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
} finally {
checkingUpdate = false;
}
}
if (this.haveNewVersion()) {
int option = JOptionPane.showConfirmDialog(mainFrame, "发现新版本,立即更新吗?", "提醒", JOptionPane.WARNING_MESSAGE);
if (option == JOptionPane.YES_OPTION) {
openUrl(homeUrl);
}
}
}
开发者ID:jonasxiao,项目名称:FinalSpeed,代码行数:31,代码来源:ClientUI.java
示例4: setSpeed
import net.fs.utils.Tools; //导入依赖的package包/类
void setSpeed(int downloadSpeed, int uploadSpeed) {
config.setDownloadSpeed(downloadSpeed);
config.setUploadSpeed(uploadSpeed);
int s1 = (int) ((float) downloadSpeed * 1.1f);
text_ds.setText(" " + Tools.getSizeStringKB(s1) + "/s ");
int s2 = (int) ((float) uploadSpeed * 1.1f);
text_us.setText(" " + Tools.getSizeStringKB(s2) + "/s ");
Route.localDownloadSpeed = downloadSpeed;
Route.localUploadSpeed = config.uploadSpeed;
saveConfig();
}
开发者ID:RCD-Y,项目名称:FinalSpeed-X,代码行数:13,代码来源:ClientUI.java
示例5: updateUISpeed
import net.fs.utils.Tools; //导入依赖的package包/类
public void updateUISpeed(int conn, int downloadSpeed, int uploadSpeed) {
String string = lang.g(12) + Tools.getSizeStringKB(downloadSpeed) + "/s"
+ " "+lang.g(13) + Tools.getSizeStringKB(uploadSpeed) + "/s";
if (downloadSpeedField != null) {
downloadSpeedField.setText(string);
}
}
开发者ID:RCD-Y,项目名称:FinalSpeed-X,代码行数:8,代码来源:ClientUI.java
示例6: checkUpdate
import net.fs.utils.Tools; //导入依赖的package包/类
public void checkUpdate() {
System.out.println("Checking Updates...");
for (int i = 0; i < 3; i++) {
checkingUpdate = true;
try {
Properties propServer = new Properties();
HttpURLConnection uc = Tools.getConnection(updateUrl);
uc.setUseCaches(false);
InputStream in = uc.getInputStream();
propServer.load(in);
serverVersion = Integer.parseInt(propServer
.getProperty("version"));
break;
} catch (Exception e) {
e.printStackTrace();
try {
Thread.sleep(3 * 1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
} finally {
checkingUpdate = false;
}
}
if (this.haveNewVersion()) {
int option = JOptionPane.showConfirmDialog(mainFrame,
lang.g(34), lang.g(9),
JOptionPane.WARNING_MESSAGE);
if (option == JOptionPane.YES_OPTION) {
openUrl(homeUrl);
}
}
}
开发者ID:RCD-Y,项目名称:FinalSpeed-X,代码行数:35,代码来源:ClientUI.java
示例7: checkUpdate
import net.fs.utils.Tools; //导入依赖的package包/类
public void checkUpdate() {
for (int i = 0; i < 3; i++) {
checkingUpdate = true;
try {
Properties propServer = new Properties();
HttpURLConnection uc = Tools.getConnection(updateUrl);
uc.setUseCaches(false);
InputStream in = uc.getInputStream();
propServer.load(in);
serverVersion = Integer.parseInt(propServer.getProperty("version"));
break;
} catch (Exception e) {
e.printStackTrace();
try {
Thread.sleep(3 * 1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
} finally {
checkingUpdate = false;
}
}
if (this.haveNewVersion()) {
int option = JOptionPane.showConfirmDialog(mainFrame, "发现新版本,立即更新吗?", "提醒", JOptionPane
.YES_NO_CANCEL_OPTION);
if (option == JOptionPane.YES_OPTION) {
openUrl(homeUrl);
}
}
}
开发者ID:Bpazy,项目名称:finalspeed,代码行数:32,代码来源:ClientUI.java
注:本文中的net.fs.utils.Tools类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论