Some operations after the shell is set to none

Source: Internet
Author: User

Package com.yc.utils;

Import java.sql.SQLException;
public class Shellutil {    Private Boolean flag=false;    private int xx; The x-axis of the mouse position when you click the interface    private int yy; The y-axis of the mouse position when you click the interface
    Main Panel off Button listener event    public void Opbuttonclose (final Label label,final Shell shell,final String uaccount) {        Label.addmousetracklistener (New Mousetrackadapter () {            @Override            public void Mouseexit (MouseEvent e) {                Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_close_normal.png"));            }    });
     Label.addmousemovelistener (New Mousemovelistener () {        public void MouseMove (MouseEvent arg0) {//background map when mouse moves            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_close_highlight.png"));        }    });

Mouse Listener Events
     Label.addmouselistener (New Mouseadapter () {        @Override        public void MouseDown (MouseEvent e) {//Background image when Mouse is pressed            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_close_down.png"));        }
         @Override        public void MouseUp (MouseEvent e) {//Mouse release            Ifmessagedialog.openconfirm (Parent.getshell (), "Warm Prompt", "Are you sure you want to exit?");){                Shell.close ();            }        }    });}
 Close button Eventpublic void Buttonclose (final Label label,final shell Shell) {    Label.addmousetracklistener (New Mousetrackadapter () {    @Override        public void Mouseexit (MouseEvent e) {            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_close_normal.png"));        }    });
     Label.addmousemovelistener (New Mousemovelistener () {        public void MouseMove (MouseEvent arg0) {            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_close_highlight.png"));        }    });
     Label.addmouselistener (New Mouseadapter () {        @Override        public void MouseDown (MouseEvent e) {            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_close_down.png"));        }        @Override        public void MouseUp (MouseEvent e) {            Shell.close ();        }    });}
 Minimize button Eventspublic void Buttonmin (final Label label,final shell Shell) {    Label.addmousetracklistener (New Mousetrackadapter () {       @Override       public void Mouseexit (MouseEvent e) {Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_mini_normal.png"));        }    });
     Label.addmousemovelistener (New Mousemovelistener () {        public void MouseMove (MouseEvent arg0) {            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_mini_highlight.png"));        }    });
     Label.addmouselistener (New Mouseadapter () {Minimized interface        @Override        public void MouseDown (MouseEvent e) {            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_mini_down.png"));        }
         public void MouseUp (MouseEvent e) {            Shell.setminimized (TRUE);        }    });}

Maximize button Eventspublic void Buttonmax (final Label label,final shell Shell) {    Label.addmousetracklistener (New Mousetrackadapter () {        @Override        public void Mouseexit (MouseEvent e) {            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_max_normal.png"));        }        });
     Label.addmousemovelistener (New Mousemovelistener () {        public void MouseMove (MouseEvent arg0) {            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_max_highlight.png"));        }    });
     Label.addmouselistener (New Mouseadapter () {        Maximizing the interface        @Override        public void MouseDown (MouseEvent e) {            Label.setimage (Swtresourcemanager.getimage (Login.class, "/pic/btn_max_down.png"));            Shell.setmaximized (TRUE);        }    });}
 Mobile interface Methodpublic void Shellmove (final Composite composite,final shell Shell) {    Composite.addmousemovelistener (New Mousemovelistener () {        public void MouseMove (MouseEvent arg0) {            if (flag) {                Shell.setbounds (Shell.getlocation (). X+arg0.x-xx, Shell.getlocation (). Y+arg0.y-yy, Shell.getbounds (). Width, Shell.getbounds (). height);            }        }    });
     Composite.addmouselistener (New Mouseadapter () {        @Override        public void MouseDown (MouseEvent e) {            Flag = true;            xx = e.x;            yy = E.y;        }
         @Override        public void MouseUp (MouseEvent e) {            Flag=false;        }    });    }}

Some operations after the shell is set to none

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.