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

📄 canvas.js

📁 javascript 很酷的类库
💻 JS
📖 第 1 页 / 共 5 页
字号:
	COL_RESIZE:(isc.Browser.isIE && isc.Browser.version >= 6 ? "col-resize" : "e-resize"), 	ROW_RESIZE:(isc.Browser.isIE && isc.Browser.version >= 6 ? "row-resize" : "n-resize"),	//>	@type	ImageStyle	//			@visibility external	//			@group	appearance    //	@value	isc.Canvas.CENTER	Center (and don't stretch at all) the image if smaller than its enclosing frame.	//CENTER:"center",	//	@value	isc.Canvas.TILE		Tile (repeat) the image if smaller than its enclosing frame.	TILE:"tile",	//	@value	isc.Canvas.STRETCH	Stretch the image to the size of its enclosing frame.	STRETCH:"stretch",	//	@value	isc.Canvas.NORMAL   Allow the image to have natural size	NORMAL:"normal",	//<	//>	@type	Canvas.BkgndRepeat	//			@group	appearance	//			@see	canvas.backgroundRepeat	REPEAT:"repeat", 			//	@value	isc.Canvas.REPEAT		Tile the background image horizontally and vertically.	NO_REPEAT:"no-repeat",		//	@value	isc.Canvas.NO_REPEAT	Don't tile the background image at all.	REPEAT_X:"repeat-x", 		//	@value	isc.Canvas.REPEAT_X		Repeat the background image horizontally but not vertically.	REPEAT_Y:"repeat-y",		//	@value	isc.Canvas.REPEAT_Y		Repeat the background image vertically but not horizontally.	//<			//>	@type	Canvas.TextDirection	//		Specifies RTL or LTR direction for text -- IE 5+ only	//		Specify this to have your text show up "right to left" (rtl), eg: in Arabic or Hebrew	//		Note: more efficient to leave blank for default of "left to right" (ltr)	//	@group	appearance	LTR:"ltr",		 		//	@value	isc.Canvas.LTR		Show text left-to-right (eg: English)	RTL:"rtl",				//	@value	isc.Canvas.RTL		Show text right-to-left (eg: Arabic)	//<			//>	@type	Canvas.SnapDirection	//		Specifies which direction to snap to, when snap-to-grid is enabled	//	@group	dragdrop	BEFORE:"before",    //  @value  isc.Canvas.BEFORE   Always snap up or left	AFTER:"after",      //  @value  isc.Canvas.AFTER    Always snap down or right	NEAREST:"nearest",  //  @value  isc.Canvas.NEAREST  Snap to the nearest grid point	//<			//>	@type	Canvas.SnapAxis	//		Specifies which axis or axes we consider when snap-to-grid is enabled	//	@group	dragdrop	                    //  @value  isc.Canvas.HORIZONTAL   Snap on the horizontal axis	                    //  @value  isc.Canvas.VERTICAL     Snap on the horizontal axis	                    //  @value  isc.Canvas.BOTH         Snap on both axes	//<        	// default zIndex for the next item to be drawn	_nextZIndex:200000,	// zIndex of the next item to be sent to the back	_SMALL_Z_INDEX:199950,	// zIndex of the next item to be brought to the front	_BIG_Z_INDEX:800000,	//>	@classAttr isc.Canvas.TAB_INDEX_GAP (integer : 80 : R)	//		Specifies the gap to leave between automatically assigned tab indices for focusable     //      canvii    //<    TAB_INDEX_GAP:50,	//>	@classAttr isc.Canvas.TAB_INDEX_FLOOR (integer : 1000 : R)	//		Specifies the lower limit for automatically assigned tab indices for focusable canvii.    // @group focus    // @visibility external    //<    TAB_INDEX_FLOOR:1000,        //> @classAttr isc.Canvas.TAB_INDEX_CEILING (integer : 32766 : RA)    // This is the native browser upper limit for tabIndices    // @visibility internal    //<        TAB_INDEX_CEILING:32766,    //>	@classAttr	isc.Canvas._imageCache		(array : [] : IRWA)	//			cache to hold images, so we avoid loading them over and over unecessarily	//		@group	images	//<	_imageCache:[],						    // List of CSS attributes that apply to text only:    textStyleAttributes : [ "fontFamily", "fontSize", "color", "backgroundColor",                             "fontWeight", "fontStyle", "textDecoration", "textAlign"                            // Optionally also include: fontSizeAdjust, fontVariant, whiteSpace                          ],    			    // No style doubling    // In various places we render widgets as a table nested inside the handle    // In this case we have to re-apply the css class applied to the widget to the TD as otherwise    // text based styling options will not be applied.    // However we DON'T want to re-apply every property, otherwise we end up with (for example)    // borders around the widget and additional borders around the table cell.    // We usually handle this by writing out explicit "null" styling options on the TD to     // override the properties we don't want doubled from the css class. These options then take    // presidence over the attributes specified in the CSS class.    // Use this central string to clear out     // - margin, border, padding, bg color, filter, background-image    _$noStyleDoublingCSS:(!isc.Browser.isIE ? "margin:0px;border:0px;padding:0px;background-image:none;"                         // Also explicitly clear filter and background color in IE                          : "margin:0px;border:0px;padding:0px;background-color:transparent;filter:none;background-image:none;"),            // Delayed Redraw	// -----------------------------------------------------------------------------------------    //>	@classAttr	isc.Canvas._redrawQueue		(array of canvas objects : [] : IRWA)	//			array to hold pointers to canvases that need to be redrawed	//			these items will be redrawn automatically after "a little while"	//		@group	handles	//		@see	Canvas.clearRedrawQueue()	//<	_redrawQueue:[],					    //>	@classAttr	Canvas._redrawQueueDelay		(number : 0 : IRWA)	//			(msec) delay after which canvases that need to be redrawn are actually redrawn	//		@group	handles	//		@see	Canvas.clearRedrawQueue()	//<    // NOTE: redraws are generally done on a timer because it batches many changes which require    // redraws into a single redraw.  Redraws can be done immediately, in specific circumstances    // like drag resizing, in order to provide more immediate response.    _redrawQueueDelay:(0),    _delayedAdjustOverflowQueueDelay:200,        // Stats and global Canvas tracking	// -----------------------------------------------------------------------------------------    //>	@classAttr	isc.Canvas._canvasList		(array of canvas objects : [] : IRWA)	//			array to hold pointers to all of the canvases that have been created	//			so we can clear them out later	//		@group	handles	//		@platformNotes	Used in IE only to clear all handles when the page is unloaded.	//		@see	Canvas._clearDOMHandles()	//<	_canvasList:[],											    // count of canvases which are flagged as _iscInternal used e.g. in the Developer Console to    // report the end-user canvas count number    _iscInternalCount: 0,    // object where we record/update various statistics    _stats : {        redraws:0,        clears:0,        destroys:0,        draws:0        // NOTE: number allocated is just Canvas._canvasList.length    },    // object for tracking redraws by widget ID    _redraws : {    },        // cache for partwise-event handler names    _partHandlers : {},    // Wrapping HTML in Canvii	// -----------------------------------------------------------------------------------------    _wrapperCanvasStack : [],            useMozBackMasks : false});isc.Canvas.addProperties({    _isA_Canvas : true,	//> @attr	canvas.ID		(string : null : IR)	// Global identifier for referring to a widget in JavaScript.  The ID property is optional if    // you do not need to refer to the widget from JavaScript, or can refer to it indirectly    // (for example, by storing the reference returned by +link{class.create,create()}).    // <P>    // An internal, unique ID will automatically be created upon instantiation for any canvas    // where one is not provided.    //    // @group basics    // @visibility external	//<												    //>	@attr	canvas.autoDraw		(boolean : true : IR)    // If true, this canvas will draw itself immediately after it is created.    // <P>    // <b>Note</b> that you should turn this OFF for any canvases that are provided as children    // of other canvases, or they will draw initially, then be clear()ed and drawn again when    // added as children, causing a large performance penalty.      // <P>    // For example, the following code is incorrect and will cause extra draw()s:    // <P>    // <pre>    //     isc.Layout.create({    //         members : [    //             isc.ListGrid.create()    //         ]    //     });    // </pre>    // It should instead be:    // <pre>    //     isc.Layout.create({    //         members : [    //             isc.ListGrid.create(<b>{ autoDraw: false }</b>)    //         ]    //     });    // </pre>    // In order to avoid unwanted autoDrawing systematically, it is recommend that you call    // +link{isc.setAutoDraw,isc.setAutoDraw(false)} immediately after SmartClient is loaded    // and before any components are created, then set <code>autoDraw:true</code> or call    // draw() explicitly to draw components.      // <P>    // Otherwise, if the global setting for autoDraw remains <code>true</code>, you must set    // autoDraw:false, as shown above, on every component in your application that     // should not immediately draw: all Canvas children, Layout members, Window items, Tab    // panes, etc, however deeply nested.  Forgetting to set autoDraw:false will result in one    // more clear()s - these are reported on the Results tab of the     // +link{group:debugging,Developer Console}, and can be tracked to individual components by    // using the "clears" log category in the Developer Console.    //    //  @example autodraw    //  @visibility external    //  @group	drawing    //<    autoDraw:true,     // Children and Peers   	// --------------------------------------------------------------------------------------------    //> @attr   canvas.parentElement    (Canvas : null : [IRA])    // This Canvas's immediate parent, if any.    // <BR>    // Can be initialized, but any subsequent manipulation should be via     // +link{canvas.addChild(),addChild()} and +link{canvas.removeChild(),removeChild()} calls    // on the parent.    //     //  @visibility external    //  @group  containment    //<        //> @attr   canvas.topElement    (Canvas : null : [RA])    // The top-most Canvas (i.e., not a child of any other Canvas), if any, in this widget's    // containment hierarchy.    //  @visibility external    //  @group  containment    //<        //> @attr   canvas.masterElement    (Canvas : null : [RA])    // This Canvas's "master" (the Canvas to which it was added as a peer), if any.    //  @visibility external    //  @group  containment    //<        //> @attr   canvas.children    (Array of Canvas : null : IRWA)    // Array of all Canvii that are immediate children of this Canvas.    //  @visibility external    //  @group  containment    //<        //> @attr   canvas.peers    (Array of Canvas : null : IRWA)    // Array of all Canvii that are peers of this Canvas.    //  @visibility external    //  @group  containment    //<        //> @attr   canvas.allowContentAndChildren (boolean : false : [IA])    // If true this widget supports having content specified via the content property and    // children specifed in the normal way. Enabling entails a small performance reduction.    // @visibility internal    //<    //> @attr   canvas.drawChildrenThenContent (boolean : false : [IA])    // If true, and this widget supports having content and children, when this widget is    // drawn, the children will be written into the handle, then the content will be created    // and inserted before the first child in the DOM.    // @visibility internal    //<    // --------------------------------------------------------------------------------------------        //> @pseudoClass DrawContext    // Object that expresses the position in the DOM where a Canvas should draw itself, used    // for insertion into an existing DOM structure.    // @treeLocation Client Reference/Foundation/Canvas    // @group drawContext    // @visibility drawContext    //<        //> @attr drawContext.element (DOMElement : null : [IRA])    // Element in the DOM    // @group drawContext    // @visibility drawContext    //<    //> @attr drawContext.position (DrawPosition : "beforeBegin" : [IRA])    // Position where Canvas should be inserted relative to <code>drawContext.element</code>.    // @group drawContext    // @visibility drawContext    //<    //> @type DrawPosition    // @value "beforeBegin" insert before the target element    // @value "afterBegin"  insert as the target element's first child    // @value "beforeEnd"   insert as the target element's last child    // @value "afterEnd"    insert after the target element    // @value "replace"     replace the target element    // @group drawContext    // @visibility external    //<    //> @attr  canvas.drawContext (DrawContext : null : [IRWA])    // Location in the DOM where this Canvas should draw itself, specified as an existing DOM    // element and a position relative to that element.    // <P>    // This feature is intended for temporary integration with legacy page architectures only;    // the native browser's reaction to DOM insertion is unspecified and unsupported.  For

⌨️ 快捷键说明

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