JavaTM 2
Platform
Std.  Ed.  v1. 4.0

javax.swing.text.html
Ŭ·¡½º MinimalHTMLWriter

java.lang.Object 
  |
  +--javax.swing.text.AbstractWriter 
        |
        +--javax.swing.text.html.MinimalHTMLWriter

public class MinimalHTMLWriter
extends AbstractWriter

MinimalHTMLWriter ´Â EditorKit ·Î ÀÛ¼ºµÇÁö ¾Ê´Â ¹®¼­ÀÇ HTML ¸¦ ½á³»±â À§Çؼ­(¶§¹®¿¡) HTMLEditorKit °¡ »ç¿ëÇÏ´Â ´ëü ¶óÀÌÅÍÀÔ´Ï´Ù. ¹®¼­ÀÇ Çü½ÄÀº ´ÙÀ½°ú °°½À´Ï´Ù.

<html>
<head>
<style>
<! -- list of named styles
p.normal {
font-family: SansSerif;
	      margin-height: 0;
	      font-size: 14
	   }
-->
</style>
</head>
<body>
<p style=normal>
½ÇÇà ÆÄÀÏÀÇ º¼µå, ÀÌÅŸ¯, ¹× ¹ØÁÙ
ÀÇ °¢ ¼Ó¼ºÀº  HTML ű׷μ­ ¹ßÇàµË´Ï´Ù.
±× ¿ÜÀÇ Å±״ <span> ű×ÀÇ
ÀϺημ­ ¹ßÇàµË´Ï´Ù.
±¸¹®Àº ÀÎ ¶óÀÎÀÇ ½ºÅ¸Àϰú °°½À´Ï´Ù. 
</p>
</body>
</html>


ÇʵåÀÇ °³¿ä
 
Ŭ·¡½º javax.swing.text. AbstractWriter ¿¡¼­ »ó¼Ó¹ÞÀº Çʵå
NEWLINE
 
»ý¼ºÀÚÀÇ °³¿ä
MinimalHTMLWriter (Writer  w, StyledDocument  doc)
          »õ·Î¿î MinimalHTMLWriter ¸¦ ÀÛ¼ºÇÕ´Ï´Ù.
MinimalHTMLWriter (Writer  w, StyledDocument  doc, int pos, int len)
          »õ·Î¿î MinimalHTMLWriter ¸¦ ÀÛ¼ºÇÕ´Ï´Ù.
 
¸Þ¼ÒµåÀÇ °³¿ä
protected  void endFontTag ()
          ÇöÀç »ç¿ëµÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.
protected  boolean inFontTag ()
          <font> ű׳»¶ó¸é true ¸¦ µ¹·ÁÁÝ´Ï´Ù.
protected  boolean isText (Element  elem)
          ¿ä¼Ò°¡ ÅØ½ºÆ®¶ó¸é true ¸¦ µ¹·ÁÁÝ´Ï´Ù.
protected  void startFontTag (String  style)
          ÇöÀç »ç¿ëµÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.
protected  void text (Element  elem)
          ÅؽºÆ®¸¦ ½á³À´Ï´Ù.
 void write ()
          StyledDocument ·ÎºÎÅÍ HTML Ãâ·ÂÀ» »ý¼ºÇÕ´Ï´Ù.
protected  void writeAttributes (AttributeSet  attr)
          ´ÙÀ½ÀÇ Çü¿ëÀÇ ¸ðµç ¼Ó¼ºÀ» ½á³À´Ï´Ù.
protected  void writeBody ()
          ¹®¼­³»ÀÇ ¿ä¼Ò·Î ¹Ýº¹ÇØ, °¡ÁöÀÇ ¿ä¼Ò³ª ÀÙÀÇ ¿ä¼ÒÀÎÁö¸¦ ÆÇ´ÜÇØ ¿ä¼Ò¸¦ ó¸®ÇÕ´Ï´Ù.
protected  void writeComponent (Element  elem)
          ÄÄÆÛ³ÍÆ® ¿ä¼ÒÀÇ ¼­µÎ¸¦ ½Ç½ÃÇÕ´Ï´Ù.
