closed #304,#33,#302,#307,#301,#305

This commit is contained in:
2017-01-23 18:27:08 +01:00
parent 880b87edff
commit 46034c1a04
10 changed files with 106 additions and 40 deletions
+22 -22
View File
@@ -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());
// }
}