import java.awt.Graphics; public class DrawAgentRadius implements IDrawAgent { double m_lfRadius; IStateAccessor m_stateAccess; int m_nColor=12; { m_stateAccess = new StateAccessors.PassThrough(); } public DrawAgentRadius(double lfRadius) { m_lfRadius = lfRadius; } public DrawAgentRadius(double lfRadius, IStateAccessor accessor) { m_lfRadius = lfRadius; m_stateAccess= accessor; } public void setColor(int nColor) { m_nColor = nColor; } // override? public void draw(java.awt.Graphics g, IProjection p, double[] arrLfPoints, StateBundle[] arrAgentStates, CommGraph graph) { int nIdx = 0; try { g.setColor(globalsUI.getColorMap().getColor(m_nColor)); int nRadScreen = p.scaleRadius(m_lfRadius); for(; nIdx < arrLfPoints.length; nIdx += 2) { g.drawArc(p.getScreenComp(0, arrLfPoints, nIdx)-nRadScreen, p.getScreenComp(1, arrLfPoints, nIdx)-nRadScreen, 2*nRadScreen, 2*nRadScreen, 0, 360); } } catch(Exception e) { } } }