@Override
public void paint(Graphics g, RsTransform gt){

      Color fc, lc;

      fc = getFillColor();
      lc = getLineColor();

      if(fc==null && lc==null)
         return;

      if(refSegment==null){
        // the shape is not depicted and not interactive because
        // no polygon was ever supplied
      }

      int      nSegment = refSegment.length;

      double   x, y;

      for(int i=0; i<nSegment; i++){
         x=refSegment[i].x;
         y=refSegment[i].y;
         ix[i] = (int)Math.floor(gt.m11*x + gt.m12*y + gt.m13 + 0.5);
         iy[i] = (int)Math.floor(gt.m21*x + gt.m22*y + gt.m23 + 0.5);
      }

      ix[nSegment]=ix[0];
      iy[nSegment]=iy[0];

      if(fc!=null){
         g.setColor(fc);
         g.fillPolygon(ix, iy, nSegment+1);
      }
      if(lc!=null){
         g.setColor(lc);
         g.drawPolygon(ix, iy, nSegment+1);
      }
   }