продолжение рефакторинга и проверка на занятость файлов
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package Common.Utils;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Utils.Utils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Arrays;
|
||||
import java.util.Vector;
|
||||
@@ -281,7 +285,27 @@ public class CommonUtils {
|
||||
public static double getFileSizeMegaBytes(File file) {
|
||||
return ((double)file.length()) / (1024 * 1024);
|
||||
}
|
||||
//Иконки
|
||||
public static ImageIcon getIcon(String path) {
|
||||
URL imageUrl = CommonUtils.class.getResource(path);
|
||||
if (imageUrl == null) {
|
||||
return null;
|
||||
}
|
||||
return new ImageIcon(imageUrl);
|
||||
}
|
||||
public static ImageIcon getTabIcon(String path) {
|
||||
URL imageUrl = CommonUtils.class.getResource(path);
|
||||
if (imageUrl == null) {
|
||||
return null;
|
||||
}
|
||||
ImageIcon icon = new ImageIcon(imageUrl);
|
||||
return new ImageIcon(icon.getImage().getScaledInstance(
|
||||
18,
|
||||
18,
|
||||
Image.SCALE_DEFAULT));
|
||||
}
|
||||
//-
|
||||
//ГЕНЕРАЦИЯ ИМЕН
|
||||
//ГЕНЕРАЦИЯ ИМЕН Старт задачи
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user