亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ovenframe.java

?? 該程序是用jbuilder制作
?? JAVA
字號:
package myoven.application;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import myoven.button.*;
import myoven.beeper.*;
import myoven.door.*;
import myoven.light.*;
import myoven.powertube.*;
import myoven.timer.*;
import myoven.observer.*;

import com.borland.jbcl.layout.XYLayout;
import javax.swing.border.*;

public class OvenFrame extends JFrame {

//微波爐元素定義
  BaseButton cookButton=new BaseButton();//烹飪按鈕
//  StatefulButton cookButton=new StatefulButton();
  BaseButton cancelButton=new BaseButton();//取消按鈕
  myoven.timer.Timer timer=myoven.timer.Timer.getInstance();//計時器
  PowerTube powertube=PowerTube.getInstance();//功率管
  Light light=Light.getInstance();//燈
  Beeper beeper=Beeper.getInstance();//鳴叫器
  Door door=new Door();//爐門

//觀察者定義
  Beeper_ButtonObserver beepBtnObs=new Beeper_ButtonObserver();
  Beeper_TimerExpiredObserver beepTimExpObs=new Beeper_TimerExpiredObserver();

  Light_TimerOnObserver lgtTimOnObs=new Light_TimerOnObserver();
  Light_DoorOpenObserver lgtDoorOpenObs=new Light_DoorOpenObserver();
  Light_DoorCloseObserver lgtDoorCloseObs=new Light_DoorCloseObserver();
  Light_TimerExpiredObserver lgtTimExpObs=new Light_TimerExpiredObserver();
  Light_TimerOffObserver lgtTimOffObs=new Light_TimerOffObserver();
  Light_CancelButtonObserver lgtCanlBtnObs=new Light_CancelButtonObserver();

  PowerTube_DoorOpenObserver pwtDoorOpenObs=new PowerTube_DoorOpenObserver();
  PowerTube_TimeOffObserver pwtTimOffObs=new PowerTube_TimeOffObserver();
  PowerTube_TimerOnObserver pwtTimOnObs=new PowerTube_TimerOnObserver();
  PowerTube_TimeExpiredObserver pwtTimExpObs=new PowerTube_TimeExpiredObserver();

  Timer_CancelButtonObserver timCanlBtnObs=new Timer_CancelButtonObserver();
  Timer_CookButtonObserver timCookBtnObs=new Timer_CookButtonObserver();
  Timer_DoorOpenObserver timDoorOpenObs=new Timer_DoorOpenObserver();
  Timer_DoorCloseObserver timDoorCloseObs=new Timer_DoorCloseObserver();

  final int TIMEINTERVAL=100;//計時單位

//界面定義
  ImageIcon icon_light_on=new ImageIcon("images/light_on.gif");
  ImageIcon icon_light_off=new ImageIcon("images/light_off.gif");
  ImageIcon icon_door_open=new ImageIcon("images/door_open.gif");
  ImageIcon icon_door_close=new ImageIcon("images/door_close.gif");
  ImageIcon icon_powerTube_off=new ImageIcon("images/powerTube_off.gif");
  ImageIcon icon_powerTube_on=new ImageIcon("images/powerTube_on.gif");
  ImageIcon icon_null=new ImageIcon();
  ImageIcon icon_oven=new ImageIcon("images/oven.jpg");
  ImageIcon icon_duck=new ImageIcon("images/duck2.jpg");

  JPanel contentPane;
  JButton jButton_cookButton = new JButton();
  JButton jButton_cancelButton = new JButton();
  JRadioButton jRadioButton_DoorSwitch = new JRadioButton();
  JLabel jLabel_light = new JLabel();
  JLabel jLabel_door = new JLabel();
  JLabel jLabel_powerTube = new JLabel();
  JLabel jLabel1 = new JLabel();
  JLabel jLabel2 = new JLabel();
  XYLayout xYLayout1 = new XYLayout();
  TitledBorder titledBorder1;
  JLabel jLabel3 = new JLabel();
  JTextField jTextField_timeRemain = new JTextField();
  JLabel jLabel4 = new JLabel();

