|
@@ -875,14 +875,12 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
|
|
|
static int lv=0;
|
|
|
|
|
|
public static int getEffectiveIndex(Model m, IGraphedElement e, int timeStep){
|
|
|
- int o;
|
|
|
- if(e.isStretching())o= timeStep*100/m.getIterations();
|
|
|
- else o= timeStep%e.getLocalPeriod()*100/e.getLocalPeriod();
|
|
|
- return o;//TODO
|
|
|
+ if(e.isStretching())return timeStep*100/(m==null?100:m.getIterations());
|
|
|
+ else return timeStep%e.getLocalPeriod()*100/e.getLocalPeriod();
|
|
|
}
|
|
|
|
|
|
public static int getEffectiveIndex(IGraphedElement e, int timeStep){
|
|
|
- return getEffectiveIndex(SingletonControl.getInstance().getControl().getModel(),e,timeStep);
|
|
|
+ return getEffectiveIndex(SingletonControl.getInstance().getControl()==null?null:SingletonControl.getInstance().getControl().getModel(),e,timeStep);
|
|
|
}
|
|
|
|
|
|
public static int getEffectiveIndex(IGraphedElement e){
|