|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.swing.text.AbstractWriter
public abstract class AbstractWriter
AbstractWriter 는, 속성을 포함한 요소 트리를 실제로 써내는 abstract 클래스입니다. 1 행 당에 써내는 문자수의 디폴트는 100 입니다. 다만, 이 값은 서브 클래스에서 설정할 수가 있습니다.
필드의 개요 | |
---|---|
protected static char |
NEWLINE
텍스트 패키지 모델의 개행법입니다. |
생성자 의 개요 | |
---|---|
protected |
AbstractWriter (Writer w,
Document doc)
새로운 AbstractWriter 를 작성합니다. |
protected |
AbstractWriter (Writer w,
Document doc,
int pos,
int len)
새로운 AbstractWriter 를 작성합니다. |
protected |
AbstractWriter (Writer w,
Element root)
새로운 AbstractWriter 를 작성합니다. |
protected |
AbstractWriter (Writer w,
Element root,
int pos,
int len)
새로운 AbstractWriter 를 작성합니다. |
메소드의 개요 | |
---|---|
protected void |
decrIndent ()
인덴트 레벨을 감 분 합니다. |
protected boolean |
getCanWrapLines ()
행이 랩 가능한가 어떤가를 돌려줍니다. |
protected int |
getCurrentLineLength ()
현재의 행의 길이를 돌려줍니다. |
protected Document |
getDocument ()
문서를 가져옵니다. |
protected ElementIterator |
getElementIterator ()
ElementIterator 를 가져옵니다. |
int |
getEndOffset ()
출력 대상의 마지막 오프셋(offset)를 돌려줍니다. |
protected int |
getIndentLevel ()
현재의 인덴트 레벨을 돌려줍니다. |
protected int |
getIndentSpace ()
인덴트 하는 스페이스의 양을 돌려줍니다. |
protected int |
getLineLength ()
행의 길이의 최대치를 돌려줍니다. |
String |
getLineSeparator ()
개행을 나타낼 때 사용하는 캐릭터 라인을 돌려줍니다. |
int |
getStartOffset ()
출력 대상의 최초의 오프셋(offset)를 돌려줍니다. |
protected String |
getText (Element elem)
요소에 관련한 텍스트를 돌려줍니다. |
protected Writer |
getWriter ()
컨텐츠를 출력할 경우에 사용하는 라이터를 돌려줍니다. |
protected void |
incrIndent ()
인덴트 레벨을 증분 합니다. |
protected void |
indent ()
인덴트를 실시합니다. |
protected boolean |
inRange (Element next)
이 메소드는, 현재의 요소가 지정된 범위내에 있을지 어떨지를 판정합니다. |
protected boolean |
isLineEmpty ()
현재의 행의 길이가 빈 상태(empty)의 경우는, true 를 돌려줍니다. |
protected void |
output (char[] content,
int start,
int length)
컨텐츠 기입시의 마지막 정지입니다. |
protected void |
setCanWrapLines (boolean newValue)
행을 랩 할 수 있을지 어떨지를 설정합니다. |
protected void |
setCurrentLineLength (int length)
현재의 행의 길이를 설정합니다. |
protected void |
setIndentSpace (int space)
인덴트에 매핑 하는 스페이스의 수를 서브 클래스로부터 지정할 수 있도록(듯이) 합니다. |
protected void |
setLineLength (int l)
1 행 근처에 기입할 수 있는 문자수를 서브 클래스로부터 설정할 수 있도록(듯이) 합니다. |
void |
setLineSeparator (String value)
개행을 나타낼 때 사용하는 String 를 설정합니다. |
protected void |
text (Element elem)
텍스트를 써냅니다. |
protected abstract void |
write ()
이 추상 메소드는, 서브 클래스에 의해 구현될 필요가 있습니다. |
protected void |
write (char ch)
문자를 써냅니다. |
protected void |
write (char[] chars,
int startIndex,
int length)
모든 서두 메소드는 이것을 호출합니다. |
protected void |
write (String content)
캐릭터 라인을 써냅니다. |
protected void |
writeAttributes (AttributeSet attr)
속성 세트를 " |
protected void |
writeLineSeparator ()
행 단락 문자를 써냅니다. |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
필드의 상세 |
---|
protected static final char NEWLINE
getLineSeparator()
,
정수 필드치 생성자 의 상세 |
---|
protected AbstractWriter(Writer w, Document doc)
w
- Writerdoc
- Documentprotected AbstractWriter(Writer w, Document doc, int pos, int len)
w
- Writerdoc
- Elementpos
- 컨텐츠를 취득한다
문서내의 위치len
- 써내는 양protected AbstractWriter(Writer w, Element root)
w
- Writerroot
- Elementprotected AbstractWriter(Writer w, Element root, int pos, int len)
w
- Writerroot
- Elementpos
- 컨텐츠를 취득한다
문서내의 위치len
- 써내는 양메소드의 상세 |
---|
public int getStartOffset()
public int getEndOffset()
protected ElementIterator getElementIterator()
protected Writer getWriter()
protected Document getDocument()
protected boolean inRange(Element next)
next
- Element
protected abstract void write() throws IOException , BadLocationException
IOException
BadLocationException
protected String getText(Element elem) throws BadLocationException
elem
- Element
String
로서의 텍스트
BadLocationException
- pos 가 문서내의
무효인 위치를 나타내는 경우protected void text(Element elem) throws BadLocationException , IOException
elem
- Element
IOException
- 입출력 에러가 발생했을 경우
BadLocationException
- pos 가 문서내의
무효인 위치를 나타내는 경우protected void setLineLength(int l)
l
- 행의 길이의 최대치protected int getLineLength()
protected void setCurrentLineLength(int length)
protected int getCurrentLineLength()
protected boolean isLineEmpty()
getCurrentLineLength
== 0 || indent
가 빈 상태(empty)의 행상에서 불려 갔을 경우에는 true 입니다.
protected void setCanWrapLines(boolean newValue)
protected boolean getCanWrapLines()
protected void setIndentSpace(int space)
space
- 인덴트에 매핑 하는 스페이스를 나타내는 int 치protected int getIndentSpace()
public void setLineSeparator(String value)
public String getLineSeparator()
protected void incrIndent()
getLineLength()
보다 커지는 것 같은 getIndentSpace()
* getIndentLevel()
가 되면(자) 인덴트 하지 않습니다.
protected void decrIndent()
protected int getIndentLevel()
incrIndent
가 불려 간 회수로부터 decrIndent
가 불려 간 회수를 당긴 수입니다.
protected void indent() throws IOException
IOException
- 입출력 에러가 발생했을 경우protected void write(char ch) throws IOException
write
메소드를 호출할 때 구현됩니다.
ch
- char
IOException
- 입출력 에러가 발생했을 경우protected void write(String content) throws IOException
write
메소드를 호출할 때 구현됩니다.
content
- String
IOException
- 입출력 에러가 발생했을 경우protected void writeLineSeparator() throws IOException
output
를 직접 호출해,lineLength
를 0 으로 설정합니다.
IOException
protected void write(char[] chars, int startIndex, int length) throws IOException
getCanWrapLines()
가 false 를 돌려주면(자) NEWLINE 를 포함하지 않는 chars
의 각 순서 첨부 output
를 호출해, 계속되어 writeLineSeparator
를 호출합니다. 한편,getCanWrapLines()
가 true 를 돌려주면(자), 필요에 따라서 캐릭터 라인을 분할해 getLineLength
를 받습니다. 유일한 예외는 현재의 캐릭터 라인에 공백이 포함되지 않는 경우로, 행의 길이가 getLineLength
를 넘기 (위해)때문에 들어가지 않습니다.
IOException
protected void writeAttributes(AttributeSet attr) throws IOException
attr
- AttributeSet
IOException
- 입출력 에러가 발생했을 경우protected void output(char[] content, int start, int length) throws IOException
write
를 호출합니다.
이 메소드도 length
에 근거해 행의 길이를 갱신합니다. 개행을 출력하기 위해서 불려 가면(자), 현재의 행의 길이를 리셋 해 무효로 할 필요가 있습니다. 이 실행이 호출해 측에 의존하는 경우는,writeLineSeparator
를 사용해 개행을 써내, 현재의 행의 길이의 프로퍼티을 갱신합니다.
IOException
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.