This page was saved using jaction on 2006-09-04 8:33:49.
Address: http://flexdocs.kr/docs/flex2/langref/flash/display/JointStyle.html
Title: flash.display.JointStyle (Flex™ 2 레퍼런스 가이드)  •  Size: 24768
Packageflash.display
Classpublic final class JointStyle
InheritanceJointStyle Inheritance Object

JointStyle 클래스는, 선의 묘화로 사용되는 결합 스타일을 지정하는 정수치의 열거입니다. 이러한 정수는,flash.display.Graphics.lineStyle() Methods의 joints Parameters의 값으로 해서 사용됩니다. 이 Methods는, 마이타, 라운드, 베벨의 3 종류의 결합을 지원(support)합니다. 다음에 예를 나타냅니다.

View the examples

See also

flash.display.Graphics.lineStyle()


Public property
 property정의
 Inheritedconstructor : Object
특정의 object 인스턴스의 클래스 object 또는 constructor    함수에의 참조입니다.
Object
 Inheritedprototype : Object
[static] 클래스 또는 함수 object의 prototype object에의 참조입니다.
Object
Public Methods
 Methods정의
 InheritedhasOwnProperty (name:String ):Boolean
object로 지정된 property가 정의되고 있는지 어떤지를 나타냅니다.
Object
 InheritedisPrototypeOf (theClass:Object ):Boolean
Object 클래스의 인스턴스가, Parameters로서 지정된 object의 prototype 체인내에 있을지 어떨지를 나타냅니다.
Object
 InheritedpropertyIsEnumerable (name:String ):Boolean
지정된 property가 존재해, 열거 가능한가 어떤가를 나타냅니다.
Object
 InheritedsetPropertyIsEnumerable (name:String , isEnum:Boolean = true):void
루프 처리에 대한 다이나믹 property의 가용성을 설정합니다.
Object
 InheritedtoString ():String
지정된 object의 string 표현을 돌려줍니다.
Object
 InheritedvalueOf ():Object
지정된 object의 원시적치를 돌려줍니다.
Object
Public 정수
 정수정의
  BEVEL : String = "bevel"
[static] flash.display.Graphics.lineStyle() Methods의 joints Parameters로 베벨 결합을 지정합니다.
JointStyle
  MITER : String = "miter"
[static] flash.display.Graphics.lineStyle() Methods의 joints Parameters로 마이타 결합을 지정합니다.
JointStyle
  ROUND : String = "round"
[static] flash.display.Graphics.lineStyle() Methods의 joints Parameters로 라운드 결합을 지정합니다.
JointStyle
정수의 상세
BEVEL정수
public static const BEVEL:String = "bevel"

flash.display.Graphics.lineStyle() Methods의 joints Parameters로 베벨 결합을 지정합니다.

MITER정수 
public static const MITER:String = "miter"

flash.display.Graphics.lineStyle() Methods의 joints Parameters로 마이타 결합을 지정합니다.

ROUND정수 
public static const ROUND:String = "round"

flash.display.Graphics.lineStyle() Methods의 joints Parameters로 라운드 결합을 지정합니다.

Examples

다음의 예에서는, JointStyleExample 클래스를 사용해, 3 개이 다른 결합 스타일을 3 조의 결합되는 선에 적용한 결과를 나타냅니다. 이것을 실시하기 위해서(때문에), 실행합니다.
  1. 각각의 선의 property는, 다음과 같이 설정됩니다.
    • 선의 길이는 80 픽셀
    • 경계선의 색은 오렌지색
    • 경계선의 크기는 30 픽셀
    • 하이라이트 칼라는 회색
    • 하이라이트 크기는 0 픽셀
    • 알파는 1 (단색이 된다)
    • 픽셀의 힌팅은 false 로 설정 (픽셀 전체에 대해서 선이 힌팅 되지 않는다).
    • 선의 축소·확대 모드는 통상 (굵기를 축소·확대)
    • 경계선 캡과 마이타 한도는 선언되고 있지만, 설정되어 있지 않기 때문에, 디폴트치가 사용됩니다.
  2. 클래스 constructor    은, 2 개의 연결선세그먼트(segment)를 3 조 작성합니다. 이러한 세그먼트(segment)는, x = 0, y = 0 을 기점으로 합니다. 그 때문에(위해)는,doDrawCorner() Methods를 3 번 호출해, 3 개의 결합 스타일 (마이타, 라운드, 베벨)을 사용합니다. 이 3 개의 doDrawCorner() 호출에서는, 전술의 결합 스타일과 property를 각각 사용해, 2 개의 연결선세그먼트(segment), 및 관련하는 선하이라이트를 묘화 합니다. 그 때, 우선 새로운 Shape object child 를 작성한 후, Graphics 클래스의 Methods를 사용해 선의 스타일을 설정해, 선과 하이라이트를 묘화 합니다. child 의 각 인스턴스가 표시 리스트에 추가되어 즉시 스테이지에 묘화 됩니다.
  3. 그 후,refreshLayout() Methods를 사용해 연결선세그먼트(segment)가 재묘화 됩니다. 재묘화 되는 위치는 y = 80 픽셀, 기점은 x = 80 픽셀, 선의 세그먼트(segment)간의 간격은 25 픽셀입니다.
package {
    import flash.display.DisplayObject;
    import flash.display.Graphics;
    import flash.display.JointStyle;
    import flash.display.LineScaleMode;
    import flash.display.Shape;
    import flash.display.Sprite;

    public class JointStyleExample extends Sprite {
        private var size:uint                  = 80;
        private var borderColor:uint           = 0xFFCC00;
        private var borderSize:uint            = 30;
        private var highlightColor:uint        = 0x666666;
        private var highlightSize:uint         = 0;
        private var gutter:uint                = 25;
        private var borderAlpha:uint           = 1;
        private var borderPixelHinting:Boolean = false;
        private var borderScaleMode:String     = LineScaleMode.NORMAL;
        private var borderCaps:String;
        private var borderMiterLimit:uint;

        public function JointStyleExample() {
            doDrawCorner(JointStyle.MITER);
            doDrawCorner(JointStyle.ROUND);
            doDrawCorner(JointStyle.BEVEL);
            refreshLayout();
        }

        private function doDrawCorner(jointStyle:String) :void {
            var halfSize:uint = Math.round(size / 2);
            var child:Shape = new Shape();
            child.graphics.lineStyle(borderSize,
                                     borderColor,
                                     borderAlpha,
                                     borderPixelHinting,
                                     borderScaleMode,
                                     borderCaps,
                                     jointStyle,
                                     borderMiterLimit);
            child.graphics.lineTo(0, 0);
            child.graphics.lineTo(size, 0);
            child.graphics.lineTo(halfSize, size);
            child.graphics.endFill();

            child.graphics.moveTo(0, 0);
            child.graphics.lineStyle(highlightSize, highlightColor);
            child.graphics.lineTo(0, 0);
            child.graphics.lineTo(size, 0);
            child.graphics.lineTo(halfSize, size);

            addChild(child);
        }

        private function refreshLayout() :void {
            var ln:uint = numChildren;
            var child:DisplayObject;
            var lastChild:DisplayObject = getChildAt(0);
            lastChild.x = size;
            lastChild.y = size;
            for (var i:uint = 1; i < ln; i++) {
                child = getChildAt(i);
                child.x = gutter + lastChild.x + lastChild.width;
                child.y = size;
                lastChild = child;
            }
        }
    }
}






 

코멘트가 추가되었을 경우, 메일로 받기. | 코멘트 리포트

현재의 페이지: http://flexdocs.kr/docs/flex2/langref/flash/display/JointStyle.html