Package fr.umlv.zen2

Examples of fr.umlv.zen2.MotionEvent


  /**
   * Main function
   * @param args
   */
  public static void main(String[] args) {
    Application.run(EscapeIR.TITLE, EscapeIR.WIDTH, EscapeIR.HEIGHT, new ApplicationCode() {
      /**
       * Associates identifiers with states
       */
      private HashMap<StateID, AbstractState> states = new HashMap<>();

View Full Code Here


   * Render the gestures and the level
   * {@link AbstractState#render()}
   */
  @Override
  public void render() {
    this.getContext().render(new ApplicationRenderCode() {
      @Override
      public void render(Graphics2D graphics) {
        Graphics2D db = (Graphics2D) bi.getGraphics();
        db.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        db.setColor(Color.BLACK);
View Full Code Here

  public void update(double delta) {
  }

  @Override
  public void render() {
    this.getContext().render(new ApplicationRenderCode() {
      @Override
      public void render(Graphics2D graphics) {
              graphics.setColor(Color.BLACK);
              graphics.fill(new Rectangle(0, 0, EscapeIR.WIDTH, EscapeIR.HEIGHT));
             
View Full Code Here

  public void update(double delta) {
  }

  @Override
  public void render() {
    this.getContext().render(new ApplicationRenderCode() {
      @Override
      public void render(Graphics2D graphics) {
              graphics.setColor(Color.BLACK);
              graphics.fill(new Rectangle(0, 0, EscapeIR.WIDTH, EscapeIR.HEIGHT));
             
View Full Code Here

   * Update the point list representing a possible gesture
   * @param context The application context to handle event
   */
  public void update(ApplicationContext context) {
        while (true) {
            final MotionEvent event = context.pollMotion();
            if (event == null)
              break;

            if (this.capturing == false && event.getKind() == MotionEvent.Kind.ACTION_DOWN) {
            this.points = new ArrayList<>();
            this.capturing = true;
            this.setGesture(GestureID.UNKNOWN);
            this.points.add(new Point(event.getX(), event.getY()));
          } else if (this.capturing == true && event.getKind() == MotionEvent.Kind.ACTION_UP) {
            this.capturing = false;
            this.analyze();
          } else if (this.capturing == true && event.getKind() == MotionEvent.Kind.ACTION_MOVE) {
            this.points.add(new Point(event.getX(), event.getY()));
          }
        }
  }
View Full Code Here

TOP

Related Classes of fr.umlv.zen2.MotionEvent

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.