|
|
|
@ -28,13 +28,13 @@ public class Document {
|
|
|
|
|
//写一个方法判断是 A3 还是 A4
|
|
|
|
|
|
|
|
|
|
public Boolean isA3() {
|
|
|
|
|
if(rollModel.equals("16mm规格")){
|
|
|
|
|
if (rollModel.equals("16mm规格")) {
|
|
|
|
|
if (width / dpi > Integer.parseInt(Config.getParam("a4.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a4.length"))) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
if (width / dpi > Integer.parseInt(Config.getParam("a0.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a0.length"))) {
|
|
|
|
|
return true;
|
|
|
|
@ -45,43 +45,43 @@ public class Document {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String toSize(){
|
|
|
|
|
if(width / dpi > Integer.parseInt(Config.getParam("a4.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a4.length"))){
|
|
|
|
|
return "A3";
|
|
|
|
|
}else if(width / dpi > Integer.parseInt(Config.getParam("a3.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a3.length"))){
|
|
|
|
|
public String toSize() {
|
|
|
|
|
if (width / dpi > Integer.parseInt(Config.getParam("a3.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a3.length"))) {
|
|
|
|
|
return "A3以上";
|
|
|
|
|
}else {
|
|
|
|
|
} else if (width / dpi > Integer.parseInt(Config.getParam("a4.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a4.length"))) {
|
|
|
|
|
return "A3";
|
|
|
|
|
} else {
|
|
|
|
|
return "A4";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Double useStore(){
|
|
|
|
|
if(width / dpi > Integer.parseInt(Config.getParam("a4.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a4.length"))){
|
|
|
|
|
return 2d;
|
|
|
|
|
}else if(width / dpi > Integer.parseInt(Config.getParam("a3.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a3.length"))){
|
|
|
|
|
public Double useStore() {
|
|
|
|
|
if (width / dpi > Integer.parseInt(Config.getParam("a3.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a3.length"))) {
|
|
|
|
|
return 4.2d;
|
|
|
|
|
}else {
|
|
|
|
|
} else if (width / dpi > Integer.parseInt(Config.getParam("a4.width"))
|
|
|
|
|
|| longTh / dpi > Integer.parseInt(Config.getParam("a4.length"))) {
|
|
|
|
|
return 2d;
|
|
|
|
|
} else {
|
|
|
|
|
return 1d;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Document(Integer width, Integer longTh, Integer dpi, String name,String rollModel) {
|
|
|
|
|
public Document(Integer width, Integer longTh, Integer dpi, String name, String rollModel) {
|
|
|
|
|
this.width = width;
|
|
|
|
|
this.longTh = longTh;
|
|
|
|
|
this.dpi = dpi;
|
|
|
|
|
this.name = name;
|
|
|
|
|
|
|
|
|
|
if(this.dpi==-1){
|
|
|
|
|
if (this.dpi == -1) {
|
|
|
|
|
this.dpi = 300;
|
|
|
|
|
}
|
|
|
|
|
this.rollModel = rollModel;
|
|
|
|
|
if(rollModel==null){
|
|
|
|
|
if (rollModel == null) {
|
|
|
|
|
this.rollModel = "16mm规格";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|