|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.swing.text.View
javax.swing.text.CompositeView
javax.swing.text.BoxView
public class BoxView
뷰는, 뷰의 아이를 축으로 따라 타일링 하는 것으로, 1 개의 박스의 형상에 배치합니다. 이 박스는, 아이의 배열을 하는 곳은 아이의 유연성도 고려된다고 하는 점으로써, TeX 에 준비되어 있는 박스와 닮아 있습니다. 따라서, 행, 단락, 리스트 항목, 열, 페이지등의 컬렉션을 표시하는데 편리한 기본 단위입니다. 아이의 타일링을 하는 축은, 주축으로 간주해집니다. 이것에 직각의 축은, 부축입니다.
각 축의 레이아웃은,layoutMajorAxis
메소드와 layoutMinorAxis
메소드로 따로 따로 처리됩니다. 서브 클래스는, 이러한 메소드를 한번 더 구현하는 것으로, 레이아웃 알고리즘을 변경합니다. 이러한 메소드는, 캐쉬된 레이아웃 정보가 있을지 어떨지, 또 캐쉬가 유효한지 어떤지에 의해, 필요에 따라서 불려 갑니다. 일반적으로, 축으로 따른 지정 사이즈가 변경되는 경우나,layoutChanged
가 불려 가 레이아웃이 강제적으로 변경되는 경우에, 이러한 메소드가 불려 갑니다. 캐쉬된 레이아웃 정보가 있는 경우는,layoutChanged
메소드로 무효로 됩니다. 친뷰에 통지된 요건은,calculateMajorAxisRequirements
메소드나 calculateMinorAxisRequirements
메소드로 계산됩니다. 레이아웃 알고리즘이 변경되었을 경우, 이러한 메소드는 재차 구현될 필요가 있습니다.
필드의 개요 |
---|
클래스 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 |
생성자 의 개요 | |
---|---|
BoxView (Element elem,
int axis)
BoxView 를 구축합니다. |
메소드의 개요 | |
---|---|
protected void |
baselineLayout (int targetSpan,
int axis,
int[] offsets,
int[] spans)
사용하는 영역의 폭 (또는 높이)인 targetSpan 를 지정한 BoxView 에 있어서의, 각 자 뷰의 위치와 extent를 계산합니다. |
protected SizeRequirements |
baselineRequirements (int axis,
SizeRequirements r)
각 자 뷰의 사이즈를 조사해, 이 BoxView 의 사이즈 요건을 계산합니다. |
protected SizeRequirements |
calculateMajorAxisRequirements (int axis,
SizeRequirements r)
주축 axis 의 사이즈 요건을 계산합니다. |
protected SizeRequirements |
calculateMinorAxisRequirements (int axis,
SizeRequirements r)
부축 axis 의 사이즈 요건을 계산합니다. |
protected void |
childAllocation (int index,
Rectangle alloc)
아이 뷰에 영역을 할당합니다. |
protected boolean |
flipEastAndWestAtEnds (int position,
Position.Bias bias)
다음의 뷰를 어느 방향으로 배치할까를 결정합니다. |
protected void |
forwardUpdate (DocumentEvent.ElementChange ec,
DocumentEvent e,
Shape a,
ViewFactory f)
지정된 DocumentEvent 를 모델의 변경 통지가 필요한 아이 뷰에 전송 합니다. |
float |
getAlignment (int axis)
축으로 따른 이 뷰의 바람직한 레이아웃을 결정합니다. |
int |
getAxis ()
타일축의 프로퍼티을 가져옵니다. |
Shape |
getChildAllocation (int index,
Shape a)
지정된 아이 뷰의 할당을 가져옵니다. |
int |
getHeight ()
박스의 현재의 높이를 돌려줍니다. |
float |
getMaximumSpan (int axis)
이 뷰의 최대 스팬을 축으로 따라 지정합니다. |
float |
getMinimumSpan (int axis)
이 뷰의 최소 스팬을 축으로 따라 지정합니다. |
protected int |
getOffset (int axis,
int childIndex)
특정의 아이에 대해, 현재의 레이아웃의 오프셋(offset)를 가져옵니다. |
float |
getPreferredSpan (int axis)
이 뷰에 적절한 스팬을 축으로 따라 지정합니다. |
int |
getResizeWeight (int axis)
사이즈 변경의 웨이트를 가져옵니다. |
protected int |
getSpan (int axis,
int childIndex)
특정의 아이에 대해, 현재의 레이아웃의 스팬을 가져옵니다. |
protected View |
getViewAtPoint (int x,
int y,
Rectangle alloc)
지정된 좌표의 아이 뷰를 가져옵니다. |
int |
getWidth ()
박스의 현재의 폭을 돌려줍니다. |
protected boolean |
isAfter (int x,
int y,
Rectangle innerAlloc)
있는 점이, 할당할 수 있었던 영역의 후에 있을지 어떨지를 판정합니다. |
protected boolean |
isAllocationValid ()
아이에게로의 할당이 현재도 유효한가 어떤가를 판정합니다. |
protected boolean |
isBefore (int x,
int y,
Rectangle innerAlloc)
있는 점이, 할당할 수 있었던 영역의 앞에 있을지 어떨지를 판정합니다. |
protected boolean |
isLayoutValid (int axis)
지정된 축으로 따라 레이아웃이 유효한가 어떤가를 결정합니다. |
protected void |
layout (int width,
int height)
박스의 레이아웃을 실행합니다. |
void |
layoutChanged (int axis)
축으로 따른 레이아웃을 무효로 합니다. |
protected void |
layoutMajorAxis (int targetSpan,
int axis,
int[] offsets,
int[] spans)
박스의 주축 (즉, 그것이 나타내는 축)을 레이아웃 합니다. |
protected void |
layoutMinorAxis (int targetSpan,
int axis,
int[] offsets,
int[] spans)
박스의 부축 (즉, 그것이 나타내는 축으로 직각의 축)을 레이아웃 합니다. |
Shape |
modelToView (int pos,
Shape a,
Position.Bias b)
문서 모델의 좌표 공간으로부터 뷰의 좌표 공간에의 매핑을 제공합니다. |
void |
paint (Graphics g,
Shape allocation)
지정된 draw 표면 및 그 표면상의 영역을 사용해 BoxView 를 draw 합니다. |
protected void |
paintChild (Graphics g,
Rectangle alloc,
int index)
아이를 draw 합니다. |
void |
preferenceChanged (View child,
boolean width,
boolean height)
아이에게 불려 가 그 스팬의 설정이 변경된 것을 나타냅니다. |
void |
replace (int index,
int length,
View [] elems)
레이아웃을 무효로 해, 요구 또는 할당의 캐쉬의 사이즈를 변경합니다. |
void |
setAxis (int axis)
타일축의 프로퍼티을 설정합니다. |
void |
setSize (float width,
float height)
뷰의 사이즈를 설정합니다. |
int |
viewToModel (float x,
float y,
Shape a,
Position.Bias [] bias)
뷰의 좌표 공간으로부터 모델의 논리 좌표 공간에의 매핑을 제공합니다. |
클래스 javax.swing.text. CompositeView 로부터 상속된 메소드 |
---|
getBottomInset , getInsideAllocation , getLeftInset , getNextEastWestVisualPositionFrom , getNextNorthSouthVisualPositionFrom , getNextVisualPositionFrom , getRightInset , getTopInset , getView , getViewAtPosition , getViewCount , getViewIndex , getViewIndexAtPosition , loadChildren , modelToView , setInsets , setParagraphInsets , setParent |
클래스 javax.swing.text. View 로부터 상속된 메소드 |
---|
append , breakView , changedUpdate , createFragment , forwardUpdateToView , getAttributes , getBreakWeight , getContainer , getDocument , getElement , getEndOffset , getGraphics , getParent , getStartOffset , getToolTipText , getViewFactory , getViewIndex , insert , insertUpdate , isVisible , modelToView , remove , removeAll , removeUpdate , updateChildren , updateLayout , viewToModel |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
생성자 의 상세 |
---|
public BoxView(Element elem, int axis)
BoxView
를 구축합니다.
elem
- 이 뷰가 취급하는 요소axis
- View.X_AXIS
또는 View.Y_AXIS
메소드의 상세 |
---|
public int getAxis()
View.Y_AXIS
public void setAxis(int axis)
axis
- View.X_AXIS
또는 View.Y_AXIS
public void layoutChanged(int axis)
setSize
메소드가 다음번 이 뷰에 불려 갔을 때에 갱신됩니다.
axis
- View.X_AXIS
또는 View.Y_AXIS
protected boolean isLayoutValid(int axis)
axis
- View.X_AXIS
또는 View.Y_AXIS
protected void paintChild(Graphics g, Rectangle alloc, int index)
g
- 그래픽스 문맥alloc
- 페인트를 위해서(때문에) 할당할 수 있었던 영역index
- 자의 인덱스 >= 0 && < getViewCount()public void replace(int index, int length, View [] elems)
CompositeView
내의 replace
index
- 신규 뷰를 삽입하기 위한 , 아이 뷰의 개시 인덱스.
이 값은 0 이상으로, getViewCount 이하length
- 삭제하는 기존의 아이 뷰의 수.
이 값은 0 이상으로, (getViewCount() - offset) 이하elems
- 추가하는 아이 뷰.
추가되는 아이가 없는 경우는,null
도 가능
(삭제에 편리)protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent e, Shape a, ViewFactory f)
DocumentEvent
를 모델의 변경 통지가 필요한 아이 뷰에 전송 합니다. 선두의 아이의 박스의 부분을 박스의 마지막에 전송 하기 전에, 아이가 그 요건을 변경하고 있어, 할당이 유효할 경우, 재페인트 됩니다.
View
내의 forwardUpdate
ec
- 이 뷰가 취급하는 요소에의 변경.
변경이 없었던 경우,null
가 될 가능성이 있는e
- 관련하는 문서로부터의 변경 정보a
- 뷰의 현재의 할당f
- 뷰가 아이를 가지는 경우에 재구축에 사용하는 팩토리View.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
,
View.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
,
View.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void preferenceChanged(View child, boolean width, boolean height)
View
내의 preferenceChanged
child
- 자 뷰width
- 폭의 설정이 변경되었을 경우에 trueheight
- 높이의 설정이 변경되었을 경우에 trueJComponent.revalidate()
public int getResizeWeight(int axis)
View
내의 getResizeWeight
axis
- View.X_AXIS
또는 View.Y_AXIS
IllegalArgumentException
- 축이 무효인 경우public void setSize(float width, float height)
View
내의 setSize
width
- 폭 >= 0height
- 높이 >= 0public void paint(Graphics g, Shape allocation)
BoxView
를 draw 합니다. 지정된 Graphics
의 클립 경계를 교차하는 아이만이 draw 됩니다.
View
내의 paint
g
- 사용하는 draw 표면allocation
- draw를 위해서(때문에) 할당할 수 있었던 영역View.paint(java.awt.Graphics, java.awt.Shape)
public Shape getChildAllocation(int index, Shape a)
null
를 돌려주기 위해서(때문에) 구현해, 그렇지 않은 경우는 슈퍼 클래스가 실행됩니다.
CompositeView
내의 getChildAllocation
index
- 자의 인덱스 >= 0 && < getViewCount()
a
- 이 뷰에 대한 할당
a
가 null
의 경우는 null
.
레이아웃이 무효의 경우도 null
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
CompositeView
내의 modelToView
pos
- 변환 대상의 위치 >>= 0a
- draw를 위해서(때문에) 할당할 수 있었던 영역b
- Position.Bias.Forward
또는 Position.Bias.Backward
의 바이어스치
BadLocationException
- 지정된 위치가, 관련지을 수 있었던 문서내의
유효한 위치를 나타내지 않는 경우View.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)
public int viewToModel(float x, float y, Shape a, Position.Bias [] bias)
CompositeView
내의 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 float getAlignment(int axis)
View
내의 getAlignment
axis
- View.X_AXIS
또는
View.Y_AXIS
IllegalArgumentException
- 축이 무효인 경우public float getPreferredSpan(int axis)
View
내의 getPreferredSpan
axis
- View.X_AXIS
또는
View.Y_AXIS
IllegalArgumentException
- 축이 무효인 형태View.getPreferredSpan(int)
public float getMinimumSpan(int axis)
View
내의 getMinimumSpan
axis
- View.X_AXIS
또는
View.Y_AXIS
IllegalArgumentException
- 축이 무효인 형태View.getPreferredSpan(int)
public float getMaximumSpan(int axis)
View
내의 getMaximumSpan
axis
- View.X_AXIS
또는
View.Y_AXIS
IllegalArgumentException
- 축이 무효인 형태View.getPreferredSpan(int)
protected boolean isAllocationValid()
protected boolean isBefore(int x, int y, Rectangle innerAlloc)
CompositeView
내의 isBefore
x
- X 좌표 >= 0y
- Y 좌표 >= 0innerAlloc
- 할당할 수 있었던 영역.
인 세트의 안쪽의 영역
protected boolean isAfter(int x, int y, Rectangle innerAlloc)
CompositeView
내의 isAfter
x
- X 좌표 >= 0y
- Y 좌표 >= 0innerAlloc
- 할당할 수 있었던 영역.
인 세트의 안쪽의 영역
protected View getViewAtPoint(int x, int y, Rectangle alloc)
CompositeView
내의 getViewAtPoint
x
- X 좌표 >= 0y
- Y 좌표 >= 0alloc
- 입구에서는 부모의 내부 할당.
출구에서 아이의 할당으로 변경
protected void childAllocation(int index, Rectangle alloc)
CompositeView
내의 childAllocation
index
- 할당하는 아이 뷰의 인덱스.
0 이상으로 getViewCount()보다 작은 값alloc
- 할당할 수 있는 영역protected void layout(int width, int height)
width
- 폭 (인 세트내) >= 0height
- 높이 (인 세트내) >= 0public int getWidth()
public int getHeight()
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
targetSpan
- 뷰로 지정된 스팬의 합계.
아이를 레이아웃 하기 위해서 사용되는axis
- 레이아웃 되는 축offsets
- 각 자 뷰의 뷰의 기점으로부터의 오프셋(offset).
이것은 반환값이며,
이 메소드의 구현에 의해 할당할 수 있는spans
- 각 자 뷰의 스팬.
이것은 반환값이며, 이 메소드의 구현에 의해 할당할 수 있다protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
targetSpan
- 뷰로 지정된 스팬의 합계.
아이를 레이아웃 하기 위해서 사용되는axis
- 레이아웃 되는 축offsets
- 각 자 뷰의 뷰의 기점으로부터의 오프셋(offset).
이것은 반환값이며,
이 메소드의 구현에 의해 할당할 수 있는spans
- 각 자 뷰의 스팬.
이것은 반환값이며, 이 메소드의 구현에 의해 할당할 수 있다protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r)
axis
의 사이즈 요건을 계산합니다.
axis
- 조사중의 축r
- SizeRequirements
객체.
null
의 경우, 1 개(살) 작성된다
SizeRequirements
객체SizeRequirements
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r)
axis
의 사이즈 요건을 계산합니다.
axis
- 조사중의 축r
- SizeRequirements
객체.
null
의 경우, 1 개(살) 작성된다
SizeRequirements
객체SizeRequirements
protected void baselineLayout(int targetSpan, int axis, int[] offsets, int[] spans)
targetSpan
를 지정한 BoxView
에 있어서의, 각 자 뷰의 위치와 extent를 계산합니다.
targetSpan
- 뷰로 지정된 스팬의 합계.
아이를 레이아웃 하기 위해서 사용되는axis
- 조사중의 축.
View.X_AXIS
또는 View.Y_AXIS
offsets
- 빈 상태(empty)의 배열. 이 메소드에 의해 각 자 뷰의 위치를 지정하는 값을 할당할 수 있는spans
- 빈 상태(empty)의 배열. 이 메소드에 의해 각 자 뷰의 extent를 지정하는 값을 할당할 수 있다protected SizeRequirements baselineRequirements(int axis, SizeRequirements r)
BoxView
의 사이즈 요건을 계산합니다.
axis
- 조사중의 축r
- SizeRequirements
객체.
null
의 경우, 1 개(살) 작성된다
SizeRequirements
객체protected int getOffset(int axis, int childIndex)
axis
- 조사중의 축childIndex
- 요구된 아이의 인덱스
protected int getSpan(int axis, int childIndex)
axis
- 조사중의 축childIndex
- 요구된 아이의 인덱스
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
가 승순에 레이아웃 되고 있는 것을 나타냅니다.
리시버가 Y_AXIS
에 따라 View
를 배치하고 있는 경우,position
와 bias
의 draw를 실시하는 View
상에서 같은 메소드를 호출하는 것으로 값을 돌려줍니다. 그렇지 않은 경우는, false 를 돌려줍니다.
CompositeView
내의 flipEastAndWestAtEnds
position
- 모델에의 위치bias
- Position.Bias.Forward
또는
Position.Bias.Backward
position
나
bias
의 draw를 실시한다
View
의 주위에 있는 View
가 내림차순에 레이아웃 되고 있는 경우는 true. 그렇지 않은 경우는 false
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.