  //Construct the frame
  public OvenFrame() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
  //Component initialization
  private void jbInit() throws Exception  {
    /*------------------我的微波爐初始化開始---------------------*/
    titledBorder1 = new TitledBorder("");

    cookButton.subscribe(timCookBtnObs);//計時器預定烹飪按鈕單擊事件
    cookButton.subscribe(beepBtnObs);//鳴叫器預定烹飪按鈕單擊事件

    cancelButton.subscribe(timCanlBtnObs);//計時器預定取消按鈕單擊事件
    cancelButton.subscribe(beepBtnObs);//鳴叫器預定取消按鈕單擊事件
    cancelButton.subscribe(lgtCanlBtnObs);//指示燈預定取消按鈕單擊事件

    timer.subscribeTimerExpired(beepTimExpObs);//鳴叫器預定計時器超時事件
    timer.subscribeTimerOn(lgtTimOnObs);//燈預定計時器開始計時事件
    timer.subscribeTimerExpired(lgtTimExpObs);//燈預定計時器超時事件
    timer.subscribeTimerOff(pwtTimOffObs);//功率管預定計時器結束計時事件
    timer.subscribeTimerOn(pwtTimOnObs);//功率管預定計時器開始計時事件
    timer.subscribeTimerExpired(pwtTimExpObs);//功率管預定計時器計時超時事件

    door.subscribeDoorOpen(pwtDoorOpenObs);//功率管預定開門事件
    door.subscribeDoorOpen(timDoorOpenObs);//計時器預定開門事件
    door.subscribeDoorClose(timDoorCloseObs);//計時器預定關門事件
    door.subscribeDoorClose(lgtDoorCloseObs);//燈預定關門事件
    door.subscribeDoorOpen(lgtDoorOpenObs);//燈預定開門事件

    contentPane = (JPanel) this.getContentPane();
    jButton_cookButton.addActionListener(new OvenFrame_jButton_cookButton_actionAdapter(this));
    contentPane.setLayout(xYLayout1);
    this.setEnabled(true);
    this.setForeground(Color.cyan);
    this.setResizable(false);
    this.setSize(new Dimension(396, 279));
    this.setTitle("我的微波爐");
    jButton_cancelButton.setBackground(Color.orange);
    jButton_cancelButton.setText("取消");
    jButton_cancelButton.addActionListener(new OvenFrame_jButton_cancelButton_actionAdapter(this));
    jRadioButton_DoorSwitch.setBackground(Color.orange);
    jRadioButton_DoorSwitch.setPreferredSize(new Dimension(69, 25));
    jRadioButton_DoorSwitch.setBorderPainted(true);
    jRadioButton_DoorSwitch.setRolloverIcon(null);
    jRadioButton_DoorSwitch.setText("開門");
    jRadioButton_DoorSwitch.addActionListener(new OvenFrame_jRadioButton_DoorSwitch_actionAdapter(this));
    jButton_cookButton.setBackground(Color.orange);
    jButton_cookButton.setIcon(null);
    jButton_cookButton.setText("烹飪");
    jLabel_light.setDisabledIcon(null);
    jLabel_light.setIcon(icon_light_off);
    jLabel_door.setIcon(icon_door_close);
    jLabel_door.setText("");
    jLabel_powerTube.setIcon(icon_powerTube_off);
    jLabel_powerTube.setText("");
    jLabel1.setText("爐門:");
    jLabel2.setText("功率管:");
    contentPane.setBackground(new Color(59, 190, 85));
    contentPane.setEnabled(true);
    contentPane.setForeground(Color.gray);
    contentPane.setBorder(BorderFactory.createRaisedBevelBorder());
    contentPane.setDebugGraphicsOptions(0);
    contentPane.setDoubleBuffered(true);
    contentPane.setOpaque(true);
    jLabel3.setIcon(icon_duck);
    jLabel3.setText("");
    jTextField_timeRemain.setEditable(false);
    jTextField_timeRemain.setSelectedTextColor(Color.white);
    jTextField_timeRemain.setText("");
    jTextField_timeRemain.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel4.setText("剩余時間:");
    contentPane.add(jButton_cookButton, new XYConstraints(317, 67, -1, -1));
    contentPane.add(jRadioButton_DoorSwitch,      new XYConstraints(319, 159, 56, -1));
    contentPane.add(jLabel2, new XYConstraints(11, 23, -1, -1));
    contentPane.add(jLabel_powerTube, new XYConstraints(59, 18, 25, -1));
    contentPane.add(jLabel3,     new XYConstraints(52, 66, 228, 135));
    contentPane.add(jLabel1, new XYConstraints(133, 21, -1, -1));
    contentPane.add(jLabel_door, new XYConstraints(178, 18, -1, -1));
    contentPane.add(jTextField_timeRemain,  new XYConstraints(114, 219, 58, -1));
    contentPane.add(jLabel4,  new XYConstraints(59, 221, 52, 15));
    contentPane.add(jLabel_light, new XYConstraints(242, 13, -1, -1));
    contentPane.add(jButton_cancelButton, new XYConstraints(318, 113, -1, -1));
  }

