Package com.kolakcc.loljclient.controller

Source Code of com.kolakcc.loljclient.controller.ChampionDetailedController

package com.kolakcc.loljclient.controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javazoom.jl.player.Player;

import com.kolakcc.loljclient.model.Champion;
import com.kolakcc.loljclient.view.ChampionDetailedView;

public class ChampionDetailedController extends KolaController implements
    ActionListener {
  Champion champion;
  ChampionDetailedView view;

  public ChampionDetailedController(Champion c) {
    this.champion = c;

    this.view = new ChampionDetailedView();
    this.setView(this.view);
    this.view.setChampion(c);

    this.view.addActionListener(this);
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    new Thread() {
      public void run() {
        try {
          Player p = new Player(
              ChampionDetailedController.this.champion
                  .getSelectionAudio());
          p.play();
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    }.start();
  }
}
TOP

Related Classes of com.kolakcc.loljclient.controller.ChampionDetailedController

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.