|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.swing.text.View
javax.swing.text.CompositeView
public abstract class CompositeView
CompositeView
는, 1 개(살) 이상의 아이 뷰를 관리하는 abstract 클래스의 View
의 구현입니다. CompositeView
는, 비교적 소수의 아이 뷰를 관리하는 것을 상정하고 있습니다. CompositeView
는,BoxView
등, 아이의 View
를 포함한,View
의 구현의 개시 포인트로서 사용됩니다. 아이의 View
의 컬렉션을 관리하는 서브 클래스에서는,replace(int, int, javax.swing.text.View[])
메소드가 사용됩니다. DocumentListener
통지중에 View
가 replace
를 호출하므로, 일반적으로 replace
를 직접 호출할 필요는 없습니다.
CompositeView
는, 아이의 View
에 레이아웃 정책를 강제합니다만, 지금부터 포함하게 되는 아이의 View
의 삽입은 허가합니다. 인 세트는,setInsets(short, short, short, short)
또는 setParagraphInsets(javax.swing.text.AttributeSet)
에 의해 설정할 수 있습니다.
View
의 추상 메소드에 가세해CompositeView
의 서브 클래스도 오버라이드(override) 할 필요가 있습니다.
isBefore(int, int, java.awt.Rectangle)
- 지정된 View
의 위치가,CompositeView
의 시각 공간의 앞에 있을지 어떨지를 조사한다
isAfter(int, int, java.awt.Rectangle)
- 지정된 View
의 위치가,CompositeView
의 시각 공간의 뒤에 있을지 어떨지를 조사한다
getViewAtPoint(int, int, java.awt.Rectangle)
- 지정된 시각 위치의 뷰를 돌려준다
childAllocation(int, java.awt.Rectangle)
- 특정의 아이 View
의 경계를 돌려준다. CompositeView
의 Inset
에 의해 경계를 오프셋(offset) 한 후에,getChildAllocation
는 childAllocation
를 호출한다
필드의 개요 |
---|
클래스 javax.swing.text. View 로부터 상속된 필드 |
---|
BadBreakWeight , ExcellentBreakWeight , ForcedBreakWeight , GoodBreakWeight , X_AXIS , Y_AXIS |
인터페이스 javax.swing. SwingConstants 로부터 상속된 필드 |
---|
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
생성자 의 개요 | |
---|---|
CompositeView (Element elem)
지정된 요소의 CompositeView 를 구축합니다. |
메소드의 개요 | |
---|---|
protected abstract void |
childAllocation (int index,
Rectangle a)
지정된 아이에게로의 할당을 돌려줍니다. |
protected boolean |
flipEastAndWestAtEnds (int position,
Position.Bias bias)
다음의 뷰를 어느 방향으로 배치할까를 결정합니다. |
protected short |
getBottomInset ()
아래의 인 세트를 가져옵니다. |
Shape |
getChildAllocation (int index,
Shape a)
지정된, draw 하는 아이 뷰에의 할당을 가져옵니다. |
protected Rectangle |
getInsideAllocation (Shape a)
뷰로 지정된 불변의 할당을, 내부 할당을 나타내는 가변 할당해로 변경합니다. |
protected short |
getLeftInset ()
왼쪽의 인 세트를 가져옵니다. |
protected int |
getNextEastWestVisualPositionFrom (int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias [] biasRet)
커서를 둘 수 있는, 다음의 시각적인 위치를 돌려줍니다. |
protected int |
getNextNorthSouthVisualPositionFrom (int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias [] biasRet)
커서를 둘 수 있는, 다음의 시각적인 위치를 돌려줍니다. |
int |
getNextVisualPositionFrom (int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias [] biasRet)
caret가 배치될 가능성이 있는, 시각적으로 나타내진 다음의 모델 위치를 결정하는 수단을 제공합니다. |
protected short |
getRightInset ()
오른쪽의 인 세트를 가져옵니다. |
protected short |
getTopInset ()
위의 인 세트를 가져옵니다. |
View |
getView (int n)
컨테이너내의 n 번째의 뷰를 돌려줍니다. |
protected abstract View |
getViewAtPoint (int x,
int y,
Rectangle alloc)
지정된 좌표의 아이 뷰를 가져옵니다. |
protected View |
getViewAtPosition (int pos,
Rectangle a)
모델내에서 지정된 위치를 나타내는 아이 뷰를 가져옵니다. |
int |
getViewCount ()
이 뷰의 아이 뷰의 수를 돌려줍니다. |
int |
getViewIndex (int pos,
Position.Bias b)
모델내의 지정된 위치를 나타내는 아이 뷰의 인덱스를 돌려줍니다. |
protected int |
getViewIndexAtPosition (int pos)
모델내의 지정된 위치를 나타내는 아이 뷰의 인덱스를 가져옵니다. |
protected abstract boolean |
isAfter (int x,
int y,
Rectangle alloc)
있는 점이, 구형 범위의 뒤에 있을지 어떨지를 판정합니다. |
protected abstract boolean |
isBefore (int x,
int y,
Rectangle alloc)
있는 점이, 구형 범위의 전에 있을지 어떨지를 판정합니다. |
protected void |
loadChildren (ViewFactory f)
뷰를 초기화하기 위해서 모든 아이를 로드합니다. |
Shape |
modelToView (int p0,
Position.Bias b0,
int p1,
Position.Bias b1,
Shape a)
문서 모델의 좌표 공간으로부터 뷰의 좌표 공간에의 매핑을 제공합니다. |
Shape |
modelToView (int pos,
Shape a,
Position.Bias b)
문서 모델의 좌표 공간으로부터 뷰의 좌표 공간에의 매핑을 제공합니다. |
void |
replace (int offset,
int length,
View [] views)
아이 뷰를 치환합니다. |
protected void |
setInsets (short top,
short left,
short bottom,
short right)
뷰의 인 세트를 설정합니다. |
protected void |
setParagraphInsets (AttributeSet attr)
지정된 속성으로부터 선택된 단락 속성으로부터, 인 세트를 설정합니다. |
void |
setParent (View parent)
뷰의 부모를 설정합니다. |
int |
viewToModel (float x,
float y,
Shape a,
Position.Bias [] bias)
뷰의 좌표 공간으로부터 모델의 논리 좌표 공간에의 매핑을 제공합니다. |
클래스 javax.swing.text. View 로부터 상속된 메소드 |
---|
append , breakView , changedUpdate , createFragment , forwardUpdate , forwardUpdateToView , getAlignment , getAttributes , getBreakWeight , getContainer , getDocument , getElement , getEndOffset , getGraphics , getMaximumSpan , getMinimumSpan , getParent , getPreferredSpan , getResizeWeight , getStartOffset , getToolTipText , getViewFactory , getViewIndex , insert , insertUpdate , isVisible , modelToView , paint , preferenceChanged , remove , removeAll , removeUpdate , setSize , updateChildren , updateLayout , viewToModel |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
생성자 의 상세 |
---|
public CompositeView(Element elem)
CompositeView
를 구축합니다.
elem
- 이 뷰가 취급하는 요소메소드의 상세 |
---|
protected void loadChildren(ViewFactory f)
setParent(javax.swing.text.View)
메소드에 의해 불려 갑니다. 서브 클래스는, 이 메소드를 재구현해 다른 방법으로 아이 뷰를 초기화할 수 있습니다. 디폴트의 구현은, 아이 요소 마다 아이 뷰를 작성합니다.
f
- 뷰파크트리setParent(javax.swing.text.View)
public void setParent(View parent)
loadChildren
메소드의 호출과 함께 슈퍼 클래스의 동작을 제공다시 하기 위해서 구현합니다. 아이를 생성자 안에 로드하지 않게 해 주세요. 이것은, 부모를 설정하는 동작이 원인이 되어, 예를 들어 수용측 Container
를 취득하기 위해서, 아이가 계층을 거슬러 올라가 검색하려고 하기 때문입니다. 이 뷰가 아이를 가지는 경우는, 뷰 계층내가 있는 위치로부터 다른 위치에 이동하고 있으므로,loadChildren
메소드는 불려 가지 않습니다.
View
내의 setParent
parent
- 뷰의 부모. 없는 경우는 null
public int getViewCount()
View
내의 getViewCount
getView(int)
public View getView(int n)
View
내의 getView
n
- 목적의 뷰의 번호 >= 0 && < getViewCount()
n
의 뷰public void replace(int offset, int length, View [] views)
null
로 설정된 부모를 가져, 삭제되는 뷰의 내부 참조를 하고 있으므로, 가베지로서 회수할 수 있습니다.
View
내의 replace
offset
- 신규 뷰를 삽입하기 위한 , 아이 뷰의 개시 인덱스.
0 이상, getViewCount 이하length
- 삭제하는 기존의 아이 뷰의 수.
이 값은 0 이상으로, (getViewCount() - offset) 이하views
- 추가하는 아이 뷰.
추가하는 아이가 없는 경우는 null
도 가능
(삭제에 편리)public Shape getChildAllocation(int index, Shape a)
View
내의 getChildAllocation
index
- 자의 인덱스 >= 0 && < getViewCount()
a
- 이 뷰에 대한 할당
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
View
내의 modelToView
pos
- 변환 대상의 위치 >>= 0a
- draw를 위해서(때문에) 할당할 수 있었던 영역b
- Position.Bias.Forward
또는 Position.Bias.Backward
의 바이어스치
BadLocationException
- 지정된 위치가, 관련지을 수 있었던 문서내의
유효한 위치를 나타내지 않는 경우View.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)
public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException
View
내의 modelToView
p0
- 변환 대상의 위치 >>= 0b0
- 위치가 2 개의 뷰의 경계인 경우에,
p0 에 의해 나타내지기 직전의 문자
또는 다음의 문자에의 바이어스.
Position.Bias.Forward
또는
Position.Bias.Backward
p1
- 변환 대상의 위치 >>= 0b1
- 위치가 2 개의 뷰의 경계인 경우에,
p1 에 의해 나타내지기 직전의 문자
또는 다음의 문자에의 바이어스a
- draw를 위해서(때문에) 할당할 수 있었던 영역
BadLocationException
- 지정된 위치가, 관련지을 수 있었던 문서내의
유효한 위치를 나타내지 않는 경우
IllegalArgumentException
- bias 인수가 무효인 경우View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public int viewToModel(float x, float y, Shape a, Position.Bias [] bias)
View
내의 viewToModel
x
- 변환하는 뷰 위치의 x 좌표 >= 0y
- 변환하는 뷰 위치의 y 좌표 >= 0a
- draw를 위해서(때문에) 할당할 수 있었던 영역bias
- Position.Bias.Forward
또는
Position.Bias.Backward
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias [] biasRet) throws BadLocationException
getNextNorthSouthVisualPositionFrom(int, javax.swing.text.Position.Bias, java.awt.Shape, int, javax.swing.text.Position.Bias[])
나 getNextEastWestVisualPositionFrom(int, javax.swing.text.Position.Bias, java.awt.Shape, int, javax.swing.text.Position.Bias[])
의 편리한 메소드입니다.
View
내의 getNextVisualPositionFrom
pos
- 변환 대상의 위치 >>= 0b
- Position.Bias.Forward
또는 Position.Bias.Backward
의 바이어스치a
- draw를 위해서(때문에) 할당할 수 있었던 영역direction
- 현재 위치로부터의 방향.
이것은, 키보드에 일반적으로 존재하는 커서 키라고 볼 수가 있어
다음의 어느 쪽인가에 된다
SwingConstants.WEST
SwingConstants.EAST
SwingConstants.NORTH
SwingConstants.SOUTH
biasRet
- 체크된 바이어스를 포함한 배열
BadLocationException
IllegalArgumentException
- direction
가 무효인 경우public int getViewIndex(int pos, Position.Bias b)
getViewIndexByPosition
메소드를 호출하기 위해서(때문에) 이 메소드를 구현하고 있습니다.
View
내의 getViewIndex
pos
- 위치 >= 0
protected abstract boolean isBefore(int x, int y, Rectangle alloc)
x
- X 좌표 >= 0y
- Y 좌표 >= 0alloc
- 구형
protected abstract boolean isAfter(int x, int y, Rectangle alloc)
x
- X 좌표 >= 0y
- Y 좌표 >= 0alloc
- 구형
protected abstract View getViewAtPoint(int x, int y, Rectangle alloc)
x
- X 좌표 >= 0y
- Y 좌표 >= 0alloc
- 입구에서의 부모의 할당.
출구에서 아이의 할당으로 변경
protected abstract void childAllocation(int index, Rectangle a)
index
- 자의 인덱스 >= 0 && < getViewCount()
a
- 입구에서의 박스의 내부에의 할당.
및, 출구에서의 인덱스 위치의 아이 뷰의 할당protected View getViewAtPosition(int pos, Rectangle a)
pos
- 위치 >= 0a
- 입구에서의 박스의 내부에의 할당.
및, 출구에서의 위치를 포함한 뷰의 할당
null
protected int getViewIndexAtPosition(int pos)
pos
- 위치 >= 0
protected Rectangle getInsideAllocation(Shape a)
childAllocation
메소드에 보내집니다.
a
- 뷰로 지정된 할당
null
의 경우,
반환값은 null
protected void setParagraphInsets(AttributeSet attr)
attr
- 속성protected void setInsets(short top, short left, short bottom, short right)
top
- 상의 인 세트 >= 0left
- 왼쪽의 인 세트 >= 0bottom
- 하의 인 세트 >= 0right
- 오른쪽의 인 세트 >= 0protected short getLeftInset()
protected short getRightInset()
protected short getTopInset()
protected short getBottomInset()
protected int getNextNorthSouthVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias [] biasRet) throws BadLocationException
pos
- 변환 대상의 위치 >>= 0b
- Position.Bias.Forward
또는
Position.Bias.Backward
의 바이어스치a
- draw를 위해서(때문에) 할당할 수 있었던 영역direction
- 현재 위치로부터의 방향.
이것은, 키보드에 일반적으로 존재하는 커서 키라고 볼 수가 있어
다음의 어느 쪽인가에 된다
SwingConstants.NORTH
SwingConstants.SOUTH
biasRet
- 체크된 바이어스를 포함한 배열
BadLocationException
IllegalArgumentException
- direction
가 무효인 경우getNextVisualPositionFrom(int, javax.swing.text.Position.Bias, java.awt.Shape, int, javax.swing.text.Position.Bias[])
protected int getNextEastWestVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias [] biasRet) throws BadLocationException
pos
- 변환 대상의 위치 >>= 0b
- Position.Bias.Forward
또는
Position.Bias.Backward
의 바이어스치a
- draw를 위해서(때문에) 할당할 수 있었던 영역direction
- 현재 위치로부터의 방향.
이것은, 키보드에 일반적으로 존재하는 커서 키라고 볼 수가 있어
다음의 어느 쪽인가에 된다
SwingConstants.WEST
SwingConstants.EAST
biasRet
- 체크된 바이어스를 포함한 배열
BadLocationException
IllegalArgumentException
- direction
가 무효인 경우getNextVisualPositionFrom(int, javax.swing.text.Position.Bias, java.awt.Shape, int, javax.swing.text.Position.Bias[])
protected boolean flipEastAndWestAtEnds(int position, Position.Bias bias)
View
가 고려됩니다. 일반적으로은, EAST 에의 View
가 인덱스 n + 1, WEST 에의 View
가 인덱스 n -1 가 되도록(듯이),View
는 왼쪽에서 오른쪽에 레이아웃 됩니다. 쌍방향 텍스트 등 일부의 경우에서는, EAST 에의 View
를 인덱스 n + 1 은 아니고 인덱스 n -1 에, 또는 WEST 에의 View
를 인덱스 n - 1 은 아니고 인덱스 n + 1 으로 할 수도 있습니다. 이 경우, 이 메소드는 true 를 돌려주어,View
가 내림차순에 레이아웃 되고 있는 것을 나타냅니다.
여기에서는 무조건 false 가 돌려주어집니다. View
를 내림차순에 배치할 가능성이 있는 경우, 서브 클래스는 이 메소드를 오버라이드(override) 합니다.
position
- 모델에의 위치bias
- Position.Bias.Forward
또는
Position.Bias.Backward
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.