Examples of SVGPoint


Examples of com.founder.fix.fixflow.core.impl.flowgraphics.svg.to.SvgLineBaseTo.SvgPoint

    svgMessageFlowTo.setId(id);
    //svgMessageFlowTo.setLabel(label);
    List<SvgPoint> svgPointList = new ArrayList<SvgPoint>();
    for (Point point : pointList) {
      SvgPoint svgPoint = svgMessageFlowTo.new SvgPoint();
      svgPoint.setX(point.getX());
      svgPoint.setY(point.getY());
      svgPointList.add(svgPoint);
    }
    svgMessageFlowTo.setSvgPointList(svgPointList);

    String lines = FlowSvgUtil.getSvgComponent(svgMessageFlowTo);
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.flowgraphics.svg.to.SvgLineBaseTo.SvgPoint

    svgAssocationTo.setId(id);
 
    List<SvgPoint> svgPointList = new ArrayList<SvgPoint>();
    for (Point point : pointList) {
      SvgPoint svgPoint = svgAssocationTo.new SvgPoint();
      svgPoint.setX(point.getX());
      svgPoint.setY(point.getY());
      svgPointList.add(svgPoint);
    }
    svgAssocationTo.setSvgPointList(svgPointList);

    String lines = FlowSvgUtil.getSvgComponent(svgAssocationTo);
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.flowgraphics.svg.to.SvgLineBaseTo.SvgPoint

    line.setId(id);
    line.setLabel(label);
    List<SvgPoint> svgPointList = new ArrayList<SvgPoint>();
    for (Point point : pointList) {
      SvgPoint svgPoint = line.new SvgPoint();
      svgPoint.setX(point.getX());
      svgPoint.setY(point.getY());
      svgPointList.add(svgPoint);
    }
    line.setSvgPointList(svgPointList);

    String lines = FlowSvgUtil.getSvgComponent(line);
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.flowgraphics.svg.to.SvgLineBaseTo.SvgPoint

  private static List<Float> getSegmentsLength(List<SvgPoint> points){
    List<Float> segList = new ArrayList<Float>();
   
    float segLen = 0f;
    for(int i=0; i< points.size() -1; i++){
      SvgPoint aa = points.get(i);
      SvgPoint bb = points.get(i+1);
     
      segLen = segmentLength(aa, bb);
      segList.add(segLen);
    }
   
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.flowgraphics.svg.to.SvgLineBaseTo.SvgPoint

  public static SvgPoint caclCenterPoint(SvgLineTo svgLine){
   
   
    List<SvgPoint>  pointList = svgLine.getSvgPointList();
   
    SvgPoint point =  svgLine.new SvgPoint();
   
    List<Float> segList = CaclModel.getSegmentsLength(pointList);
   
    float totalLength = 0f;
   
    for(float seg : segList){
      totalLength+=seg;
    }
   
    float centerLen = totalLength/2;
   
   
    int keySegIndex = 0;
   
    float keySeg = 0f;
    float tempLen = 0f;
    for(float seg : segList){
      keySeg = seg;
      keySegIndex++;
      if((tempLen+keySeg) > centerLen){
        break;
      }
      else{
        tempLen+=keySeg;
      }
     
    }

    float lastLen = centerLen - tempLen;
   
    SvgPoint startPoint = pointList.get(keySegIndex-1);
    SvgPoint endPoint = pointList.get(keySegIndex);
   
    float scale = lastLen/keySeg;
   
   
    float x = startPoint.getX() + (endPoint.getX() - startPoint.getX())*scale;
    float y = startPoint.getY() + (endPoint.getY() - startPoint.getY())*scale;
   
    point.setX(x);
    point.setY(y);
   
   
 
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.flowgraphics.svg.to.SvgLineBaseTo.SvgPoint

        if(i==0){
          pointPath.append("M");
        }else{
          pointPath.append("L");
        }
        SvgPoint point = pointList.get(i);
        pointPath.append(point.getX());
        pointPath.append(" ");
        pointPath.append(point.getY());
      }
     
      if(size!=0 && size%2==0){
        SvgPoint leftPoint = pointList.get(size/2-1);
        SvgPoint rightPoint = pointList.get(size/2);
        textx = String.valueOf((leftPoint.getX()+rightPoint.getX())/2);
        texty = String.valueOf((leftPoint.getY()+rightPoint.getY())/2);
      }else{
        int position = size/2;
        SvgPoint middlePoint = pointList.get(position);
        textx = String.valueOf(middlePoint.getX());
        texty = String.valueOf(middlePoint.getY());
      }
     
      str = FlowSvgUtil.replaceAll(str, path, pointPath.toString());
      str = FlowSvgUtil.replaceAll(str, text_x, textx);
      str = FlowSvgUtil.replaceAll(str, text_y, texty);
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.flowgraphics.svg.to.SvgLineBaseTo.SvgPoint

          pointPath.append("M");
        }else{
          pointPath.append("L");
        }

        SvgPoint point = pointList.get(i);
        float x = point.getX();
        float y = point.getY();
        x = x-2;
        y = y-2;
        pointPath.append(x);
        pointPath.append(" ");
        pointPath.append(y);
      }
     
      int textLength = lineTo.getLabel()==null?0:lineTo.getLabel().length();
      SvgPoint svgPoint = CaclModel.caclCenterPoint(lineTo);
      textx = StringUtil.getString(svgPoint.getX()-textLength*6.9/2);
      texty = StringUtil.getString(svgPoint.getY()-20);
     
//      if(size!=0 && size%2==0){
//        SvgPoint leftPoint = pointList.get(size/2-1);
//        SvgPoint rightPoint = pointList.get(size/2);
//        textx = String.valueOf((leftPoint.getX()+rightPoint.getX())/2);
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.flowgraphics.svg.to.SvgLineBaseTo.SvgPoint

          pointPath.append("M");
        }else{
          pointPath.append("L");
        }

        SvgPoint point = pointList.get(i);
        float x = point.getX();
        float y = point.getY();
        x = x-2;
        y = y-2;
        pointPath.append(x);
        pointPath.append(" ");
        pointPath.append(y);
      }
     
      int textLength = lineTo.getLabel()==null?0:lineTo.getLabel().length();
      SvgPoint svgPoint = CaclModel.caclCenterPoint(lineTo);
      textx = StringUtil.getString(svgPoint.getX()-textLength*6.9/2);
      texty = StringUtil.getString(svgPoint.getY()-20);
     
//      if(size!=0 && size%2==0){
//        SvgPoint leftPoint = pointList.get(size/2-1);
//        SvgPoint rightPoint = pointList.get(size/2);
//        textx = String.valueOf((leftPoint.getX()+rightPoint.getX())/2);
View Full Code Here

Examples of org.w3c.dom.svg.SVGPoint

    /**
     * <b>DOM</b>: Implements {@link SVGSVGElement#createSVGPoint()}.
     */
    public SVGPoint createSVGPoint() {
        return new SVGPoint() {
                float x;
                float y;
                public float getX() {
                    return x;
                }
View Full Code Here

Examples of org.w3c.dom.svg.SVGPoint

    /**
     */
    protected SVGItem createSVGItem(Object newItem){
       
        SVGPoint point= (SVGPoint)newItem;

        return new SVGPointItem(point.getX(), point.getY());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.