Examples of ILine


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

    // If there exists an intersection point between the two lines created using control points and points,
    // where is a loop that must be removed by inverting the control points.
    // For the first point, the lines are created differently.
    final int posPrev = position==0 ? 1 : position - 1;
    final int posNext = position==0 ? points.size()-1 : position==points.size()-1 ? 0 : position + 1;
    final ILine line1 = ShapeFactory.createLine(getPtAt(posPrev), ctrlPts[0]);
    final ILine line2 = ShapeFactory.createLine(getPtAt(posNext), ctrlPts[1]);

    if(line1.getIntersectionSegment(line2)==null) {
      firstCtrlPts.get(position).setPoint(ctrlPts[0]);
      secondCtrlPts.get(position).setPoint(ctrlPts[1]);
    }else {
View Full Code Here

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


  @Override
  public void paint(final Graphics2D g, final Color fColour, final boolean asShadow) {
    if(!model.hasStyle()) return ;
    final ILine arrowLine   = model.getArrowLine();
    if(arrowLine==null) return;
    final IPoint pt1     = arrowLine.getPoint1();
    final double lineAngle  = arrowLine.getLineAngle();
    final double lineB      = arrowLine.getB();
    final double c2x;
        final double c2y;
        final double c3x;
        final double c3y;
View Full Code Here

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

   */
  @Override
  public void updatePath() {
    path.reset();

    final ILine arrowLine = model.getArrowLine();

    if(model.getArrowStyle()==ArrowStyle.NONE || arrowLine==null) return;
    final double xRot;
        final double yRot;
        final double lineAngle  = arrowLine.getLineAngle();
    final IPoint pt1     = arrowLine.getPoint1();
    final IPoint pt2     = arrowLine.getPoint2();
    final double lineB      = arrowLine.getB();

    if(LNumber.equalsDouble(Math.abs(lineAngle), Math.PI/2.) || LNumber.equalsDouble(Math.abs(lineAngle), 0.)) {
      xRot = pt1.getX();
      yRot = pt1.getY();
    } else {
View Full Code Here

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

                            pt1.setX(pt2.getX() - Point2D.distance(pt2.getX(), pt2.getY(), br.getX(), (tl.getY() + br.getY()) / 2.));

                        pt2.setX(tl.getX() + (br.getX() - tl.getX()) * gradMidPt);
                    } else {
                        final IPoint cg = shape.getGravityCentre();
                        final ILine l2;
                        final ILine l;

                        pt1 = pt1.rotatePoint(cg, -angle);
                        pt2 = pt2.rotatePoint(cg, -angle);
                        l = ShapeFactory.createLine(pt1, pt2);

                        if (angle >= 0. && angle < Math.PI / 2.)
                            l2 = l.getPerpendicularLine(tl);
                        else
                            l2 = l.getPerpendicularLine(ShapeFactory.createPoint(tl.getX(), br.getY()));

                        pt1 = l.getIntersection(l2);
                        final double distance = Point2D.distance(cg.getX(), cg.getY(), pt1.getX(), pt1.getY());
                        l.setX1(pt1.getX());
                        l.setY1(pt1.getY());
                        final IPoint[] pts = l.findPoints(pt1, 2 * distance * gradMidPt);
                        pt2 = pts[0];

                        if (gradMidPt < 0.5)
                            pt1 = pt1.rotatePoint(shape.getGravityCentre(), Math.PI);
                    }
View Full Code Here

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

  protected static double[] updatePoint4Arrows(final double x, final double y, final IArrow arr) {
    final double[] coords = {x, y};

    if(arr.getArrowStyle().isReducingShape()) {
      final ILine line = arr.getArrowLine();

      if(line!=null) {
        final IPoint[] ps = line.findPoints(line.getPoint1(), arr.getArrowShapeLength()/2.);
        if(ps!=null) {
          if(line.isInSegment(ps[0])) {
            coords[0] = ps[0].getX();
            coords[1] = ps[0].getY();
          }else {
            coords[0] = ps[1].getX();
            coords[1] = ps[1].getY();
View Full Code Here

Examples of org.jacoco.core.analysis.ILine

  private static void writeLines(final ISourceNode source,
      final XMLElement parent) throws IOException {
    final int last = source.getLastLine();
    for (int nr = source.getFirstLine(); nr <= last; nr++) {
      final ILine line = source.getLine(nr);
      if (line.getStatus() != ICounter.EMPTY) {
        final XMLElement element = parent.element("line");
        element.attr("nr", nr);
        final ICounter insn = line.getInstructionCounter();
        element.attr("mi", insn.getMissedCount());
        element.attr("ci", insn.getCoveredCount());
        final ICounter branches = line.getBranchCounter();
        element.attr("mb", branches.getMissedCount());
        element.attr("cb", branches.getCoveredCount());
      }
    }
  }
View Full Code Here

Examples of org.jacoco.core.analysis.ILine

    final int firstLine = child.getFirstLine();
    if (firstLine != UNKNOWN_LINE) {
      final int lastLine = child.getLastLine();
      ensureCapacity(firstLine, lastLine);
      for (int i = firstLine; i <= lastLine; i++) {
        final ILine line = child.getLine(i);
        incrementLine(line.getInstructionCounter(),
            line.getBranchCounter(), i);
      }
    }
  }
View Full Code Here

Examples of org.jacoco.core.analysis.ILine

    result = analyzer.getCoverage();
  }

  private void assertLine(int nr, int insnMissed, int insnCovered,
      int branchesMissed, int branchesCovered) {
    final ILine line = result.getLine(nr);
    assertEquals("Instructions in line " + nr,
        CounterImpl.getInstance(insnMissed, insnCovered),
        line.getInstructionCounter());
    assertEquals("Branches in line " + nr,
        CounterImpl.getInstance(branchesMissed, branchesCovered),
        line.getBranchCounter());
  }
View Full Code Here

Examples of org.jacoco.core.analysis.ILine

    sourceCoverage = files.iterator().next();
  }

  protected void assertLine(final String tag, final int status) {
    final int nr = source.getLineNumber(tag);
    final ILine line = sourceCoverage.getLine(nr);
    final String msg = String.format("Status in line %s: %s",
        Integer.valueOf(nr), source.getLine(nr));
    final int insnStatus = line.getInstructionCounter().getStatus();
    assertEquals(msg, STATUS_NAME[status], STATUS_NAME[insnStatus]);
  }
View Full Code Here

Examples of org.jacoco.core.analysis.ILine

  }

  protected void assertLine(final String tag, final int missedBranches,
      final int coveredBranches) {
    final int nr = source.getLineNumber(tag);
    final ILine line = sourceCoverage.getLine(nr);
    final String msg = String.format("Branches in line %s: %s",
        Integer.valueOf(nr), source.getLine(nr));
    assertEquals(msg + " branches",
        CounterImpl.getInstance(missedBranches, coveredBranches),
        line.getBranchCounter());
  }
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.