public GuideCustomColorProvider() { colorForInterest = new ColorFeatureGradiatedIndex("Avg Output"); colorForInterest.setDataPoint( new UnitIntervalDataPoint() { /** */ private static final long serialVersionUID = -6033261844239803432L; public double getValue(Object object) { Guide learner = (Guide) object; double interest = learner.getEfficacy(); if (interest > 1.0) { return 1.0; } return interest; } }); colorForInterest.setMaximumColor(ColorFeature.GREEN); colorForInterest.setMinimumColor(ColorFeature.RED); }
/** * * <!-- begin-user-doc --> * Provides a background color for the given Learning Resource. * * @param object the agent * @return the background color for the element, or <code>null</code> to use the default * background color * <!-- end-user-doc --> * @generated */ public Color getBackground(Object object) { return colorForInterest.getColor(object); }
/** * * <!-- begin-user-doc --> * Provides a color for Learning Resource based on wether we want to fill or not. * * @param object the agent * @return the foreground color for the element, or <code>null</code> to use the default * foreground color * <!-- end-user-doc --> * @generated */ public Color getColor(Object object, boolean fill) { return colorForInterest.getColor(object); }