Package flyingdiamond.model

Examples of flyingdiamond.model.ModelUpdateCaseEnum


      //waiting for one grew and the up updated,then grow a new line and update
      //again.
      SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
          ArticleMatrix matrix = (ArticleMatrix) o;
          ModelUpdateCaseEnum updateCase =(ModelUpdateCaseEnum) arg;
          if (updateCase == ModelUpdateCaseEnum.ACTIVATED) {
            shine(matrix);
          } else if (updateCase == ModelUpdateCaseEnum.UNACTIVATED) {
            stopShine();
          } else if (updateCase == ModelUpdateCaseEnum.STRUCTURE_CHANGED) {
View Full Code Here


    exitButton.addActionListener(this);
    exitMenuItem.addActionListener(this);
  }
 
  public void update(Observable o, Object arg) {
    ModelUpdateCaseEnum updateCase =(ModelUpdateCaseEnum) arg;
    if(updateCase==ModelUpdateCaseEnum.RELOAD_PREPROCESS
       ||updateCase==ModelUpdateCaseEnum.NEW_GAME_PREPROCESS){
      setNewGameEnabled(false);
    }else if(updateCase==ModelUpdateCaseEnum.RELOAD_POSTPROCESS
         ||updateCase==ModelUpdateCaseEnum.NEW_GAME_POSTPROCESS){
View Full Code Here

  /**
   * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
   */
  public void update(final Observable o, final Object arg) {
    try {
      ModelUpdateCaseEnum updateCase =(ModelUpdateCaseEnum) arg;
      if(updateCase==ModelUpdateCaseEnum.NEW_GAME_PREPROCESS
         ||updateCase==ModelUpdateCaseEnum.GOAL
         ||updateCase==ModelUpdateCaseEnum.NEW_LEVEL){
        //NOTE:All view update work are UI work,they should be in EDT!!!
        //The update method is called by models,they are in system threads,
View Full Code Here

    // waiting for one grew and the up updated,then grow a new line and
    // update again.
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        GameRunningManager manager = (GameRunningManager) o;
        ModelUpdateCaseEnum updateCase = (ModelUpdateCaseEnum) arg;
        if (updateCase == ModelUpdateCaseEnum.LEVEL_PASSED) {
          JOptionPane.showMessageDialog(mainFrame,
              "You passed this level! Now level "
                  + manager.getLevel() + "starts...");
        }
View Full Code Here

* It observes the models,play sounds according to models' status.
*/
public class SoundView implements Observer{

  public void update(Observable o, Object arg) {
    ModelUpdateCaseEnum updateCase =(ModelUpdateCaseEnum) arg;
    if(updateCase==ModelUpdateCaseEnum.REMOVE_ARTICLE_PREPROCESS){
      ((ArticleMatrix) o).getActivatedArticle().getAudioClip().play();
    }else if(updateCase==ModelUpdateCaseEnum.BOMB_BONUS){
      SoundResourcer.getInstance().getAuidoClip(ResourceEnum.SOUND_BOMB_BONUS).play();
    }else if(updateCase==ModelUpdateCaseEnum.SUPER_BOMB_BONUS){
View Full Code Here

TOP

Related Classes of flyingdiamond.model.ModelUpdateCaseEnum

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.