?? jobdetailtablemodel.java
字號:
package jp.co.ntl.swing.ext.spooler;
import java.sql.Timestamp;
///import java.util.Vector;
import jp.co.ntl.Util;
import jp.co.ntl.preference.PreferenceInfo;
import jp.co.ntl.spooler.SpoolerInfo;
///import jp.co.ntl.paper.PaperInfo;
public class JobDetailTableModel extends JobDetailTableModelBase {
/**
*
*/
private static final long serialVersionUID = 1L;
public static final int MAX_ROW = 11;
public static final int ROW_JOBID = 0;
public static final int ROW_JOB = 1;
public static final int ROW_STATUS = 2;
public static final int ROW_SPSERIAL = 3;
public static final int ROW_USER = 4;
public static final int ROW_COPY = 5;
public static final int ROW_PAPERSIZE = 6;
public static final int ROW_PAGE = 7;
public static final int ROW_SIZE = 8;
public static final int ROW_DATE = 9;
public static final int ROW_PRINTER = 10;
public JobDetailTableModel(SpoolerInfo spoolerInfo, String language) {
super(spoolerInfo, language);
columnItem = "";
columnValue = "";
columnNames = new String[] { columnItem, columnValue };
fireTableDataChanged();
}
public int getRowCount() {
if (spoolerInfo == null) {
return 0;
}
return MAX_ROW;
}
public Object getValueAt(int row, int column) {
double paperWidth, paperLength;
if (spoolerInfo == null) {
return null;
}
if (row >= MAX_ROW) {
return null;
}
if (column >= columnNames.length) {
return null;
}
if (row == ROW_JOBID) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_JOBID);
case 1:
return spoolerInfo.getJobID();
}
} else if (row == ROW_JOB) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_JOB);
case 1:
return spoolerInfo.getJob();
}
} else if (row == ROW_STATUS) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_STATUS);
case 1:
// 2006.10.10 報嶞儃僞儞墴壓僼儕僢僋懳墳 lium mod start
//return Util.getStatusString(language, spoolerInfo.getStatus(), spoolerInfo.getError());
int status = spoolerInfo.getStatus();
if (spoolerInfo.getQueType() == SpoolerInfo.PRINTING_QUEUE &&
status == SpoolerInfo.SC_SPOOL_END) {
status = SpoolerInfo.SC_PRINT;
}
return Util.getStatusString(language, status, spoolerInfo.getError());
// 2006.10.10 報嶞儃僞儞墴壓僼儕僢僋懳墳丂lium mod end
}
} else if (row == ROW_SPSERIAL) {
if (Util.getPreferenceInfo().getAuthType() != PreferenceInfo.AUTH_LOGIN) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_SPSERIAL);
case 1:
return spoolerInfo.getSPKeyInfo().getSerial();
}
}
} else if (row == ROW_USER) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_USER);
case 1:
return spoolerInfo.getSPKeyInfo().getUser().getUserName();
}
} else if (row == ROW_COPY) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_COPY);
case 1:
return String.valueOf(spoolerInfo.getCopy());
}
} else if (row == ROW_PAGE) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_PAGE);
case 1:
return String.valueOf(spoolerInfo.getPage());
}
} else if (row == ROW_SIZE) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_SIZE);
case 1:
return Util.getSizeString(language, spoolerInfo.getSize());
}
} else if (row == ROW_DATE) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_DATE);
case 1:
return new Timestamp(spoolerInfo.getDate()).toString();
}
} else if (row == ROW_PRINTER) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_PRINTER);
case 1:
return spoolerInfo.getPrinterInfo().getName();
}
} else if (row == ROW_PAPERSIZE) {
switch (column) {
case 0:
return Resource.getString(Resource.LIST_PAPERSIZE);
case 1:
if (spoolerInfo.getPaperSize().equals("")) {
return "-";
} else {
paperWidth = (double)spoolerInfo.getPaperWidth() / 10.0;
paperLength = (double)spoolerInfo.getPaperLength() / 10.0;
if (paperWidth == 0.0 || paperLength == 0.0) {
return spoolerInfo.getPaperSize();
} else {
return
spoolerInfo.getPaperSize() + " (" +
paperWidth + " mm x " +
paperLength + " mm)";
}
}
}
}
return "";
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -