Examples of Point2D


Examples of com.marimon.image.framework.datamodel.Point2D

        ShortSample2D[][] samples = new ShortSample2D[signal.getSizeX()][signal
                .getSizeY()];
        for (int i = 0; i < signal.getSizeX(); i++) {
            for (int j = 0; j < signal.getSizeY(); j++) {
                Sample2D samp = signal.getPixel(i, j);
                Point2D point = samp.getPoint();
                samples[i][j] = new ShortSample2D(point, new ShortSampleValue(
                        samp.getValue().shortValue()));
            }
        }
        return new ShortMatrixSignal(samples);
View Full Code Here

Examples of com.math.Point2D

    slider.setValue(0);
    World.cam.setLinVel(v);
  }

  public void propertyChange(PropertyChangeEvent e) {
    Point2D p = (Point2D)e.getNewValue();
    World.cam.setVel(p.x/10f, p.y/10f);
  }
View Full Code Here

Examples of com.sun.javafx.geom.Point2D

   * Gets the center of the specified rectangle.
   * @param rect
   * @return
   */
  public static Point2D center(Rectangle2D rect) {
    Point2D c = new Point2D(
        (float) (rect.getMinX() + rect.getWidth() / 2),
        (float) (rect.getMinY() + rect.getHeight() / 2));
   
    return c;
  }
View Full Code Here

