Package net.sf.latexdraw.glib.models.interfaces.shape

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPolyline


      final double posY = shape.getPosition().getY();
      final IArrow arr0 = shape.getArrowAt(1);
      final IArrow arr1 = shape.getArrowAt(3);
      final double arr0Reduction = arr0.getArrowStyle().needsLineReduction() ? arr0.getArrowShapedWidth() : 0.;
      final double arr1Reduction = arr1.getArrowStyle().needsLineReduction() ? arr1.getArrowShapedWidth() : 0.;
      final IPolyline xLine = ShapeFactory.createPolyline();
      final IPolyline yLine = ShapeFactory.createPolyline();

      xLine.addPoint(ShapeFactory.createPoint(posX+shape.getGridStartX()*IShape.PPC + arr0Reduction, posY));
      xLine.addPoint(ShapeFactory.createPoint(posX+shape.getGridEndX()*IShape.PPC - arr1Reduction, posY));
      yLine.addPoint(ShapeFactory.createPoint(posX, posY-shape.getGridStartY()*IShape.PPC - arr0Reduction));
      yLine.addPoint(ShapeFactory.createPoint(posX, posY-shape.getGridEndY()*IShape.PPC + arr1Reduction));

      xLine.getArrowAt(0).copy(arr0);
      xLine.getArrowAt(1).copy(arr1);
      yLine.getArrowAt(0).copy(shape.getArrowAt(0));
      yLine.getArrowAt(1).copy(shape.getArrowAt(2));
      final SVGElement eltX = new LPolylinesSVGGenerator(xLine).toSVG(document);
      final SVGElement eltY = new LPolylinesSVGGenerator(yLine).toSVG(document);

      elt.appendChild(eltX);
      elt.appendChild(eltY);
View Full Code Here


          sh.addPoint(ShapeFactory.createPoint(x*IShape.PPC*xs+posX, -shape.getY(x)*IShape.PPC*ys+posY));
  }


  private void updateLine(final double posX, final double posY, final double minX, final double maxX, final double step) {
    final IPolyline pl = ShapeFactory.createPolyline();
    pl.copy(shape);
    if(lineView!=null) lineView.flush();
    lineView = new LPolylineView(pl);
    fillPoints(pl, posX, posY, minX, maxX, step);
    lineView.update();
  }
View Full Code Here

TOP

Related Classes of net.sf.latexdraw.glib.models.interfaces.shape.IPolyline

Copyright © 2018 www.massapicom. 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.