boolean approx  boolean i18n  Currency accum  Currency withShipping  Currency withRealShipping  Currency realAccum
src/com/jbidwatcher/ui/AuctionsUIModel.java
if (accum != null && !accum.isNull()) {
      String sAndH = "s/h";
      if (!Locale.getDefault().equals(Locale.US)) sAndH = "p/p";

      StringBuilder result = new StringBuilder();
      //  If we managed to do the i18n thing through it all, and we have
      //  some real values, return it.
      if (i18n && realAccum != null) {
        result.append(realAccum.toString());
        if (withRealShipping != null && !realAccum.equals(withRealShipping)) {
          result.append(" (").append(withRealShipping).append(" with ").append(sAndH).append(')');
String formatSum(boolean approx, boolean i18n, Currency accum, Currency withShipping, Currency withRealShipping, Currency realAccum)
Currency accum  Currency withShipping  String sAndH  StringBuilder result
src/com/jbidwatcher/ui/AuctionsUIModel.java
result.append(accum.toString())
          .append(" (")
          .append(withShipping)
          .append(" with ")
          .append(sAndH)
          .append(')');
  public JPanel getPanel() { return mPanel;
void formatAmountAndShipping(Currency accum, Currency withShipping, String sAndH, StringBuilder result)
src/com/jbidwatcher/ui/AuctionsUIModel.java
return _table;
JTable getTable()
src/com/jbidwatcher/ui/table/AuctionSortable.java
public AuctionSortable()
AuctionEntry ae
src/com/jbidwatcher/ui/table/AuctionSortable.java
entry = ae;
void setEntry(AuctionEntry ae)
MultiSnipeManager multiManager  AuctionList inList
src/com/jbidwatcher/ui/table/auctionTableModel.java
this.multiManager = multiManager;
    dispList = inList;
public auctionTableModel(MultiSnipeManager multiManager, AuctionList inList)
AuctionEntry aEntry
src/com/jbidwatcher/ui/table/auctionTableModel.java
Currency shipping = aEntry.getShippingWithInsurance();
    if (shipping.getCurrencyType() == Currency.NONE) {
      return "--"; // shipping not set so cannot add up values
Object priceWithShippingColumn(AuctionEntry aEntry)
AuctionEntry aEntry
src/com/jbidwatcher/ui/table/auctionTableModel.java
String thumb = aEntry.getThumbnail();
    if (thumb != null) {
      if (iconCache.containsKey(thumb)) return iconCache.get(thumb);
      thumb = thumb.replaceAll("file:", "");
      ImageIcon base = new ImageIcon(thumb);
      int h = base.getIconHeight();
      int w = base.getIconWidth();
      if (h <= 64 && w <= 64) {
        h = -1;
        w = -1;
Object thumbnailColumn(AuctionEntry aEntry)
w > h
src/com/jbidwatcher/ui/table/auctionTableModel.java
w = 64;
          h = -1;
else if (w > h)
h == w
src/com/jbidwatcher/ui/table/auctionTableModel.java
h = 64;
          w = -1;
else if (h == w)
AuctionEntry aEntry
src/com/jbidwatcher/ui/table/auctionTableModel.java
if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
      return "N/A";
    SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
    return fmt.format(aEntry.getEndDate());
Object endDateColumn(AuctionEntry aEntry)
AuctionEntry aEntry
src/com/jbidwatcher/ui/table/auctionTableModel.java
if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
      return "N/A";
    String endTime = aEntry.getTimeLeft();
    if (endTime.equals(AuctionEntry.endedAuction)) {
      SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
      endTime = fmt.format(aEntry.getEndDate());
      if (!aEntry.isComplete()) {
        endTime = "<html><body color=\"red\">" + endTime + "</body></html>";
Object timeLeftColumn(AuctionEntry aEntry)
AuctionEntry aEntry  String errorNote
src/com/jbidwatcher/ui/table/auctionTableModel.java
if (aEntry.isSniped()) {
      return formatSnipe(aEntry, errorNote);
Object snipeColumn(AuctionEntry aEntry, String errorNote)
AuctionEntry aEntry
src/com/jbidwatcher/ui/table/auctionTableModel.java
Currency curPrice = aEntry.getCurrentPrice();
    if (aEntry.isFixed()) {
      return curPrice + " (FP" + ((aEntry.getQuantity() > 1) ? " x " + aEntry.getQuantity() + ")" : ")");
Object currentBid(AuctionEntry aEntry)
src/com/jbidwatcher/ui/table/auctionTableModel.java
return dispList.size();
int getRowCount()
src/com/jbidwatcher/ui/table/auctionTableModel.java
return TableColumnController.columnCount();
int getColumnCount()
int aColumn
src/com/jbidwatcher/ui/table/auctionTableModel.java
return TableColumnController.getInstance().getColumnName(aColumn);
String getColumnName(int aColumn)
int aColumn
src/com/jbidwatcher/ui/table/auctionTableModel.java
if (aColumn != 5) return String.class;
    return Icon.class;
Class getColumnClass(int aColumn)
int row  int column
src/com/jbidwatcher/ui/table/auctionTableModel.java
return false;
  public void delete(int row) {
    dispList.remove(row);
    fireTableRowsDeleted(row, row);
  public synchronized int findRow(Comparison c) {
    for (int i = 0; i < getRowCount(); i++) {
      if (c.match(getValueAt(i, -1))) return i;
    return -1;
  public synchronized int findRow(Object o) {
    List<Object> cache = new ArrayList<>();
    for (int i = 0; i < getRowCount(); i++) {
      Object curStep = getValueAt(i, -1);
      if (curStep == o) return i;
      cache.add(curStep);
    for (int i = 0; i < cache.size(); i++) {
      if (cache.get(i).equals(o)) return i;
boolean isCellEditable(int row, int column)
Object o
src/com/jbidwatcher/ui/table/auctionTableModel.java
int row = findRow(o);
    if (row != -1) {
      delete(row);
      fireTableRowsDeleted(row, row);
    return row != -1;
  public int insert(Object o) {
    dispList.add((AuctionEntry) o);
    int row = findRow(o);
    fireTableRowsInserted(row, row);
    return dispList.size() - 1;
  //  Except when we want to sort them...
  public Class getSortByColumnClass(int i) {
    //  Status is the only one where the type is very different than the dummy data.
    if (i == TableColumnController.STATUS ||
        i == TableColumnController.THUMBNAIL ||
        i == TableColumnController.SELLER_FEEDBACK ||
        i == TableColumnController.BIDCOUNT ||
        i == TableColumnController.SELLER_POSITIVE_FEEDBACK) return Integer.class;

    if (i == -1 || i > TableColumnController.MAX_FIXED_COLUMN) return String.class;

    Object o = getDummyValueAtColumn(i);
    return o.getClass();
boolean delete(Object o)
int i  int j
src/com/jbidwatcher/ui/table/auctionTableModel.java
try {
      AuctionEntry entry = dispList.get(i);

      featherweightSortBy.setEntry(entry);
      AuctionSortable sortBy = featherweightSortBy;

      switch (j) {
        case -1:
          return entry;
        case TableColumnController.ID:
          return sortBy.getId();
        case TableColumnController.CUR_BID:
          return sortBy.getCurrentBid();
        case TableColumnController.SNIPE_OR_MAX:
          return sortBy.getSnipeOrMax();
        case TableColumnController.TIME_LEFT:
          return entry.getEndDate();
        case TableColumnController.TITLE:
          return entry.getTitle();
        case TableColumnController.STATUS:
          return buildEntryFlags(entry);
        case TableColumnController.THUMBNAIL:
          return 0;
        case TableColumnController.SELLER:
          return entry.getSellerName();
        case TableColumnController.FIXED_PRICE:
          return sortBy.getFixedPrice();
        case TableColumnController.SHIPPING_INSURANCE:
          return sortBy.getShippingInsurance();
        case TableColumnController.BIDDER:
          return entry.getHighBidder();
        case TableColumnController.MAX:
          return sortBy.getMax();
        case TableColumnController.SNIPE:
          return sortBy.getSnipe();
        case TableColumnController.COMMENT:
          return sortBy.getComment();
        case TableColumnController.END_DATE:
          return entry.getEndDate();
        case TableColumnController.SELLER_FEEDBACK:
          return sortBy.getSellerFeedback();
        case TableColumnController.ITEM_LOCATION:
          return entry.getItemLocation();
        case TableColumnController.BIDCOUNT:
          return entry.getNumBidders();
        case TableColumnController.JUSTPRICE:
          return entry.getUSCurBid();
        case TableColumnController.SELLER_POSITIVE_FEEDBACK:
          return sortBy.getSellerPositiveFeedback();
        case TableColumnController.CUR_TOTAL:
          return sortBy.getCurrentTotal();
        case TableColumnController.SNIPE_TOTAL:
          return sortBy.getSnipeTotal();
        //  Columns beyond the MAX_FIXED_COLUMN are custom columns, or a bug.
        default: {
          if (j > TableColumnController.MAX_FIXED_COLUMN && j < TableColumnController.columnCount()) {
            return TableColumnController.getInstance().customColumn(j, entry);
Object getSortByValueAt(int i, int j)
src/com/jbidwatcher/ui/AuctionsUIModel.java
return mPanel;
JPanel getPanel()
src/com/jbidwatcher/ui/AuctionsUIModel.java
return _table;
JTable getTable()
AuctionEntry ae
src/com/jbidwatcher/ui/table/AuctionSortable.java
entry = ae;
public AuctionSortable(AuctionEntry ae)
src/com/jbidwatcher/ui/table/auctionTableModel.java
return dispList.size();
int getRowCount()
src/com/jbidwatcher/ui/table/auctionTableModel.java
return TableColumnController.columnCount();
int getColumnCount()
int aColumn
src/com/jbidwatcher/ui/table/auctionTableModel.java
return TableColumnController.getInstance().getColumnName(aColumn);
String getColumnName(int aColumn)
int row
src/com/jbidwatcher/ui/table/auctionTableModel.java
dispList.remove(row);
    fireTableRowsDeleted(row, row);
void delete(int row)
Comparison c
src/com/jbidwatcher/ui/table/auctionTableModel.java
for(int i=0; i<getRowCount(); i++) {
      if(c.match(getValueAt(i, -1))) return i;
int findRow(Comparison c)
Object o
src/com/jbidwatcher/ui/table/auctionTableModel.java
List<Object> cache = new ArrayList<>();
    for(int i=0; i<getRowCount(); i++) {
      Object curStep = getValueAt(i, -1);
      if(curStep == o) return i;
      cache.add(curStep);
int findRow(Object o)
Object o
src/com/jbidwatcher/ui/table/auctionTableModel.java
int row = findRow(o);
    if(row != -1) {
      delete(row);
      fireTableRowsDeleted(row, row);
boolean delete(Object o)
Object o
src/com/jbidwatcher/ui/table/auctionTableModel.java
dispList.add((AuctionEntry)o);
    int row = findRow(o);
    fireTableRowsInserted(row, row);
    return dispList.size()-1;
int insert(Object o)
int aColumn
src/com/jbidwatcher/ui/table/auctionTableModel.java
if(aColumn != 5) return String.class; return Icon.class;
Class getColumnClass(int aColumn)
int i
src/com/jbidwatcher/ui/table/auctionTableModel.java
//  Status is the only one where the type is very different than the dummy data.
    if (i == TableColumnController.STATUS ||
        i == TableColumnController.THUMBNAIL ||
        i == TableColumnController.SELLER_FEEDBACK ||
        i == TableColumnController.BIDCOUNT ||
        i == TableColumnController.SELLER_POSITIVE_FEEDBACK) return Integer.class;

    if (i == -1 || i > TableColumnController.MAX_FIXED_COLUMN) return String.class;

    Object o = getDummyValueAtColumn(i);
    return o.getClass();
Class getSortByColumnClass(int i)
int i  int j
src/com/jbidwatcher/ui/table/auctionTableModel.java
try {
      AuctionEntry entry = dispList.get(i);
      AuctionSortable sortBy = new AuctionSortable(entry);

      switch(j) {
        case -1: return entry;
        case TableColumnController.ID: return sortBy.getId();
        case TableColumnController.CUR_BID: return sortBy.getCurrentBid();
        case TableColumnController.SNIPE_OR_MAX: return sortBy.getSnipeOrMax();
        case TableColumnController.TIME_LEFT: return entry.getEndDate();
        case TableColumnController.TITLE: return entry.getTitle();
        case TableColumnController.STATUS: return buildEntryFlags(entry);
        case TableColumnController.THUMBNAIL: return 0;
        case TableColumnController.SELLER: return entry.getSellerName();
        case TableColumnController.FIXED_PRICE: return sortBy.getFixedPrice();
        case TableColumnController.SHIPPING_INSURANCE: return sortBy.getShippingInsurance();
        case TableColumnController.BIDDER: return entry.getHighBidder();
        case TableColumnController.MAX: return sortBy.getMax();
        case TableColumnController.SNIPE: return sortBy.getSnipe();
        case TableColumnController.COMMENT: return sortBy.getComment();
        case TableColumnController.END_DATE: return entry.getEndDate();
        case TableColumnController.SELLER_FEEDBACK: return sortBy.getSellerFeedback();
        case TableColumnController.ITEM_LOCATION: return entry.getItemLocation();
        case TableColumnController.BIDCOUNT: return entry.getNumBidders();
        case TableColumnController.JUSTPRICE: return entry.getUSCurBid();
        case TableColumnController.SELLER_POSITIVE_FEEDBACK: return sortBy.getSellerPositiveFeedback();
        case TableColumnController.CUR_TOTAL: return sortBy.getCurrentTotal();
        case TableColumnController.SNIPE_TOTAL: return sortBy.getSnipeTotal();
        //  Columns beyond the MAX_FIXED_COLUMN are custom columns, or a bug.
        default: {
          if(j > TableColumnController.MAX_FIXED_COLUMN && j < TableColumnController.columnCount()) {
            return TableColumnController.getInstance().customColumn(j, entry);
Object getSortByValueAt(int i, int j)
AuctionEntry aEntry
src/com/jbidwatcher/ui/table/auctionTableModel.java
Currency shipping = aEntry.getShippingWithInsurance();
    if(shipping.getCurrencyType() == Currency.NONE) {
      return "--"; // shipping not set so cannot add up values
Object priceWithShippingColumn(AuctionEntry aEntry)
AuctionEntry aEntry
src/com/jbidwatcher/ui/table/auctionTableModel.java
String thumb = aEntry.getThumbnail();
    if (thumb != null) {
      if(iconCache.containsKey(thumb)) return iconCache.get(thumb);
      thumb = thumb.replaceAll("file:", "");
      ImageIcon base = new ImageIcon(thumb);
      int h = base.getIconHeight();
      int w = base.getIconWidth();
      if (h <= 64 && w <= 64) {
        h = -1;
        w = -1;
Object thumbnailColumn(AuctionEntry aEntry)
w > h
src/com/jbidwatcher/ui/table/auctionTableModel.java
w = 64;
          h = -1;
else if (w > h)
h == w
src/com/jbidwatcher/ui/table/auctionTableModel.java
h = 64;
          w = -1;
else if (h == w)
AuctionEntry aEntry
src/com/jbidwatcher/ui/table/auctionTableModel.java
if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
      return "N/A";
    SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
    return fmt.format(aEntry.getEndDate());
  private Object timeLeftColumn(AuctionEntry aEntry) {
    if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
      return "N/A";
    String endTime = aEntry.getTimeLeft();
    if(endTime.equals(AuctionEntry.endedAuction)) {
      SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
      endTime = fmt.format(aEntry.getEndDate());
      if(!aEntry.isComplete()) {
        endTime = "<html><body color=\"red\">" + endTime + "</body></html>";
Object endDateColumn(AuctionEntry aEntry)
AuctionEntry aEntry  String errorNote
src/com/jbidwatcher/ui/table/auctionTableModel.java
if (aEntry.isSniped()) {
      return formatSnipe(aEntry, errorNote);
Object snipeColumn(AuctionEntry aEntry, String errorNote)
AuctionEntry aEntry
src/com/jbidwatcher/ui/table/auctionTableModel.java
Currency curPrice = aEntry.getCurrentPrice();
    if(aEntry.isFixed()) {
      return curPrice + " (FP" + ((aEntry.getQuantity() > 1) ? " x " + aEntry.getQuantity() + ")" : ")");
Object currentBid(AuctionEntry aEntry)
MultiSnipeManager multiManager  AuctionList inList
src/com/jbidwatcher/ui/table/auctionTableModel.java
this.multiManager = multiManager;
    dispList = inList;
  public boolean isCellEditable(int row, int column) {
    return false;
public auctionTableModel(MultiSnipeManager multiManager, AuctionList inList)