⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jobdetaillogintablemodel.java

📁 打印管理程序,测试完全通过.windows开发环境.
💻 JAVA
字号:
package jp.co.ntl.swing.ext.spooler;

import java.sql.Timestamp;

import jp.co.ntl.Util;
import jp.co.ntl.spooler.SpoolerInfo;

public class JobDetailLoginTableModel extends JobDetailTableModelBase {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static final int	MAX_ROW			= 10;
	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_USER		= 3;
	public static final int	ROW_COPY		= 4;
	public static final int	ROW_PAPERSIZE	= 5;
	public static final int	ROW_PAGE		= 6;
	public static final int	ROW_SIZE		= 7;
	public static final int	ROW_DATE		= 8;
	public static final int	ROW_PRINTER		= 9;
	
	public JobDetailLoginTableModel(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:
				return Util.getStatusString(language, spoolerInfo.getStatus(), spoolerInfo.getError());
			}
		} 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 + -