Print

Print


Sen, this is bug was stomped a while ago on the SVN repository, you  
might try that.  (or as a quick hack you can change edge.to() to  
edge.getOtherNode(node) I think).  I've been delaying releasing a new  
tarball of MASON in order to make further progress on the manual  
(writing the manual triggers bug fixes in MASON, it's a useful  
exercise).  I expect to have something ready for release next week.

Sean

On Jul 6, 2011, at 1:42 AM, Sen Lin wrote:

> hi,
> There may be a bug in the class of NetworkPortrayal2D.
> the following is from NetworkPortrayl2D's hitOrDraw  method:
>
> protected void hitOrDraw(Graphics2D graphics, DrawInfo2D info, Bag  
> putInHere)
> {
>    ........................
>    ........................
>     for(int y=0;y<edges.numObjs;y++)
>     {
>           Edge edge = (Edge)edges.objs[y];
>           Double2D locStop =  
> field.getObjectLocation(edge.to());              /////// here's the  
> bug  !!!!!!!!!
>           ..........................................................
>           .........................................................
>
>          newinfo.secondPoint.x = (info.draw.x + (xScale) * locStop.x);
>          .........................................................
>     }
> }
>
> if the network is undirected,   Double2D locStop =  
> field.getObjectLocation(edge.to()) will get a wrong second point  
> location, because edge.to()  is not necessary the other end of this  
> edge. In other words,   edge.to() may return  the first network node  
> if the network is undirected.
> This bug will cause some display errors. For example,in a undirected  
> network,  when i wanna draw an edge label, the label will appear in  
> two different positions.
>
>
>
>
> -- 
> Best wishes!
>
> Lin Sen
> Network Key Lab, Institute of Computing Technology ,Chinese Academy  
> of Science
> Address£ºF-707, Qingnian Department, Zhongguancun East Road, Beijing,  
> P.R.C.
> Post£º10000
> Tel£º1521-064-9236