Examples of Line


Examples of net.phys2d.raw.shapes.Line

    Box box = (Box) boxBody.getShape();
    Circle circle = (Circle) circleBody.getShape();
   
    Vector2f[] pts = box.getPoints(boxBody.getPosition(), boxBody.getRotation());
    Line[] lines = new Line[4];
    lines[0] = new Line(pts[0],pts[1]);
    lines[1] = new Line(pts[1],pts[2]);
    lines[2] = new Line(pts[2],pts[3]);
    lines[3] = new Line(pts[3],pts[0]);
   
    float r2 = circle.getRadius() * circle.getRadius();
    int closest = -1;
    float closestDistance = Float.MAX_VALUE;
   
View Full Code Here

Examples of net.sf.minuteProject.loader.implicitstructure.node.Line

    return lines;
  }

  private Line parseLine(String strLine, String separator,
      List<Property> properties) {
    Line line = new Line();
    StringTokenizer st = new StringTokenizer(strLine, separator);
    int size = properties.size();
    int i = 0;
    while (st.hasMoreElements()) {
      if (i < size) {
        String token = st.nextToken();
        Property prop = properties.get(i);
        Property property = new Property();
        property.setName(prop.getName());
        property.setValue(token);
        line.addProperty(property);
        i++;
      }
    }
    return line;
  }
View Full Code Here

Examples of net.sourceforge.ganttproject.chart.GraphicPrimitiveContainer.Line

//                        curX, getLineTopPosition(), curX, getLineTopPosition()+10);
//                firstWeekendDay = true;
//            }

            if (curDate.equals(myToday) && myRedlineOption.isChecked()) {
                Line redLine = getPrimitiveContainer().createLine(
                        curX+2, getLineBottomPosition()+1, curX+2, getHeight());
                redLine.setForegroundColor(Color.RED);
            }
            if ((curDate.equals(getChartModel().getTaskManager().getProjectStart()) ||
                    curDate.equals(getChartModel().getTaskManager().getProjectEnd())) &&
                isProjectBoundariesOptionOn()) {
                Line blueLine = getPrimitiveContainer().createLine(
                        curX, getLineBottomPosition()+1, curX, getHeight());
                blueLine.setForegroundColor(Color.BLUE);
            }

            curX = nextOffset.getOffsetPixels();
            curDate = nextOffset.getOffsetEnd();
            //System.err.println("curDate="+curDate+" curX="+curX);
View Full Code Here

