<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 14,  comments - 7,  trackbacks - 0
    項(xiàng)目需求:1.病人來(lái)掛號(hào)時(shí)根據(jù)自己想找的醫(yī)生掛相應(yīng)的醫(yī)生的號(hào),即加到相應(yīng)醫(yī)生的病人隊(duì)列中。
                       2.醫(yī)生看見(jiàn)自己的屏幕,點(diǎn)擊自己的名字,得到自己相應(yīng)列表的下一位病人
    具體代碼如下:
    醫(yī)生:
    package com.dr.queue;

    import java.util.LinkedList;
    import java.util.List;
    import java.util.Queue;

    public class Doctor {
        
    private String dName;
        
    private int dNum;
        
    private Queue<Patient> patientList;
        
    private Patient p;

        
    public Patient getP() {
            
    return p;
        }


        
    public void setP(Patient p) {
            
    this.p = p;
        }


        
    public Doctor(String name, int dNum) {
            
    this.setdName(dName);
            
    this.setdNum(dNum);
            patientList 
    = new LinkedList<Patient>();
            
    // this.setPatientList(new LinkedList<Patient>());
        }


        
    public Queue<Patient> getPatientList() {
            
    return patientList;
        }


        
    // public void setPatientList(Queue<Patient> patientList) {
        
    // this.patientList = patientList;
        
    // }
        public String getdName() {
            
    return dName;
        }


        
    public void setdName(String dName) {
            
    this.dName = dName;
        }


        
    public int getdNum() {
            
    return dNum;
        }


        
    public void setdNum(int dNum) {
            
    this.dNum = dNum;
        }


        
    public void offerPatient(Patient patient) {
            
    this.patientList.offer(patient);
            
    // return patientList;
        }


        
    public void looking() {
            System.out.println(
    "I handling the " + this.p.getpNum() + " waiter");
            
    try {
                Thread.sleep(
    100);
            }
     catch (InterruptedException e) {
                e.printStackTrace();
            }

            System.out.println(
    "I have handled the patient,next ,next ,next");

        }


    }

    病人:
    package com.dr.queue;

    public class Patient {
        
    private String pName;
    package com.dr.ui;

    import java.util.Queue;

    import org.eclipse.swt.SWT;
    import org.eclipse.swt.events.SelectionAdapter;
    import org.eclipse.swt.events.SelectionEvent;
    import org.eclipse.swt.graphics.Font;
    import org.eclipse.swt.widgets.Button;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.widgets.Text;

    import com.dr.queue.Patient;
    import com.dr.queue.QueueServer;

    public class DoctorQueueUI {
        
    public static void main(String[] args) {
            
    final Display display = Display.getDefault();
            
    final Shell shell = new Shell();
            shell.setMaximized(
    true);
            shell.setText(
    "醫(yī)生使用客戶端");

            
    // final Map<Doctor,List<Patient>> m = new
            
    // HashMap<Doctor,List<Patient>>();

            
    final Text txt = new Text(shell, SWT.MULTI);
            txt.setBounds(
    35050500450);

            QueueServer qs 
    = new QueueServer();
            
    final Queue<Patient> rosePL = qs.init("rose");
            
    final Queue<Patient> xiaoPL = qs.init("xiaoxiao");
            
    final Queue<Patient> yangPL = qs.init("yangguang");

            
    final Button button1 = new Button(shell, SWT.Activate);
            button1.setBounds(
    25053020075); // 設(shè)置按鈕位置
            button1.setFont(new Font(display, "宋體"12, SWT.BOLD));
            button1.setText(
    "一號(hào)專(zhuān)家rose");// 設(shè)置按鈕上的文字

            button1.addSelectionListener(
    new SelectionAdapter() {
                
    public void widgetSelected(SelectionEvent e) {

                    Patient patient 
    = rosePL.poll();

                    
    if (patient != null{
                        txt.setText(
    "請(qǐng)" + patient.getpNum() + "號(hào)病人到一號(hào)專(zhuān)家rose這就診!");
                    }
     else {
                        txt.setText(
    "現(xiàn)在沒(méi)有病人就診,您可以休息一下!");
                    }

                    
    //                    
                }

            }
    );
            
    final Button button2 = new Button(shell, SWT.Activate);
            button2.setBounds(
    50053020075); // 設(shè)置按鈕位置
            button2.setFont(new Font(display, "宋體"12, SWT.BOLD));
            button2.setText(
    "二號(hào)專(zhuān)家xiaoxiao");// 設(shè)置按鈕上的文字

            button2.addSelectionListener(
    new SelectionAdapter() {
                
    public void widgetSelected(SelectionEvent e) {
                    Patient patient 
    = xiaoPL.poll();
                    
    if (patient != null{
                        txt
                                .setText(
    "請(qǐng)" + patient.getpNum()
                                        
    + "號(hào)病人到二號(hào)專(zhuān)家xiaoxiao這就診");
                    }
     else {
                        txt.setText(
    "現(xiàn)在沒(méi)有病人就診,您可以休息一下");
                    }

                    
    //                        
                }

            }
    );
            
    final Button button3 = new Button(shell, SWT.Activate);
            button3.setBounds(
    75053020075); // 設(shè)置按鈕位置
            button3.setFont(new Font(display, "宋體"12, SWT.BOLD));
            button3.setText(
    "三好專(zhuān)家yangguang");// 設(shè)置按鈕上的文字

            button3.addSelectionListener(
    new SelectionAdapter() {
                
    public void widgetSelected(SelectionEvent e) {

                    Patient patient 
    = yangPL.poll();

                    
    if (patient != null{
                        txt.setText(
    "請(qǐng)" + patient.getpNum()
                                
    + "號(hào)病人到三好專(zhuān)家yangguang這就診");
                    }
     else {
                        txt.setText(
    "現(xiàn)在沒(méi)有病人就診,您可以休息一下");
                    }

                    
    //                            
                }

            }
    );

            shell.layout();
            shell.open();
            
    while (!shell.isDisposed()) {
                
    if (!display.readAndDispatch())
                    display.sleep();
            }


        }

    }


        
    private int pNum;
        
    private int frontNum;
        
    public int getFrontNum() {
            
    return frontNum;
        }

        
    public void setFrontNum(int frontNum) {
            
    this.frontNum = frontNum;
        }

        
    public String getpName() {
            
    return pName;
        }

        
    public void setpName(String pName) {
            
    this.pName = pName;
        }

        
    public int getpNum() {
            
    return pNum;
        }

        
    public void setpNum(int pNum) {
            
    this.pNum = pNum;
        }

        
    }

    病人掛號(hào)界面UI:
    package com.dr.ui;

    import java.util.HashMap;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.Map;
    import java.util.Queue;

    import org.eclipse.swt.SWT;
    import org.eclipse.swt.events.SelectionAdapter;
    import org.eclipse.swt.events.SelectionEvent;
    import org.eclipse.swt.graphics.Font;
    import org.eclipse.swt.widgets.Button;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.widgets.Text;

    import com.dr.queue.Doctor;
    import com.dr.queue.Patient;
    import com.dr.queue.QueueServer;

    public class PatientQueueUI {
        
    public static void main(String[] args) {
            
    final Display display = Display.getDefault();
            
    final Shell shell = new Shell();
            shell.setMaximized(
    true);
            shell.setText(
    "醫(yī)院排隊(duì)病人使用客戶端");

            
    // final Map<Doctor,Queue<Patient>> m = new
            
    // HashMap<Doctor,Queue<Patient>>();
            QueueServer qs = new QueueServer();
            
    final Queue<Patient> rosePL = qs.init("rose");
            
    final Queue<Patient> xiaoPL = qs.init("xiaoxiao");
            
    final Queue<Patient> yangPL = qs.init("yangguang");

            
    final Text txt = new Text(shell, SWT.MULTI);
            txt.setBounds(
    35050500450);

            
    final Button button1 = new Button(shell, SWT.Activate);
            button1.setBounds(
    25053020075); // 設(shè)置按鈕位置
            button1.setFont(new Font(display, "宋體"12, SWT.BOLD));
            button1.setText(
    "一號(hào)專(zhuān)家rose");// 設(shè)置按鈕上的文字
            final Button button2 = new Button(shell, SWT.Activate);
            button2.setBounds(
    50053020075); // 設(shè)置按鈕位置
            button2.setFont(new Font(display, "宋體"12, SWT.BOLD));
            button2.setText(
    "二號(hào)專(zhuān)家xiaoxiao");// 設(shè)置按鈕上的文字
            final Button button3 = new Button(shell, SWT.Activate);
            button3.setBounds(
    75053020075); // 設(shè)置按鈕位置
            button3.setFont(new Font(display, "宋體"12, SWT.BOLD));
            button3.setText(
    "三號(hào)專(zhuān)家yangguang");// 設(shè)置按鈕上的文字

            button1.addSelectionListener(
    new SelectionAdapter() {
                
    public void widgetSelected(SelectionEvent e) {
                    Doctor d1 
    = new Doctor("rose"1);
                    Patient patient 
    = new Patient();
                    
    // Queue<Patient> p1=m.get("xiaoxiao");
                    
    // d1.addPatient(patient);
                    rosePL.offer(patient);

                    patient.setpNum(rosePL.size());
                    patient.setFrontNum(rosePL.size() 
    - 1);
                    
    // m.put(d1, p1);

                    
    if (rosePL.size() <= 30{
                        txt.setText(
    "一號(hào)專(zhuān)家為您就診,\n" + "您現(xiàn)在排在" + rosePL.size()
                                
    + "號(hào),\n" + "前面人數(shù)為" + patient.getFrontNum());
                    }
     else {
                        txt
                                .setText(
    "一號(hào)專(zhuān)家為您就診" + "您現(xiàn)在排在" + rosePL.size() + "號(hào)"
                                        
    + "您前面已有" + patient.getFrontNum()
                                        
    + "人,\n您可以考慮其他專(zhuān)家");
                    }

                    
    //                        
                }

            }
    );
            button2.addSelectionListener(
    new SelectionAdapter() {
                
    public void widgetSelected(SelectionEvent e) {
                    Doctor d2 
    = new Doctor("xiaoxiao"1);
                    Patient patient 
    = new Patient();
                    
    // d1.addPatient(patient);
                    xiaoPL.offer(patient);

                    patient.setpNum(xiaoPL.size());
                    patient.setFrontNum(xiaoPL.size() 
    - 1);
                    
    // m.put(d2, p2);

                    
    if (xiaoPL.size() <= 30{
                        txt.setText(
    "二號(hào)專(zhuān)家為您就診,\n" + "您現(xiàn)在排在" + rosePL.size()
                                
    + "號(hào),\n" + "前面人數(shù)為" + patient.getFrontNum());
                    }
     else {
                        txt
                                .setText(
    "二號(hào)專(zhuān)家為您就診,\n" + "您現(xiàn)在排在" + rosePL.size()
                                        
    + "號(hào)" + "您前面已有" + patient.getFrontNum()
                                        
    + "人,\n您可以考慮其他專(zhuān)家");
                    }

                    
    //                        
                }

            }
    );
            button3.addSelectionListener(
    new SelectionAdapter() {
                
    public void widgetSelected(SelectionEvent e) {
                    Doctor d3 
    = new Doctor("yangguang"1);
                    Patient patient 
    = new Patient();
                    
    // d1.addPatient(patient);
                    yangPL.offer(patient);

                    patient.setpNum(yangPL.size());
                    patient.setFrontNum(yangPL.size() 
    - 1);
                    
    // m.put(d3, yangPL);
                    
    // System.out.println(m.get(d3));

                    
    if (yangPL.size() <= 30{
                        txt.setText(
    "三號(hào)專(zhuān)家為您就診,\n" + "您現(xiàn)在排在" + yangPL.size()
                                
    + "號(hào),\n" + "前面人數(shù)為" + patient.getFrontNum());
                    }
     else {
                        txt.setText(
    "您前面已有" + patient.getFrontNum()
                                
    + "人,\n您可以考慮其他專(zhuān)家");
                    }

                    
    //                        
                }

            }
    );

            shell.layout();
            shell.open();
            
    while (!shell.isDisposed()) {
                
    if (!display.readAndDispatch())
                    display.sleep();
            }

        }

    }

    醫(yī)生界面UI:
    掛號(hào)時(shí)運(yùn)行界面如下,點(diǎn)擊相應(yīng)的專(zhuān)家會(huì)加到相應(yīng)的專(zhuān)家中會(huì)是相應(yīng)的專(zhuān)家為您就診:
    醫(yī)生叫號(hào)時(shí)運(yùn)行界面如下,相應(yīng)的專(zhuān)家點(diǎn)擊自己相應(yīng)的名字可以出現(xiàn)自己相應(yīng)的下一個(gè)病人的名字:
    posted on 2010-11-02 16:51 迷人笑笑 閱讀(3472) 評(píng)論(1)  編輯  收藏

    FeedBack:
    # re: java-醫(yī)院病人排隊(duì)掛號(hào)醫(yī)生叫號(hào)簡(jiǎn)潔小系統(tǒng)
    2012-04-16 17:33 | sss
    代碼不全 QueueServer 沒(méi)有  回復(fù)  更多評(píng)論
      

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    <2010年11月>
    31123456
    78910111213
    14151617181920
    21222324252627
    2829301234
    567891011

    常用鏈接

    留言簿(13)

    隨筆檔案

    文章檔案

    搜索

    •  

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 亚洲国产精品成人久久久| 久久精品国产精品亚洲蜜月| 国产亚洲sss在线播放| 日韩精品成人无码专区免费| 大学生一级毛片免费看| 四虎影视永久免费观看| 亚洲AV一区二区三区四区| 青青草国产免费久久久下载| 亚洲狠狠婷婷综合久久久久| 久久国产美女免费观看精品| 91香蕉国产线在线观看免费| 亚洲日本在线观看| 中文字幕乱码亚洲精品一区| 中文字幕无码免费久久9一区9| 中文字幕亚洲乱码熟女一区二区| 亚洲综合久久精品无码色欲| 大学生高清一级毛片免费| 精品久久久久久亚洲中文字幕| 日本免费一区二区三区四区五六区 | 亚洲av乱码一区二区三区香蕉| 啦啦啦中文在线观看电视剧免费版| 亚洲熟伦熟女专区hd高清| 国产一精品一aⅴ一免费| a高清免费毛片久久| 女人张开腿等男人桶免费视频| 亚洲精品V天堂中文字幕| 亚洲第一区精品日韩在线播放| 99免费精品视频| 亚洲黄色三级视频| a拍拍男女免费看全片| 日韩电影免费在线| 国产亚洲男人的天堂在线观看| 久久精品人成免费| 亚洲精品国产国语| 亚洲伦乱亚洲h视频| 一级毛片免费观看| 久久久青草青青国产亚洲免观 | 亚洲综合伊人久久大杳蕉| 99re6免费视频| 精品特级一级毛片免费观看| 久久亚洲高清观看|