  public void  workingState(){ //監聽微波爐工作狀態,以便界面顯示
    while(true){
      if(door.getIsOpen()){//門處于打開狀態
        jLabel_door.setIcon(icon_door_open);//顯示開啟的門
      }else{//門閉合
        jLabel_door.setIcon(icon_door_close);//顯示關閉的門
      }
      if(light.getIsOn()){//燈開了
        jLabel_light.setIcon(icon_light_on);//顯示開了的燈
      }else{//燈關了
        jLabel_light.setIcon(icon_light_off);//顯示關了的燈
      }
      if(powertube.getIsOn()){//功率管開了
        jTextField_timeRemain.setText(Integer.toString(timer.getTime_remaining()));//顯示烹飪時候剩余時間
        jLabel_powerTube.setIcon(icon_powerTube_on);//顯示功率管處于工作狀態的圖標
      }else{//功率管關了
        jTextField_timeRemain.setText("0");//顯示烹飪剩余時間=0,即烹飪結束
        jLabel_powerTube.setIcon(icon_powerTube_off);//顯示功率管處于非工作狀態的圖標
      }
      try{
        Thread.sleep(TIMEINTERVAL);//每個時間TIMEINTERVAL 監聽一次微波爐個組成元素的狀態
      }catch(InterruptedException e){}
    }
  }
/*
  JProgressBar jProgressBar1 = new JProgressBar(0,60);
  public void Progress(){//進度條,未實現
    num=0;
    int totalTime=-1;
 while(true){
      if((timer.getIsOn()&&timer.getTime_remaining()==0)){//剩余時間==0并且isOn,說明烹飪結束
        return;
      }
      if(totalTime==-1&&timer.getTime_remaining()!=0){
        totalTime=timer.getTime_remaining();
      }

      System.out.println("進度條位置:"+((totalTime-timer.getTime_remaining())==-1?0:totalTime-timer.getTime_remaining()));
      jProgressBar1.setValue((totalTime-timer.getTime_remaining())==-1?0:totalTime-timer.getTime_remaining());
      try{
        Thread.sleep(1000);//TIMEINTERVAL);
      }catch(InterruptedException e){}
//      num+=95;
    }
  }
  JProgressBar current = new JProgressBar(0,2000);
  //JProgressBar current = new JProgressBar();
 public void iterate(){
   num=0;
       while(num<2000){
         System.out.println("current:"+num);
                current.setValue(num);
                try{
                        Thread.sleep(1000);
                }
                catch(InterruptedException e){}
                num+=95;
        }
}
*/
  //Overridden so we can exit when window is closed
  protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
      System.exit(0);
    }
  }

  void jButton_cookButton_actionPerformed(ActionEvent e) {//烹飪按鈕
    cookButton.pressed();//給烹飪按鈕發消息
  }
  void jButton_cancelButton_actionPerformed(ActionEvent e) {//取消按鈕
    cancelButton.pressed();//給取消按鈕發消息
  }

  void jRadioButton_DoorSwitch_actionPerformed(ActionEvent e) {
System.out.println(jRadioButton_DoorSwitch.isSelected());
    if(jRadioButton_DoorSwitch.isSelected()){
      jRadioButton_DoorSwitch.setText("關門");
      door.open();//打開門(radio處于選中狀態)isOpen=true;
    }
    else{
      jRadioButton_DoorSwitch.setText("開門");
      door.close();//關閉門(radio非選中狀態) isOpen=false;
    }
  }
}

