Package cl.alejo.jcsim.csim.circuit

Examples of cl.alejo.jcsim.csim.circuit.Point


  public ClkDescriptor(ParamClk params) {
    super();
    this.params = params;
    this.pointPin = new cl.alejo.jcsim.csim.circuit.Point[1];
    this.typeOfGate = GateDescriptor.GATE_TYPE_NORMAL;
    this.pointPin[0] = new Point(10, 10); // El pinIn 1
    this.sGateName = "ClkDesc";
    this.pinCount = 1;
  }
View Full Code Here


   * @param y
   *            int
   */
  public void apply(int x, int y) {
    // Y Aplicamos el click en el lugar adecuado
    Point point = toGateCoords(x, y);
    gate.apply(point._x, point._y);
  }
View Full Code Here

   * @param y
   *            int
   */
  public boolean contains(int x, int y) {
    // El centro
    Point pointA = getCenter();

    // Obtengo el punto en coordenas del gate
    // Y la gracia es que esta rotado
    Point pointB = toGateCoords(x, y);

    // Lo traslado devuelta
    pointB._x += pointA._x;
    pointB._y += pointA._y;

View Full Code Here

      // Primero un punto2d
      transRotate.inverseTransform(p2d, p2d);
    } catch (Exception e) {
      System.out.println("No invertible");
    }
    return new Point((int) p2d.getX(), (int) p2d.getY());
  }
View Full Code Here

      // Primero un punto2d
      transRotate.transform(p2d, p2d);
    } catch (Exception e) {
      System.out.println("No invertible");
    }
    return new Point((int) p2d.getX(), (int) p2d.getY());
  }
View Full Code Here

    AffineTransform transRotTemp = new AffineTransform();
    transRotTemp.setToIdentity();
    transRotTemp.rotate(Math.toRadians(90));

    // Cambio la transformacion de traslacion
    Point ptC = new cl.alejo.jcsim.csim.circuit.Point((int) this.transTranslate.getTranslateX(),
      (int) transTranslate.getTranslateY());
    Point pt = new Point(_x - ptC._x, _y - ptC._y);
    Point ptRot = new cl.alejo.jcsim.csim.circuit.Point(ptC._x + pt._x, ptC._y + pt._y);
    Point2D.Double p2d = new Point2D.Double(-pt._x, -pt._y);
    transRotTemp.transform(p2d, p2d);
    p2d = new java.awt.geom.Point2D.Double(Circuit.gridTrunc((int) p2d.getX()), Circuit.gridTrunc((int) p2d.getY()));
    // El nuevo centro donde debe estar ubicada la compuerta
    Point2D.Double ptNewCenter = new Point2D.Double(ptRot._x + p2d.x + Circuit.GRIDSIZE, ptRot._y + p2d.y);
View Full Code Here

   *            int
   */
  public Point toGateCoords(int x, int y) {

    // TRansformo el punto a coordenadas de la compuerta
    Point pointA = getCenter();
    Point pointB = new Point(x, y);
    pointB._x -= pointA._x;
    pointB._y -= pointA._y;
    Point pointC = rotatedPoint(pointB._x, pointB._y);

    // Listo
    return pointC;
  }
View Full Code Here

   */
  public Point transformedPoint(int x, int y) {
    // Primero un punto2d
    java.awt.geom.Point2D.Double p2d = new java.awt.geom.Point2D.Double(x, y);
    transform.transform(p2d, p2d);
    return new Point((int) p2d.getX(), (int) p2d.getY());
  }
View Full Code Here

   */
  public Point transformedPoint(Point p) {
    // Primero un punto2d
    java.awt.geom.Point2D.Double p2d = new java.awt.geom.Point2D.Double(p._x, p._y);
    transform.transform(p2d, p2d);
    return new Point((int) p2d.getX(), (int) p2d.getY());
  }
View Full Code Here

   */
  public TreeStateDescriptor(GateParameters params) {
    super();
    this.params = params;
    this.pointPin = new Point[3];
    this.pointPin[0] = new Point(0, 16); // El pinOut
    this.pointPin[1] = new Point(16, 0); // El pinIn
    this.pointPin[2] = new Point(-16, 0);
    this.sGateName = "TreeStateDesc";
    this.pinCount = 3;
  }
View Full Code Here

TOP

Related Classes of cl.alejo.jcsim.csim.circuit.Point

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.