001package polaris.sdk.ui.controls; 002import polaris.sdk.ui.*; 003 004public class RingProgress extends ProgressBar {public RingProgress(){w=h=64;}@Override protected void paint(Painter p){float s=Math.min(w,h),amount=MotionValue.clamp(motion("progress",(float)value,20,.98f));p.ring(ax,ay,s,4,1,0,theme().field);p.ring(ax,ay,s,4,amount,0,theme().accent);String t=Math.round(value*100)+"%";p.textWeight(t,ax+(s-p.textWidth(t,12,500))/2,ay+(s-12)/2,12,ink(),500);}}