Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
changeproperty.js
Package: Javascript工作流图形界面.rar [view]
Upload User: yfdli66
Upload Date: 2010-02-20
Package Size: 47k
Code Size: 4k
Category:
JavaScript
Development Platform:
JavaScript
- /*------------------------------------------------------------------------------
- + 属性的改变 +
- + +
- + +
- -------------------------------------------------------------------------------*/
- //改变属性策略角色接口
- function ChangePropertyStrategy (aSObj) {
- //interface
- this.sObj = aSObj; //当前所选控件
- this.change = change;
- function change () {
- }
- }
- //改变 name
- function ChangeNameSty (aSObj) {
- //inhert
- this.base=ChangePropertyStrategy;
- this.base(aSObj);
- //property
- this.inputValue;
- //override
- this.change = change;
- function change () {
- this.sObj.lastChild.innerText = this.inputValue;
- }
- }
- //改变 left
- function ChangeLeftSty (aSObj) {
- //inhert
- this.base=ChangePropertyStrategy;
- this.base(aSObj);
- //property
- this.inputValue;
- this.canvasObj;
- //override
- this.change = change;
- function change () {
- var myLeft = this.inputValue;
- this.sObj.style.pixelLeft=myLeft;
- var rx = this.sObj.style.pixelLeft;
- var sx = this.canvasObj.clientWidth-(this.sObj.style.pixelLeft+this.sObj.clientWidth);
- if( rx<0 ) this.sObj.style.left = 0;
- if( sx<0 ) this.sObj.style.left = this.canvasObj.clientWidth-this.sObj.clientWidth;
- }
- }
- //改变 Top
- function ChangeTopSty (aSObj) {
- //inhert
- this.base=ChangePropertyStrategy;
- this.base(aSObj);
- //property
- this.inputValue;
- this.canvasObj;
- //override
- this.change = change;
- function change () {
- var myTop = this.inputValue;
- this.sObj.style.pixelTop=myTop;
- var ry = this.sObj.style.pixelTop;
- var sy = this.canvasObj.clientHeight-(this.sObj.style.pixelTop+this.sObj.clientHeight);
- if( ry<0 ) this.sObj.style.top = 0;
- if( sy<0 ) this.sObj.style.top = this.canvasObj.clientHeight-this.sObj.clientHeight;
- }
- }
- //改变 view
- function ChangeViewSty (aSObj) {
- //inhert
- this.base=ChangePropertyStrategy;
- this.base(aSObj);
- //property
- this.inputValue;
- //override
- this.change = change;
- function change () {
- this.sObj.view = this.inputValue;
- }
- }
- //改变 auto
- function ChangeAutoSty (aSObj) {
- //inhert
- this.base=ChangePropertyStrategy;
- this.base(aSObj);
- //property
- this.inputValue;
- //override
- this.change = change;
- function change () {
- this.sObj.auto = this.inputValue;
- }
- }
- //改变 ConditionType
- function ChangeConditionTypeSty (aSObj) {
- //inhert
- this.base=ChangePropertyStrategy;
- this.base(aSObj);
- //property
- this.inputValue;
- //override
- this.change = change;
- function change () {
- this.sObj.conditionType = this.inputValue;
- }
- }
- //改变 Owner
- function ChangeOwnerSty (aSObj) {
- //inhert
- this.base=ChangePropertyStrategy;
- this.base(aSObj);
- //property
- this.inputValue;
- //override
- this.change = change;
- function change () {
- this.sObj.owner = this.inputValue;
- }
- }
- //改变 status
- function ChangeStatusSty (aSObj) {
- //inhert
- this.base=ChangePropertyStrategy;
- this.base(aSObj);
- //property
- this.inputValue;
- //override
- this.change = change;
- function change () {
- this.sObj.status = this.inputValue;
- }
- }
- //改变 old-status
- function ChangeOldStatusSty (aSObj) {
- //inhert
- this.base=ChangePropertyStrategy;
- this.base(aSObj);
- //property
- this.inputValue;
- //override
- this.change = change;
- function change () {
- this.sObj.oldStatus = this.inputValue;
- }
- }
- //环境角色 改变对象属性
- function ChangePropertyContext () {
- //property
- this.changePropertyStrategy;
- //method
- this.setStrategy = setStrategy;
- this.changeProperty = changeProperty;
- function setStrategy (aChangePropertyStrategy) {
- this.changePropertyStrategy = aChangePropertyStrategy;
- }
- function changeProperty () {
- return this.changePropertyStrategy.change();
- }
- }