DragablePanel.js
上传用户:ahit0551
上传日期:2009-04-15
资源大小:2345k
文件大小:1k
源码类别:

xml/soap/webservice

开发平台:

Java

  1. /**
  2.  * <p>Title: DragablePanel</p>
  3.  * <p>Description: 使用左坐标、上坐标定位。</p>
  4.  * <p>Copyright: Copyright (c) xio.name 2006</p>
  5.  * @author xio
  6.  */ function DragablePanel(ui, container) {     this.base = Panel;     this.base(ui);     this.setPosition("absolute");     this.setCursor(Cursor.MOVE);     this.container = container;     this.addMouseListener(new DragablePanelMouseListener(this, container)); } DragablePanel.prototype = new Panel(); DragablePanel.prototype.toString = function () {     return "[Component,Panel,DragablePanel]"; }; // /**  *  */ function DragablePanelMouseListener(source, container) {     this.source = source;     this.container = container; } DragablePanelMouseListener.prototype = new MouseListener(); DragablePanelMouseListener.prototype.onMouseDown = function (e) {     var theButton = e.button;     if (theButton == Browser.BUTTON_LEFT) {         this.container.setDragSource(this.source);         this.container.setDragCoord(Toolkit.getContainerCoord(e, this.container));     } };