Examples of net.wigis.graph.dnv.geometry.Line

          r.setBottomRight( (float)( r.getBottomRight().getX() * xRatio ), (float)( r.getBottomRight().getY() * yRatio ) );
          r.setTopLeft( (float)( r.getTopLeft().getX() * xRatio ), (float)( r.getTopLeft().getY() * yRatio ) );
        }
        else if( g instanceof Line )
        {
          Line l = (Line)g;
          l.setStart( (float)( l.getStart().getX() * xRatio ), (float)( l.getStart().getY() * yRatio ) );
          l.setEnd( (float)( l.getEnd().getX() * xRatio ), (float)( l.getEnd().getY() * yRatio ) );
        }
        else if( g instanceof Text )
        {
          Text t = (Text)g;
          t.setPosition( (float)( t.getPosition().getX() * xRatio ), (float)( t.getPosition().getY() * yRatio ) );
View Full Code Here

Examples of nl.nuggit.words.board.Line

    return word;
  }

  private Boolean checkCrossword(Line line, int position, Word word,
      int wordIndex) {
    Line crossingLine = board.getOrthogonalLine(line, position + wordIndex);
    if (!hasAdjacentTiles(line, crossingLine)) {
      return null;
    }
    // find start
    int startPosition = line.getPosition();
    while (startPosition > 0
        && crossingLine.getSquares()[startPosition - 1].getTile() != null) {
      startPosition--;
    }
    // find end
    int endPosition = line.getPosition();
    while (endPosition < (crossingLine.getSquares().length - 1)
        && crossingLine.getSquares()[endPosition + 1].getTile() != null) {
      endPosition++;
    }

    Tile newTile = word.getTiles().get(wordIndex);

    // construct crossword and count tiles already on the board
    StringBuilder sb = new StringBuilder();
    int score = 0;
    for (int i = startPosition; i <= endPosition; i++) {
      if (i == line.getPosition()) {
        // skip the new tile
        sb.append(newTile.getLetter().getSymbol());
        continue;
      }
      Tile tile = crossingLine.getSquares()[i].getTile();
      sb.append(tile.getLetter().getSymbol());
      score += tile.getLetter().getValue();
    }

    // count the new tile, possibly with booster
View Full Code Here

Examples of nu.fw.jeti.plugins.drawing.shapes.Line

   * After releasing the mouse the ellipse is memorized in the history, drawn
   * and sent to the other users.
   */
  public void mouseReleased(Double point, int scaleX, int scaleY) {
    end = point;
    Line line = new Line(start, end, color, chat.getMyJID());
    chat.draw(line);
    board.setCurrentShape(null);
  }
View Full Code Here

Examples of org.apache.commons.math3.geometry.euclidean.threed.Line

public class LineTest {

    @Test
    public void testContains() throws MathIllegalArgumentException, MathArithmeticException {
        Vector3D p1 = new Vector3D(0, 0, 1);
        Line l = new Line(p1, new Vector3D(0, 0, 2), 1.0e-10);
        Assert.assertTrue(l.contains(p1));
        Assert.assertTrue(l.contains(new Vector3D(1.0, p1, 0.3, l.getDirection())));
        Vector3D u = l.getDirection().orthogonal();
        Vector3D v = Vector3D.crossProduct(l.getDirection(), u);
        for (double alpha = 0; alpha < 2 * FastMath.PI; alpha += 0.3) {
            Assert.assertTrue(! l.contains(p1.add(new Vector3D(FastMath.cos(alpha), u,
                                                               FastMath.sin(alpha), v))));
        }
    }
View Full Code Here

Examples of org.apache.commons.math3.geometry.euclidean.threed.Line

    @Test
    public void testSimilar() throws MathIllegalArgumentException, MathArithmeticException {
        Vector3D p1  = new Vector3D (1.2, 3.4, -5.8);
        Vector3D p2  = new Vector3D (3.4, -5.8, 1.2);
        Line     lA  = new Line(p1, p2, 1.0e-10);
        Line     lB  = new Line(p2, p1, 1.0e-10);
        Assert.assertTrue(lA.isSimilarTo(lB));
        Assert.assertTrue(! lA.isSimilarTo(new Line(p1, p1.add(lA.getDirection().orthogonal()), 1.0e-10)));
    }
View Full Code Here

Examples of org.apache.commons.math3.geometry.euclidean.threed.Line

        Assert.assertTrue(! lA.isSimilarTo(new Line(p1, p1.add(lA.getDirection().orthogonal()), 1.0e-10)));
    }

    @Test
    public void testPointDistance() throws MathIllegalArgumentException {
        Line l = new Line(new Vector3D(0, 1, 1), new Vector3D(0, 2, 2), 1.0e-10);
        Assert.assertEquals(FastMath.sqrt(3.0 / 2.0), l.distance(new Vector3D(1, 0, 1)), 1.0e-10);
        Assert.assertEquals(0, l.distance(new Vector3D(0, -4, -4)), 1.0e-10);
    }
View Full Code Here

Examples of org.apache.commons.math3.geometry.euclidean.threed.Line

        Assert.assertEquals(0, l.distance(new Vector3D(0, -4, -4)), 1.0e-10);
    }

    @Test
    public void testLineDistance() throws MathIllegalArgumentException {
        Line l = new Line(new Vector3D(0, 1, 1), new Vector3D(0, 2, 2), 1.0e-10);
        Assert.assertEquals(1.0,
                            l.distance(new Line(new Vector3D(1, 0, 1), new Vector3D(1, 0, 2), 1.0e-10)),
                            1.0e-10);
        Assert.assertEquals(0.5,
                            l.distance(new Line(new Vector3D(-0.5, 0, 0), new Vector3D(-0.5, -1, -1), 1.0e-10)),
                            1.0e-10);
        Assert.assertEquals(0.0,
                            l.distance(l),
                            1.0e-10);
        Assert.assertEquals(0.0,
                            l.distance(new Line(new Vector3D(0, -4, -4), new Vector3D(0, -5, -5), 1.0e-10)),
                            1.0e-10);
        Assert.assertEquals(0.0,
                            l.distance(new Line(new Vector3D(0, -4, -4), new Vector3D(0, -3, -4), 1.0e-10)),
                            1.0e-10);
        Assert.assertEquals(0.0,
                            l.distance(new Line(new Vector3D(0, -4, -4), new Vector3D(1, -4, -4), 1.0e-10)),
                            1.0e-10);
        Assert.assertEquals(FastMath.sqrt(8),
                            l.distance(new Line(new Vector3D(0, -4, 0), new Vector3D(1, -4, 0), 1.0e-10)),
                            1.0e-10);
    }
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.