Search in sources :

Example 1 with OTOutboxTableModel

use of com.moneychanger.ui.model.OTOutboxTableModel in project otapij by FellowTraveler.

the class CustomTable method prepareRenderer.

public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex) {
    Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
    if (c instanceof JComponent) {
        JComponent jc = (JComponent) c;
        if (getValueAt(rowIndex, vColIndex) instanceof String) {
            //Utility.getKeyFromName((String)getValueAt(rowIndex, vColIndex));
            String value = (String) getValueAt(rowIndex, vColIndex);
            if (this.getModel() instanceof AccountTableModel && vColIndex == 0) {
                value = (String) this.getModel().getValueAt(rowIndex, 3);
            }
            if (this.getModel() instanceof NYMTableModel && vColIndex == 0) {
                value = (String) this.getModel().getValueAt(rowIndex, 1);
            }
            if (this.getModel() instanceof BasketTableModel && vColIndex == 0) {
                value = (String) this.getModel().getValueAt(rowIndex, 1);
            }
            if (this.getModel() instanceof AssetContractTableModel && vColIndex == 0) {
                value = (String) this.getModel().getValueAt(rowIndex, 1);
            }
            if (this.getModel() instanceof ServerContractTableModel && vColIndex == 0) {
                value = (String) this.getModel().getValueAt(rowIndex, 1);
            }
            if (this.getModel() instanceof OTOutboxTableModel) {
                if (vColIndex == 4)
                    value = (String) this.getModel().getValueAt(rowIndex, 8);
                if (vColIndex == 5)
                    value = (String) this.getModel().getValueAt(rowIndex, 9);
            }
            if (this.getModel() instanceof OTInboxTableModel) {
                if (vColIndex == 4)
                    value = (String) this.getModel().getValueAt(rowIndex, 10);
                if (vColIndex == 5)
                    value = (String) this.getModel().getValueAt(rowIndex, 11);
            }
            if (this.getModel() instanceof NYMOutboxTableModel) {
                if (vColIndex == 1)
                    value = (String) this.getModel().getValueAt(rowIndex, 4);
                if (vColIndex == 2)
                    value = (String) this.getModel().getValueAt(rowIndex, 5);
            }
            if (this.getModel() instanceof NYMBoxTableModel) {
                if (vColIndex == 1)
                    value = (String) this.getModel().getValueAt(rowIndex, 4);
                if (vColIndex == 2)
                    value = (String) this.getModel().getValueAt(rowIndex, 5);
            }
            jc.setToolTipText(value);
        }
    }
    return c;
}
Also used : BasketTableModel(com.moneychanger.ui.model.BasketTableModel) NYMTableModel(com.moneychanger.ui.model.NYMTableModel) OTInboxTableModel(com.moneychanger.ui.model.OTInboxTableModel) NYMBoxTableModel(com.moneychanger.ui.model.NYMBoxTableModel) AccountTableModel(com.moneychanger.ui.model.AccountTableModel) NYMOutboxTableModel(com.moneychanger.ui.model.NYMOutboxTableModel) JComponent(javax.swing.JComponent) OTOutboxTableModel(com.moneychanger.ui.model.OTOutboxTableModel) JComponent(javax.swing.JComponent) Component(java.awt.Component) ServerContractTableModel(com.moneychanger.ui.model.ServerContractTableModel) AssetContractTableModel(com.moneychanger.ui.model.AssetContractTableModel)

Aggregations

AccountTableModel (com.moneychanger.ui.model.AccountTableModel)1 AssetContractTableModel (com.moneychanger.ui.model.AssetContractTableModel)1 BasketTableModel (com.moneychanger.ui.model.BasketTableModel)1 NYMBoxTableModel (com.moneychanger.ui.model.NYMBoxTableModel)1 NYMOutboxTableModel (com.moneychanger.ui.model.NYMOutboxTableModel)1 NYMTableModel (com.moneychanger.ui.model.NYMTableModel)1 OTInboxTableModel (com.moneychanger.ui.model.OTInboxTableModel)1 OTOutboxTableModel (com.moneychanger.ui.model.OTOutboxTableModel)1 ServerContractTableModel (com.moneychanger.ui.model.ServerContractTableModel)1 Component (java.awt.Component)1 JComponent (javax.swing.JComponent)1