protected  void writeContent (Element  elem, boolean needsIndenting)
          HTML ¿¡ ÁذÅÇÑ ¹æ¹ýÀ¸·Î ¼Ó¼º ¼¼Æ®¸¦ ½á³À´Ï´Ù.
protected  void writeEndParagraph ()
          <p> ű׿¡ ´ëÇÑ Á¾·á ű׸¦ ¹ßÇàÇÕ´Ï´Ù.
protected  void writeEndTag (String  endTag)
          ÀûÀýÈ÷ Àε§Æ® ó¸®µÈ Á¾·á ű׸¦ ½á³À´Ï´Ù.
protected  void writeHeader ()
          <head> ¹× <style> ÀÇ Å±׸¦ ½á³», ´ÙÀ½¿¡ writeStyles()¸¦ ±âµ¿ÇØ <style> ű×ÀÇ ÄÁÅÙÃ÷·Î¼­ ¸ðµç À̸§ ÷ºÎÀÇ ½ºÅ¸ÀÏÀ» ½á³À´Ï´Ù.
protected  void writeHTMLTags (AttributeSet  attr)
          ¼Ó¼º ¼³Á¤¿¡ ±Ù°ÅÇØ ÅØ½ºÆ®ÀÇ º¼µå <b>, ÀÌÅŸ¯ <i>, ¹× <u> ÀÇ Å±׸¦ »ý¼ºÇÕ´Ï´Ù.
protected  void writeImage (Element  elem)
          ¾ÆÀÌÄÜ ¿ä¼ÒÀÇ ¼­µÎ¸¦ ½Ç½ÃÇÕ´Ï´Ù.
protected  void writeLeaf (Element  elem)
          ÅؽºÆ® ÀÌ¿ÜÀÇ ÀÙÀÇ ¿ä¼ÒÀÇ ¼­µÎ¸¦ Á¦¾îÇÕ´Ï´Ù.
protected  void writeNonHTMLAttributes (AttributeSet  attr)
          HTML ÁذÅÀÇ ¹æ¹ýÀ¸·Î ³ª¸ÓÁöÀÇ Ä³¸¯ÅÍ ·¹º§ÀÇ ¼Ó¼º (º¼µå, ÀÌÅŸ¯, ¹ØÁÙ ÀÌ¿ÜÀÇ ¼Ó¼º)À» ½á³À´Ï´Ù.
protected  void writeStartParagraph (Element  elem)
          ´Ü¶ôÀÇ °³½Ã ű׸¦ ¹ßÇàÇÕ´Ï´Ù.
protected  void writeStartTag (String  tag)
          ÀûÀýÈ÷ Àε§Æ® ó¸®µÈ °³½Ã ű׸¦ ½á³À´Ï´Ù.
protected  void writeStyles ()
          <style> ű×ÀÇ ÄÁÅÙÃ÷·Î¼­ ¸ðµç À̸§ ÷ºÎ ½ºÅ¸ÀÏÀ» ½á³À´Ï´Ù.
 
Ŭ·¡½º javax.swing.text. AbstractWriter ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
decrIndent , getCanWrapLines , getCurrentLineLength , getDocument , getElementIterator , getEndOffset , getIndentLevel , getIndentSpace , getLineLength , getLineSeparator , getStartOffset , getText , getWriter , incrIndent , indent , inRange , isLineEmpty , output , setCanWrapLines , setCurrentLineLength , setIndentSpace , setLineLength , setLineSeparator , write , write , write , writeLineSeparator
 
Ŭ·¡½º java.lang. Object ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

»ý¼ºÀÚÀÇ »ó¼¼

MinimalHTMLWriter

public MinimalHTMLWriter(Writer  w,
                         StyledDocument  doc)
»õ·Î¿î MinimalHTMLWriter ¸¦ ÀÛ¼ºÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
w - Writer
doc - StyledDocument

MinimalHTMLWriter

public MinimalHTMLWriter(Writer  w,
                         StyledDocument  doc,
                         int pos,
                         int len)
