orientation.as

来自「用于flash/flex的 as3的 2D图形图像图表的动态生成」· AS 代码 · 共 45 行

AS
45
字号
package flare.util
{
	/**
	 * Constants defining layout orientations.
	 */
	public class Orientation
	{
		/** Constant indicating a left-to-right layout orientation. */
		public static const LEFT_TO_RIGHT:String = "leftToRight";
		/** Constant indicating a right-to-left layout orientation. */
		public static const RIGHT_TO_LEFT:String = "rightToLeft";
		/** Constant indicating a top-to-bottom layout orientation. */
		public static const TOP_TO_BOTTOM:String = "topToBottom";
		/** Constant indicating a bottom-to-top layout orientation. */
		public static const BOTTOM_TO_TOP:String = "bottomToTop";
		
		/**
		 * This is an abstract class and can not be instantiated.
		 */
		public function Orientation() {
			throw new Error("This is an abstract class.");
		}

		/**
		 * Returns true if the input string indicates a vertical orientation.
		 * @param an orientation string
		 * @return true if the input string indicates a vertical orientation
		 */
		public static function isVertical(orient:String):Boolean
		{
			return (orient==TOP_TO_BOTTOM || orient==BOTTOM_TO_TOP);
		}
		
		/**
		 * Returns true if the input string indicates a horizontal orientation.
		 * @param an orientation string
		 * @return true if the input string indicates a horizontal orientation
		 */
		public static function isHorizontal(orient:String):Boolean
		{
			return (orient==LEFT_TO_RIGHT || orient==RIGHT_TO_LEFT);
		}

	} // end of class Orientation
}

⌨️ 快捷键说明

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