Package org.mt4j.input

Examples of org.mt4j.input.IMTEventListener


     
    final FlickrLoader flickrLoader = new FlickrLoader(p, flickrApiKey, flickrSecret, sp, 100);
        flickrLoader.setFotoLoadCount(3);
        flickrLoader.setUsePlacesForGeoSearch(usePlacesForGeoSearch);
       
        flickrLoader.addProgressFinishedListener(new IMTEventListener(){
      public void processMTEvent(MTEvent mtEvent) {
        System.out.println("Loading finished!");
       
        p.getCurrentScene().registerPreDrawAction(new IPreDrawAction(){
          public boolean isLoop() {


                     
                      //Create flickr loader thread
                      final FlickrMTFotoLoader flickrLoader = new FlickrMTFotoLoader(app, flickrApiKey, flickrSecret, sp, 300);
                      flickrLoader.setFotoLoadCount(5);
                      //Define action when loader thread finished
                      flickrLoader.addProgressFinishedListener(new IMTEventListener(){
                    public void processMTEvent(MTEvent mtEvent) {
                      //Add the loaded fotos in the main drawing thread to
                      //avoid threading problems
                      registerPreDrawAction(new IPreDrawAction(){
                        public void processAction() {

* @param e the e
*/
protected void fireEvent(MTEvent e) {
    synchronized(loadingFinishedListeners) {
      for (int i = 0; i < loadingFinishedListeners.size(); i++) {
        IMTEventListener listener = loadingFinishedListeners.get(i);
        listener.processMTEvent(e);
      }
    }
  }

      }
//      String fotoUrl = foto.getSmallUrl();
      String fotoUrl = foto.getMediumUrl(); //Get the bigger photo
      image = new MTImage(p.loadImage(fotoUrl), p);

      this.addProgressFinishedListener(new IMTEventListener(){
        public void processMTEvent(MTEvent mtEvent) {
          p.getCurrentScene().registerPreDrawAction(new IPreDrawAction(){
            public boolean isLoop() {
              return false;
            }

TOP

Related Classes of org.mt4j.input.IMTEventListener

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.