IfScoreTableColumn.java :  » Game » FFGenie-2010.3-src » ffg » game » vs » Java Open Source

Java Open Source » Game » FFGenie 2010.3 src 
FFGenie 2010.3 src » ffg » game » vs » IfScoreTableColumn.java
package ffg.game.vs;

import ffg.gui.table.column.FFGTableColumn;
import ffg.gui.table.column.IntegerColumnInfo;
import ffg.gui.table.renderer.PriceChangeTableCellRendererDecorator;

/**
 * Column representing the amount a player will rise given he scores x in the next round.
 * @author eugeneh
 * @param <E> Subclass of {@link VSGameStats}
 */
public class IfScoreTableColumn<E extends VSGameStats> extends FFGTableColumn<E, Integer> {
    private final int score;
    
    /**
     * Creates a new instance of IfScoreTableColumn
     * @param score the score
     */
    public IfScoreTableColumn(int score) {
        super("If " + score, IntegerColumnInfo.REVERSE_INSTANCE, PriceChangeTableCellRendererDecorator.INSTANCE);
        this.score = score;
    }
    
    public boolean isFilterable() {
        return true;
    }

    public Integer getObjectValue(E baseObject) {
        return baseObject.changeFromScore(score);
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.