⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 suite.js

📁 这是一个关于java的JSP页面中使用象Swing组件的一个库文件.
💻 JS
字号:
function uiPanel_Suite(domDiv) {  this._super(domDiv);  this.__domDiv = domDiv;  this.__automaticallyStuck = false;  this.__explicitlyStuck = false;  this.__positionAnchor = null;  this.__showTimerId = null;  this.__hideTimerId = null;  this.__lifeCycleNotifier = new uiHtml_LifeCycleNotifier();  this.__originalZIndex = this.getDepth();  uiPanel_Suite.__addToZIndexGroup(this, this.__originalZIndex);  var event = (uiHtml_Window.getInstance().isOpera())? "click" : "mousedown" ;  var panel = this;  this.appendEventHandler(event, function(e) {    panel.__moveToTop();  });  var suite = this;  this.appendEventHandler("mouseover", function(e) {    suite.__disableHide(true);  });  this.appendEventHandler("mouseout", function(e) {    suite.__enableHide(true);  });}uiPanel_Suite = uiUtil_Object.declareClass(uiPanel_Suite, uiHtml_Panel);uiPanel_Suite.__zIndexGroups = new Array();uiPanel_Suite.prototype._setLifeCycleListener = function(listener) {  this.__lifeCycleNotifier.setListener(listener);};uiPanel_Suite.prototype._setSticker = function(toggle) {  this.__sticker = toggle;  var suite = this;  this.__sticker.appendOnStateOn(function(e) {    suite.__disableHide();  });  this.__sticker.appendOnStateOff(function(e) {    suite.__enableHide();  });};uiPanel_Suite.prototype.__activateShowTimer = function(domEvent, msDelay) {  this.__logger.debug("Activating panel show timer");  var suite = this;  this.__showTimerId = window.setTimeout(function() {    suite.requestShow(domEvent);  }, msDelay);};uiPanel_Suite.prototype.__deactivateShowTimer = function() {  if (this.__showTimerId != null) {    this.__logger.debug("Deactivating panel show timer");    window.clearTimeout(this.__showTimerId);    this.__showTimerId = null;  }};uiPanel_Suite.prototype.__activateHideTimer = function(domEvent, msDelay, force) {  this.__logger.debug("Activating panel hide timer");  var suite = this;  this.__hideTimerId = window.setTimeout(function() {    suite.requestHide(domEvent, force);  }, msDelay);};uiPanel_Suite.prototype.__deactivateHideTimer = function() {  if (this.__hideTimerId != null) {    this.__logger.debug("Deactivating panel hide timer");    window.clearTimeout(this.__hideTimerId);    this.__hideTimerId = null;  }};uiPanel_Suite.prototype._setShowTrigger =    function(trigger, eventType, actionDelay, attachedToMouse) {  var suite = this;  trigger.appendEventHandler(eventType, function(e) {    if (!suite.isShowing()) {      suite.__adjustPosition(attachedToMouse, new uiHtml_Event(e));    }    suite.__activateShowTimer(e, actionDelay);  });  if (eventType == "mouseover") {    trigger.appendEventHandler("mouseout", function(e) {      suite.__deactivateShowTimer();    });  }  else if (eventType == "focus") {    trigger.appendEventHandler("blur", function(e) {      suite.__deactivateShowTimer();    });  }};uiPanel_Suite.prototype._setHideTrigger =    function(trigger, eventType, actionDelay, force) {  var suite = this;  trigger.appendEventHandler(eventType, function(e) {    suite.__activateHideTimer(e, actionDelay, force);  });  if (eventType == "mouseout") {    trigger.appendEventHandler("mouseover", function(e) {      suite.__deactivateHideTimer();    });  }  else if (eventType == "blur") {    trigger.appendEventHandler("focus", function(e) {      suite.__deactivateHideTimer();    });  }};uiPanel_Suite.prototype._setPositionAnchor = function(anchor) {  this.__positionAnchor = anchor;  this.__adjustPosition(false, null);};uiPanel_Suite.prototype.__disableHide = function(auto) {  if (auto) {    this.__automaticallyStuck = true;  }  else {    this.__explicitlyStuck = true;  }};uiPanel_Suite.prototype.__enableHide = function(auto) {  if (auto) {    this.__automaticallyStuck = false;  }  else {    this.__explicitlyStuck = false;  }};uiPanel_Suite.prototype.__shouldHide = function() {  if (!this.__automaticallyStuck && !this.__explicitlyStuck) {    return true;  }  return false;};uiPanel_Suite.prototype.__adjustPosition = function(attachedToMouse, event) {  if (attachedToMouse) {    this.setStyleAttribute("position", "absolute");    var position = event.getAbsolutePosition();    var wrapper = uiHtml_ElementWrapper.getInstance();    var x = position.getLeft();    var y = position.getTop();    var currentElement = this.getDomObject().offsetParent;    while (currentElement != null &&        uiHtml_Element.getTagName(currentElement) != "body") {      if (wrapper.getCascadedStyleAttribute(currentElement, "position") == "absolute") {        x -= currentElement.offsetLeft;        y -= currentElement.offsetTop;      }      currentElement = currentElement.offsetParent;    }    this.setDimension(x, y);  }  else if (this.__positionAnchor) {    this.setStyleAttribute("position", "absolute");    this.__adjustPositionRelativeTo(this.__positionAnchor);  }};uiPanel_Suite.prototype.requestShow = function(domEvent) {  if (!this.__lifeCycleNotifier.notify("onBeforeShow", domEvent)) {    return;  }  this.show();  this.__lifeCycleNotifier.notify("onAfterShow", domEvent);};uiPanel_Suite.prototype.show = function() {  this.focus();  this.__moveToTop();  this._callSuper("show");};uiPanel_Suite.prototype.requestHide = function(domEvent, force) {  if (this.__shouldHide() || force) {    if (!this.__lifeCycleNotifier.notify("onBeforeHide", domEvent)) {      return;    }    this.hide();    this.__lifeCycleNotifier.notify("onAfterHide", domEvent);  }};uiPanel_Suite.prototype.hide = function() {  this._callSuper("hide");};uiPanel_Suite.prototype.__adjustPositionRelativeTo = function(anchor) {  var maxWidth = uiHtml_Document.getInstance().getWidth();  var anchorDimension = anchor.getRelativeDimension();  var anchorLeft = anchorDimension.getLeft();  var anchorRight = anchorDimension.getRight();  var anchorTop = anchorDimension.getTop();  var panelWidth = this.getWidth();  var lhsLeft = anchorLeft - panelWidth;  var crossesLeftBoundary = (lhsLeft < 0);  var crossesRightBoundary = ((anchorRight + panelWidth) > maxWidth);  if (crossesRightBoundary && !crossesLeftBoundary) {    this.setDimension(lhsLeft, anchorTop);  }  else {    this.setDimension(anchorRight, anchorTop);  }};uiPanel_Suite.prototype.__moveToTop = function() {  var zIndexGroup = uiPanel_Suite.__zIndexGroups[this.__originalZIndex];  var topZIndex = this.__originalZIndex + zIndexGroup.length - 1;  var oldZIndex = this.getDepth();  for (var i = 0; i < zIndexGroup.length; i++) {    if (zIndexGroup[i].getDepth() > oldZIndex) {      zIndexGroup[i].setDepth(zIndexGroup[i].getDepth() - 1);    }  }  this.setDepth(topZIndex);};uiPanel_Suite.createByEither = function(id, name) {  return uiHtml_Element.createByEither(id, name, uiPanel_Suite);};uiPanel_Suite.__addToZIndexGroup = function(panel, zIndexValue) {  if (uiPanel_Suite.__zIndexGroups[zIndexValue] == null) {    uiPanel_Suite.__zIndexGroups[zIndexValue] = new Array();  }  var zIndexGroup = uiPanel_Suite.__zIndexGroups[zIndexValue];  panel.setDepth(zIndexValue + zIndexGroup.length);  zIndexGroup.push(panel);};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -