|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 차의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요 : 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.swing.LayoutStyle
public abstract class LayoutStyle
LayoutStyle
는, 컴퍼넌트의 배치에 관한 정보를 제공합니다. 이 클래스는, 주로 비주얼 툴과 레이아웃 매니저로 사용됩니다. 대부분의 경우, 개발자가 이 클래스를 사용할 필요는 없습니다.
일반적으로,LayoutStyle
의 설정이나 작성은 실시하지 않습니다. 대신에, static 메소드 getInstance
를 사용해 현재의 인스턴스를 가져옵니다.
상자의 클래스의 개요 | |
---|---|
static class |
LayoutStyle.ComponentPlacement
ComponentPlacement 는, 2 개의 컴퍼넌트를 서로 관련지어 배치하는 경우에 사용할 수 있는 방법의 열거입니다. |
생성자 의 개요 | |
---|---|
LayoutStyle ()
새로운 LayoutStyle 를 작성합니다. |
메소드의 개요 | |
---|---|
abstract int |
getContainerGap (JComponent component,
int position,
Container parent)
컴퍼넌트로부터 그 부모의 지정된 구석까지의 스페이스의 양을 돌려줍니다. |
static LayoutStyle |
getInstance ()
LayoutStyle 의 공유 인스턴스를 돌려줍니다. |
abstract int |
getPreferredGap (JComponent component1,
JComponent component2,
LayoutStyle.ComponentPlacement type,
int position,
Container parent)
2 개의 컴퍼넌트간의 스페이스의 양을 돌려줍니다. |
static void |
setInstance (LayoutStyle style)
LayoutStyle 의 공유 인스턴스를 설정합니다. |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
생성자 의 상세 |
---|
public LayoutStyle()
LayoutStyle
를 작성합니다. 일반적으로,LayoutStyle
는 작성하지 않습니다. 대신에,getInstance
메소드를 사용해 현재의 LayoutStyle
를 가져옵니다.
메소드의 상세 |
---|
public static void setInstance(LayoutStyle style)
LayoutStyle
의 공유 인스턴스를 설정합니다. null
를 지정하면(자), 현재의 LookAndFeel
의 LayoutStyle
가 사용됩니다.
style
- LayoutStyle
또는 null
getInstance()
public static LayoutStyle getInstance()
LayoutStyle
의 공유 인스턴스를 돌려줍니다. setInstance
로 인스턴스가 지정되어 있지 않은 경우는, 현재의 LookAndFeel
의 LayoutStyle
가 돌려주어집니다.
LayoutStyle
의 공유 인스턴스LookAndFeel.getLayoutStyle()
public abstract int getPreferredGap(JComponent component1, JComponent component2, LayoutStyle.ComponentPlacement type, int position, Container parent)
component1
를 기준으로 한 component2
의 배치 거리를 나타냅니다. 예를 들어, 다음의 코드는,component2
를 component1
의 윗쪽에 배치할 때의 component2
와 component1
의 사이의 거리를 돌려줍니다.
int gap = getPreferredGap(component1, component2, ComponentPlacement.RELATED, SwingConstants.NORTH, parent);
type
파라미터는, 2 개의 컴퍼넌트의 관계를 나타냅니다. 2 개의 컴퍼넌트가 같은 부모를 가져, 논리적으로 관련성이 있는 자주(잘) 닮은 항목을 표시하고 있는 경우,RELATED
를 사용합니다. 2 개의 컴퍼넌트의 부모가 같아도, 논리적으로 관련성이 없는 항목을 표시하고 있는 경우는,UNRELATED
를 사용합니다. RELATED
타입과 UNRELATED
타입의 Look & Feel 의 차이를 구별할 수 없는 경우도 있습니다.
반환값에서는,component2
또는 component1
의 현재의 사이즈와 위치가 고려되지 않습니다. 반환값으로, 컴퍼넌트의 다양한 프로퍼티이 고려되는 일이 있습니다. 예를 들어, 스페이스는, font size나 컴퍼넌트의 적절한 사이즈에 따라서 다를 가능성이 있습니다.
component1
- component2
를 배치할 때 기준으로 한다
JComponent
component2
- 배치되는 JComponent
position
- component1
를 기준으로 했다
component2
의 배치 위치.
SwingConstants.NORTH
,
SwingConstants.SOUTH
,
SwingConstants.EAST
, 또는
SwingConstants.WEST
type
- 2 개의 컴퍼넌트의 배치 방법parent
- component2
의 부모.
실제의 부모와는 다를 가능성이 있다. 또,null
의 가능성도 있다
NullPointerException
- component1
,
component2
, 또는 type
가
null
IllegalArgumentException
- position
가 다음의 머지않아도 아닌 경우.
SwingConstants.NORTH
,
SwingConstants.SOUTH
,
SwingConstants.EAST
, 또는
SwingConstants.WEST
LookAndFeel.getLayoutStyle()
public abstract int getContainerGap(JComponent component, int position, Container parent)
component
- 배치되는 JComponent
position
- 부모를 기준으로 한 component
의 배치 위치.
SwingConstants.NORTH
,
SwingConstants.SOUTH
,
SwingConstants.EAST
, 또는
SwingConstants.WEST
parent
- component
의 부모.
실제의 부모와는 다를 가능성이 있다. 또,null
의 가능성도 있다
IllegalArgumentException
- position
가 다음의 머지않아도 아닌 경우.
SwingConstants.NORTH
,
SwingConstants.SOUTH
,
SwingConstants.EAST
, 또는
SwingConstants.WEST
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 차의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요 : 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.