/** * Load a tool tip representation for this DLV from the server. Set retrieved tool tip back into * DLV so that next time it will have to be loaded again. * * @param dlv In/Out * @return Tool tip information, or <code>null</code> on no tool tip. */ public static Object loadToolTip(DepotLookupValue dlv) { Object o = null; DepotLookupToolTip dltt = (DepotLookupToolTip) dlv.getAuxInfo(); if (dltt == null) { dltt = new DepotLookupToolTip(); o = dltt.createToolTip(dlv); dlv.setAuxInfo(dltt); } else { o = dltt.getToolTip(); } return o; }
/* * (non-Javadoc) * * @see javax.swing.table.TableModel#getValueAt(int, int) */ public Object getValueAt(int rowIndex, int columnIndex) { if (rowIndex > this.valueObjects.size() || columnIndex > 6) { return ""; } else { DepotLookupValue dlv = ((DepotLookupValue) getValueObjectAt(rowIndex)); if (columnIndex == 0) { String dt = dlv.getDepotType(); return (dt == null) ? "" : dt; } else if (columnIndex == 1) { return dlv.toString(); } else if (columnIndex == 2) { return dlv.getFacilityValue().getCity(); } else if (columnIndex == 3) { return UnitConverter.formatMeters(dlv.getDistance(), km); } else if (columnIndex == 4) { // return Float.toString((float)((DepotLookupValue) // getValueObjectAt(rowIndex)).getTruckingPrice()/100); return CurrencyTextConverter.longToText(dlv.getTruckingPrice(), 2); } else if (columnIndex == 5) { // return Float.toString((float)((DepotLookupValue) // getValueObjectAt(rowIndex)).getChargesPrice()/100); return CurrencyTextConverter.longToText(dlv.getChargesPrice(), 2); } else if (columnIndex == 6) { // return Float.toString((float)((DepotLookupValue) // getValueObjectAt(rowIndex)).getPrice()/100); return CurrencyTextConverter.longToText(dlv.getPrice(), 2); } else { return ""; } } }
/* * (non-Javadoc) * * @see net.metaship.swing.generic.ContextTableModel#getNewEmptyModel() */ public ValueObject getNewEmptyModel() { DepotLookupValue val = new DepotLookupValue(); val.getClientValueObjectProxy().setNew(); return val; }