001package polaris.sdk.ui.controls; 002import polaris.sdk.ui.*; 003 004public class ProgressBar extends Widget {protected double value=.5;public ProgressBar(){h=12;w=230;}public ProgressBar value(double v){if(!Double.isFinite(v))throw new IllegalArgumentException("value");value=Math.max(0,Math.min(1,v));return this;}public double value(){return value;}@Override protected void paint(Painter p){float amount=MotionValue.clamp(motion("progress",(float)value,20,.98f));p.fill(ax,ay,w,h,h/2,theme().field);p.fill(ax,ay,w*amount,h,h/2,Theme.alpha(theme().accent,.85f));}}