class OvenFrame_jButton_cookButton_actionAdapter implements java.awt.event.ActionListener {
  OvenFrame adaptee;

  OvenFrame_jButton_cookButton_actionAdapter(OvenFrame adaptee) {
    this.adaptee = adaptee;
  }
  public void actionPerformed(ActionEvent e) {
    adaptee.jButton_cookButton_actionPerformed(e);
  }
}

class OvenFrame_jButton_cancelButton_actionAdapter implements java.awt.event.ActionListener {
  OvenFrame adaptee;

  OvenFrame_jButton_cancelButton_actionAdapter(OvenFrame adaptee) {
    this.adaptee = adaptee;
  }
  public void actionPerformed(ActionEvent e) {
    adaptee.jButton_cancelButton_actionPerformed(e);
  }
}

class OvenFrame_jRadioButton_DoorSwitch_actionAdapter implements java.awt.event.ActionListener {
  OvenFrame adaptee;

  OvenFrame_jRadioButton_DoorSwitch_actionAdapter(OvenFrame adaptee) {
    this.adaptee = adaptee;
  }
  public void actionPerformed(ActionEvent e) {
    adaptee.jRadioButton_DoorSwitch_actionPerformed(e);
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一级在线观看| 99国产精品99久久久久久| 国产电影一区在线| 一本久久a久久免费精品不卡| 日韩欧美在线123| 亚洲日本韩国一区| 国产高清在线精品| 欧美xxxx老人做受| 天天色综合天天| 日本韩国精品一区二区在线观看| 久久久三级国产网站| 美国欧美日韩国产在线播放| 91精品福利在线| 国产精品久久久久一区二区三区共| 日本一区中文字幕 | 国产精品1区2区| 欧美精品欧美精品系列| 一区二区三区美女视频| 波多野结衣亚洲| 国产精品毛片高清在线完整版| 久久国产日韩欧美精品| 777奇米成人网| 丝袜国产日韩另类美女| 欧美三电影在线| 亚洲一区二区三区不卡国产欧美| 91久久精品一区二区三区| 国产精品超碰97尤物18| av资源站一区| 中文字幕一区二区三区在线观看 | 亚洲精品日日夜夜| 成人久久视频在线观看| 国产精品国产三级国产普通话99| 成人精品免费视频| 自拍偷拍亚洲欧美日韩| 色综合久久综合网欧美综合网| 亚洲欧洲在线观看av| 99久久夜色精品国产网站| 1区2区3区精品视频| 91一区二区在线观看| 一区二区在线看| 欧美日韩一区中文字幕| 免费观看在线综合色| 久久久www成人免费毛片麻豆| 国产盗摄视频一区二区三区| 中文成人av在线| 一本到不卡精品视频在线观看| 亚洲成人av在线电影| 日韩午夜三级在线| 国产高清精品网站| 一区二区三区在线视频免费观看| 欧洲一区在线观看| 蜜臀av亚洲一区中文字幕| 26uuu成人网一区二区三区| 成人av在线资源网站| 亚洲精品国产a| 欧美一区二区三区在线观看| 国产乱码精品1区2区3区| 国产精品久久久久久久午夜片| 色婷婷狠狠综合| 日本欧美韩国一区三区| 国产三级精品视频| 在线精品视频一区二区三四| 奇米影视一区二区三区小说| 久久精品男人天堂av| 91久久国产最好的精华液| 蜜臀久久久久久久| 18欧美乱大交hd1984| 91精品国产日韩91久久久久久| 国产精品自拍网站| 一区二区国产盗摄色噜噜| 欧美一个色资源| 99久久精品免费精品国产| 婷婷综合另类小说色区| 中文字幕免费观看一区| 91精品国模一区二区三区| 成人免费毛片a| 久久精品噜噜噜成人88aⅴ| 亚洲色图欧洲色图婷婷| 精品国产免费人成在线观看| 94色蜜桃网一区二区三区| 精品亚洲国内自在自线福利| 亚洲一区二区在线播放相泽| 中文字幕不卡的av| 精品日韩欧美在线| 欧美日韩国产一级片| av爱爱亚洲一区| 国产毛片一区二区| 日本视频一区二区| 亚洲图片自拍偷拍| 伊人婷婷欧美激情| 中文字幕一区二区三区四区不卡| 精品国产一区二区亚洲人成毛片| 欧美视频自拍偷拍| 94-欧美-setu| 99国产精品久久久久久久久久| 国产精品88av| 国产精品77777| 国产乱人伦偷精品视频免下载| 日本不卡视频一二三区| 亚洲图片欧美一区| 亚洲国产一区二区视频| 又紧又大又爽精品一区二区| 国产精品久久久久久久久久久免费看| 精品日韩在线一区| 日韩欧美一区二区不卡| 91.com视频| 日韩欧美aaaaaa| 精品国产不卡一区二区三区| 欧美电影免费观看高清完整版在 | 精品久久久久久综合日本欧美| 欧美丰满美乳xxx高潮www| 欧美婷婷六月丁香综合色| 色av一区二区| 欧美婷婷六月丁香综合色| 欧美日韩国产色站一区二区三区| 欧美怡红院视频| 欧美唯美清纯偷拍| 欧美日韩黄色影视| 欧美一区二区二区| 欧美xfplay| 欧美高清在线一区| 亚洲女与黑人做爰| 亚洲制服丝袜av| 日本欧美久久久久免费播放网| 捆绑变态av一区二区三区| 久草在线在线精品观看| 国产乱人伦精品一区二区在线观看| 国产盗摄一区二区三区| jvid福利写真一区二区三区| 91麻豆国产福利精品| 欧美男男青年gay1069videost | 在线观看成人免费视频| 欧美日韩精品综合在线| 91精品国产欧美一区二区成人| 日韩一级免费一区| 亚洲国产精品成人综合色在线婷婷 | 国产精品理伦片| 亚洲黄色免费电影| 奇米四色…亚洲| 成人午夜免费电影| 欧美午夜电影在线播放| 26uuu国产在线精品一区二区| 1区2区3区国产精品| 免费美女久久99| av一区二区三区在线| 欧美精品国产精品| 久久青草国产手机看片福利盒子| 亚洲视频每日更新| 男人的j进女人的j一区| 成人av午夜电影| 欧美一区二区三区男人的天堂| 久久久久久久久岛国免费| 又紧又大又爽精品一区二区| 久久精品99国产国产精| 色就色 综合激情| 国产无人区一区二区三区| 亚洲一区二区三区爽爽爽爽爽| 国产精品一区二区黑丝| 欧美丝袜自拍制服另类| 中文字幕乱码日本亚洲一区二区| 亚洲成人免费av| 不卡av免费在线观看| 日韩欧美电影在线| 一区二区三区在线免费视频| 国产精品一区二区三区99| 337p亚洲精品色噜噜噜| 亚洲少妇中出一区| 国产sm精品调教视频网站| 884aa四虎影成人精品一区| 亚洲欧洲成人精品av97| 久久不见久久见免费视频1| 在线观看中文字幕不卡| 国产精品视频观看| 国产一区二区美女诱惑| 欧美一区二区在线免费播放| 亚洲激情男女视频| 色综合中文字幕| 欧美视频在线一区| 久久久777精品电影网影网 | 国产一区二区三区高清播放| 91.xcao| 三级久久三级久久久| 欧美亚洲国产一区二区三区va| 久久精品亚洲乱码伦伦中文| 毛片不卡一区二区| 4438成人网| 日本强好片久久久久久aaa| 在线观看av不卡| 一区二区成人在线观看| 99久久精品国产导航| 最新高清无码专区| av男人天堂一区| 国产亚洲精品福利| 国产美女一区二区三区| 精品裸体舞一区二区三区| 老司机一区二区| 久久无码av三级| 国产成人免费视频| 中文字幕+乱码+中文字幕一区| 国产一区二区看久久|