public void addStock(int i, Stock stock) { if (i == -1) return; this.stocks.getStockList().add(i, stock); this.state.add(i, stock.isTriggered()); this.fireTableRowsInserted(i, i); selector.select(i); }
public Stock removeStock(int i) { if (i == -1) return null; selector.deselect(i); Stock stock = stocks.getStockList().remove(i); state.remove(i); this.fireTableRowsDeleted(i, i); return stock; }
public void addLastStock(Stock stock) { stocks.add(stock); state.add(stock.isTriggered()); this.fireTableRowsInserted(stocks.getStockList().size() - 1, stocks.getStockList().size() - 1); selector.select(stocks.getStockList().size() - 1); }