»õ·Î¿î MinimalHTMLWriter ¸¦ ÀÛ¼ºÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
w - Writer
doc - StyledDocument
pos - ÄÁÅÙÃ÷¸¦ ÃëµæÇÏ´Â ¹®¼­³»ÀÇ À§Ä¡
len - ½á³»´Â ¾ç
¸Þ¼ÒµåÀÇ »ó¼¼

write

public void write()
           throws IOException ,
                  BadLocationException 
StyledDocument ·ÎºÎÅÍ HTML Ãâ·ÂÀ» »ý¼ºÇÕ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º AbstractWriter ³»ÀÇ write
¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
BadLocationException - pos °¡ ¹®¼­³»ÀÇ ¹«È¿ÀÎ À§Ä¡¸¦ ³ªÅ¸³»´Â °æ¿ì

writeAttributes

protected void writeAttributes(AttributeSet  attr)
                        throws IOException 
´ÙÀ½ÀÇ Çü¿ëÀÇ ¸ðµç ¼Ó¼ºÀ» ½á³À´Ï´Ù. StyleConstants.ParagraphConstants, StyleConstants.CharacterConstants, StyleConstants.FontConstants, StyleConstants.ColorConstants. ¼Ó¼º¸í°ú °ªÀº ±¸µÎÁ¡À¸·Î, °¢ Á¶´Â ¼¼¹ÌÄÝ·ÐÀ¸·Î °¢°¢ ´Ü¶ôÁö¾îÁý´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º AbstractWriter ³»ÀÇ writeAttributes
¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

text

protected void text(Element  elem)
             throws IOException ,
                    BadLocationException 
ÅØ½ºÆ®¸¦ ½á³À´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º AbstractWriter ³»ÀÇ text
¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
BadLocationException - pos °¡ ¹®¼­³»ÀÇ ¹«È¿ÀÎ À§Ä¡¸¦ ³ªÅ¸³»´Â °æ¿ì

writeStartTag

protected void writeStartTag(String  tag)
                      throws IOException 
ÀûÀýÈ÷ Àε§Æ® ó¸®µÈ °³½Ã ű׸¦ ½á³À´Ï´Ù. ¶Ç Àε§Æ® ·¹º§À» ÀÎÅ©¸®¸ÕÆ®(increment) ÇÕ´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

writeEndTag

protected void writeEndTag(String  endTag)
                    throws IOException 
ÀûÀýÈ÷ Àε§Æ® ó¸®µÈ Á¾·á ű׸¦ ½á³À´Ï´Ù. ¶Ç Àε§Æ® ·¹º§À» °¨¼Ò ÇÕ´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

writeHeader

protected void writeHeader()
                    throws IOException 
<head> ¹× <style> ÀÇ Å±׸¦ ½á³», ´ÙÀ½¿¡ writeStyles()¸¦ ±âµ¿ÇØ <style> ű×ÀÇ ÄÁÅÙÃ÷·Î¼­ ¸ðµç À̸§ ÷ºÎÀÇ ½ºÅ¸ÀÏÀ» ½á³À´Ï´Ù. ÄÁÅÙÃ÷ÀÇ ÀüÈÄ¿¡´Â ű׸¦ ¼­Æ÷Æ®ÇÏÁö ¾Ê´Â ¾îÇø®ÄÉÀ̼ÇÀ̳ª ºê¶ó¿ìÀú¿¡¼­µµ ¹®¼­¸¦ Ç¥½ÃÇÒ ¼ö ÀÖ°Ô, À¯È¿ÇÑ HTML ÄÚ¸àÆ® ¸¶Ä¿°¡ ¹èÄ¡µË´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

writeStyles

protected void writeStyles()
                    throws IOException 
<style> ű×ÀÇ ÄÁÅÙÃ÷·Î¼­ ¸ðµç À̸§ ÷ºÎ ½ºÅ¸ÀÏÀ» ½á³À´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

writeBody

protected void writeBody()
                  throws IOException ,
                         BadLocationException 
