Package eu.flatworld.cstrader.data

Examples of eu.flatworld.cstrader.data.ItemLine


    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        JLabel c = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        ItemsTableModel model = (ItemsTableModel) table.getModel();
        ItemLine itemLine = model.getItemAtRow(table.convertRowIndexToModel(row));
        ItemProperty in = itemsProperties.get(itemLine.getItem().getName());

        LocationProperty ln = locationsProperties.get(itemLine.getLocation().getName());
        if ((ln != null) && ln.isIgnore()) {
            c.setForeground(ignoreColor);
        } else if ((in != null) && model.isForSale() && (in.getMaximumForSalePrice() != null) &&
                (itemLine.getPrice() <= in.getMaximumForSalePrice())) {
            c.setForeground(nicePriceColor);
        } else if ((in != null) && !model.isForSale() && (in.getMinimumWantedPrice() != null) &&
                itemLine.getPrice() >= in.getMinimumWantedPrice()) {
            c.setForeground(nicePriceColor);
        } else if (itemLine.getConnectedItemLines().size() != 0) {
            c.setForeground(routeColor);
        } else {
            c.setForeground(UIManager.getColor("Table.foreground"));
        }
        if (itemLine.getConnectedItemLines().size() > 0) {
            c.setToolTipText(PricelistsTools.buildTooltip(itemLine));
        }
        if (value instanceof Number) {
            c.setText(df.format(value));
        }
View Full Code Here

TOP

Related Classes of eu.flatworld.cstrader.data.ItemLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.