Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: gef/src/org/tigris/gef/presentation FigEdgePoly.java

gef
Discussion topic

Back to topic list

CVS update: gef/src/org/tigris/gef/presentation FigEdgePoly.java

Reply

Author toby
Full name Toby Baier
Date 2001-04-05 04:28:33 PDT
Message User: toby
  Date: 01/04/05 04:28:33

  Modified: src/org/tigris/gef/presentation FigEdgePoly.java
  Log:
  changed routing algo for edges, so they are straight lines (i.e. after
  "AddToDiagram" in ArgoUML) rather than twisting and turning multipoint tracks
  Obtained from:Marcus Andersson
  Submitted by:Toby
  
  Revision Changes Path
  1.3 +4 -26 gef/src/org/tigris/g​ef/presentation/FigE​dgePoly.java
  
  Index: FigEdgePoly.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/presentation​/FigEdgePoly.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FigEdgePoly.java 2000/12/20 05:19:47 1.2
  +++ FigEdgePoly.java 2001/04/05 11:28:32 1.3
  @@ -26,7 +26,7 @@
   // File: FigEdgePoly.java
   // Classes: FigEdgePoly
   // Original Author: agauthie at ics dot uci dot edu
  -// $Id: FigEdgePoly.java,v 1.2 2000/12/20 05:19:47 carnold Exp $
  +// $Id: FigEdgePoly.java,v 1.3 2001/04/05 11:28:32 toby Exp $
   
   package org.tigris.gef.presentation;
   
  @@ -81,8 +81,8 @@
      * Needs-More-Work: Sometimes the edge can get non-rectilinear. */
     public void computeRoute() {
       if (!_initiallyLaidOut) {
  - layoutEdge();
  - _initiallyLaidOut = true;
  + layoutEdge();
  + _initiallyLaidOut = true;
       }
       FigPoly p = ((FigPoly) _fig);
   
  @@ -130,31 +130,9 @@
         dstPt = _destPortFig.connect​ionPoint(srcPt);
       }
   
  - Rectangle srcRR = _sourceFigNode.routingRect();
  - Rectangle dstRR = _destFigNode.routingRect();
  -
  - Object srcPort = _sourcePortFig.getOwner();
  - Object dstPort = _destPortFig.getOwner();
  - int srcSector = _sourceFigNode.getPo​rtSector(_destPortFi​g);
  - int dstSector = _destFigNode.getPort​Sector(_sourcePortFi​g);
  -
  - // first decide what layout case we have
  - Point srcRRPt = routingRectPoint(srcPt, srcRR, srcSector);
  - Point dstRRPt = routingRectPoint(dstPt, dstRR, dstSector);
  -
  - if (srcSector == 1 || srcSector == -1) {
  - xpoints[npoints] = srcPt.x; ypoints[npoints++] = srcPt.y; }
       xpoints[npoints] = srcPt.x; ypoints[npoints++] = srcPt.y;
  - xpoints[npoints] = srcRRPt.x; ypoints[npoints++] = srcRRPt.y;
  -
  - npoints = npoints + tryRoute(dstRRPt.x, dstRRPt.y, npoints,
  - xpoints, ypoints,
  - srcRR, dstRR, srcSector, dstSector);
  -
  - xpoints[npoints] = dstRRPt.x; ypoints[npoints++] = dstRRPt.y;
       xpoints[npoints] = dstPt.x; ypoints[npoints++] = dstPt.y;
  - // if (dstSector == 1 || dstSector == -1) {
  - // xpoints[npoints] = dstPt.x; ypoints[npoints++] = dstPt.y; }
  +
       Polygon routePoly = new Polygon(xpoints, ypoints, npoints);
       ((FigPoly)_fig).setP​olygon(routePoly);
     }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: gef/src/org/tigris/gef/presentation FigEdgePoly.java toby Toby Baier 2001-04-05 04:28:33 PDT
Messages per page: