001    /**
002     * Created by IntelliJ IDEA.
003     * User: Wei Wang
004     * Date: Feb 24, 2003
005     * Time: 4:18:16 PM
006     */
007    
008    package EVolve.util.painters;
009    
010    import EVolve.visualization.AutoImage;
011    import EVolve.visualization.Predictor;
012    
013    public class EventPredictionPainter extends PredictionPainter{
014        private int lineWidth;
015    
016        public void paint(AutoImage image, long x, long y, long z) {
017            int X = (int)(x%lineWidth), Y= (int)(x/lineWidth);
018            predictor[(int)y].newTarget(z);
019    
020            if (validateTarget(y,z)) {
021                if (predictor[(int)y].isCorrect()) {
022                    if (image.getColor(X, Y) == null) {
023                        image.setColor(X, Y, colorBlue);
024                    }
025                } else {
026                    image.setColor(X, Y, colorRed);
027                    miss[(int)y]++;
028                }
029            } else {
030                if (image.getColor(X, Y) == null) {
031                    image.setColor(X, Y, colorBlue);
032                }
033            }
034        }
035    
036        public void setParameters(Predictor[] predictor, int targetType, int lineWidth) {
037            setPredictor(predictor,targetType);
038            this.lineWidth = lineWidth;
039        }
040    
041    }