¹®¼­³»ÀÇ ¿ä¼Ò·Î ¹Ýº¹ÇØ, °¡ÁöÀÇ ¿ä¼Ò³ª ÀÙÀÇ ¿ä¼ÒÀÎÁö¸¦ ÆÇ´ÜÇØ ¿ä¼Ò¸¦ ó¸®ÇÕ´Ï´Ù. ÅØ½ºÆ®ÀÎ ÀÙÀÇ ¿ä¼Ò¿¡´Â Ưº°ÇÑ Ã³¸®¸¦ ½Ç½ÃÇÕ´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
BadLocationException

writeEndParagraph

protected void writeEndParagraph()
                          throws IOException 
<p> ű׿¡ ´ëÇÑ Á¾·á ű׸¦ ¹ßÇàÇÕ´Ï´Ù. ű׸¦ ½á³»±â Àü¿¡, ¿ÀÇÂÇϰí ÀÖ´Â ´Ù¸¥ ¸ðµç űװ¡ ¿Ã¹Ù¸£°í Ŭ·Î¿ìÁî µÇ´Â °ÍÀ» È®ÀÎÇÕ´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

writeStartParagraph

protected void writeStartParagraph(Element  elem)
                            throws IOException 
´Ü¶ôÀÇ °³½Ã ű׸¦ ¹ßÇàÇÕ´Ï´Ù. ´Ü¶ô¿¡ ´ëÀÀÇÏ´Â À̸§ ÷ºÎ ½ºÅ¸ÀÏÀÌ ÀÖÀ¸¸é, <p> ű×ÀÇ Å¬·¡½º ¼Ó¼ºµµ »ý¼ºÇØ ±× °ªÀ» ½ºÅ¸ÀÏÀÇ À̸§À¸·Î ¼³Á¤ÇÕ´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

writeLeaf

protected void writeLeaf(Element  elem)
                  throws IOException 
ÅØ½ºÆ® ÀÌ¿ÜÀÇ ÀÙÀÇ ¿ä¼ÒÀÇ ¼­µÎ¸¦ Á¦¾îÇÕ´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

writeImage

protected void writeImage(Element  elem)
                   throws IOException 
¾ÆÀÌÄÜ ¿ä¼ÒÀÇ ¼­µÎ¸¦ ½Ç½ÃÇÕ´Ï´Ù. ÀǵµÀûÀ¸·Î ±¸ÇöÇÏÁö ¾Ê´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. ÀÌ ¸Þ¼ÒµåÀÇ ±¸Çö ¹æ¹ýÀº Æú¸®½ÃÀÇ ¹®Á¦ÀÔ´Ï´Ù. ¿¹¸¦ µé¾î, <img> ű׸¦ »ý¼ºÇÏ°Ô µÇ¾î ÀÖ´Â °æ¿ì, src ¼Ó¼º (À̹ÌÁöÀÇ À§Ä¡)À» ³ªÅ¸³»·Á¸é , °æ¿ì¿¡ ÀÇÇØ, URL ¸¦ »ç¿ëÇÏ´Â Àϵµ ½ºÆ®¸²À¸·ÎºÎÅÍ ÀоîµéÀÌ´Â Àϵµ ÀÖ½À´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
elem - StyleConstants.IconElementName ÇüÀÇ ¿ä¼Ò
IOException

writeComponent

protected void writeComponent(Element  elem)
                       throws IOException 
ÄÄÆÛ³ÍÆ® ¿ä¼ÒÀÇ ¼­µÎ¸¦ ½Ç½ÃÇÕ´Ï´Ù. ÀǵµÀûÀ¸·Î ±¸ÇöÇÏÁö ¾Ê´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. ÀÌ ¸Þ¼ÒµåÀÇ ±¸Çö ¹æ¹ýÀº Æú¸®½ÃÀÇ ¹®Á¦ÀÔ´Ï´Ù.

IOException

isText

protected boolean isText(Element  elem)
¿ä¼Ò°¡ ÅØ½ºÆ®¶ó¸é true ¸¦ µ¹·ÁÁÝ´Ï´Ù.


writeContent

protected void writeContent(Element  elem,
                            boolean needsIndenting)
                     throws IOException ,
                            BadLocationException 
