📄 managerdata.java
字号:
package loader.data;import javax.swing.table.*;import java.util.*;/** * * @author juddy */public class ManagerData extends AbstractTableModel{ private ArrayList<String> url; //column 0 private ArrayList<String> location; //column 1 private ArrayList<ProgressData> prosd;//column 2 public ManagerData(){ url = new ArrayList<String>(); location = new ArrayList<String>(); prosd = new ArrayList<ProgressData>(); } public void register( String url, String location, ProgressData data ){ this.url.add( url ); this.location.add( location ); this.prosd.add( data ); fireTableRowsInserted( this.url.size()-1, this.url.size()-1 ); } public void addValue( String url, int value ){ int i = this.url.indexOf( url ); this.prosd.get( i ).setCurrentLength( value ); fireTableCellUpdated( i, 2 ); } public void removeItem( String url ){ int i = this.url.indexOf( url ); this.location.remove( i ); this.prosd.remove( i ); this.url.remove( i ); fireTableRowsDeleted( i, i ); } public int getColumnCount(){ return 3; } public int getRowCount(){ return url.size(); } public Object getValueAt( int row, int col ){ switch( col ){ case 0: return url.get( row ); case 1: return location.get( row ); case 2: return prosd.get( row ); } return null; } public Class getColumnClass( int col ){ if( col == 0 || col == 1 ){ return String.class; } else { return ProgressData.class; } } public boolean isCellEditable( int row, int col ){ return false; } public String getColumnName( int col ){ if( col == 0 ){ return "URL"; } else if( col == 1 ){ return "LOCATION"; } else { return "PROGRESS"; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -