closed #304,#33,#302,#307,#301,#305
This commit is contained in:
@@ -2,14 +2,15 @@ package model;
|
||||
|
||||
import workers.FilesWorker;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
|
||||
public class SOMImage {
|
||||
|
||||
private static String name; // the filename
|
||||
|
||||
private final SOMConfig config = SOMConfig.getInstance();
|
||||
|
||||
private final File tmb; // thumbnail
|
||||
private final File prv; // preview
|
||||
private final File src; // source
|
||||
@@ -25,8 +26,7 @@ public class SOMImage {
|
||||
|
||||
File src = new File(FilesWorker.getSourcePath().toString() + "/" + name);
|
||||
|
||||
File prv = new File(FilesWorker.getPreviewPath().toString() + "/"
|
||||
+ name);
|
||||
File prv = new File(FilesWorker.getPreviewPath().toString() + "/" + name);
|
||||
|
||||
File tmb = new File(FilesWorker.getThumbPath().toString() + "/" + name);
|
||||
|
||||
@@ -153,23 +153,23 @@ public class SOMImage {
|
||||
* @param type 0 = thumb, 1 = preview, 2 = full Size
|
||||
* @return
|
||||
*/
|
||||
public ImageIcon toImageIcon(int type) {
|
||||
File imagepath;
|
||||
switch (type) {
|
||||
case 0:
|
||||
imagepath = getTmb();
|
||||
break;
|
||||
case 1:
|
||||
imagepath = getPrv();
|
||||
break;
|
||||
case 2:
|
||||
imagepath = getSrc();
|
||||
break;
|
||||
default:
|
||||
imagepath = null;
|
||||
break;
|
||||
}
|
||||
|
||||
return new ImageIcon(imagepath.getPath());
|
||||
}
|
||||
// public ImageIcon toImageIcon(int type) {
|
||||
// File imagepath;
|
||||
// switch (type) {
|
||||
// case 0:
|
||||
// imagepath = getTmb();
|
||||
// break;
|
||||
// case 1:
|
||||
// imagepath = getPrv();
|
||||
// break;
|
||||
// case 2:
|
||||
// imagepath = getSrc();
|
||||
// break;
|
||||
// default:
|
||||
// imagepath = null;
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// return new ImageIcon(imagepath.getPath());
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user