|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요 : 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.swing.text.AbstractDocument
javax.swing.text.DefaultStyledDocument
public class DefaultStyledDocument
RTF (Rich Text Format)에 유사한 방식을 사용해, 자체나 단락 서식을 마크 올라갈 수 있는 문서입니다. 이 문서의 요소 구조는, 스타일 런의 스타일의 편성을 나타냅니다. 이러한 스타일 런은, 단락 요소의 구조 (다른 구조에 포함되고 있는 경우도 있어)에 대응 붙일 수 있습니다. 논리 서식이 단락 경계로 지정되고 있으므로, 스타일 런은 단락 경계에서 분할됩니다.
경고: 이 클래스의 직렬화 된 객체는, 향후의 Swing 릴리스와 호환은 아니게 될 예정입니다. 현재의 직렬화의 지원는, 단기간의 운용이나, 같은 버젼의 Swing 를 실행하는 어플리케이션간의 RMI 에 적절하고 있습니다. JDK Version 1.4 이후, 모든 JavaBeans™ 의 장기간의 운용 지원는,java.beans
패키지에 추가되고 있습니다. 자세한 것은,XMLEncoder
를 참조해 주세요.
Document
,
AbstractDocument
상자의 클래스의 개요 | |
---|---|
static class |
DefaultStyledDocument.AttributeUndoableEdit
UndoableEdit 는, Element 의 AttributeSet 에 더해진 변경을 기억하기 위해서 사용합니다. |
class |
DefaultStyledDocument.ElementBuffer
요소의 계층에 대한 변경을 관리하는 클래스입니다. |
static class |
DefaultStyledDocument.ElementSpec
요소를 구축하는 구현입니다. |
protected class |
DefaultStyledDocument.SectionElement
문서의 디폴트 루트 요소로, 포함되는 단락이나 행을 매핑 합니다. |
클래스 javax.swing.text. AbstractDocument 로부터 상속된 상자의 클래스/인터페이스 |
---|
AbstractDocument.AbstractElement , AbstractDocument.AttributeContext , AbstractDocument.BranchElement , AbstractDocument.Content , AbstractDocument.DefaultDocumentEvent , AbstractDocument.ElementEdit , AbstractDocument.LeafElement |
필드의 개요 | |
---|---|
protected DefaultStyledDocument.ElementBuffer |
buffer
|
static int |
BUFFER_SIZE_DEFAULT
초기 컨텐츠 버퍼의 디폴트 사이즈입니다. |
클래스 javax.swing.text. AbstractDocument 로부터 상속된 필드 |
---|
BAD_LOCATION , BidiElementName , ContentElementName , ElementNameAttribute , listenerList , ParagraphElementName , SectionElementName |
인터페이스 javax.swing.text. Document 로부터 상속된 필드 |
---|
StreamDescriptionProperty , TitleProperty |
생성자 의 개요 | |
---|---|
DefaultStyledDocument ()
디폴트의 서식 첨부 문서를 구축합니다. |
|
DefaultStyledDocument (AbstractDocument.Content c,
StyleContext styles)
서식 첨부 문서를 구축합니다. |
|
DefaultStyledDocument (StyleContext styles)
디폴트의 컨텐츠 기억역의 구현과 서식의 공유 세트를 사용해, 서식 첨부 문서를 구축합니다. |
메소드의 개요 | |
---|---|
void |
addDocumentListener (DocumentListener listener)
문서 청취자를 추가해, 변경이 있었을 때에 통지되도록(듯이) 합니다. |
Style |
addStyle (String nm,
Style parent)
논리 서식 계층에 새로운 서식을 추가합니다. |
protected void |
create (DefaultStyledDocument.ElementSpec [] data)
문서를 초기화해, 지정된 요소 구조 ( getDefaultRootElement 메소드에 의해 보고되는 구조)를 반영합니다. |
protected AbstractDocument.AbstractElement |
createDefaultRoot ()
디폴트의 문서 구조를 나타내기 위해서(때문에) 사용하는 루트 요소를 작성합니다. |
Color |
getBackground (AttributeSet attr)
속성 세트로부터 백그라운드 칼라를 가져옵니다. |
Element |
getCharacterElement (int pos)
위치에 근거해 문자 요소를 가져옵니다. |
Element |
getDefaultRootElement ()
디폴트의 루트 요소를 가져옵니다. |
Font |
getFont (AttributeSet attr)
속성 세트로부터 폰트를 가져옵니다. |
Color |
getForeground (AttributeSet attr)
속성 세트로부터 foreground 칼라를 가져옵니다. |
Style |
getLogicalStyle (int p)
지정된 위치에 의해 나타내진 단락에 할당할 수 있었던 논리 서식을 가져옵니다. |
Element |
getParagraphElement (int pos)
오프셋(offset) pos 의 단락의 요소를 가져옵니다. |
Style |
getStyle (String nm)
이전에 추가된 이름 첨부 서식을 가져옵니다. |
Enumeration <? > |
getStyleNames ()
서식명의 리스트를 가져옵니다. |
protected void |
insert (int offset,
DefaultStyledDocument.ElementSpec [] data)
새로운 요소를 일괄해 삽입합니다. |
protected void |
insertUpdate (AbstractDocument.DefaultDocumentEvent chng,
AttributeSet attr)
문서 구조를 텍스트 삽입의 결과로 갱신합니다. |
void |
removeDocumentListener (DocumentListener listener)
문서 청취자를 삭제합니다. |
void |
removeStyle (String nm)
이전에 문서에 추가된 이름 첨부 서식을 삭제합니다. |
protected void |
removeUpdate (AbstractDocument.DefaultDocumentEvent chng)
텍스트 삭제의 결과로서 문서 구조를 갱신합니다. |
void |
setCharacterAttributes (int offset,
int length,
AttributeSet s,
boolean replace)
문서의 일부에 속성을 설정합니다. |
void |
setLogicalStyle (int pos,
Style s)
지정된 위치의 단락에 사용하는 논리 서식을 설정합니다. |
void |
setParagraphAttributes (int offset,
int length,
AttributeSet s,
boolean replace)
단락에 속성을 설정합니다. |
protected void |
styleChanged (Style style)
이 문서의 서식이 변경되었을 때에 불려 갑니다. |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
인터페이스 javax.swing.text. Document 로부터 상속된 메소드 |
---|
addUndoableEditListener , createPosition , getEndPosition , getLength , getProperty , getRootElements , getStartPosition , getText , getText , insertString , putProperty , remove , removeUndoableEditListener , render |
필드의 상세 |
---|
public static final int BUFFER_SIZE_DEFAULT
protected DefaultStyledDocument.ElementBuffer buffer
생성자 의 상세 |
---|
public DefaultStyledDocument(AbstractDocument.Content c, StyleContext styles)
c
- 컨텐츠의 컨테이너styles
- 문서간에 공유할 수 있는 자원
(와)과 서식 정의public DefaultStyledDocument(StyleContext styles)
styles
- 스타일public DefaultStyledDocument()
메소드의 상세 |
---|
public Element getDefaultRootElement()
Document
내의 getDefaultRootElement
AbstractDocument
내의 getDefaultRootElement
Document.getDefaultRootElement()
protected void create(DefaultStyledDocument.ElementSpec [] data)
getDefaultRootElement
메소드에 의해 보고되는 구조)를 반영합니다. 문서가 하등의 데이터를 보관 유지하고 있는 경우, 그것이 최초로 삭제됩니다.
protected void insert(int offset, DefaultStyledDocument.ElementSpec [] data) throws BadLocationException
이 메소드는 thread에 대해서 안전합니다만, 대부분의 Swing 메소드는 다릅니다. 자세한 것은,「How to Use Threads」를 참조해 주세요.
offset
- 개시 오프셋(offset) >= 0data
- 요소 데이터
BadLocationException
- 개시 오프셋(offset)가 무효인 경우public Style addStyle(String nm, Style parent)
StyledDocument
내의 addStyle
nm
- 서식의 이름. 이름 첨부 서식의 컬렉션 중(안)에서 일의일 필요가 있다.
이 이름은, 서식에 이름이 붙지 않은 경우는 null
(이)가 될 수도 있지만, 이름이 없는 서식은 이름으로 취득할 수 없기 때문에,
반환되는 참조는 호출해 옆에서 관리할 필요가 있다.
이름이 없는 서식은, 스타일 런으로 볼 수 있는 것 같은 문자 속성의 오버라이드(override)등으로
편리한 경우가
어느parent
- 친서식. 지정되어 있지 않은 속성이
다른 서식에서 해석 처리될 필요가 없는 경우는 null 도 가능
public void removeStyle(String nm)
StyledDocument
내의 removeStyle
nm
- 삭제되는 서식의 이름public Style getStyle(String nm)
StyledDocument
내의 getStyle
nm
- 서식의 이름
public Enumeration <? > getStyleNames()
public void setLogicalStyle(int pos, Style s)
이 메소드는 thread에 대해서 안전합니다만, 대부분의 Swing 메소드는 다릅니다. 자세한 것은,「How to Use Threads」를 참조해 주세요.
StyledDocument
내의 setLogicalStyle
pos
- 문서의 선두로부터의 오프셋(offset) >= 0s
- 단락에 할당할 수 있었던 논리 서식. 없는 경우는 nullpublic Style getLogicalStyle(int p)
StyledDocument
내의 getLogicalStyle
p
- 단락으로 변환해, 할당하는 논리 서식을 지정하는 위치.
0 이상.
이것은, 문서의 선두로부터의 오프셋(offset)
public void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)
이 메소드는 thread에 대해서 안전합니다만, 대부분의 Swing 메소드는 다릅니다. 자세한 것은,「How to Use Threads」를 참조해 주세요.
StyledDocument
내의 setCharacterAttributes
offset
- 문서의 오프셋(offset) >= 0length
- 길이 >= 0s
- 속성replace
- 새로운 속성의 설정전에 종래의 속성을
치환할 필요가 있는 경우는 truepublic void setParagraphAttributes(int offset, int length, AttributeSet s, boolean replace)
이 메소드는 thread에 대해서 안전합니다만, 대부분의 Swing 메소드는 다릅니다. 자세한 것은,「How to Use Threads」를 참조해 주세요.
StyledDocument
내의 setParagraphAttributes
offset
- 단락에 대한 오프셋(offset) >= 0length
- 영향을 받는 문자수 >= 0s
- 속성replace
- 기존의 속성을 치환하는지, 머지 할까public Element getParagraphElement(int pos)
pos
의 단락의 요소를 가져옵니다. 1 개의 단락은, 적어도 1 개(살)의, 일반적으로은 잎인 아이의 Element 로부터 구성되어 있습니다.
StyledDocument
내의 getParagraphElement
AbstractDocument
내의 getParagraphElement
pos
- 개시 오프셋(offset) >= 0
public Element getCharacterElement(int pos)
StyledDocument
내의 getCharacterElement
pos
- 문서의 위치 >= 0
protected void insertUpdate(AbstractDocument.DefaultDocumentEvent chng, AttributeSet attr)
AbstractDocument
내의 insertUpdate
chng
- 문서 변경의 설명attr
- 속성protected void removeUpdate(AbstractDocument.DefaultDocumentEvent chng)
AbstractDocument
내의 removeUpdate
chng
- 문서 변경의 설명protected AbstractDocument.AbstractElement createDefaultRoot()
public Color getForeground(AttributeSet attr)
StyledDocument
내의 getForeground
attr
- 속성 세트
public Color getBackground(AttributeSet attr)
StyledDocument
내의 getBackground
attr
- 속성 세트
public Font getFont(AttributeSet attr)
StyledDocument
내의 getFont
attr
- 속성 세트
protected void styleChanged(Style style)
style
- 변경된 Stylepublic void addDocumentListener(DocumentListener listener)
Document
내의 addDocumentListener
AbstractDocument
내의 addDocumentListener
listener
- 청취자Document.addDocumentListener(javax.swing.event.DocumentListener)
public void removeDocumentListener(DocumentListener listener)
Document
내의 removeDocumentListener
AbstractDocument
내의 removeDocumentListener
listener
- 청취자Document.removeDocumentListener(javax.swing.event.DocumentListener)
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요 : 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.