1 37 38 39 40 41 42 package com.lutris.appserver.debugger.applet; 43 44 import java.util.Vector ; 45 46 47 import javax.swing.*; 48 import javax.swing.table.*; 49 import com.lutris.appserver.debugger.applet.io.*; 50 51 52 public class TransactionListModel extends AbstractListModel { 53 54 private Snapshot myState; 55 56 public TransactionListModel() { 57 myState = new Snapshot(); 58 } 59 60 61 public int getSize() { 62 return myState.transactions.length; 63 } 64 65 public Object getElementAt(int index) { 66 return myState.transactions[index]; 67 } 68 69 public void updateToSnapshot(Snapshot s) { 70 int oldSize = myState.transactions.length; 71 myState = s; 72 73 74 fireContentsChanged(this, 0, oldSize); 75 } 76 77 78 public int idToRow(int id) { 79 for (int i=0; i<myState.transactions.length; i++) 80 if (myState.transactions[i].id == id) 81 return i; 82 return -1; 83 } 84 85 } 86 | Popular Tags |