Class Index | File Index

Classes


Class nas.UnitValue

Adobe Extend Script の UnitValue クラスとメソッド互換の単位つき長さオブジェクト
第二引数で単位が指定されない場合は第一引数の単位を使用する
引数間で単位が異なる場合は第一引数の指定値を第二引数の単位へ変換してオブジェクト化する
どちらも無効な場合は、第一引数の数値部分をpointで換算
未知の単位が与えられた場合は単位系を無効のまま数値のみで初期化して要求はptで代用する<estk互換>
無効な値で初期化された場合は値を0に設定する。<estk互換>
有効な単位は in,inches,mm,millimeters,cm,centimeters,pt,picas,points,mp,millipoints
Defined in: nas_common.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
nas.UnitValue(numberString, unitString)
単位つきの長さを統一的に扱うクラス 単位間のコンバート機能を内包している
Adobe ESTK 互換
Field Summary
Field Attributes Field Name and Description
 
as
指定された単位文字列に変換した数値を返す
 
指定された単位文字列にオブジェクトを変換する
 
現在の単位文字列を付記した数値文字列を返す
 
現在の単位系の値を返す Object.valueに同じ
Method Summary
Method Attributes Method Name and Description
 
setValue(myNumberString, myUnitString)
引数をパースしてUnitValueのプロパティを設定するメソッド
初期化の際にもコールされる
Class Detail
nas.UnitValue(numberString, unitString)
単位つきの長さを統一的に扱うクラス 単位間のコンバート機能を内包している
Adobe ESTK 互換
	A = new nas.UnitValue("123","mm")    ;//
	B = new nas.UnitValue("-72pt","in")  ;//
	C = new nas.UnitValue(25.4,"cm")     ;//
	D = new nas.UnitValue("うさぎ",'カメ') ;// {value: 0, type: "pt"}
	E = new nas.UnitValue('125 degree')  ;// {value: 0, type: "pt"}
	F = new nas.UnitValue(A)             ;// {value: 123, type: "mm"}
Parameters:
numberString
unitString
Field Detail
{Number} as
指定された単位文字列に変換した数値を返す

{String} convert
指定された単位文字列にオブジェクトを変換する

{String} toString
現在の単位文字列を付記した数値文字列を返す

{Number} valueOf
現在の単位系の値を返す Object.valueに同じ
Method Detail
{nas.UnitValue} setValue(myNumberString, myUnitString)
引数をパースしてUnitValueのプロパティを設定するメソッド
初期化の際にもコールされる
Parameters:
myNumberString
myUnitString
Returns:
{nas.UnitValue} 値をセットされた nas.UnitValue 本体

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2019 17:32:04 GMT+0900 (JST)