HTML ¿¡ ÁذÅÇÑ ¹æ¹ýÀ¸·Î ¼Ó¼º ¼¼Æ®¸¦ ½á³À´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
BadLocationException - pos °¡ ¹®¼­³»ÀÇ ¹«È¿ÀÎ À§Ä¡¸¦ ³ªÅ¸³»´Â °æ¿ì

writeHTMLTags

protected void writeHTMLTags(AttributeSet  attr)
                      throws IOException 
¼Ó¼º ¼³Á¤¿¡ ±Ù°ÅÇØ ÅØ½ºÆ®ÀÇ º¼µå <b>, ÀÌÅŸ¯ <i>, ¹× <u> ÀÇ Å±׸¦ »ý¼ºÇÕ´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

writeNonHTMLAttributes

protected void writeNonHTMLAttributes(AttributeSet  attr)
                               throws IOException 
HTML ÁذÅÀÇ ¹æ¹ýÀ¸·Î ³ª¸ÓÁöÀÇ Ä³¸¯ÅÍ ·¹º§ÀÇ ¼Ó¼º (º¼µå, ÀÌÅŸ¯, ¹ØÁÙ ÀÌ¿ÜÀÇ ¼Ó¼º)À» ½á³À´Ï´Ù. ÆùÆ® ÆÐ¹Ð¸®³ª font sizeµîÀÇ ¼Ó¼ºÀÌ Á÷Á¢ HTML ű׿¡ ¸ÅÇÎ µÇÁö ¾Ê´Â °æ¿ì, ÀÎ ¶óÀÎ ½ºÅ¸ÀÏÀÇ °æ¿ì¿Í °°°Ô <span> űװ¡ »ý¼ºµÇ¾î, ±× ½ºÅ¸ÀÏ ¼Ó¼ºÀÌ ³ª¸ÓÁöÀÇ ¼Ó¼ºÀÇ ¸®½ºÆ®¸¦ Æ÷ÇÔÇϵµ·Ï(µíÀÌ) ¼³Á¤µË´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

inFontTag

protected boolean inFontTag()
<font> ű׳»¶ó¸é true ¸¦ µ¹·ÁÁÝ´Ï´Ù.


endFontTag

protected void endFontTag()
                   throws IOException 
ÇöÀç »ç¿ëµÇ°í ÀÖÁö ¾Ê½À´Ï´Ù. ´ë½Å¿¡ <span> °¡ ½á³»Áý´Ï´Ù.

<font> ű׿ëÀÇ Á¾·á ű׸¦ ½á³À´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

startFontTag

protected void startFontTag(String  style)
                     throws IOException 
ÇöÀç »ç¿ëµÇ°í ÀÖÁö ¾Ê½À´Ï´Ù. ´ë½Å¿¡ <span> °¡ ½á³»Áý´Ï´Ù.

<font> ű׿ëÀÇ °³½Ã ű׸¦ ½á³À´Ï´Ù. ÆùÆ® ű״ »óÀÚ·Î ÇÒ ¼ö ¾ø±â ¶§¹®¿¡, »õ·Î¿î °³½Ã ű׸¦ ½á³»±â Àü¿¡, ÆùÆ® ű×ÀÇ Æ÷À§¸¦ Ŭ·Î¿ìÁî ÇÕ´Ï´Ù.

¿¹¿Ü:
IOException - ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì

JavaTM 2
Platform
Std.  Ed.  v1. 4.0

¹ö±×ÀÇ º¸°í¿Í ±â´ÉÀÇ ¸®Äù½ºÆ®
ÀÌ¿ÜÀÇ API ·¹ÆÛ·±½º ¹× °³¹ßÀÚ¿ë ¹®¼­¿¡ ´ëÇØ¼­´Â Java 2 SDK SE °³¹ßÀÚ¿ë ¹®¼­¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä. °³¹ßÀÚÀü¿ëÀÇ »ó¼¼ÇÑ ÇØ¼³, °³³äÀÇ °³¿ä, ¿ë¾îÀÇ Á¤ÀÇ, ¹ö±×ÀÇ È¸ÇÇÃ¥, ¹× ÄÚµå ½Ç·Ê°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù.

Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ À־ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.