Examples of graphics.common.Point2D

    Random rand = new Random( System.nanoTime() );
    final int listSize = 400;
    GraphicsObject[] objList = new GraphicsObject[ listSize ];
    List< GraphicsObject > objList2 = new LinkedList< GraphicsObject >();
    for( int i = 0; i < listSize; i++ ) {
      Point2D tempPoint = new Point2D( rand.nextInt( window.getWidth() - 30 ) + 30, rand.nextInt( window.getHeight() - 30 ) + 30 );
      Size2D tempSize = new Size2D( rand.nextInt( 30 ) + 21, rand.nextInt( 30 ) + 21 );
      GraphicsObject obj = new JavaSprite( "fenceright",
          tempPoint, tempSize );
      objList[ i ] = obj;
      objList2.add( obj );
    }
    GraphicsObject obj = new JavaSprite( "fenceright",
        new Point2D( 15, 31 ), new Size2D( 80, 80 ) );
   
    GraphicsObject elp1 = new Oval( new Point2D( 50, 50 ), new Size2D( 30, 16 ) );
    ((Oval)elp1).setColor( new Color( 255, 0, 0 ) );
    GraphicsObject elp2 = new Oval( new Point2D( 300, 300 ), new Size2D( 30, 16 ),
                      new Color( 255, 0, 0 ) );
    GraphicsObject cur = new BezierCurve( new Point2D( 65, 58 ), new Point2D( 315, 108 ),
                  new Point2D( 315, 208 ), new Point2D( 315, 308 ),
                  new Color( 255, 255, 0 ), 100 );
   
    Network network = new Network();
    Network.Node n1 = network.new Node( new Oval( new Point2D( 100, 100 ), new Size2D( 30, 15 ) ) );
    Network.Node n2 = network.new Node( new Oval( new Point2D( 200, 450 ), new Size2D( 30, 15 ) ) );
    Network.Node n3 = network.new Node( new Oval( new Point2D( 30, 200 ), new Size2D( 30, 15 ) ) );
    Network.Node n4 = network.new Node( new Oval( new Point2D( 500, 40 ), new Size2D( 30, 15 ) ) );
    network.addNode( n1 );
    network.addNode( n2 );
    network.addNode( n3 );
    network.addNode( n4 );
    network.addEdge( n1, n2 );
    network.addEdge( n1, n4 );
    //network.addEdge( n2, n3 );
    //network.addEdge( n4, n3 );
   
    Timer timer = new Timer();
    int frames = 0, prevFrames = 0;
    int timePassed = 0;
    timer.start();
    while( true ) {
      kb.poll();
      if( kb.keyDown( KeyEvent.VK_Q ) ) {
        break;
      }
      if( kb.keyDown( KeyEvent.VK_A ) ) {
        Point2D tempPoint = new Point2D( rand.nextInt( window.getWidth() ), rand.nextInt( window.getHeight() ) );
        Size2D tempSize = new Size2D( rand.nextInt( 30 ) + 21, rand.nextInt( 30 ) + 21 );
        GraphicsObject obj2 = new JavaSprite( "fenceright",
            tempPoint, tempSize );
        objList2.add( obj2 );
      }
View Full Code Here

Examples of java.awt.geom.Point2D

    if (totalHeight < width) totalHeight = width;
   
    GeneralPath path = computeShield(width, totalHeight);
    for (int i = 0; i < inputs; i++) {
      Location loci = OrGate.FACTORY.getInputOffset(attrs, i);
      Point2D p = new Point2D.Float(loci.getX() + 1, loci.getY());
      int iters = 0;
      while (path.contains(p) && iters < 15) {
        iters++;
        p.setLocation(p.getX() + 1, p.getY());
      }
      if (iters >= 15) iters = 0;
      lengths[i] = iters;
    }
   
View Full Code Here

Examples of java.awt.geom.Point2D

            String string, JustificationInfo info, GlyphVector vector) {
        float adjust = 0.0f;
        for (int i = 0; i < string.length(); i++) {
            char c = string.charAt(i);
            if (i != 0) {
                Point2D point = vector.getGlyphPosition(i);
                vector.setGlyphPosition(
                        i, new Point2D.Double(point.getX() + adjust, point.getY()));
            }
            if (c == ' ' || c == '\u00a0' || c == '\u3000') {
                adjust += info.getSpaceAdjust();
            } else {
                adjust += info.getNonSpaceAdjust();
View Full Code Here

Examples of java.awt.geom.Point2D

            bounds = box.getPaintingInfo().getAggregateBounds();
        } else {
            bounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c);
        }

        Point2D docCorner = new Point2D.Double(bounds.x, bounds.y + bounds.height);
        Point2D pdfCorner = new Point.Double();
        _transform.transform(docCorner, pdfCorner);
        pdfCorner.setLocation(pdfCorner.getX(), normalizeY((float) pdfCorner.getY()));

        com.lowagie.text.Rectangle result = new com.lowagie.text.Rectangle(
                (float) pdfCorner.getX(), (float) pdfCorner.getY(),
                (float) pdfCorner.getX() + getDeviceLength(bounds.width),
                (float) pdfCorner.getY() + getDeviceLength(bounds.height));
        return result;
    }
View Full Code Here

Examples of java.awt.geom.Point2D

    }

    final String positionText = result1.getProperty("position");
    if (positionText != null)
    {
      final Point2D pos = (Point2D) new Point2DConverter().convertFromString(positionText, getLocator());
      getStyle().setStyleProperty(ElementStyleKeys.POS_X, new Float(pos.getX()));
      getStyle().setStyleProperty(ElementStyleKeys.POS_Y, new Float(pos.getY()));
    }

    final String minSizeText = result1.getProperty("minimumSize");
    if (minSizeText != null)
    {
View Full Code Here

Examples of java.awt.geom.Point2D

   *
   * @return The object.
   */
  public Object createObject()
  {
    final Point2D point = new Point2D.Float();

    final float x = getFloatParameter("x");
    final float y = getFloatParameter("y");
    point.setLocation(x, y);
    return point;
  }
View Full Code Here

Examples of java.awt.geom.Point2D

    if (!(o instanceof Point2D))
    {
      throw new ObjectFactoryException("The given object is no java.awt.geom.Point2D.");
    }

    final Point2D point = (Point2D) o;
    final float x = (float) point.getX();
    final float y = (float) point.getY();

    setParameter("x", new Float(x));
    setParameter("y", new Float(y));
  }
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.