/*
 * Copyright (C) 2015 Pedro Vicente Gomez Sanchez.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.pedrovgs.lynx.presenter;

import com.github.pedrovgs.lynx.model.Trace;
import java.util.List;

/**
 * Presenter created to decouple Lynx library view implementations from Lynx model. This presenter
 * responsibility is related to all the presentation logic to Lynx UI implementations. Lynx UI
 * implementations have to implement LynxPresenter.View interface.
 *
 * @author Pedro Vicente Gómez Sánchez.
 */
public class LynxPresenter {

  private final View view;

  public LynxPresenter(View view) {
    this.view = view;
  }

  public void resume() {

  }

  public void pause() {

  }

  public interface View {

    void showTraces(List<Trace> traces);
  }
}

@@ -651,16 +651,60 @@
 enter;%0A%0A
+import com.github.pedrovgs.lynx.model.Lynx;%0A
 import c
@@ -1107,36 +1107,133 @@
 ter 
-%7B%0A%0A  private final View view
+implements Lynx.LynxListener %7B%0A%0A  private final Lynx lynx;%0A  private final View view;%0A  private final TraceBuffer traceBuffer
 ;%0A%0A 
@@ -1254,16 +1254,27 @@
 esenter(
+Lynx lynx, 
 View vie
@@ -1291,81 +1291,323 @@
 his.
-view = view;%0A  %7D%0A%0A  public void resume() %7B%0A%0A  %7D%0A%0A  public void pause() %7B%0A
+lynx = lynx;%0A    this.view = view;%0A    this.traceBuffer = new TraceBuffer();%0A  %7D%0A%0A  public void resume() %7B%0A    lynx.registerListener(this);%0A    lynx.startReading();%0A  %7D%0A%0A  public void pause() %7B%0A    lynx.unregisterListener(this);%0A    lynx.stopReading();%0A  %7D%0A%0A  @Override public void onNewTraces(List%3CTrace%3E traces) %7B
 %0A  %7D

Add basic implementation for resume and pause methods in LynxPresenter